hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Fuzzing support in Hardhat

Open Melvillian opened this issue 2 years ago • 15 comments

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.

Melvillian avatar Dec 08 '21 03:12 Melvillian

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.

tinybike avatar Jan 29 '22 18:01 tinybike

I'd love to see that implemented

fergarrui avatar Feb 08 '22 17:02 fergarrui

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

cloudre01 avatar Feb 09 '22 13:02 cloudre01

Can't wait for this critical feature!

RusseII avatar Mar 22 '22 14:03 RusseII

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

rodrigoherrerai avatar Mar 27 '22 16:03 rodrigoherrerai

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

AbhinavMir avatar Apr 13 '22 23:04 AbhinavMir

@AbhinavMir messaged you through Twitter

rodrigoherrerai avatar Apr 14 '22 07:04 rodrigoherrerai

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] avatar Jun 09 '22 15:06 github-actions[bot]

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

github-actions[bot] avatar Jun 16 '22 18:06 github-actions[bot]

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

karooolis avatar Aug 22 '22 06:08 karooolis

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.

feuGeneA avatar Aug 22 '22 15:08 feuGeneA

@karooolis Would love to work on it as well

rodrigoherrerai avatar Aug 22 '22 15:08 rodrigoherrerai

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

gorgos avatar Jan 14 '23 08:01 gorgos

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

incregeni avatar Jul 03 '23 00:07 incregeni

hoping to see this feature

Confucian-e avatar Dec 21 '23 09:12 Confucian-e