Skip to content

Commit

Permalink
add another todo
Browse files Browse the repository at this point in the history
  • Loading branch information
NotJeremyLiu committed Apr 24, 2023
1 parent 744d22e commit 49c7eaf
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions x/protorev/keeper/developer_fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,6 @@ func (k Keeper) SendDeveloperFeesToDeveloperAccount(ctx sdk.Context) error {
return nil
}

// Deprecated: Can be removed in v16
// UpdateDeveloperFees updates the fees that developers can withdraw from the module account
func (k Keeper) UpdateDeveloperFees(ctx sdk.Context, denom string, profit sdk.Int) error {
daysSinceGenesis, err := k.GetDaysSinceModuleGenesis(ctx)
if err != nil {
return err
}

// Calculate the developer fee
if daysSinceGenesis < types.Phase1Length {
profit = profit.MulRaw(types.ProfitSplitPhase1).QuoRaw(100)
} else if daysSinceGenesis < types.Phase2Length {
profit = profit.MulRaw(types.ProfitSplitPhase2).QuoRaw(100)
} else {
profit = profit.MulRaw(types.ProfitSplitPhase3).QuoRaw(100)
}

// Get the developer fees for the denom, if not there then set it to 0 and initialize it
currentDeveloperFee, err := k.GetDeveloperFees(ctx, denom)
if err != nil {
currentDeveloperFee = sdk.NewCoin(denom, sdk.ZeroInt())
}
currentDeveloperFee.Amount = currentDeveloperFee.Amount.Add(profit)

// Set the developer fees for the denom
if err = k.SetDeveloperFees(ctx, currentDeveloperFee); err != nil {
return err
}

return nil
}

// SendDeveloperFee sends the developer fee from the module account to the developer account
func (k Keeper) SendDeveloperFee(ctx sdk.Context, arbProfit sdk.Coin) error {
// Developer account must be set in order to be able to withdraw developer fees
Expand Down

0 comments on commit 49c7eaf

Please sign in to comment.