Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
andresaiello committed Oct 17, 2024
1 parent 29bd678 commit 0ec2e46
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 4 additions & 3 deletions packages/zevm-app-contracts/contracts/xp-nft/ZetaXPGov.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ contract ZetaXPGov is Governor, GovernorSettings, GovernorCountingSimple, Govern
constructor(
ZetaXP_V2 _xpNFT,
TimelockController _timelock,
uint256 _quorumPercentage // Set the quorum percentage (e.g., 4%)
uint256 _quorumPercentage, // Set the quorum percentage (e.g., 4%)
bytes32 _tag
)
Governor("ZetaXPGov")
GovernorSettings(7200 /* 1 day */, 50400 /* 1 week */, 0)
GovernorTimelockControl(_timelock)
{
xpNFT = _xpNFT;
quorumPercentage = _quorumPercentage;
tagValidToVote = _tag;
}

// @todo: implement access control
function setTagValidToVote(bytes32 _tag) external {
function setTagValidToVote(bytes32 _tag) external onlyGovernance {

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

Parameter ZetaXPGov.setTagValidToVote(bytes32)._tag is not in mixedCase
tagValidToVote = _tag;
}

Expand Down
10 changes: 9 additions & 1 deletion packages/zevm-app-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ const config: HardhatUserConfig = {
{ version: "0.6.6" /** For uniswap v2 */ },
{ version: "0.8.7" },
{ version: "0.8.9" },
{ version: "0.8.20" },
{
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
version: "0.8.20",
},
],
settings: {
/**
Expand Down
4 changes: 1 addition & 3 deletions packages/zevm-app-contracts/test/xp-nft/zeta-xp-gov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@ describe("ZetaXPGov", () => {

// Deploy the ZetaXPGov contract
const ZetaXPGovFactory = await ethers.getContractFactory("ZetaXPGov");
zetaGov = await ZetaXPGovFactory.deploy(zetaXP.address, timelock.address, 4);
zetaGov = await ZetaXPGovFactory.deploy(zetaXP.address, timelock.address, 4, tag);
await zetaGov.deployed();

// Assign proposer and executor roles to the signer
const proposerRole = await timelock.PROPOSER_ROLE();
const executorRole = await timelock.EXECUTOR_ROLE();
await timelock.grantRole(proposerRole, zetaGov.address);
await timelock.grantRole(executorRole, zetaGov.address);

await zetaGov.setTagValidToVote(tag);
});

// Helper function to extract token ID from minting receipt
Expand Down

0 comments on commit 0ec2e46

Please sign in to comment.