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

24 lines
655 B
Solidity

contract C {
constructor() payable {
require(msg.value > 100);
}
uint c;
function f(address payable _a, uint _v) public {
require(_v < 10);
require(c < 2);
++c;
_a.transfer(_v);
}
function inv() public view {
assert(address(this).balance > 80); // should hold
assert(address(this).balance > 90); // should fail
}
}
// ====
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
// Warning 6328: (280-314): CHC: Assertion violation happens here.
// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
// Warning 1236: (175-190): BMC: Insufficient funds happens here.