Skip to content

Commit

Permalink
Apply SafeERC20's forceApprove() for Reward Token Allowance to Royalt…
Browse files Browse the repository at this point in the history
…yModule (#339)
  • Loading branch information
kingster-will authored Dec 10, 2024
1 parent 0580c31 commit 5d709c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/modules/grouping/EvenSplitGroupPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ contract EvenSplitGroupPool is IGroupRewardPool, ProtocolPausableUpgradeable, UU
uint256 rewardsPerIp = _getRewardPerIp(groupId, token);
uint256 totalRewards = rewardsPerIp * ipIds.length;
if (totalRewards == 0) return rewards;
IERC20(token).approve(address(ROYALTY_MODULE), totalRewards);
IERC20(token).forceApprove(address(ROYALTY_MODULE), totalRewards);
for (uint256 i = 0; i < ipIds.length; i++) {
if (!_isIpAdded(groupId, ipIds[i])) continue;
// calculate pending reward for each IP
Expand Down

0 comments on commit 5d709c6

Please sign in to comment.