echidna icon indicating copy to clipboard operation
echidna copied to clipboard

Improve using a 1:1 mapping of config → contract

Open 0x6080 opened this issue 2 years ago • 1 comments

There is often circumstances that you want a contract to be tested with a particular set of config options. For example, youh might want to adjust maxTimeDelay for certain functions.

From what I can tell, the best way to do this would be to do something like what Balancer Core does:

<testContract1>.sol
<testContract1>.yaml
<testContract2>.sol
<testContract2>.yaml
...

You can then do echidna-test ./echidna/testContract1 --config ./echidna/testContract1.yaml, echidna-test ./echidna/testContract2 --config ./echidna/testContract2.yaml, ... to test each with the correct config.

However, this really doesn't scale. If this kind of naming pattern is used, it could be automatic to map each config to each contract. Then you could just do echidna-test ./echidna/ and it would work correctly.

If Balancer's scheme is not the best way to do this, or if this alternative does not work, is there some way to adjust a config option in a particular contract?

Would love to get some feedback on this issue, thanks!

0x6080 avatar Mar 12 '22 19:03 0x6080

If you want, you can keep all the contract in the same solidity file, and just change the yaml file (or use the same for some of them), but I see what you mean. We will think about it and start a discussion here. Thanks!

ggrieco-tob avatar Mar 12 '22 21:03 ggrieco-tob