mirror of https://github.com/status-im/EIPs.git
Updated to use staticcall
This commit is contained in:
parent
d39b3885d4
commit
50f59da47f
|
@ -145,16 +145,14 @@ contract ERC165Cache {
|
|||
return ImplStatus.No;
|
||||
}
|
||||
|
||||
// Update this after the Metropolis hard fork to use staticcall!
|
||||
function noThrowCall(address _contract, bytes4 _interfaceId) internal view returns (bool result) {
|
||||
bytes4 erc165ID = ERC165ID;
|
||||
assembly {
|
||||
let x := mload(0x40) // Find empty storage location using "free memory pointer"
|
||||
mstore(x, erc165ID) // Place signature at begining of empty storage
|
||||
mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
|
||||
call(30000, // 30k gas
|
||||
staticcall(30000, // 30k gas
|
||||
_contract, // To addr
|
||||
0, // No value
|
||||
x, // Inputs are stored at location x
|
||||
0x8, // Inputs are 8 byes long
|
||||
x, // Store output over input (saves space)
|
||||
|
|
Loading…
Reference in New Issue