Skip to content

Commit

Permalink
Updated deployment script for ParanetIncentivesPoolFactory, deployed …
Browse files Browse the repository at this point in the history
…new contract on Base/Neuroweb
  • Loading branch information
u-hubar committed Sep 13, 2024
1 parent e29d4c3 commit 6dc9a45
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 26 deletions.
2 changes: 1 addition & 1 deletion deploy/046_deploy_paranet_incentives_pool_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DeployFunction } from 'hardhat-deploy/types';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (!hre.network.name.startsWith('otp') && !hre.network.name.startsWith('hardhat')) {
if (hre.network.name.startsWith('gnosis')) {
return;
}

Expand Down
9 changes: 9 additions & 0 deletions deployments/base_mainnet_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,15 @@
"deploymentBlock": 16310756,
"deploymentTimestamp": 1719410863148,
"deployed": true
},
"ParanetIncentivesPoolFactory": {
"evmAddress": "0x1295037627a42BA1d02Cb13e7c080009dF71C7D1",
"version": "2.0.0",
"gitBranch": "feature/neuro-erc20-incentives",
"gitCommitHash": "b5e57be38cfd094ccd52819fa2c458e4b4acf854",
"deploymentBlock": 19726096,
"deploymentTimestamp": 1726241547795,
"deployed": true
}
}
}
9 changes: 9 additions & 0 deletions deployments/base_sepolia_dev_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,15 @@
"deploymentBlock": 11509127,
"deploymentTimestamp": 1718786545806,
"deployed": true
},
"ParanetIncentivesPoolFactory": {
"evmAddress": "0x64769faeb5903279EFA59B5170BB6257AcCd2A71",
"version": "2.0.0",
"gitBranch": "feature/neuro-erc20-incentives",
"gitCommitHash": "b5e57be38cfd094ccd52819fa2c458e4b4acf854",
"deploymentBlock": 15227285,
"deploymentTimestamp": 1726222864380,
"deployed": true
}
}
}
9 changes: 9 additions & 0 deletions deployments/base_sepolia_test_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,15 @@
"deploymentBlock": 11510567,
"deploymentTimestamp": 1718789426637,
"deployed": true
},
"ParanetIncentivesPoolFactory": {
"evmAddress": "0x3cCCDD320c76030f760E60aa0E519fA3B1fC4b02",
"version": "2.0.0",
"gitBranch": "feature/neuro-erc20-incentives",
"gitCommitHash": "b5e57be38cfd094ccd52819fa2c458e4b4acf854",
"deploymentBlock": 15236554,
"deploymentTimestamp": 1726241399211,
"deployed": true
}
}
}
9 changes: 0 additions & 9 deletions deployments/gnosis_chiado_dev_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,6 @@
"deploymentBlock": 10357793,
"deploymentTimestamp": 1718619642976,
"deployed": true
},
"ParanetIncentivesPoolFactory": {
"evmAddress": "0xEA7932aDfA759BA6D78c42bCE6De6258768F7b4e",
"version": "2.0.0",
"gitBranch": "improvement/paranet-incentives-additional-getters",
"gitCommitHash": "86a1d826db5485390b6fca1b13673261d0c4d89e",
"deploymentBlock": 10357795,
"deploymentTimestamp": 1718619653053,
"deployed": true
}
}
}
12 changes: 6 additions & 6 deletions deployments/otp_mainnet_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,13 @@
"deployed": true
},
"ParanetIncentivesPoolFactory": {
"evmAddress": "0x7749834AB8152de91B9b3252Da7750247F52F495",
"substrateAddress": "5EMjsczk5SaUrPcwJmAgXPbxqdWmWduN6z3JV6tSJAReRtJx",
"evmAddress": "0x079e0619161B8aa91F83E6Ed0470fa295F4715C2",
"substrateAddress": "5EMjsczMhexJhiduehcbGxhVwRAKBRX9VXDZ3NnHSnB3znva",
"version": "2.0.0",
"gitBranch": "improvement/paranet-incentives-additional-getters",
"gitCommitHash": "4cef06a0b27b03e64d68215f5b3df091b73e31e2",
"deploymentBlock": 5162782,
"deploymentTimestamp": 1718631441728,
"gitBranch": "feature/neuro-erc20-incentives",
"gitCommitHash": "e29d4c314acdde185e8bf1c133ea812344d15af0",
"deploymentBlock": 5802358,
"deploymentTimestamp": 1726242413487,
"deployed": true
}
},
Expand Down
12 changes: 6 additions & 6 deletions deployments/otp_testnet_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@
"deployed": true
},
"ParanetIncentivesPoolFactory": {
"evmAddress": "0x043F6aBBfd8882acb4f71C49E7f4Bd71271d5FD0",
"substrateAddress": "5EMjsczM2VgpRxsY2B7g23uW33fR21633UMZZUxA6owKPXt6",
"evmAddress": "0x15CDB0bB8eb782c9b21efD99084c15D2Dc44aa92",
"substrateAddress": "5EMjsczQYXEGTkiEhqAEzmC6Mgz8tuVzRiJ3szZpvNiS7u8P",
"version": "2.0.0",
"gitBranch": "improvement/paranet-incentives-additional-getters",
"gitCommitHash": "bbf78d963b46a63c4c55fd6a82fc0bbdb59c40bc",
"deploymentBlock": 4108247,
"deploymentTimestamp": 1718630808590,
"gitBranch": "feature/neuro-erc20-incentives",
"gitCommitHash": "e29d4c314acdde185e8bf1c133ea812344d15af0",
"deploymentBlock": 4532480,
"deploymentTimestamp": 1726242358520,
"deployed": true
}
},
Expand Down
21 changes: 17 additions & 4 deletions test/v2/unit/ParanetNeuroIncentivesPool.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { loadFixture, time } from '@nomicfoundation/hardhat-network-helpers';
import { expect } from 'chai';
import { BigNumberish } from 'ethers';
import hre, { ethers, hardhatArguments } from 'hardhat';
import { BigNumberish, Event } from 'ethers';
import hre from 'hardhat';
import { SignerWithAddress } from 'hardhat-deploy-ethers/signers';

