Skip to content

Commit

Permalink
redeploy testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
andresaiello committed Dec 16, 2024
1 parent 75dbf0f commit de743de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/zevm-app-contracts/data/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"TimelockController": "0x44139C2150c11c25f517B8a8F974b59C82aEe709",
"ZetaXPGov": "0x854032d484aE21acC34F36324E55A8080F21Af12",
"invitationManagerV2": "0xb80f6360194Dd6B47B80bd8730b3dBb05a39e723",
"InstantRewardsFactory": "0xe79fA3b72278AdaE6d4B43cfFDACd6446F41d03f"
"InstantRewardsFactory": "0x3A557fe83FD734f21DD35E98f546B9706d486F55"
},
"zeta_mainnet": {
"disperse": "0x23ce409Ea60c3d75827d04D9db3d52F3af62e44d",
Expand Down
14 changes: 11 additions & 3 deletions packages/zevm-app-contracts/scripts/instant-rewards/deploy-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");

Expand Down Expand Up @@ -70,14 +76,16 @@ const deployInstantRewards = async () => {
saveAddress("InstantRewardsFactory", instantRewards.address, networkName);

await verifyContract(instantRewards.address, [owner]);
// await verifyContract("0xAf5693bBC958e442462F411F46421e389c7A8602", [owner]);

return instantRewards;
};

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) => {
Expand Down

0 comments on commit de743de

Please sign in to comment.