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

25 lines
610 B
Solidity
Raw Normal View History

function l(address payable a) {
a.transfer(1);
}
contract C {
uint x;
function f(address payable a) public payable {
require(msg.value > 1);
uint b1 = address(this).balance;
2021-08-23 09:30:12 +00:00
require(a != address(this));
l(a);
uint b2 = address(this).balance;
assert(b1 == b2); // should fail
2021-08-23 09:30:12 +00:00
assert(b1 == b2 + 1); // should hold
assert(x == 0); // should hold
}
}
// ====
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
2021-08-23 09:30:12 +00:00
// Warning 6328: (258-274): CHC: Assertion violation happens here.
2021-10-06 09:53:03 +00:00
// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\n
// Warning 1236: (33-46): BMC: Insufficient funds happens here.