Fix getExternalCodeSize in the Yul Ewasm interpreter

This commit is contained in:
Alex Beregszaszi 2019-12-18 22:54:34 +00:00
parent 37ae229a4c
commit 47a8e5fbd1

View File

@ -286,7 +286,8 @@ u256 EWasmBuiltinInterpreter::evalBuiltin(YulString _fun, vector<u256> const& _a
return 0;
}
else if (_fun == "eth.getExternalCodeSize"_yulstring)
return u256(keccak256(h256(readAddress(arg[0])))) & 0xffffff;
// Generate "random" code length. Make sure it fits the page size.
return u256(keccak256(h256(readAddress(arg[0])))) & 0xfff;
else if (_fun == "eth.getGasLeft"_yulstring)
return 0x99;
else if (_fun == "eth.getBlockGasLimit"_yulstring)