Skip to content

Behavior of ERC165Checker when less than 30k gas available #1750

Open
@wighawag

Description

@wighawag

EIP-165 stipulate that supportsInterface can use up to 30,000 gas.

But as you can see in openzeppelin implementation here, the call is executed without making sure 30,000 gas is indeed given to the call. Remember, the gas provided as part of the STATIC_CALL is just a maximum.

And because of EIP-150 behaviour, it is possible for supportsInterface to get less gas than required for it to complete (and thus throw which is interpreted wrongly as non-implementation) while the rest of the transaction continue and complete.

I described the issue in more details here as the issue is also present in the example implementation described at EIP-165.

Various solution are presented here but the best option is EIP-1930 which also solve issue present in other use cases like meta-transactions.

Also find some test case regarding EIP-165 here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions