Skip to content

Commit 9dee7bc

Browse files
authored
Merge pull request #28 from soramitsu/feature/add_extra_details_to_penalty_pool_claim
2 parents 3631a24 + c033fcf commit 9dee7bc

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

contracts/interfaces/IPenaltyFeePool.sol

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface IPenaltyFeePoolStorage {
1313
* @dev rewardDebt Used to calculate rewards efficiently
1414
* @dev pending The amount of rewards pending for the user
1515
*/
16-
struct UserInfo {
16+
struct UserInfo {
1717
uint256 amount;
1818
uint256 claimed;
1919
uint256 rewardDebt;
@@ -48,7 +48,7 @@ interface IPenaltyFeePoolStorage {
4848
uint256 accRewardPerShare;
4949
address adminWallet;
5050
}
51-
51+
5252
/**
5353
* ERROR MESSAGES
5454
*/
@@ -64,11 +64,26 @@ interface IPenaltyFeePoolStorage {
6464
/**
6565
* EVENTS
6666
*/
67-
67+
6868
/**
6969
* @notice Event to notify when an admin claims accumulated fees
7070
* @dev Emitted in 'claim' function
7171
* @param amount The amount of fees claimed
7272
*/
7373
event FeeClaim(uint256 amount);
74+
75+
/**
76+
* @notice Event to notify when a user claims rewards in penalty pool
77+
* @dev Emitted in 'claim' function
78+
* @param user The address of the user who claims rewards
79+
* @param amount The amount of rewards claimed
80+
* @param amount The amount of rewards claimed
81+
* @param amount The amount of rewards claimed
82+
*/
83+
event PenaltyClaim(
84+
address indexed user,
85+
uint256 amount,
86+
uint256 penalityAmount,
87+
uint256 totalPenalties
88+
);
7489
}

contracts/pools/ERC20PenaltyFeePool.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ contract ERC20PenaltyFeePool is ReentrancyGuard, Ownable, IPoolERC20, IPenaltyFe
145145
pool.totalClaimed += pending;
146146
pool.totalPenalties += penalityAmount;
147147
IERC20(pool.rewardToken).safeTransfer(msg.sender, pending);
148-
emit Claim(msg.sender, pending);
148+
emit PenaltyClaim(msg.sender, pending, penalityAmount, pool.totalPenalties);
149149
} else {
150150
revert NothingToClaim();
151151
}

0 commit comments

Comments
 (0)