Skip to content

Commit 45adce1

Browse files
committed
fix: I4: Typos and missing documentation
1 parent 7041ae7 commit 45adce1

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

src/contracts/tokens/RewardDistributor.sol

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {IRewardDistributor} from '@interfaces/tokens/IRewardDistributor.sol';
1111
import {Authorizable} from '@contracts/utils/Authorizable.sol';
1212
import {Modifiable} from '@contracts/utils/Modifiable.sol';
1313

14+
import {Assertions} from '@libraries/Assertions.sol';
1415
import {Encoding} from '@libraries/Encoding.sol';
1516
/**
1617
* @title RewardDistributor
@@ -20,7 +21,7 @@ import {Encoding} from '@libraries/Encoding.sol';
2021
contract RewardDistributor is Authorizable, Modifiable, Pausable, IRewardDistributor {
2122
using Encoding for bytes;
2223
using SafeERC20 for IERC20;
23-
24+
using Assertions for uint256;
2425
// --- Data ---
2526

2627
/// @inheritdoc IRewardDistributor
@@ -101,7 +102,7 @@ contract RewardDistributor is Authorizable, Modifiable, Pausable, IRewardDistrib
101102
}
102103

103104
/// @inheritdoc IRewardDistributor
104-
function emergencyWidthdraw(address _rescueReceiver, address _token, uint256 _wad) external isAuthorized {
105+
function emergencyWithdraw(address _rescueReceiver, address _token, uint256 _wad) external isAuthorized {
105106
if (_token == address(0)) {
106107
revert RewardDistributor_InvalidTokenAddress();
107108
}
@@ -137,4 +138,9 @@ contract RewardDistributor is Authorizable, Modifiable, Pausable, IRewardDistrib
137138
else if (_param == 'rootSetter') rootSetter = _address;
138139
else revert UnrecognizedParam();
139140
}
141+
142+
/// @inheritdoc Modifiable
143+
function _validateParameters() internal view override {
144+
epochDuration.assertGt(0);
145+
}
140146
}

src/contracts/tokens/StakingManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ contract StakingManager is Authorizable, Modifiable, IStakingManager {
9898
/**
9999
* @param _protocolToken Address of the ProtocolToken contract
100100
* @param _stakingToken Address of the StakingToken contract
101-
* @param _cooldownPeriod Address of the StakingToken contract
101+
* @param _cooldownPeriod Amount of time before a user can withdraw their staked tokens
102102
*/
103103
constructor(
104104
address _protocolToken,

src/interfaces/tokens/IRewardDistributor.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,5 @@ interface IRewardDistributor is IAuthorizable, IModifiable {
147147
* @param _token Address of the token
148148
* @param _wad Amount of reward tokens to withdraw
149149
*/
150-
function emergencyWidthdraw(address _rescueReceiver, address _token, uint256 _wad) external;
150+
function emergencyWithdraw(address _rescueReceiver, address _token, uint256 _wad) external;
151151
}

src/interfaces/tokens/IStakingManager.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ interface IStakingManager is IAuthorizable, IModifiable {
180180
}
181181

182182
struct StakingManagerParams {
183+
// Amount of time before a user can withdraw their staked tokens
183184
uint256 cooldownPeriod;
184185
}
185186

test/unit/RewardDistributor.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,31 +261,31 @@ contract Unit_RewardDistributor_EmergencyWithdrawal is Base {
261261
vm.expectEmit(true, true, true, true);
262262
emit RewardDistributorEmergencyWithdrawal(rescueReceiver, address(mockRewardToken), RESCUE_AMOUNT);
263263
vm.prank(authorizedAccount);
264-
rewardDistributor.emergencyWidthdraw(rescueReceiver, address(mockRewardToken), RESCUE_AMOUNT);
264+
rewardDistributor.emergencyWithdraw(rescueReceiver, address(mockRewardToken), RESCUE_AMOUNT);
265265
}
266266

267267
function test_Revert_EmergencyWithdrawal_NotAuthorized() public {
268268
address rescueReceiver = makeAddr('rescueReceiver');
269269

270270
vm.prank(user);
271271
vm.expectRevert(IAuthorizable.Unauthorized.selector);
272-
rewardDistributor.emergencyWidthdraw(rescueReceiver, address(mockRewardToken), RESCUE_AMOUNT);
272+
rewardDistributor.emergencyWithdraw(rescueReceiver, address(mockRewardToken), RESCUE_AMOUNT);
273273
}
274274

275275
function test_Revert_EmergencyWithdrawal_InvalidTokenAddress() public {
276276
address rescueReceiver = makeAddr('rescueReceiver');
277277

278278
vm.prank(authorizedAccount);
279279
vm.expectRevert(IRewardDistributor.RewardDistributor_InvalidTokenAddress.selector);
280-
rewardDistributor.emergencyWidthdraw(rescueReceiver, address(0), RESCUE_AMOUNT);
280+
rewardDistributor.emergencyWithdraw(rescueReceiver, address(0), RESCUE_AMOUNT);
281281
}
282282

283283
function test_Revert_EmergencyWithdrawal_InvalidAmount() public {
284284
address rescueReceiver = makeAddr('rescueReceiver');
285285

286286
vm.prank(authorizedAccount);
287287
vm.expectRevert(IRewardDistributor.RewardDistributor_InvalidAmount.selector);
288-
rewardDistributor.emergencyWidthdraw(rescueReceiver, address(mockRewardToken), 0);
288+
rewardDistributor.emergencyWithdraw(rescueReceiver, address(mockRewardToken), 0);
289289
}
290290
}
291291

0 commit comments

Comments
 (0)