2025-01-24 15:28:29 +01:00
|
|
|
const MINTED_TOKENS = 1_000_000_000_000_000
|
2023-04-03 10:39:48 +02:00
|
|
|
|
2025-01-24 15:28:29 +01:00
|
|
|
module.exports = async ({
|
|
|
|
deployments,
|
|
|
|
getNamedAccounts,
|
|
|
|
getUnnamedAccounts,
|
|
|
|
network,
|
|
|
|
}) => {
|
2021-11-16 13:54:38 +01:00
|
|
|
const { deployer } = await getNamedAccounts()
|
2025-01-24 15:28:29 +01:00
|
|
|
const tokenDeployment = await deployments.deploy("TestToken", {
|
|
|
|
from: deployer,
|
|
|
|
})
|
|
|
|
const token = await hre.ethers.getContractAt(
|
|
|
|
"TestToken",
|
|
|
|
tokenDeployment.address
|
|
|
|
)
|
2023-04-03 10:39:48 +02:00
|
|
|
|
2025-01-24 15:28:29 +01:00
|
|
|
const accounts = [
|
|
|
|
...Object.values(await getNamedAccounts()),
|
|
|
|
...(await getUnnamedAccounts()),
|
|
|
|
]
|
2023-05-05 16:00:26 +10:00
|
|
|
if (network.tags.local) {
|
|
|
|
for (const account of accounts) {
|
|
|
|
console.log(`Minting ${MINTED_TOKENS} tokens to address ${account}`)
|
2023-04-03 10:39:48 +02:00
|
|
|
|
2025-01-24 15:28:29 +01:00
|
|
|
const transaction = await token.mint(account, MINTED_TOKENS, {
|
|
|
|
from: deployer,
|
|
|
|
})
|
2023-05-05 16:00:26 +10:00
|
|
|
await transaction.wait()
|
|
|
|
}
|
2024-01-25 15:00:46 +01:00
|
|
|
console.log()
|
2023-04-03 10:39:48 +02:00
|
|
|
}
|
2021-11-16 13:54:38 +01:00
|
|
|
}
|
|
|
|
|
2022-02-09 14:17:23 +01:00
|
|
|
module.exports.tags = ["TestToken"]
|