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

19 lines
724 B
Solidity
Raw Normal View History

2021-08-11 16:10:34 +00:00
contract C {
uint x;
function s(uint _x) public view {
x == _x;
}
function f(address a) public {
(bool s, bytes memory data) = a.staticcall("");
assert(x == 0); // should hold
}
}
// ====
// SMTEngine: all
// ----
// Warning 2519: (106-112): This declaration shadows an existing declaration.
// Warning 2072: (106-112): Unused local variable.
// Warning 2072: (114-131): Unused local variable.
// Warning 2018: (72-188): Function state mutability can be restricted to view
2021-10-06 09:53:03 +00:00
// Info 1180: Contract invariant(s) for :C:\n(x <= 0)\nReentrancy property(ies) for :C:\n((!(x <= 0) || (x' <= 0)) && (!(x <= 0) || (<errorCode> <= 0)))\n<errorCode> = 0 -> no errors\n<errorCode> = 1 -> Assertion failed at assert(x == 0)\n