From 699931aab111a249ed27d62ad1dc07476821d9f5 Mon Sep 17 00:00:00 2001 From: Apotheosis <97164662+0xApotheosis@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:16:59 +1000 Subject: [PATCH] chore: deployment tweaks --- ignition/modules/StakingRewards.ts | 18 +++++++----------- test/Deployment.ts | 14 ++++++++++---- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ignition/modules/StakingRewards.ts b/ignition/modules/StakingRewards.ts index 6b5793a..d807da6 100644 --- a/ignition/modules/StakingRewards.ts +++ b/ignition/modules/StakingRewards.ts @@ -1,25 +1,21 @@ import { buildModule } from '@nomicfoundation/hardhat-ignition/modules'; -const REWARDS_DISTRIBUTION = '0x32DBc9Cf9E8FbCebE1e0a2ecF05Ed86Ca3096Cb6'; // FIXME: this is a dummy address - it needs to be set - -const REWARDS_TOKEN = '0xc770eefad204b5180df6a14ee197d99d808ee52d'; // FOX -const STAKING_TOKEN = '0x470e8de2ebaef52014a47cb5e6af86884947f08c'; // ETH/FOX Pool - -export const REWARDS_DURATION = 14n * 24n * 60n * 60n; // 14 days in seconds - FIXME: use the correct value +export const REWARDS_DISTRIBUTION = '0xEc84524385ffD1eA423Ec4682caa5AB56071FbC7'; +export const REWARDS_TOKEN = '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d'; // FOX +export const STAKING_TOKEN = '0x470e8de2eBaef52014A47Cb5E6aF86884947F08c'; // ETH/FOX Pool +export const OWNER = '0x90A48D5CF7343B08dA12E067680B4C6dbfE551Be'; // DAO multi-sig const StakingRewardsModule = buildModule('StakingRewardsModule', (m) => { - const owner = m.getAccount(0); + const deployer = m.getAccount(0); + const owner = m.getParameter('owner', OWNER); const rewardsDistribution = m.getParameter('rewardsDistribution', REWARDS_DISTRIBUTION); const rewardsToken = m.getParameter('rewardsToken', REWARDS_TOKEN); const stakingToken = m.getParameter('stakingToken', STAKING_TOKEN); - const rewardsDuration = m.getParameter('newRewardsDuration', REWARDS_DURATION); const stakingRewards = m.contract('StakingRewards', [owner, rewardsDistribution, rewardsToken, stakingToken], { - from: owner, + from: deployer, }); - m.call(stakingRewards, 'setRewardsDuration', [rewardsDuration]); - return { stakingRewards }; }); diff --git a/test/Deployment.ts b/test/Deployment.ts index 58c1640..c16f59b 100644 --- a/test/Deployment.ts +++ b/test/Deployment.ts @@ -1,11 +1,17 @@ -import StakingRewardsModule, { REWARDS_DURATION } from '../ignition/modules/StakingRewards'; +import StakingRewardsModule, { OWNER, REWARDS_DISTRIBUTION, REWARDS_TOKEN, STAKING_TOKEN } from '../ignition/modules/StakingRewards'; import hre from 'hardhat'; import { expect } from 'chai'; describe('Deployment', function () { - it('Should set the rewards duration', async function () { + it('Should deploy with constructor params', async function () { const { stakingRewards } = await hre.ignition.deploy(StakingRewardsModule); - const rewardsDuration: bigint = await stakingRewards.read.rewardsDuration(); - expect(rewardsDuration).to.equal(REWARDS_DURATION); + const owner = await stakingRewards.read.owner(); + const rewardsDistribution = await stakingRewards.read.rewardsDistribution(); + const rewardsToken = await stakingRewards.read.rewardsToken(); + const stakingToken = await stakingRewards.read.stakingToken(); + expect(owner).to.equal(OWNER); + expect(rewardsDistribution).to.equal(REWARDS_DISTRIBUTION); + expect(rewardsToken).to.equal(REWARDS_TOKEN); + expect(stakingToken).to.equal(STAKING_TOKEN); }); });