import {
Expand Down Expand Up @@ -223,9 +223,18 @@ describe('@v2 @unit ParanetNeuroIncentivesPool contract', function () {
const number = 1;
const { paranetKAStorageContract, paranetKATokenId } = await registerParanet(accounts, Paranet, number);

const incentivesPoolParams = {
paranetKAStorageContract,
paranetKATokenId,
tracToNeuroEmissionMultiplier: hre.ethers.utils.parseEther('1'),
paranetOperatorRewardPercentage: 1_000,
paranetIncentivizationProposalVotersRewardPercentage: 1_000,
};
const IncentivesPool = await deployERC20NeuroIncentivesPool(accounts, incentivesPoolParams, 1);

// create ERC721 contract instance
const owner = accounts[100 + number];
const erc721 = (await ethers.getContractAt('IERC721', paranetKAStorageContract, owner)) as IERC721;
const erc721 = (await hre.ethers.getContractAt('IERC721', paranetKAStorageContract, owner)) as IERC721;

// transfer to new operator
const newOwner = accounts[200 + number];
Expand All @@ -235,6 +244,10 @@ describe('@v2 @unit ParanetNeuroIncentivesPool contract', function () {
// check transfer
const currentOwner = await erc721.ownerOf(paranetKATokenId);
expect(currentOwner).to.be.equal(newOwner.address);

// check if paranet operator
const isParanetOperator = await IncentivesPool.isParanetOperator(newOwner.address);
expect(isParanetOperator).to.be.true;
});

it('votersRegistrar can add voters, voters data can be returned and added voters are proposal voters', async function () {
Expand Down Expand Up @@ -357,7 +370,7 @@ describe('@v2 @unit ParanetNeuroIncentivesPool contract', function () {
const votersRegistrar = accounts[0];
const tx = await IncentivesPool.connect(votersRegistrar).initiateNeuroEmissionMultiplierUpdate(newMultiplier);
const receipt = await tx.wait();
const event = receipt.events?.find((e: any) => e.event === 'NeuroEmissionMultiplierUpdateInitiated');
const event = receipt.events?.find((e: Event) => e.event === 'NeuroEmissionMultiplierUpdateInitiated');
const emittedTimestamp = event?.args?.timestamp;

// jump 7 days in time
Expand Down

0 comments on commit 6dc9a45

Please sign in to comment.