diff --git a/scripts/deploy_erc721.ts b/scripts/deploy_erc721.ts index ae806df..5dd1b56 100644 --- a/scripts/deploy_erc721.ts +++ b/scripts/deploy_erc721.ts @@ -2,6 +2,11 @@ import { ethers } from "hardhat"; import { pn } from "./utils"; async function main() { + 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", @@ -9,13 +14,19 @@ async function main() { 100, true, true, - "http://local.dev" + "http://local.dev", + ownerTokenAddress, + masterTokenAddress ); const instance = await contract.deployed(); const tx = instance.deployTransaction; const rec = await tx.wait(); - console.log("CollectibleV1 deployed. Gas used:", pn(rec.gasUsed)); + console.log( + `CollectibleV1 deployed at ${instance.address}. Gas used: ${pn( + rec.gasUsed + )}` + ); } // We recommend this pattern to be able to use async/await everywhere // and properly handle errors. diff --git a/scripts/deploy_owner_token.ts b/scripts/deploy_owner_token.ts new file mode 100644 index 0000000..5879471 --- /dev/null +++ b/scripts/deploy_owner_token.ts @@ -0,0 +1,29 @@ +import { ethers } from "hardhat"; +import { pn } from "./utils"; + +async function main() { + const CollectibleV1 = await ethers.getContractFactory("OwnerToken"); + const contract = await CollectibleV1.deploy( + "Test", + "TEST", + "http://local.dev", + "Test 2", + "TEST 2", + "http://local2.dev", + "0x12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" + ); + + const instance = await contract.deployed(); + const tx = instance.deployTransaction; + const rec = await tx.wait(); + console.log( + `OwnerToken deployed at ${instance.address}. Gas used: ${pn(rec.gasUsed)}` + ); + console.log("Master token deployed at", rec.events[0].args.masterToken); +} +// 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; +});