Skip to content

Commit

Permalink
natspec for initializer and addRewardToken
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit committed Jun 12, 2024
1 parent 68d7e84 commit 20078c6
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Staking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ contract Staking is Ownable2StepUpgradeable {
/// --------------------------------------------------------
/// --------------------------------------------------------

/// @notice Initialize the bridge
/// @notice Initialize the contract
/// @param newOwner The owner of the contract, i.e. the DAO contract address
/// @param stakingToken The address of the staking token, i.e. SHU
/// @param _rewardsDistributor The address of the rewards distributor
/// contract
/// @param _lockPeriod The lock period in seconds
/// @param _minStake The minimum stake amount
function initialize(
address newOwner,
address stakingToken,
Expand All @@ -92,19 +98,22 @@ contract Staking is Ownable2StepUpgradeable {
uint256 _minStake
) public initializer {
transferOwnership(newOwner);

shu = IERC20(stakingToken);
rewardsDistributor = IRewardsDistributor(_rewardsDistributor);
lockPeriod = _lockPeriod;
minStake = _minStake;
}

function addRewardToken(IERC20 _rewardToken) external {
/// @notice Add a reward token
/// @dev Only the rewards distributor can add reward tokens
/// @param rewardToken The address of the reward token
function addRewardToken(address rewardToken) external {
require(

Check warning on line 111 in src/Staking.sol

View workflow job for this annotation

GitHub Actions / lint

Error message for require is too long: 46 counted / 32 allowed
msg.sender == address(rewardsDistributor),
"Only rewards distributor can add reward tokens"
);
rewardTokenList.push(address(_rewardToken));

rewardTokenList.push(rewardToken);
}

// Locks SHU, update the user's shares (non-transferable)
Expand Down

0 comments on commit 20078c6

Please sign in to comment.