39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
const hre = require("hardhat");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
async function main() {
|
|
const [deployer] = await hre.ethers.getSigners();
|
|
console.log("deployer:", deployer.address);
|
|
console.log("network:", hre.network.name);
|
|
console.log("mint_mode:", "gas_only");
|
|
|
|
const factory = await hre.ethers.getContractFactory("EdutHumanMembership");
|
|
const contract = await factory.deploy();
|
|
await contract.deployed();
|
|
|
|
console.log("membership_contract:", contract.address);
|
|
|
|
const output = {
|
|
network: hre.network.name,
|
|
chainId: hre.network.config.chainId || null,
|
|
deployer: deployer.address,
|
|
mintCurrency: hre.ethers.constants.AddressZero,
|
|
mintAmountAtomic: "0",
|
|
membershipContract: contract.address,
|
|
txHash: contract.deployTransaction.hash,
|
|
};
|
|
const outputPath = (process.env.DEPLOY_OUTPUT_PATH || "").trim();
|
|
if (outputPath) {
|
|
const absolute = path.resolve(outputPath);
|
|
fs.mkdirSync(path.dirname(absolute), { recursive: true });
|
|
fs.writeFileSync(absolute, JSON.stringify(output, null, 2));
|
|
console.log("deployment_output:", absolute);
|
|
}
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.error(err);
|
|
process.exitCode = 1;
|
|
});
|