solidity/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_1.sol
2020-12-28 14:32:53 +01:00

20 lines
450 B
Solidity

pragma experimental SMTChecker;
interface D { function e() external; }
contract C {
bool locked = true;
function call(address target) public {
locked = false;
D(target).e();
locked = true;
}
function broken() public view {
assert(locked);
}
}
// ----
// Warning 6328: (239-253): CHC: Assertion violation happens here.\nCounterexample:\nlocked = false\ntarget = 0\n\n\nTransaction trace:\nconstructor()\nState: locked = true\ncall(0)