Skip to content

Commit

Permalink
deploy and verify
Browse files Browse the repository at this point in the history
  • Loading branch information
andresaiello committed Aug 15, 2024
1 parent 3d1b6ec commit 82aafaf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
11 changes: 10 additions & 1 deletion packages/zevm-app-contracts/data/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
"zetaSwapBtcInbound": "0x358E2cfC0E16444Ba7D3164Bbeeb6bEA7472c559",
"invitationManager": "0x3649C03C472B698213926543456E9c21081e529d",
"withdrawERC20": "0xa349B9367cc54b47CAb8D09A95836AE8b4D1d84E",
"ZetaXP": "0x80ECE9a08ba893e1B863C0c6B3c098268C146E40"
"ZetaXP": "0xE1DfA5dfd1d6c6b47C8c9b8726EdD019D365491D"
},
"zeta_mainnet": {
"disperse": "0x23ce409Ea60c3d75827d04D9db3d52F3af62e44d",
"rewardDistributorFactory": "0xB9dc665610CF5109cE23aBBdaAc315B41FA094c1",
"zetaSwap": "0xA8168Dc495Ed61E70f5c1941e2860050AB902cEF",
"zetaSwapBtcInbound": "0x358E2cfC0E16444Ba7D3164Bbeeb6bEA7472c559",
"invitationManager": "0x3649C03C472B698213926543456E9c21081e529d",
"withdrawERC20": "0xa349B9367cc54b47CAb8D09A95836AE8b4D1d84E",
"ZetaXP": "0x6926b6ea978d59a8Ab6aC05486Fd0bED6D15eC29"
}
}
}
24 changes: 23 additions & 1 deletion packages/zevm-app-contracts/scripts/xp-nft/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isProtocolNetworkName } from "@zetachain/protocol-contracts";
import { ethers, network, upgrades } from "hardhat";
import { ethers, network, run, upgrades } from "hardhat";

import { ZetaXP__factory } from "../../typechain-types";
import { saveAddress } from "../address.helpers";
Expand All @@ -9,6 +9,20 @@ const networkName = network.name;
const ZETA_BASE_URL = "https://api.zetachain.io/nft/";
const signer = "0x1d24d94520B94B26351f6573de5ef9731c48531A";

const verifyContract = async (contractAddress: string, constructorArguments: any[]) => {
// Verification process
console.log(`Verifying contract ${contractAddress}...`);
try {
await run("verify:verify", {
address: contractAddress,
constructorArguments,
});
console.log("Verification successful");
} catch (error) {
console.error("Verification failed:", error);
}
};

const deployZetaXP = async () => {
if (!isProtocolNetworkName(networkName)) throw new Error("Invalid network name");

Expand All @@ -17,8 +31,16 @@ const deployZetaXP = async () => {

await zetaXP.deployed();

// Get the implementation address
const implementationAddress = await upgrades.erc1967.getImplementationAddress(zetaXP.address);

console.log("ZetaXP deployed to:", zetaXP.address);
console.log("ZetaXP implementation deployed to:", implementationAddress);

saveAddress("ZetaXP", zetaXP.address, networkName);

await verifyContract(zetaXP.address, ["ZETA NFT", "ZNFT", ZETA_BASE_URL, signer]);
await verifyContract(implementationAddress, []);
};

const main = async () => {
Expand Down

0 comments on commit 82aafaf

Please sign in to comment.