Skip to content

Commit

Permalink
Merge branch 'main' into estaking-imp
Browse files Browse the repository at this point in the history
  • Loading branch information
amityadav0 authored Dec 3, 2024
2 parents 06ce70d + 7b89d6a commit 3e01544
Show file tree
Hide file tree
Showing 23 changed files with 124 additions and 283 deletions.
16 changes: 8 additions & 8 deletions x/amm/keeper/keeper_join_pool_no_swap.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (k Keeper) JoinPoolNoSwap(
}
params := k.GetParams(ctx)
snapshot := k.GetAccountedPoolSnapshotOrSet(ctx, pool)
sharesOut, _, weightBalanceBonus, err := pool.JoinPool(ctx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokensIn, params)
tokensJoined, sharesOut, _, weightBalanceBonus, err := pool.JoinPool(ctx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokensIn, params)
if err != nil {
return nil, sdkmath.ZeroInt(), err
}
Expand All @@ -78,23 +78,23 @@ func (k Keeper) JoinPoolNoSwap(
shareOutAmount, sharesOut))
}

err = k.ApplyJoinPoolStateChange(ctx, pool, sender, sharesOut, tokensIn, weightBalanceBonus)
err = k.ApplyJoinPoolStateChange(ctx, pool, sender, sharesOut, tokensJoined, weightBalanceBonus)
if err != nil {
return nil, sdkmath.Int{}, err
}
// Increase liquidity amount
err = k.RecordTotalLiquidityIncrease(ctx, tokensIn)
err = k.RecordTotalLiquidityIncrease(ctx, tokensJoined)
if err != nil {
return nil, sdkmath.Int{}, err
}

return tokensIn, sharesOut, err
return tokensJoined, sharesOut, err
}

params := k.GetParams(ctx)
// on oracle pool, full tokenInMaxs are used regardless shareOutAmount
snapshot := k.GetAccountedPoolSnapshotOrSet(ctx, pool)
sharesOut, _, weightBalanceBonus, err := pool.JoinPool(ctx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokenInMaxs, params)
tokensJoined, sharesOut, _, weightBalanceBonus, err := pool.JoinPool(ctx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokenInMaxs, params)
if err != nil {
return nil, sdkmath.ZeroInt(), err
}
Expand All @@ -105,16 +105,16 @@ func (k Keeper) JoinPoolNoSwap(
shareOutAmount, sharesOut))
}

err = k.ApplyJoinPoolStateChange(ctx, pool, sender, sharesOut, tokenInMaxs, weightBalanceBonus)
err = k.ApplyJoinPoolStateChange(ctx, pool, sender, sharesOut, tokensJoined, weightBalanceBonus)
if err != nil {
return nil, sdkmath.Int{}, err
}

// Increase liquidity amount
err = k.RecordTotalLiquidityIncrease(ctx, tokenInMaxs)
err = k.RecordTotalLiquidityIncrease(ctx, tokensJoined)
if err != nil {
return nil, sdkmath.Int{}, err
}

return tokenInMaxs, sharesOut, err
return tokensJoined, sharesOut, err
}
28 changes: 28 additions & 0 deletions x/amm/keeper/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,31 @@ func (k Keeper) RemoveFromPoolBalance(ctx sdk.Context, pool *types.Pool, removeS
k.SetPool(ctx, *pool)
return k.RecordTotalLiquidityDecrease(ctx, coins)
}

