building-secure-contracts
building-secure-contracts copied to clipboard
Is Hardhat compatible in the End to End Test Example?
Basically I was trying to replace Truffle with Hardhat in this example (https://github.com/crytic/building-secure-contracts/blob/master/program-analysis/echidna/end-to-end-testing.md), since Hardhat can offer multiple solc version support when compiling.
So the contracts I am using is the same as those in the drizzle-box example. Etheno can successfully record the transaction and then I tried using Echidna to run the end to end test. But there is error occuring:
I searched in Echidna and Crytic-compile repo and found the similar issues: Echidna: https://github.com/crytic/echidna/issues/631 crytic-compile: https://github.com/crytic/crytic-compile/issues/164 https://github.com/crytic/crytic-compile/issues/236
Then I checked my build-info file and I found it's located in the artifacts/build-info directory, there's only one build info json file. So I am wondering why crytic-compile output the "No such file or directory: 'artifacts/build-info'" error, since I did not make any special directory for the build info json file.
May I ask if there's any special argument needs to be added to the yaml config file? I tried to modify the cryticArgs option, but the same error occured, my config file hardhat.yaml shows below:
Hardhat should work, but we need to check this particular example. We will investigate during the week.
Hardhat should work, but we need to check this particular example. We will investigate during the week.
@ggrieco-tob Hi sir, basically the reason I prefer hardhat over truffle is because that it can import different solc compilers with different version so that it can compile a whole project of contracts written in different solidity pragma. But now it seems that truffle cannot provide this kind of feature, it can only import one solc compiler so it is actually not quite compatible with the end-to-end method.
May I know if crytic-compile provides the similar functionality to hardhat?
crytic-compile allows to specify a solc version, but it will not allow multiple versions. You should use hardhat for that. Btw, I still need to investigate this issue, sorry :disappointed:
crytic-compile allows to specify a solc version, but it will not allow multiple versions. You should use hardhat for that. Btw, I still need to investigate this issue, sorry 😞
Ok got it, never mind sir, I will also try to investigate and find a way to solve it, thank you for your support 👍