From de743def68d53c933d08fe76d072dc93cf5ace12 Mon Sep 17 00:00:00 2001 From: Andres Aiello Date: Mon, 16 Dec 2024 15:24:23 -0300 Subject: [PATCH] redeploy testnet --- packages/zevm-app-contracts/data/addresses.json | 2 +- .../scripts/instant-rewards/deploy-v2.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/zevm-app-contracts/data/addresses.json b/packages/zevm-app-contracts/data/addresses.json index b3da2be..44b5424 100644 --- a/packages/zevm-app-contracts/data/addresses.json +++ b/packages/zevm-app-contracts/data/addresses.json @@ -13,7 +13,7 @@ "TimelockController": "0x44139C2150c11c25f517B8a8F974b59C82aEe709", "ZetaXPGov": "0x854032d484aE21acC34F36324E55A8080F21Af12", "invitationManagerV2": "0xb80f6360194Dd6B47B80bd8730b3dBb05a39e723", - "InstantRewardsFactory": "0xe79fA3b72278AdaE6d4B43cfFDACd6446F41d03f" + "InstantRewardsFactory": "0x3A557fe83FD734f21DD35E98f546B9706d486F55" }, "zeta_mainnet": { "disperse": "0x23ce409Ea60c3d75827d04D9db3d52F3af62e44d", diff --git a/packages/zevm-app-contracts/scripts/instant-rewards/deploy-v2.ts b/packages/zevm-app-contracts/scripts/instant-rewards/deploy-v2.ts index 1010a45..37ff9af 100644 --- a/packages/zevm-app-contracts/scripts/instant-rewards/deploy-v2.ts +++ b/packages/zevm-app-contracts/scripts/instant-rewards/deploy-v2.ts @@ -15,8 +15,14 @@ const OWNERS = { //@ts-ignore const owner = OWNERS[networkName]; +console.log("Owner:", owner); + +const deployInstantRewardsSample = async (instantRewardsFactoryAddress: string) => { + const [deployer] = await ethers.getSigners(); + + const InstantRewardsFactory = new InstantRewardsFactory__factory(deployer); + const instantRewards = InstantRewardsFactory.attach(instantRewardsFactoryAddress); -const deployInstantRewardsSample = async (instantRewards: InstantRewardsFactory) => { // get current timestamp from ethers const block = await ethers.provider.getBlock("latest"); const timestamp = block.timestamp; @@ -38,7 +44,7 @@ const deployInstantRewardsSample = async (instantRewards: InstantRewardsFactory) }); const rec = await tx.wait(); - console.log(rec); + // query event InstantRewardsCreated to get the address const event = rec.events?.find((event) => event.event === "InstantRewardsCreated"); @@ -70,6 +76,7 @@ const deployInstantRewards = async () => { saveAddress("InstantRewardsFactory", instantRewards.address, networkName); await verifyContract(instantRewards.address, [owner]); + // await verifyContract("0xAf5693bBC958e442462F411F46421e389c7A8602", [owner]); return instantRewards; }; @@ -77,7 +84,8 @@ const deployInstantRewards = async () => { const main = async () => { if (!isProtocolNetworkName(networkName)) throw new Error("Invalid network name"); const instantRewards = await deployInstantRewards(); - await deployInstantRewardsSample(instantRewards); + await deployInstantRewardsSample(instantRewards.address); + // await deployInstantRewardsSample("0x3A557fe83FD734f21DD35E98f546B9706d486F55"); }; main().catch((error) => {