NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.33k stars 1.42k forks source link

Fuzzing support in Hardhat #2136

Open Melvillian opened 2 years ago

Melvillian commented 2 years ago

dapptools and recently foundry both support fuzzing natively. We should support fuzzing with Typescript. This will help keep feature parity with similar smart contract devkits, and give TS users an additional powerful tool in their testing kit which currently doesn't exist, either natively in Hardhat nor as a plugin.

I don't have a concrete suggestion for what the UX should be for this, but here are some ideas.

1) Use code instrospection to detect which tests the user wants to make use of fuzzing (similar to how dapptools and foundry do it with *WithFuzzing suffix) 2) Add a built-in hardhat function uses to wrap Mocha's it tests, which takes as its arguments the variables you want to fuzz against

I have implemented some fuzz tests on my own using hardhat, and it would have saved me a lot of time, as well as encouraged me to write more comprehensive tests in the first place, if Hardhat had a ready-to-go tool for fuzzing.

I'm happy to help implement this with the help of an existing Hardhat contributor.

tinybike commented 2 years ago

I'd like to see this as well. Hardhat is an especially natural choice because built-in fuzzing support would nicely complement its mainnet forking feature.

fergarrui commented 2 years ago

I'd love to see that implemented

cloudre01 commented 2 years ago

Would love to see this included in the hardhat toolkit as well

RusseII commented 2 years ago

Can't wait for this critical feature!

rodrigoherrerai commented 2 years ago

Is Hardhat planning to launch an integrated fuzzer soon ? If not, we can build one.

AbhinavMir commented 2 years ago

@rodrigoherrerai I'd love to build native fuzzing feature in Hardhat - happy to chat.

rodrigoherrerai commented 2 years ago

@AbhinavMir messaged you through Twitter

github-actions[bot] commented 2 years ago

This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 7 days with no activity.

karooolis commented 2 years ago

Is anyone working on it? I'd like to give a shot at it.

feuGeneA commented 2 years ago

No one is working on it yet. Feel free to dive in. However, please be aware that the initial work will be "product work" rather than "technical work," which means discussion with the team to figure out what exactly should be done and how it should be approached. Any facilitation of that discussion would be welcome here on this Issue.

rodrigoherrerai commented 2 years ago

@karooolis Would love to work on it as well

gorgos commented 1 year ago

Good talk for anyone who wants to do the product work: https://www.youtube.com/watch?v=RrdrfdtWnSo

bony000 commented 1 year ago

I can't wait for this critical feature, If someone have a plan to this feature, I will contribute to it

Confucian-e commented 11 months ago

hoping to see this feature