communities-contracts/scripts/deploy_erc721.ts

37 lines
959 B
TypeScript
Raw Normal View History

2023-01-19 11:21:41 +00:00
import { ethers } from "hardhat";
import { pn } from "./utils";
2023-01-19 11:21:41 +00:00
async function main() {
2023-07-21 08:04:02 +00:00
const TestToken = await ethers.getContractFactory("Currency");
const testToken = await TestToken.deploy();
const ownerTokenAddress = testToken.address;
const masterTokenAddress = testToken.address;
const CollectibleV1 = await ethers.getContractFactory("CollectibleV1");
const contract = await CollectibleV1.deploy(
"Test",
"TEST",
100,
true,
true,
2023-07-21 08:04:02 +00:00
"http://local.dev",
ownerTokenAddress,
masterTokenAddress
);
2023-01-19 11:21:41 +00:00
const instance = await contract.deployed();
const tx = instance.deployTransaction;
const rec = await tx.wait();
2023-07-21 08:04:02 +00:00
console.log(
`CollectibleV1 deployed at ${instance.address}. Gas used: ${pn(
rec.gasUsed
)}`
);
2023-01-19 11:21:41 +00:00
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});