Skip to content

Commit

Permalink
Merge pull request #28 from soramitsu/feature/add_extra_details_to_pe…
Browse files Browse the repository at this point in the history
…nalty_pool_claim
  • Loading branch information
ayodeko authored May 29, 2024
2 parents 3631a24 + c033fcf commit 9dee7bc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions contracts/interfaces/IPenaltyFeePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface IPenaltyFeePoolStorage {
* @dev rewardDebt Used to calculate rewards efficiently
* @dev pending The amount of rewards pending for the user
*/
struct UserInfo {
struct UserInfo {
uint256 amount;
uint256 claimed;
uint256 rewardDebt;
Expand Down Expand Up @@ -48,7 +48,7 @@ interface IPenaltyFeePoolStorage {
uint256 accRewardPerShare;
address adminWallet;
}

/**
* ERROR MESSAGES
*/
Expand All @@ -64,11 +64,26 @@ interface IPenaltyFeePoolStorage {
/**
* EVENTS
*/

/**
* @notice Event to notify when an admin claims accumulated fees
* @dev Emitted in 'claim' function
* @param amount The amount of fees claimed
*/
event FeeClaim(uint256 amount);

/**
* @notice Event to notify when a user claims rewards in penalty pool
* @dev Emitted in 'claim' function
* @param user The address of the user who claims rewards
* @param amount The amount of rewards claimed
* @param amount The amount of rewards claimed
* @param amount The amount of rewards claimed
*/
event PenaltyClaim(
address indexed user,
uint256 amount,
uint256 penalityAmount,
uint256 totalPenalties
);
}
2 changes: 1 addition & 1 deletion contracts/pools/ERC20PenaltyFeePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ contract ERC20PenaltyFeePool is ReentrancyGuard, Ownable, IPoolERC20, IPenaltyFe
pool.totalClaimed += pending;
pool.totalPenalties += penalityAmount;
IERC20(pool.rewardToken).safeTransfer(msg.sender, pending);
emit Claim(msg.sender, pending);
emit PenaltyClaim(msg.sender, pending, penalityAmount, pool.totalPenalties);
} else {
revert NothingToClaim();
}
Expand Down

0 comments on commit 9dee7bc

Please sign in to comment.