Lack of support for function pointers
ggrieco-tob opened this issue · comments
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 (ethereum/hevm@24a6777) is put into an hevm release
I've updated hevm here #986