Updated to use staticcall

This commit is contained in:
William Entriken 2018-02-16 06:35:16 -05:00 committed by GitHub
parent d39b3885d4
commit 50f59da47f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

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