solidity/test/libsolidity/smtCheckerTests/blockchain_state/balance_receive_2.sol

22 lines
645 B
Solidity
Raw Normal View History

2021-08-20 16:47:38 +00:00
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
2022-01-12 17:42:40 +00:00
// SMTIgnoreCex: yes
2021-08-20 16:47:38 +00:00
// ----
2022-01-12 17:42:40 +00:00
// Warning 4984: (266-272): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (235-273): CHC: Assertion violation happens here.
2023-02-09 16:07:13 +00:00
// Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.