-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: add script to deploy mock ERC20 tokens
- Loading branch information
1 parent
8964405
commit 6f48d13
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { task, types } from "hardhat/config"; | ||
import "@nomiclabs/hardhat-waffle"; | ||
|
||
// Example execution | ||
// npx hardhat deployERC20 --decimals 18 --name QuickSwap --symbol QUICK --network mumbai | ||
task("deployERC20", "Deploy a MockERC20") | ||
.addParam('name', 'Token name', undefined, types.string) | ||
.addParam('symbol', 'Token symbol', undefined, types.string) | ||
.addParam('decimals', 'Token decimals', 18, types.string) | ||
.setAction(async ({name, symbol, decimals}, hre) => { | ||
|
||
|
||
const ERC20 = await hre.ethers.getContractFactory("MockERC20"); | ||
const erc20 = await ERC20.deploy(); | ||
|
||
await erc20.deployed(); | ||
console.log(`New mock ERC20 deployed at ${erc20.address} 🍜`) | ||
|
||
console.log(`Setting token detail... 🍨`) | ||
await erc20.init(name, symbol, decimals) | ||
|
||
await hre.run("verify:verify", { | ||
address: erc20.address, | ||
network: hre.ethers.provider.network | ||
}) | ||
}); |