solidity/test/libsolidity/semanticTests/constructor/no_callvalue_check.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
486 B
Solidity

contract A1 {}
contract B1 is A1 { constructor() payable {} }
contract A2 { constructor() {} }
contract B2 is A2 { constructor() payable {} }
contract B3 { constructor() payable {} }
contract C {
function f() public payable returns (bool) {
// Make sure none of these revert.
new B1{value: 10}();
new B2{value: 10}();
new B3{value: 10}();
return true;
}
}
// ----
// f(), 2000 ether -> true
// gas irOptimized: 119451
// gas legacy: 122615
// gas legacyOptimized: 122484