2023-04-03 08:39:48 +00:00
|
|
|
const MINTED_TOKENS = 1_000_000_000
|
|
|
|
|
|
|
|
module.exports = async ({ deployments, getNamedAccounts, getUnnamedAccounts }) => {
|
2021-11-16 12:54:38 +00:00
|
|
|
const { deployer } = await getNamedAccounts()
|
2023-04-03 08:39:48 +00:00
|
|
|
const tokenDeployment = await deployments.deploy("TestToken", { from: deployer })
|
|
|
|
const token = await hre.ethers.getContractAt("TestToken", tokenDeployment.address)
|
|
|
|
|
|
|
|
const accounts = [...Object.values(await getNamedAccounts()), ...(await getUnnamedAccounts())]
|
|
|
|
for (const account of accounts) {
|
|
|
|
console.log(`Minting ${MINTED_TOKENS} tokens to address ${account}`)
|
|
|
|
|
2023-04-17 13:14:35 +00:00
|
|
|
const transaction = await token.mint(account, MINTED_TOKENS, { from: deployer })
|
|
|
|
await transaction.wait()
|
2023-04-03 08:39:48 +00:00
|
|
|
}
|
2021-11-16 12:54:38 +00:00
|
|
|
}
|
|
|
|
|
2022-02-09 13:17:23 +00:00
|
|
|
module.exports.tags = ["TestToken"]
|