From 3b892e8153bd80a9b3ff693f41fcb52c2447d645 Mon Sep 17 00:00:00 2001 From: Apotheosis <97164662+0xApotheosis@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:19:03 +1000 Subject: [PATCH] chore: improve deployment notes. --- README.md | 12 ++++++++++++ ignition/modules/StakingRewards.ts | 2 +- test/StakingRewards.ts | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd892fe..05830f6 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,15 @@ Test: `npx hardhat test` ## Deploy with Ignition `npx hardhat ignition deploy ignition/modules/StakingRewards.ts` + +### Deployment notes + +The `rewardsDistribution` address has exclusive permissions to call the `notifyRewardAmount` function, which is used to add new rewards to the contract. + +The `owner` address has exclusive permissions to call: + +- The `recoverERC20` function, which is used to recover any ERC20 tokens that are accidentally sent to the contract (except the staking token). + +- The `setRewardsDuration` function, which is used to set the rewards duration. + +- The `owner` can nominate a new owner for the contract. diff --git a/ignition/modules/StakingRewards.ts b/ignition/modules/StakingRewards.ts index 8663ca3..d959737 100644 --- a/ignition/modules/StakingRewards.ts +++ b/ignition/modules/StakingRewards.ts @@ -2,7 +2,7 @@ import { buildModule } from '@nomicfoundation/hardhat-ignition/modules'; const OWNER = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'; const REWARDS_DISTRIBUTION = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8'; -const REWARDS_TOKEN = '0xc770eefad204b5180df6a14ee197d99d808ee52d'; +const REWARDS_TOKEN = '0xc770eefad204b5180df6a14ee197d99d808ee52d'; // FOX const STAKING_TOKEN = '0x470e8de2ebaef52014a47cb5e6af86884947f08c'; // ETH/FOX Pool const StakingRewardsModule = buildModule('StakingRewardsModule', (m) => { diff --git a/test/StakingRewards.ts b/test/StakingRewards.ts index 08cf8dc..066f5ce 100644 --- a/test/StakingRewards.ts +++ b/test/StakingRewards.ts @@ -25,7 +25,7 @@ describe('StakingRewards', function () { }); describe('Function permissions', () => { - it('only owner can call notifyRewardAmount', async () => { + it('only rewardsDistribution can call notifyRewardAmount', async () => { const { rewardsDistribution, stakingRewards, rewardsToken, stakingAccount2 } = await loadFixture(deployStakingRewardsFixture); const rewardAmount = parseEther('1');