solidity/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.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

28 lines
695 B
Solidity

contract Other {
constructor() payable {
}
function getAddress() public returns (address) {
return address(this);
}
}
contract ClientReceipt {
Other other;
constructor() payable {
other = new Other{value:500}();
}
function getAddress() public returns (address) {
return other.getAddress();
}
}
// ----
// constructor(), 2000 wei ->
// gas irOptimized: 171859
// gas legacy: 230026
// gas legacyOptimized: 173877
// balance -> 1500
// gas irOptimized: 191881
// gas legacy: 235167
// gas legacyOptimized: 180756
// getAddress() -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a
// balance: 0x137aa4dfc0911524504fcd4d98501f179bc13b4a -> 500