cawfree / hardhat-copy

Pull a smart contract from mainnet onto your local chain.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hardhat-copy

hardhat-copy helps you import an Ethereum mainnet smart contract onto your local Hardhat node, enabling you to rapidly experiment with production smart contracts from the safety of your local environment.

🚀 getting started

Make sure you have downloaded the Node.js library from npm and have also installed Hardhat. Then just use npx hardhat-copy to generate a project which clones and deploys your desired mainnet smart contract onto your local branch:

# Try it!
CONTRACT_ADDRESS=0xef0182dc0574cd5874494a120750fd222fdb909a npx hardhat-copy

This will create a hardhat project in your working directory, i.e.:

HardhatCopy_0xef0182dc0574cd5874494a120750fd222fdb909a/

If you cd into this project, you can execute the included Mocha unit tests using the HRE:

npx hardhat test

By default, this simply deploys the specified smart contract onto your local environment; the included unit tests can then be extended for your own experimentation!

✌️ license

MIT

About

Pull a smart contract from mainnet onto your local chain.

License:MIT License


Languages

Language:TypeScript 92.5%Language:JavaScript 7.5%