mirror of
https://github.com/crytic/echidna.git
synced 2026-10-12 02:12:32 +00:00
42 lines
769 B
Solidity
42 lines
769 B
Solidity
contract Test {
|
|
TestAssert ta;
|
|
event AssertionFailed(string message);
|
|
constructor() public {
|
|
ta = new TestAssert();
|
|
}
|
|
|
|
function set0(int val) public returns (bool){
|
|
assert(val % 100 != 0);
|
|
}
|
|
|
|
function internal_func(uint val) internal {
|
|
if(val > 128)
|
|
emit AssertionFailed("error");
|
|
}
|
|
|
|
function set1(uint val) public {}
|
|
|
|
function f() public {
|
|
emit AssertionFailed("error");
|
|
revert();
|
|
}
|
|
|
|
function internal_assert(uint val) public returns (bool){
|
|
internal_func(val);
|
|
}
|
|
|
|
function external_assert(uint val) public returns (bool){
|
|
ta.fail(val);
|
|
}
|
|
|
|
}
|
|
|
|
contract TestAssert {
|
|
event AssertionFailed(string message);
|
|
function fail(uint val) public {
|
|
if(val > 128)
|
|
emit AssertionFailed("error");
|
|
}
|
|
|
|
}
|