Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Expose ERC165 supportsInterface operation in schema #92

Open
raulk opened this issue Jul 26, 2018 · 1 comment
Open

Expose ERC165 supportsInterface operation in schema #92

raulk opened this issue Jul 26, 2018 · 1 comment

Comments

@raulk
Copy link
Contributor

raulk commented Jul 26, 2018

The ERC165 standard allows us to interrogate if a contract supports a specific function. It also appears to be a prerequisite for univocally identifying ERC721 contracts (#33).

The current proposal is to add a new field on the Account type. Suggested definition:

supportsInterface(selector: String!): ERC165Result!

Where ERC165Result is an enum with values:

  • SUPPORTED => if the contract has a supportsInterface(bytes4) function as mandated by the standard, and the result of the call is true.
  • NOT_SUPPORTED => if the contract has a supportsInterface(bytes4) function as mandated by the standard, and the result of the call is false.
  • NON_INTROSPECTABLE => if the contract doesn't expose a supportsInterface(bytes4) function.

The selector argument is the String representation of the function selector (e.g. transfer(address,uint)). More info here: http://solidity.readthedocs.io/en/v0.4.21/abi-spec.html#function-selector.

The resolver would need to convert the String representation into its corresponding binary representation as per the link above (there might be functions in the web3 lib to do this).

@raulk
Copy link
Contributor Author

raulk commented Jul 26, 2018

@jonathanBuhler – would you like to take the lead on this one and collaborate with @akhila-raju?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants