Skip to content

Commit

Permalink
Add commission to RewardsDistributer event (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
nz-neooo authored May 14, 2023
1 parent e060f5a commit 42eb897
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/RewardsDistributer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ contract RewardsDistributer is IRewardsDistributer, Initializable, OwnableUpgrad

/// @dev ### EVENTS
/// @notice Emitted when rewards are distributed for the earliest pending distributed Era.
event DistributeRewards(address indexed indexer, uint256 indexed eraIdx, uint256 rewards);
event DistributeRewards(address indexed indexer, uint256 indexed eraIdx, uint256 rewards, uint256 commission);
/// @notice Emitted when user claimed rewards.
event ClaimRewards(address indexed indexer, address indexed delegator, uint256 rewards);
/// @notice Emitted when the rewards change, such as when rewards coming from new agreement.
Expand Down Expand Up @@ -289,12 +289,12 @@ contract RewardsDistributer is IRewardsDistributer, Initializable, OwnableUpgrad
uint256 commission = MathUtil.mulDiv(commissionRate, rewardInfo.eraReward, PER_MILL);

info[indexer].accSQTPerStake += MathUtil.mulDiv(rewardInfo.eraReward - commission, PER_TRILL, totalStake);

// add commission to unbonding request
IERC20(settings.getSQToken()).safeTransfer(settings.getStaking(), commission);
IStaking(settings.getStaking()).unbondCommission(indexer, commission);

emit DistributeRewards(indexer, rewardInfo.lastClaimEra, rewardInfo.eraReward);
emit DistributeRewards(indexer, rewardInfo.lastClaimEra, rewardInfo.eraReward, commission);

IPermissionedExchange exchange = IPermissionedExchange(settings.getPermissionedExchange());
exchange.addQuota(settings.getSQToken(), indexer, commission);
Expand Down

0 comments on commit 42eb897

Please sign in to comment.