-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReverseENS Pseudo-Introspection, or standard interface detection #672
Comments
It's an interesting idea and just as the original EIP165 idea it can be really useful for many contract developers. I have some questions.
Then there is nothing that can be done to enforce it, right? All this should just be seen as only a guideline by the contract author? |
The called party can lie about the interface implementation, they can also implement it in the wrong way. The caller should be aware of that and should not assume and check any thing that is executed in an untrusted contract. |
I see one problem with this, it breaks reverse resolution. I don't see any reason why the root node can't use the reverse resolver, as long as the subnodes for each interface use the public resolver. If you set the root node to use the public resolver and provide either 1) a way to transfer ownership of the root node to another address (for example the contract's owner/deployer) or 2) a way to set the contract's "name" in the reverse resolver, this should work without breaking reverse resolution. |
@stevenh512 This standard does not break the rerverse resolution. This is done in the name field of resolver for [address].addr.reverse This standard just add subnodes of the form [InterfaceName].[addres].addr.reverse whos addr method of their resolver points to the contract that implements that interface for that address. |
@jbaylina I understand I may have miscommunicated what I meant in my previous comment and also (after watching your talk about this and Yoga Token) that English is probably not your first language, so perhaps we're misunderstanding each other a little bit here. My fault for not explaining more clearly. It's not the adding of subnodes (or the requirement that those subnodes use the public resolver or some other resolver that provides The way ENS works, if the root node is using the reverse resolver (so that reverse resolution works as expected), there is no reason why the I'm having network issues at the moment, but if you'd like I can try sending a PR on your (edited for clarity and to fix typos) |
Ah, yea I see your point! I merged the PR. Also note that BTW, good PR! This repository may became a ReverseENS manager for contracts, instead of just an EIP672 helper!. new name proposals for the repository are accepted.. |
Preamble
Simple Summary
Creates a standard method to publish and discover which interfaces a smart contract or a regular address implements.
Abstract
This ERC standardizes a way to publish which interfaces does a specific address support or which is the delegated counterparty address that can handle the interface on its behalf.
The proposed mechanism allows backwards compatibility for all contracts that can execute arbitrary external transactions (multisigs) and provides an upgrade path for contracts that can designate other contracts as the implementation of a certain interface.
Motivation
For some "standard interfaces" like the ERC 20 token interface ( #20 ), it is sometimes useful to query whether a contract supports the interface and if yes, which version of the interface, in order to adapt the way in which the contract is to be utilized.
Specification
The interfaces that a specific address implements will be registered using ReverseENS records. Any address can automatically claim its own
.addr.reverse
for just gas and point it to a resolver. Then, for every new interface the contract supports, it will create a new record (setSubnodeOwner
) to set each desired address that implements the interface. The public resolver can be used for this purpose, as it implementsaddr()
andsetAddr(address)
.If the resolver or the
addr()
for[InterfaceName].[ADDRESS].addr.reverse
is 0, then we consider the address to not implement the interface.Otherwise, the returned
addr()
points to the the contract that implements that interface for the specific address.This address can be the same address if the contract implements the interface, or the address of a different contract (proxy contract) that handles this interface.
Example
Rationale
We tried to keep this specification as simple as possible. This implementation is also compatible with the current solidity version and the current ENS implementation.
This standard has many advantages in respect to the current EIP165 proposal:
As an example, with this interface it’s trivial to define a proxy contract for a regular address that implements ITokenFallback that defines who can send a token to this address and what to do with this token.
Backwards Compatibility
This interface allows regular accounts and generic contracts to make any call like multisigs or DAOs, and to define new contracts that implement this interface.
Example implementation
Test Cases
You can check the implementation and a test here: https://github.com/jbaylina/eip672
Copyright
Copyright and related rights waived via CC0.
The text was updated successfully, but these errors were encountered: