solidity/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_2.sol
2023-03-09 14:59:32 +01:00

22 lines
645 B
Solidity

contract C {
uint x;
bool once;
constructor() payable {
x = address(this).balance;
}
function f() public payable {
require(!once);
once = true;
require(msg.value > 0);
assert(address(this).balance > x); // should hold
assert(address(this).balance > x + 10); // should fail
}
}
// ====
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
// Warning 4984: (266-272): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (235-273): CHC: Assertion violation happens here.
// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.