solidity/test/libsolidity/smtCheckerTests/external_calls/external_reentrancy_2.sol

17 lines
417 B
Solidity
Raw Normal View History

2020-12-18 18:10:32 +00:00
pragma experimental SMTChecker;
interface D { function e() external; }
contract C {
bool locked = true;
function call(address target) public {
assert(locked);
locked = false;
D(target).e();
locked = true;
}
}
// ----
// Warning 6328: (150-164): CHC: Assertion violation happens here.\nCounterexample:\nlocked = false\ntarget = 0\n\n\nTransaction trace:\nC.constructor()\nState: locked = true\nC.call(0)