-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
echidna error during compilation #813
Comments
Hi, thanks for the report. The echidna docker container has solc 0.5.7 preinstalled, but your contract requires a newer version. You'll need to remove that solc installation and install a compatible solc. You can use solc-select for that:
We have a PR in progress (#706) to update the Docker image and include solc-select in it, so this use case is better handled in the future 👍 |
when i ran it now i get the following
is there any way to specify which contract to test? |
yep, you can add the echidna |
echidna-test: Constructor arguments are required: [("_sushi",address),("_devaddr",address),("_sushiPerBlock",uint256),("_startBlock",uint256),("_bonusEndBlock",uint256)]. in what format should i pass the parameter?, furthermore i saw that the process can be done automatically using slither-prop but when itry to use slither-prop on my contract "slither-prop ./FlatFile.sol --contract MasterChef" I get:
any advices? |
It seems that you are on track, however you should use a contract without parameters for testing, Echidna cannot initialize it for you. |
what about the slither prop? |
slither-prop will generate a contract with properties, but only for ERC20/ERC721, but it cannot initialize any contract. You can edit the resulting file to fill in any missing initialization, however in this case, keep in mind that you need to provide address to contracts that are non-trivial. For instance, If you do not want to recreate this, considering checking this: https://github.com/crytic/building-secure-contracts/blob/master/program-analysis/echidna/end-to-end-testing.md |
To add on to what @ggrieco-tob said, and for anyone else reading in the future, there is no manual way in Echidna to pass constructor arguments; you should use a contract that doesn't take arguments. If your arguments are simple enough, you can do so by having a contract FooTest is Test {
// update the constructor
constructor() public Test("foo", "bar", "baz") { }
// add the properties you want to use in echidna
function echidna_test_balance() public view returns (bool) {
return ...;
}
}
|
This is already documented |
i have given echidna the flat file of masterchef (which i compiled beforehand) without the pragma solidity line (as seen in examples)
then i ran the docker container using the following line docker run -it -v
pwd
:/src ghcr.io/crytic/echidna/echidna echidna-test /src/test.sol.test.sol is attached below.
when ran i get the following error:
any suggestions or ideas to what i did wrong?
p.s is there any way to define compiler version in the docekr run line?
FlatFile.txt
The text was updated successfully, but these errors were encountered: