solidity/test/libsolidity/semanticTests/arithmetics/check_var_init.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

20 lines
365 B
Solidity

contract C {
uint public x = msg.value - 10;
constructor() payable {}
}
contract D {
function f() public {
unchecked {
new C();
}
}
function g() public payable returns (uint) {
return (new C{value: 11}()).x();
}
}
// ----
// f() -> FAILURE, hex"4e487b71", 0x11
// g(), 100 wei -> 1
// gas legacy: 100370