Skip to content

Commit

Permalink
Add usdc fee collection event in Masterchef ABCI (#1114)
Browse files Browse the repository at this point in the history
* add usdc fee collection event

* update attributes name

---------

Co-authored-by: Abhinav Kumar <[email protected]>
  • Loading branch information
99adarsh and avkr003 authored Jan 22, 2025
1 parent 77fb006 commit 8ef8bbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/masterchef/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,14 @@ func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, addre
// Sum total swapped
totalSwappedCoins = totalSwappedCoins.Add(swappedCoins...)
}
if !totalSwappedCoins.IsZero() {
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.TypeEvtUsdcFee,
sdk.NewAttribute("amount", totalSwappedCoins.String()),
),
})
}

return totalSwappedCoins, nil
}
Expand Down
1 change: 1 addition & 0 deletions x/masterchef/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const (
TypeEvtClaimRewards = "claim_rewards"
TypeEvtSetPoolMultiplier = "set_pool_multiplier"
TypeEvtSkipSwap = "skip_conversion_of_fee"
TypeEvtUsdcFee = "fee_collected_in_usdc"

AttributeRewardDenom = "reward_denom"
AttributeMinAmount = "min_amount"
Expand Down

0 comments on commit 8ef8bbb

Please sign in to comment.