🎉 Description
While browsing EIP 820 I found code like
function erc165InterfaceSupported(address _contract, bytes4 _interfaceId) constant public returns (bool) {
if (!erc165Cache[_contract][_interfaceId]) {
erc165UpdateCache(_contract, _interfaceId);
}
return interfaces[_contract][_interfaceId] != 0;
}
function erc165UpdateCache(address _contract, bytes4 _interfaceId) public {
interfaces[_contract][_interfaceId] =
erc165InterfaceSupported_NoCache(_contract, _interfaceId) ? _contract : 0;
erc165Cache[_contract][_interfaceId] = true;
}
which cleverly caches the results of 165 lookups.
We should
- profile the gas gains
- develop a mixin contract that can be added to
ERC165Checker.sol
🎉 Description
While browsing EIP 820 I found code like
which cleverly caches the results of 165 lookups.
We should
ERC165Checker.sol