From 0bebea318394a30415f008e7f182826c79dc53d4 Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Wed, 20 Sep 2023 13:22:53 +0200 Subject: [PATCH 1/4] Add initial cat mint script --- .../deploy/300_catalyst/300_catalyst_mint.ts | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts diff --git a/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts b/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts new file mode 100644 index 0000000000..c0fbe6969e --- /dev/null +++ b/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts @@ -0,0 +1,43 @@ +import {DeployFunction} from 'hardhat-deploy/types'; +import {HardhatRuntimeEnvironment} from 'hardhat/types'; + +const func: DeployFunction = async function ( + hre: HardhatRuntimeEnvironment +): Promise { + const {deployments, getNamedAccounts} = hre; + const {execute, catchUnknownSigner, log} = deployments; + const {catalystMinter} = await getNamedAccounts(); + + // TODO Clarify whether the below is the correct contract name + const GiveawayContract = await deployments.get('MultiGiveawayV1'); + + // TODO Specify amounts + const amounts = { + Common: 100, + Uncommon: 200, + Rare: 300, + Epic: 400, + Legendary: 500, + Mythic: 600, + }; + await catchUnknownSigner( + execute('Catalyst', {from: catalystMinter, log: true}, 'mintBatch', [ + GiveawayContract.address, + [1, 2, 3, 4, 5, 6], + [ + amounts.Common, + amounts.Uncommon, + amounts.Rare, + amounts.Epic, + amounts.Legendary, + amounts.Mythic, + ], + [], + ]) + ); + log(`Minted 6 NFTs to ${GiveawayContract.address}`); +}; + +export default func; +func.tags = ['Catalyst_mint', 'L2']; +func.dependencies = ['Catalyst_deploy']; From 28081c44484e68bdd9a1517049092eaf95e899f3 Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Wed, 20 Sep 2023 14:00:01 +0200 Subject: [PATCH 2/4] Update cat mint receiver and rm square brackets around args --- .../deploy/300_catalyst/300_catalyst_mint.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts b/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts index c0fbe6969e..b806e77a15 100644 --- a/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts +++ b/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts @@ -8,9 +8,6 @@ const func: DeployFunction = async function ( const {execute, catchUnknownSigner, log} = deployments; const {catalystMinter} = await getNamedAccounts(); - // TODO Clarify whether the below is the correct contract name - const GiveawayContract = await deployments.get('MultiGiveawayV1'); - // TODO Specify amounts const amounts = { Common: 100, @@ -21,8 +18,11 @@ const func: DeployFunction = async function ( Mythic: 600, }; await catchUnknownSigner( - execute('Catalyst', {from: catalystMinter, log: true}, 'mintBatch', [ - GiveawayContract.address, + execute( + 'Catalyst', + {from: catalystMinter, log: true}, + 'mintBatch', + '0x214d52880b1e4E17d020908cd8EAa988FfDD4020', // GiveawayContract [1, 2, 3, 4, 5, 6], [ amounts.Common, @@ -31,9 +31,8 @@ const func: DeployFunction = async function ( amounts.Epic, amounts.Legendary, amounts.Mythic, - ], - [], - ]) + ] + ) ); log(`Minted 6 NFTs to ${GiveawayContract.address}`); }; From 934d768182d423b460c25aaf35f780cdc0c80e0b Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Wed, 20 Sep 2023 16:19:19 +0200 Subject: [PATCH 3/4] Revert from hardcoded contract address for now --- packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts b/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts index b806e77a15..a96c67ffd8 100644 --- a/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts +++ b/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts @@ -1,13 +1,14 @@ import {DeployFunction} from 'hardhat-deploy/types'; import {HardhatRuntimeEnvironment} from 'hardhat/types'; -const func: DeployFunction = async function ( - hre: HardhatRuntimeEnvironment -): Promise { +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deployments, getNamedAccounts} = hre; const {execute, catchUnknownSigner, log} = deployments; const {catalystMinter} = await getNamedAccounts(); + // TODO Clarify whether the below is the correct contract name + const GiveawayContract = await deployments.get('MultiGiveawayV1'); + // TODO Specify amounts const amounts = { Common: 100, @@ -22,7 +23,7 @@ const func: DeployFunction = async function ( 'Catalyst', {from: catalystMinter, log: true}, 'mintBatch', - '0x214d52880b1e4E17d020908cd8EAa988FfDD4020', // GiveawayContract + GiveawayContract.address, [1, 2, 3, 4, 5, 6], [ amounts.Common, From d5ce1945affed260bda0250d0f6a51ffdf85ce3b Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Thu, 21 Sep 2023 18:12:57 +0200 Subject: [PATCH 4/4] Update giveaway contract address --- .../deploy/300_catalyst/300_catalyst_mint.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts b/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts index a96c67ffd8..53509e2d79 100644 --- a/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts +++ b/packages/deploy/deploy/300_catalyst/300_catalyst_mint.ts @@ -6,8 +6,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {execute, catchUnknownSigner, log} = deployments; const {catalystMinter} = await getNamedAccounts(); - // TODO Clarify whether the below is the correct contract name - const GiveawayContract = await deployments.get('MultiGiveawayV1'); + const mumbaiGivewayContractAddress = + '0xfCE84d07909489508C5B293a850AF15Fb7147bc6'; + const polygonGiveawayContractAddress = + '0x214d52880b1e4E17d020908cd8EAa988FfDD4020'; + + const giveawayContractAddress = + hre.network.name === 'mumbai' + ? mumbaiGivewayContractAddress + : polygonGiveawayContractAddress; // TODO Specify amounts const amounts = { @@ -23,7 +30,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { 'Catalyst', {from: catalystMinter, log: true}, 'mintBatch', - GiveawayContract.address, + giveawayContractAddress, [1, 2, 3, 4, 5, 6], [ amounts.Common, @@ -35,7 +42,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { ] ) ); - log(`Minted 6 NFTs to ${GiveawayContract.address}`); + log(`Minted 6 NFTs to ${giveawayContractAddress}`); }; export default func;