Open lum7na opened 1 month ago
Here's another example: at a lower optimization level (200), executing the transaction f()
results in an error code of 0x32
. However, at a higher optimization level (99999999), the transaction successfully returns.
contract C {
function g(uint256 x, uint256 y) private returns(uint256) {
return x;
}
function f() public returns(uint[] memory, uint) {
try this.f() returns (uint[] memory x, uint y) {
return (x, g(y, x[1]));
} catch {
}
}
}
Hi! When compiling the program below with
--via-ir --optimize
and using--optimize-runs 200
and--optimize-runs 99999999
respectively, different error codes are returned when thef()
function is called. Specifically,--optimize-runs 200
yields0x4e487b710000000000000000000000000000000000000000000000000000000000000032
, while--optimize-runs 99999999
results in0x0
. I conducted tests on Remix using the0.8.27
compiler version, and the issue can be reproduced on the latest compiler version as well.I'm interested in knowing: are error codes always accurate, and what is the correct error code?