Closed acuarica closed 2 weeks ago
Creating a smaller contract based on 0xEC702942609FaD2afC1489277d918611f0e17ceb
, the following contract causes this issue
interface IERC20 {
function decimals() external view returns (uint256);
}
contract Test {
function truToToken() external view returns (uint256) {
return 10**IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7).decimals();
}
}
The CFG for this contract (it was generated by temporarily patching the Exp
eval
to avoid the error) looks like
On pc 51
you can see the Exp
AST node 0xa ** 0x313ce56700000000000000000000000000000000000000000000000000000000
, which is causing the issue. The 0x313ce567
value is a function selector for decimals()
$ cast sig 'decimals()'
0x313ce567
This 0x313ce567
value was first moved into memory to perform the staticcall
on pc 165
. All of this heavily implies that the STATICCALL
(and CALL
and DELEGATECALL
) steps need to invalidate previous memory locations.
When analyzing contract
0xEC702942609FaD2afC1489277d918611f0e17ceb
, the following error is raisedHow to reproduce it
Run
After further investigation, the error stack is
This issue is a follow up of https://github.com/acuarica/evm/issues/125, where some errors were reported when running
sevm
on a large contract dataset. The other errors encountered in the dataset were (these are already fixed)