From 5ef971e9d9f2a9eb0ac9a91d9e867f0afa13b75d Mon Sep 17 00:00:00 2001 From: gab0071 Date: Thu, 22 Aug 2024 14:47:42 -0500 Subject: [PATCH] updated contracts --- src/Main.sol | 10 +--------- test/MainTest.t.sol | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Main.sol b/src/Main.sol index 7bdabe8..9e04f48 100644 --- a/src/Main.sol +++ b/src/Main.sol @@ -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; @@ -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]; - } } diff --git a/test/MainTest.t.sol b/test/MainTest.t.sol index 0c75925..bad662d 100644 --- a/test/MainTest.t.sol +++ b/test/MainTest.t.sol @@ -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.");