// For migration only, fixes for amm mismatch has been added, to verify if the fix is working we
// will match the balances and do operations after
func (k Keeper) MatchAmmBalances(ctx sdk.Context) error {
// Match pool balances and assets structure balances
pools := k.GetAllPool(ctx)
for _, pool := range pools {
if !pool.PoolParams.UseOracle {
balances := k.bankKeeper.GetAllBalances(ctx, sdk.MustAccAddressFromBech32(pool.GetAddress()))
for _, asset := range pool.PoolAssets {
for _, balance := range balances {
if asset.Token.Denom == balance.Denom {
if asset.Token.Amount.GT(balance.Amount) {
k.bankKeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(asset.Token.Denom, asset.Token.Amount.Sub(balance.Amount))))
k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.MustAccAddressFromBech32(pool.GetAddress()), sdk.NewCoins(sdk.NewCoin(asset.Token.Denom, asset.Token.Amount.Sub(balance.Amount))))
}

if asset.Token.Amount.LT(balance.Amount) {
k.bankKeeper.SendCoinsFromAccountToModule(ctx, sdk.MustAccAddressFromBech32(pool.GetAddress()), types.ModuleName, sdk.NewCoins(sdk.NewCoin(asset.Token.Denom, balance.Amount.Sub(asset.Token.Amount))))
k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(asset.Token.Denom, balance.Amount.Sub(asset.Token.Amount))))
}
}
}
}
}
}
return nil
}
8 changes: 4 additions & 4 deletions x/amm/keeper/query_join_pool_estimation.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ func (k Keeper) JoinPoolEst(
params := k.GetParams(ctx)
snapshot := k.GetAccountedPoolSnapshotOrSet(ctx, pool)
cacheCtx, _ := ctx.CacheContext()
sharesOut, slippage, weightBalanceBonus, err = pool.JoinPool(cacheCtx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokensIn, params)
tokensJoined, sharesOut, slippage, weightBalanceBonus, err := pool.JoinPool(cacheCtx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokensIn, params)
if err != nil {
return nil, math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), err
}

return tokensIn, sharesOut, slippage, weightBalanceBonus, err
return tokensJoined, sharesOut, slippage, weightBalanceBonus, err
}

params := k.GetParams(ctx)
// on oracle pool, full tokenInMaxs are used regardless shareOutAmount
snapshot := k.GetAccountedPoolSnapshotOrSet(ctx, pool)
cacheCtx, _ := ctx.CacheContext()
sharesOut, slippage, weightBalanceBonus, err = pool.JoinPool(cacheCtx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokenInMaxs, params)
tokensJoined, sharesOut, slippage, weightBalanceBonus, err := pool.JoinPool(cacheCtx, &snapshot, k.oracleKeeper, k.accountedPoolKeeper, tokenInMaxs, params)
if err != nil {
return nil, math.ZeroInt(), math.LegacyZeroDec(), math.LegacyZeroDec(), err
}

return tokenInMaxs, sharesOut, slippage, weightBalanceBonus, err
return tokensJoined, sharesOut, slippage, weightBalanceBonus, err
}
3 changes: 2 additions & 1 deletion x/amm/keeper/query_join_pool_estimation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestJoinPoolEstimation(t *testing.T) {
AmountsIn: sdk.NewCoins(sdk.NewInt64Coin("denom1", 100), sdk.NewInt64Coin("denom2", 200)),
})
require.NoError(t, err)
require.Equal(t, sdk.Coins(resp.AmountsIn).String(), "100denom1,200denom2")
// Pool ratio is 1:1, so join pool will accept only 100denom1,100denom2
require.Equal(t, sdk.Coins(resp.AmountsIn).String(), "100denom1,100denom2")
require.Equal(t, resp.ShareAmountOut.String(), "100000000000000000amm/pool/1")
}
9 changes: 9 additions & 0 deletions x/amm/migrations/v9_migration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package migrations

import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

func (m Migrator) V9Migration(ctx sdk.Context) error {
return m.keeper.MatchAmmBalances(ctx)
}
8 changes: 2 additions & 6 deletions x/amm/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
m := migrations.NewMigrator(am.keeper)
err := cfg.RegisterMigration(types.ModuleName, 6, m.V7Migration)
if err != nil {
panic(err)
}
err = cfg.RegisterMigration(types.ModuleName, 7, m.V8Migration)
err := cfg.RegisterMigration(types.ModuleName, 8, m.V9Migration)
if err != nil {
panic(err)
}
Expand All @@ -163,7 +159,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
}

// ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1
func (AppModule) ConsensusVersion() uint64 { return 8 }
func (AppModule) ConsensusVersion() uint64 { return 9 }

