Skip to content

Commit

Permalink
updated contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
gab0071 committed Aug 22, 2024
1 parent ae0718b commit 5ef971e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/Main.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contract Main is Ownable {
/////////////////////////////////////////////////////////////////////////////////////////////////////////*/
StakingToken public immutable i_stakingToken;
RewardToken public immutable i_rewardToken;
address[] private stakers;
address[] public stakers;

struct StakeInfo {
uint256 StakedBalance;
Expand Down Expand Up @@ -117,12 +117,4 @@ contract Main is Ownable {
}
}
}

/*/////////////////////////////////////////////////////////////////////////////////////////////////////////
Getter Functions
/////////////////////////////////////////////////////////////////////////////////////////////////////////*/
function getStakerAt(uint256 index) public view returns (address) {
require(index < stakers.length, "Index out of bounds");
return stakers[index];
}
}
2 changes: 1 addition & 1 deletion test/MainTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contract MainTest is Test {
assertEq(stakingTokenBalanceOfMainContractNew, newStakedBalance);

// verify that user2 was succefully added into the stakers array
address staker = mainContract.getStakerAt(1);
address staker = mainContract.stakers(1);
assertEq(staker, user2, "Staker number 2 was not added to the array.");


Expand Down

0 comments on commit 5ef971e

Please sign in to comment.