echidna
echidna copied to clipboard
Lack of support for function pointers
Run echidna on this:
pragma solidity ^0.7.1;
contract FunctionArg {
function echidna_test() external pure returns (bool) {
return true;
}
function ptr(function()external f) public {
f();
}
}
will result in:
echidna-test: internal error: method type
CallStack (from HasCallStack):
error, called at src/EVM/Solidity.hs:339:22 in hevm-0.49.0-GY0kNk5Azi3A3vL1VQ1lX4:EVM.Solidity
which is caused by hevm not parsing correctly that ABI feature.
This will not be fixed in Echidna, instead we will wait until hevm provides supports
Implemented this change at https://github.com/samalws/echidna/tree/fnPtr, won't do an echidna PR until the relevant hevm commit (https://github.com/ethereum/hevm/commit/24a6777d9d2849785add927d423a62b287bf1d2f) is put into an hevm release
I've updated hevm here https://github.com/crytic/echidna/pull/986