Skip to content

Commit

Permalink
fix: contract deployed by account 0
Browse files Browse the repository at this point in the history
  • Loading branch information
0xApotheosis committed Sep 16, 2024
1 parent ffc1687 commit 682b101
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const config: HardhatUserConfig = {
networks: {
localhost: {
url: 'http://127.0.0.1:8545',
// Account 0 of the default Hardhat node, funded with ETH so we can test deployment locally
accounts: ['0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'],
},
// Mainnet configuration (only used if INFURA_API_KEY and PRIVATE_KEY are set)
// Let's us still test locally without setting up mainnet
Expand Down
10 changes: 6 additions & 4 deletions ignition/modules/StakingRewards.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { buildModule } from '@nomicfoundation/hardhat-ignition/modules';

const OWNER = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'; // FIXME: this is a dummy Hardhat address
const REWARDS_DISTRIBUTION = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8'; // FIXME: this is a dummy Hardhat address
const REWARDS_DISTRIBUTION = '0x5337027a4873210E1A4a0F2558F05C9792E2C9E6'; // 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

const StakingRewardsModule = buildModule('StakingRewardsModule', (m) => {
const owner = m.getParameter('owner', OWNER);
const owner = m.getAccount(0);
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]);
const stakingRewards = m.contract('StakingRewards', [owner, rewardsDistribution, rewardsToken, stakingToken], {
from: owner,
});

m.call(stakingRewards, 'setRewardsDuration', [rewardsDuration]);

Expand Down

0 comments on commit 682b101

Please sign in to comment.