mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-02-10 05:36:47 +00:00
only mint tokens when on local hardhat network
This commit is contained in:
parent
312a3eee55
commit
c7b69893a1
@ -1,11 +1,12 @@
|
|||||||
const MINTED_TOKENS = 1_000_000_000
|
const MINTED_TOKENS = 1_000_000_000
|
||||||
|
|
||||||
module.exports = async ({ deployments, getNamedAccounts, getUnnamedAccounts }) => {
|
module.exports = async ({ deployments, getNamedAccounts, getUnnamedAccounts, network }) => {
|
||||||
const { deployer } = await getNamedAccounts()
|
const { deployer } = await getNamedAccounts()
|
||||||
const tokenDeployment = await deployments.deploy("TestToken", { from: deployer })
|
const tokenDeployment = await deployments.deploy("TestToken", { from: deployer })
|
||||||
const token = await hre.ethers.getContractAt("TestToken", tokenDeployment.address)
|
const token = await hre.ethers.getContractAt("TestToken", tokenDeployment.address)
|
||||||
|
|
||||||
const accounts = [...Object.values(await getNamedAccounts()), ...(await getUnnamedAccounts())]
|
const accounts = [...Object.values(await getNamedAccounts()), ...(await getUnnamedAccounts())]
|
||||||
|
if (network.tags.local) {
|
||||||
for (const account of accounts) {
|
for (const account of accounts) {
|
||||||
console.log(`Minting ${MINTED_TOKENS} tokens to address ${account}`)
|
console.log(`Minting ${MINTED_TOKENS} tokens to address ${account}`)
|
||||||
|
|
||||||
@ -13,5 +14,6 @@ module.exports = async ({ deployments, getNamedAccounts, getUnnamedAccounts }) =
|
|||||||
await transaction.wait()
|
await transaction.wait()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module.exports.tags = ["TestToken"]
|
module.exports.tags = ["TestToken"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user