solidity/test/libsolidity/semanticTests/immutable/use_scratch.sol
Daniel Kirchner 44da8507b1 Change default EVM version to Shanghai.
Co-authored-by: Rodrigo Q. Saramago <rodrigoqsaramago@gmail.com>
2023-05-08 16:34:23 +02:00

23 lines
396 B
Solidity

contract C {
uint256 immutable x;
uint256 immutable y;
mapping(uint => uint) public m;
constructor(uint _a) {
x = 42;
y = 23;
m[_a] = 7;
new uint[](4);
}
function f() public view returns (uint256, uint256) {
return (x+x,y);
}
}
// ----
// constructor(): 3 ->
// gas irOptimized: 124838
// gas legacy: 197645
// gas legacyOptimized: 137678
// f() -> 84, 23
// m(uint256): 3 -> 7