Assertion Checking Modes
contract Foo {
/// #if_succeeds {:msg "P1"} y == x + 1;
function inc(uint x) public pure returns (uint y) {
return x+1;
}
}contract Foo {
event AssertionFailed(string message);
function inc(uint x) public returns (uint y) {
y = _original_Foo_inc(x);
if ((!((y == (x + 1))))) {
emit AssertionFailed("0: P1");
assert(false);
}
}
function _original_Foo_inc(uint x) private pure returns (uint y) {
return (x + 1);
}
}No assertions
User assertion failures without event logging
Last updated