Skip to content

Commit

Permalink
Claim rewards during requestWithdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
dulguun-staderlabs committed Dec 9, 2023
1 parent 450a8e6 commit c6bfcc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions contracts/SDIncentiveController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ contract SDIncentiveController is ISDIncentiveController, AccessControlUpgradeab
updateReward(account);

uint256 reward = rewards[account];
if (reward == 0) {
revert NoRewardsToClaim();
}
rewards[account] = 0;
IERC20(staderConfig.getStaderToken()).transfer(account, reward);
if (reward > 0) IERC20(staderConfig.getStaderToken()).transfer(account, reward);

emit RewardClaimed(account, reward);
}
Expand Down
1 change: 1 addition & 0 deletions contracts/SDUtilityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ contract SDUtilityPool is ISDUtilityPool, AccessControlUpgradeable, PausableUpgr
if (requestIdsByDelegatorAddress[msg.sender].length + 1 > maxNonRedeemedDelegatorRequestCount) {
revert MaxLimitOnWithdrawRequestCountReached();
}
ISDIncentiveController(staderConfig.getSDIncentiveController()).claim(msg.sender);
sdRequestedForWithdraw += _sdAmountToWithdraw;
delegatorWithdrawRequests[nextRequestId] = DelegatorWithdrawInfo(
msg.sender,
Expand Down

0 comments on commit c6bfcc8

Please sign in to comment.