// BeginBlock contains the logic that is automatically triggered at the beginning of each block
func (am AppModule) BeginBlock(_ context.Context) error {
Expand Down
5 changes: 3 additions & 2 deletions x/amm/types/calc_out_amt_given_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ func (p Pool) CalcOutAmtGivenIn(
if err != nil {
return sdk.Coin{}, sdkmath.LegacyZeroDec(), err
}

if tokenAmountOut.IsZero() {
return sdk.Coin{}, sdkmath.LegacyZeroDec(), ErrAmountTooLow
return sdk.Coin{}, sdkmath.LegacyZeroDec(), ErrTokenOutAmountZero
}

rate, err := p.GetTokenARate(ctx, oracle, snapshot, tokenIn.Denom, tokenOutDenom, accountedPool)
Expand All @@ -87,7 +88,7 @@ func (p Pool) CalcOutAmtGivenIn(
// We ignore the decimal component, as we round down the token amount out.
tokenAmountOutInt := tokenAmountOut.TruncateInt()
if !tokenAmountOutInt.IsPositive() {
return sdk.Coin{}, sdkmath.LegacyZeroDec(), errorsmod.Wrapf(ErrInvalidMathApprox, "token amount must be positive")
return sdk.Coin{}, sdkmath.LegacyZeroDec(), ErrTokenOutAmountZero
}

return sdk.NewCoin(tokenOutDenom, tokenAmountOutInt), slippage, nil
Expand Down
5 changes: 4 additions & 1 deletion x/amm/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package types
// DONTCOVER

import (
"cosmossdk.io/errors"
"fmt"

"cosmossdk.io/errors"
)

// x/amm module sentinel errors
Expand Down Expand Up @@ -36,6 +37,8 @@ var (
ErrInvalidShareAmountOut = errors.Register(ModuleName, 112, "invalid share amount out")
ErrPoolAssetsMustBeTwo = errors.Register(ModuleName, 113, "pool assets must be exactly two")
ErrOnlyBaseAssetsPoolAllowed = errors.Register(ModuleName, 114, "Only base assets paired pool allowed")

ErrTokenOutAmountZero = errors.Register(ModuleName, 115, "token out amount is zero")
)

const (
Expand Down
28 changes: 14 additions & 14 deletions x/amm/types/pool_join_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,20 @@ func (p *Pool) JoinPool(
oracleKeeper OracleKeeper,
accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins,
params Params,
) (numShares sdkmath.Int, slippage sdkmath.LegacyDec, weightBalanceBonus sdkmath.LegacyDec, err error) {
) (tokensJoined sdk.Coins, numShares sdkmath.Int, slippage sdkmath.LegacyDec, weightBalanceBonus sdkmath.LegacyDec, err error) {
// if it's not single sided liquidity, add at pool ratio
if len(tokensIn) != 1 {
numShares, tokensJoined, err := p.CalcJoinPoolNoSwapShares(tokensIn)
if err != nil {
return sdkmath.Int{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
return sdk.NewCoins(), sdkmath.Int{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
}

// update pool with the calculated share and liquidity needed to join pool
err = p.IncreaseLiquidity(numShares, tokensJoined)
if err != nil {
return sdkmath.Int{}, sdkmath.LegacyDec{}, sdkmath.LegacyDec{}, err
return sdk.NewCoins(), sdkmath.Int{}, sdkmath.LegacyDec{}, sdkmath.LegacyDec{}, err
}
return numShares, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), nil
return tokensJoined, numShares, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), nil
}

if !p.PoolParams.UseOracle {
Expand All @@ -152,37 +152,37 @@ func (p *Pool) JoinPool(

numShares, tokensJoined, err := p.CalcSingleAssetJoinPoolShares(tokensIn)
if err != nil {
return sdkmath.Int{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
return sdk.NewCoins(), sdkmath.Int{}, sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
}

// update pool with the calculated share and liquidity needed to join pool
err = p.IncreaseLiquidity(numShares, tokensJoined)
if err != nil {
return sdkmath.Int{}, sdkmath.LegacyDec{}, sdkmath.LegacyDec{}, err
return sdk.NewCoins(), sdkmath.Int{}, sdkmath.LegacyDec{}, sdkmath.LegacyDec{}, err
}
return numShares, totalSlippage, sdkmath.LegacyZeroDec(), nil
return tokensJoined, numShares, totalSlippage, sdkmath.LegacyZeroDec(), nil
}

joinValueWithoutSlippage, err := p.CalcJoinValueWithoutSlippage(ctx, oracleKeeper, accountedPoolKeeper, tokensIn)
if err != nil {
return sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
}

accountedAssets := p.GetAccountedBalance(ctx, accountedPoolKeeper, p.PoolAssets)
initialWeightDistance := p.WeightDistanceFromTarget(ctx, oracleKeeper, accountedAssets)
tvl, err := p.TVL(ctx, oracleKeeper, accountedPoolKeeper)
if err != nil {
return sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
}

// Ensure tvl is not zero to avoid division by zero
if tvl.IsZero() {
return sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), ErrAmountTooLow
return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), ErrAmountTooLow
}

newAssetPools, err := p.NewPoolAssetsAfterSwap(ctx, tokensIn, sdk.Coins{}, accountedAssets)
newAssetPools, err := p.NewPoolAssetsAfterSwap(ctx, tokensIn, sdk.NewCoins(), accountedAssets)
if err != nil {
return sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
}
weightDistance := p.WeightDistanceFromTarget(ctx, oracleKeeper, newAssetPools)
distanceDiff := weightDistance.Sub(initialWeightDistance)
Expand Down Expand Up @@ -216,9 +216,9 @@ func (p *Pool) JoinPool(
numShares = numSharesDec.RoundInt()
err = p.IncreaseLiquidity(numShares, tokensIn)
if err != nil {
return sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
return sdk.NewCoins(), sdkmath.ZeroInt(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), err
}

// No slippage in oracle pool due to 1 hr lock
return numShares, sdkmath.LegacyZeroDec(), weightBalanceBonus, nil
return tokensIn, numShares, sdkmath.LegacyZeroDec(), weightBalanceBonus, nil
}
2 changes: 1 addition & 1 deletion x/amm/types/swap_out_amt_given_in_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func (suite *TestSuite) TestSwapOutAmtGivenIn() {
tokenOut, _, _, weightBonus, err := pool.SwapOutAmtGivenIn(suite.ctx, suite.app.OracleKeeper, &pool, sdk.Coins{tc.tokenIn}, tc.outTokenDenom, tc.swapFee, suite.app.AccountedPoolKeeper, sdkmath.LegacyOneDec(), params)
if tc.expErr {
suite.Require().Error(err)
suite.Require().EqualError(err, "amount too low")
suite.Require().EqualError(err, "token out amount is zero")
} else {
suite.Require().NoError(err)
suite.Require().Equal(tokenOut.String(), tc.expTokenOut.String())
Expand Down
File renamed without changes.
46 changes: 37 additions & 9 deletions x/masterchef/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error {

// Move gas fees collected to dex revenue wallet
// Convert it into USDC
func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, address sdk.AccAddress) sdk.Coins {
func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, address sdk.AccAddress) (sdk.Coins, error) {
// fetch and clear the collected fees for distribution, since this is
// called in BeginBlock, collected fees will be from the previous block
// (and distributed to the previous proposer)
Expand All @@ -326,6 +326,9 @@ func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, addre
// Find a pool that can convert tokenIn to usdc
pool, found := k.amm.GetBestPoolWithDenoms(ctx, []string{tokenIn.Denom, baseCurrency}, false)
if !found {
// If there is a denom for which pool doesn't exist, log it, otherwise
// if pool exist, throw error later
ctx.Logger().Info("Pool not found for denom: " + tokenIn.Denom)
continue
}

Expand All @@ -334,7 +337,19 @@ func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, addre
snapshot := k.amm.GetAccountedPoolSnapshotOrSet(ctx, pool)
tokenOutCoin, _, _, _, err := k.amm.SwapOutAmtGivenIn(ctx, pool.PoolId, k.oracleKeeper, &snapshot, sdk.Coins{tokenIn}, baseCurrency, math.LegacyZeroDec(), math.LegacyOneDec())
if err != nil {
continue
// Continue as we can swap it when this amount is higher
if err == ammtypes.ErrTokenOutAmountZero {
ctx.Logger().Info("Token out amount is zero(skipping conversion) for denom: " + tokenIn.Denom)
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.TypeEvtSkipSwap,
sdk.NewAttribute("Token denom", tokenIn.Denom),
sdk.NewAttribute("Token amount", "0"),
),
})
continue
}
return sdk.Coins{}, err
}

tokenOutAmount := tokenOutCoin.Amount
Expand All @@ -344,12 +359,10 @@ func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, addre

// Settles balances between the tx sender and the pool to match the swap that was executed earlier.
// Also emits a swap event and updates related liquidity metrics.
cacheCtx, write := ctx.CacheContext()
_, err = k.amm.UpdatePoolForSwap(cacheCtx, pool, address, address, tokenIn, tokenOutCoin, math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec())
_, err = k.amm.UpdatePoolForSwap(ctx, pool, address, address, tokenIn, tokenOutCoin, math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec())
if err != nil {
continue
return sdk.Coins{}, err
}
write()

// Swapped USDC coin
swappedCoins := sdk.NewCoins(sdk.NewCoin(baseCurrency, tokenOutAmount))
Expand All @@ -358,14 +371,17 @@ func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, addre
totalSwappedCoins = totalSwappedCoins.Add(swappedCoins...)
}

return totalSwappedCoins
return totalSwappedCoins, nil
}

func (k Keeper) CollectGasFees(ctx sdk.Context, baseCurrency string) (sdk.DecCoins, error) {
params := k.GetParams(ctx)
feeCollector := k.authKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName)
// Calculate each portion of Gas fees collected - stakers, LPs
fees := k.ConvertGasFeesToUsdc(ctx, baseCurrency, feeCollector.GetAddress())
fees, err := k.ConvertGasFeesToUsdc(ctx, baseCurrency, feeCollector.GetAddress())
if err != nil {
return sdk.DecCoins{}, err
}
gasFeeCollectedDec := sdk.NewDecCoinsFromCoins(fees...)

gasFeesForLpsDec := gasFeeCollectedDec.MulDecTruncate(params.RewardPortionForLps)
Expand Down Expand Up @@ -408,7 +424,10 @@ func (k Keeper) CollectPerpRevenue(ctx sdk.Context, baseCurrency string) (sdk.De
fundAddr := k.perpetualKeeper.GetIncrementalBorrowInterestPaymentFundAddress(ctx)
params := k.GetParams(ctx)
// Transfer revenue to a single wallet of Perpetual revenue wallet.
fees := k.ConvertGasFeesToUsdc(ctx, baseCurrency, fundAddr)
fees, err := k.ConvertGasFeesToUsdc(ctx, baseCurrency, fundAddr)
if err != nil {
return sdk.DecCoins{}, err
}
// Calculate each portion of Gas fees collected - stakers, LPs
perpFeeCollectedDec := sdk.NewDecCoinsFromCoins(fees...)

Expand All @@ -420,6 +439,7 @@ func (k Keeper) CollectPerpRevenue(ctx sdk.Context, baseCurrency string) (sdk.De

lpsGasFeeCoins, _ := perpFeesForLpsDec.TruncateDecimal()
protocolGasFeeCoins, _ := perpFeesForProtocolDec.TruncateDecimal()
stakerCoins, _ := perpFeesForStakersDec.TruncateDecimal()

// Send coins from fund address to masterchef
if lpsGasFeeCoins.IsAllPositive() {
Expand All @@ -429,6 +449,14 @@ func (k Keeper) CollectPerpRevenue(ctx sdk.Context, baseCurrency string) (sdk.De
}
}

// Send coins to fee collector name
if perpFeesForStakersDec.IsAllPositive() {
err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, authtypes.FeeCollectorName, stakerCoins)
if err != nil {
return sdk.DecCoins{}, err
}
}

// Send coins to protocol revenue address
if protocolGasFeeCoins.IsAllPositive() {
protocolRevenueAddress, err := sdk.AccAddressFromBech32(params.ProtocolRevenueAddress)
Expand Down
Loading

0 comments on commit 3e01544

Please sign in to comment.