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

29 lines
914 B
Solidity
Raw Normal View History

2021-08-20 16:47:38 +00:00
contract C {
bool once;
function f() public payable {
require(!once);
once = true;
require(msg.value == 10);
assert(address(this).balance >= 10); // should hold
assert(address(this).balance >= 20); // should fail
g();
}
function g() internal view {
assert(address(this).balance >= 10); // should hold
assert(address(this).balance >= 20); // should fail
h();
}
function h() internal view {
assert(address(this).balance >= 10); // should hold
assert(address(this).balance >= 20); // should fail
}
}
// ====
// SMTEngine: all
2021-10-06 09:53:03 +00:00
// SMTIgnoreOS: macos
2021-08-20 16:47:38 +00:00
// ----
2023-02-09 16:07:13 +00:00
// Warning 6328: (173-208): CHC: Assertion violation happens here.
// Warning 6328: (321-356): CHC: Assertion violation happens here.
// Warning 6328: (469-504): CHC: Assertion violation happens here.
// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.