hardhat init
by cloning on-chain verified contracts
#5397
Labels
status:ready
This issue is ready to be worked on
hardhat init
by cloning on-chain verified contracts
#5397
Describe the feature
We propose to bring the clone on-chain verified contracts feature to hardhat to facilitate daily development, learning, and experimenting of Ethereum developers.
Motivation
Currently
hardhat init
creates only sample projects.This creates an obstacle on blockchain developers, who may want to re-compile the contracts of popular DApps, customize it, deploy in a local chain, write hardhat tests/tasks with the contract, etc.
Proposal
We propose to extend the
hardhat init
command by providing one additional question during the project creation guide, e.g.,Do you want to clone an existing on-chain contract?
, to allow users to opt into the clone feature.This will dump contract source code from Etherscan or other sources into the hardhat project being created, and most importantly, the hardhat configuration will be adjusted according to the compilation settings for the on-chain contract.
We welcome any comments and suggestions helping us improve this feature and contribute to a better smart contract development and debugging experience.
Disclaimer
We (@ZhangZhuoSJTU and I) are planning to bring the clone on-chain verified contracts feature to hardhat, just as we did for foundry: foundry-rs/foundry#7576.
More information can be found at foundry-rs/foundry#7575
The
forge clone
feature has received great feedback in the community. https://x.com/troublor/status/1780984367931695256Now we are trying to bring this to hardhat.
Search terms
clone, init
The text was updated successfully, but these errors were encountered: