Consensys / ethql

A GraphQL interface to Ethereum :fire:
Apache License 2.0
623 stars 85 forks source link

Expose ERC165 supportsInterface operation in schema #92

Open raulk opened 6 years ago

raulk commented 6 years ago

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:

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 commented 6 years ago

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