echidna
echidna copied to clipboard
Errors running echidna - solc-args
solc fails to complile large contract which require optimize to compile successful.
But cryptic-compile fails to compile the contract when ran through echidna even with solc-args "optmize"
set. Does solc-args get passed through the cryptic-compiles solc-args argument?
examples:
crytic-compile LargeContract.sol
Fails - Stack too deep when compiling inline assembly: Variable value0 is 1 slot(s) too deep inside the stack.
crytic-compile --solc-args="optimize" LargeContract.sol
Succeeds
slither LargeContract.sol
Fails - crytic_compile.platform.exceptions.InvalidCompilation: Invalid solc compilation Compiler error: Stack too deep when compiling inline assembly: Variable value0 is 1 slot(s) too deep inside the stack.
slither LargeContract.sol --solc-args="optimize"
Succeeds
echidna-test LargeContract.sol --contract LargeContract
Fails - CryticCompile:Invalid solc compilation Compiler error: Stack too deep when compiling inline assembly: Variable value0 is 1 slot(s) too deep inside the stack.
echidna-test LargeContract.sol --solc-args="optimize" --contract LargeContract
Fails - echidna-test: Error running slither:
echidna-test LargeContract.sol --solc-args="optimize" --crytic-args="solc-args optimize" --contract LargeContract
Tryna figure out a way to pass through solc-args to crytic
I dunno what im trying to find with this issue. But each individual tool works alone, but using echidna it all falls apart.
Slither has no errors running it standalone, but echidna somehow thinks it does error.
Hi! I suspect crytic-compile is getting the options through echidna, but not slither. Echidna calls slither with "ignore-compile" set, so normally any compilation options are not needed, but IIRC ignore-compile does not have any impact when you're using a standalone .sol
file (as there's no pre-built artifacts to read like you'd have with Hardhat or another framework). Can you do a short experiment to confirm?
- Create a
slither.config.json
in the current directory with the following content:
{
"solc_args": "optimize"
}
- Run
echidna-test LargeContract.sol --solc-args="optimize" --contract LargeContract
@elopez that worked, thanks.
Cool! Then we should probably add the missing arguments to the Slither call 🤔 Let's leave this issue open so we can track the fix.
This also helped me, thanks
I think we can close this one, and perhaps add some documentation about it in building secure contracts.