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

Expose ERC165 supportsInterface operation in schema #92

Description

@raulk

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).

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions