2020-05-14 18:09:52 +00:00
|
|
|
pragma experimental SMTChecker;
|
|
|
|
|
|
|
|
contract State {
|
|
|
|
uint x;
|
|
|
|
function f() public returns (uint) {
|
|
|
|
if (x == 0) x = 1;
|
|
|
|
else if (x == 1) x = 2;
|
|
|
|
else if (x == 2) x = 0;
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contract C {
|
|
|
|
address owner;
|
|
|
|
uint y;
|
|
|
|
uint z;
|
|
|
|
State s;
|
|
|
|
|
2020-06-23 12:14:24 +00:00
|
|
|
constructor() {
|
2020-05-14 18:09:52 +00:00
|
|
|
owner = msg.sender;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setOwner(address _owner) public {
|
|
|
|
owner = _owner;
|
|
|
|
}
|
|
|
|
|
|
|
|
function f() public {
|
|
|
|
address prevOwner = owner;
|
|
|
|
y = s.f();
|
|
|
|
z = s.f();
|
|
|
|
assert(prevOwner == owner);
|
|
|
|
}
|
|
|
|
|
|
|
|
function inv() public view {
|
|
|
|
// This is safe but external calls do not yet support the state
|
|
|
|
// of the called contract.
|
|
|
|
assert(owner == address(0) || y != z);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ----
|
2020-06-23 12:14:24 +00:00
|
|
|
// Warning 4661: (435-461): Assertion violation happens here
|
|
|
|
// Warning 5084: (610-620): Type conversion is not yet fully supported and might yield false positives.
|
|
|
|
// Warning 4661: (594-631): Assertion violation happens here
|