diff --git a/packages/zevm-app-contracts/contracts/xp-nft/ZetaXPGov.sol b/packages/zevm-app-contracts/contracts/xp-nft/ZetaXPGov.sol index 3924f5f..617811d 100644 --- a/packages/zevm-app-contracts/contracts/xp-nft/ZetaXPGov.sol +++ b/packages/zevm-app-contracts/contracts/xp-nft/ZetaXPGov.sol @@ -42,7 +42,6 @@ contract ZetaXPGov is Governor, GovernorSettings, GovernorCountingSimple, Govern ) internal view override returns (uint256) { uint256 tokenId = xpNFT.tokenByUserTag(account, tagValidToVote); uint256 level = xpNFT.getLevel(tokenId); - require(level > 0, "ZetaXPGov: invalid NFT level"); // Assign voting weight based on NFT level if (level == 1) { @@ -119,4 +118,18 @@ contract ZetaXPGov is Governor, GovernorSettings, GovernorCountingSimple, Govern function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) { return super._executor(); } + + function _castVote( + uint256 proposalId, + address account, + uint8 support, + string memory reason, + bytes memory params + ) internal override returns (uint256) { + uint256 tokenId = xpNFT.tokenByUserTag(account, tagValidToVote); + uint256 level = xpNFT.getLevel(tokenId); + require(level > 0, "ZetaXPGov: invalid NFT level"); + + return super._castVote(proposalId, account, support, reason, params); + } } diff --git a/packages/zevm-app-contracts/data/addresses.json b/packages/zevm-app-contracts/data/addresses.json index 066dbf5..14f8de8 100644 --- a/packages/zevm-app-contracts/data/addresses.json +++ b/packages/zevm-app-contracts/data/addresses.json @@ -10,8 +10,8 @@ "ZetaXP": "0x5c25b6f4D2b7a550a80561d3Bf274C953aC8be7d", "InstantRewards": "0x10DfEd4ba9b8F6a1c998E829FfC0325D533c80E3", "ProofOfLiveness": "0x981EB6fD19717Faf293Fba0cBD05C6Ac97b8C808", - "TimelockController": "0x26F16EB99F195F1f401b0Afcafa2FEbb9427CE09", - "ZetaXPGov": "0x7B01E3060B9aAb92E3b981DB699330bB582a53C0" + "TimelockController": "0x75C2C7dD9f8Fe9f7B303570Db164504106D019F5", + "ZetaXPGov": "0xCA95803a99000863D935D3aA86a1a7F190F06D0a" }, "zeta_mainnet": { "disperse": "0x23ce409Ea60c3d75827d04D9db3d52F3af62e44d", diff --git a/packages/zevm-app-contracts/scripts/xp-nft/deploy-gov.ts b/packages/zevm-app-contracts/scripts/xp-nft/deploy-gov.ts index 9a4750e..b338fd5 100644 --- a/packages/zevm-app-contracts/scripts/xp-nft/deploy-gov.ts +++ b/packages/zevm-app-contracts/scripts/xp-nft/deploy-gov.ts @@ -4,6 +4,8 @@ import { ethers, network } from "hardhat"; import { getZEVMAppAddress, saveAddress } from "../address.helpers"; import { verifyContract } from "../explorer.helpers"; +const QUANTUM_PERCENTAGE = 4; + const networkName = network.name; const encodeTag = (tag: string) => ethers.utils.keccak256(ethers.utils.defaultAbiCoder.encode(["string"], [tag])); @@ -40,12 +42,12 @@ const deployXPGov = async () => { // Deploy the ZetaXPGov contract const ZetaXPGovFactory = await ethers.getContractFactory("ZetaXPGov"); - const zetaGov = await ZetaXPGovFactory.deploy(zetaXPAddress, timelockAddress, 4, tag); + const zetaGov = await ZetaXPGovFactory.deploy(zetaXPAddress, timelockAddress, QUANTUM_PERCENTAGE, tag); await zetaGov.deployed(); const zetaGovAddress = zetaGov.address; - executeVerifyContract("ZetaXPGov", zetaGovAddress, [zetaXPAddress, timelockAddress, 4, tag]); + executeVerifyContract("ZetaXPGov", zetaGovAddress, [zetaXPAddress, timelockAddress, QUANTUM_PERCENTAGE, tag]); // Assign proposer and executor roles to the signer const proposerRole = await timelock.PROPOSER_ROLE();