2021-08-20 16:47:38 +00:00
|
|
|
contract C {
|
|
|
|
uint prevBalance;
|
|
|
|
constructor() payable {
|
|
|
|
prevBalance = address(this).balance;
|
|
|
|
}
|
|
|
|
function f() public payable {
|
|
|
|
assert(address(this).balance == prevBalance + msg.value); // should fail because there might be funds from selfdestruct/block.coinbase
|
|
|
|
assert(address(this).balance < prevBalance + msg.value); // should fail
|
|
|
|
assert(address(this).balance >= prevBalance + msg.value); // should hold
|
|
|
|
prevBalance = address(this).balance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// SMTEngine: all
|
2021-08-23 09:30:12 +00:00
|
|
|
// SMTIgnoreCex: yes
|
2021-08-20 16:47:38 +00:00
|
|
|
// ----
|
2021-08-23 09:30:12 +00:00
|
|
|
// Warning 6328: (132-188): CHC: Assertion violation happens here.
|
|
|
|
// Warning 6328: (269-324): CHC: Assertion violation happens here.
|
2021-10-06 09:53:03 +00:00
|
|
|
// Info 1180: Contract invariant(s) for :C:\n((prevBalance + ((- 1) * (:var 1).balances[address(this)])) <= 0)\n
|