25 lines
612 B
JavaScript
Raw Normal View History

const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules")
const MAX_ACCOUNTS = 20
const MINTED_TOKENS = 1_000_000_000_000_000n
module.exports = buildModule("Token", (m) => {
const deployer = m.getAccount(0)
const token = m.contract("TestToken", [], {
from: deployer,
})
2025-04-15 15:28:48 +02:00
if (hre.network.config && hre.network.config.tags.includes("local")) {
for (let i = 0; i < MAX_ACCOUNTS; i++) {
const account = m.getAccount(i)
2025-04-15 15:28:48 +02:00
m.call(token, "mint", [account, MINTED_TOKENS], {
from: deployer,
id: `SendingEth_${i}`,
})
}
}
return { token }
})