Skip to content

Commit

Permalink
Update Claim Rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatmittal committed Nov 14, 2023
1 parent 3293323 commit 1a18a8e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions contracts/plugins/assets/curve/cvx/vendor/ConvexStakingWrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,15 @@ contract ConvexStakingWrapper is ERC20, ReentrancyGuard {
}

function claimRewards() external {
uint256 cvxOldBal = IERC20(cvx).balanceOf(msg.sender);
uint256 crvOldBal = IERC20(crv).balanceOf(msg.sender);
address _account = address(msg.sender);
if (rewardRedirect[_account] != address(0)) {
_checkpointAndClaim([_account, rewardRedirect[_account]]);
} else {
_checkpointAndClaim([_account, _account]);
}
emit RewardsClaimed(IERC20(cvx), IERC20(cvx).balanceOf(msg.sender) - cvxOldBal);
emit RewardsClaimed(IERC20(crv), IERC20(crv).balanceOf(msg.sender) - crvOldBal);
address _account = rewardRedirect[_account] == address(0)
? msg.sender
: rewardRedirect[_account];

uint256 cvxOldBal = IERC20(cvx).balanceOf(_account);
uint256 crvOldBal = IERC20(crv).balanceOf(_account);
_checkpointAndClaim([msg.sender, _account]);
emit RewardsClaimed(IERC20(cvx), IERC20(cvx).balanceOf(_account) - cvxOldBal);
emit RewardsClaimed(IERC20(crv), IERC20(crv).balanceOf(_account) - crvOldBal);
}

//set any claimed rewards to automatically go to a different address
Expand Down

0 comments on commit 1a18a8e

Please sign in to comment.