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

21 lines
845 B
Solidity
Raw Normal View History

2021-08-20 16:47:38 +00:00
interface I {
function ext() external;
}
contract C {
function f(I _i) public {
uint x = address(this).balance;
_i.ext();
assert(address(this).balance == x); // should fail
assert(address(this).balance >= x); // should hold
}
}
// ====
// SMTEngine: all
2021-11-24 10:38:22 +00:00
// SMTIgnoreOS: macos
2021-08-20 16:47:38 +00:00
// ----
// Warning 1218: (131-165): CHC: Error trying to invoke SMT solver.
// Warning 6328: (131-165): CHC: Assertion violation might happen here.
2021-11-23 17:08:36 +00:00
// Info 1180: Reentrancy property(ies) for :C:\n(!(<errorCode> >= 2) && (((:var 1).balances[address(this)] + ((- 1) * (:var 0).balances[address(this)])) <= 0))\n<errorCode> = 0 -> no errors\n<errorCode> = 1 -> Assertion failed at assert(address(this).balance == x)\n<errorCode> = 2 -> Assertion failed at assert(address(this).balance >= x)\n
2021-08-23 09:30:12 +00:00
// Warning 4661: (131-165): BMC: Assertion violation happens here.