ante

package
v30.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateFeeSharePool

func CalculateFeeSharePool(fees sdk.Coins, govPercent sdkmath.LegacyDec) sdk.Coins

CalculateFeeSharePool computes the total developer pool per denom: RoundInt(govPercent * feeAmount). The pool is computed ONCE for the whole tx — never per recipient — so the aggregate paid out can never exceed govPercent of the fee. tested in ante_test.go

func SplitFeeSharePool

func SplitFeeSharePool(pool sdk.Coins, numPairs int) []sdk.Coins

SplitFeeSharePool splits the developer pool between numPairs recipients with a running remainder: everyone gets pool/numPairs (truncated) and the LAST recipient additionally receives the leftover. The aggregate always equals the pool exactly — the old per-recipient RoundInt(pool/numPairs) could sum to MORE than the pool and overdraw the escrow, reverting the tx. tested in ante_test.go

Types

type FeeSharePayoutDecorator

type FeeSharePayoutDecorator struct {
	// contains filtered or unexported fields
}

FeeSharePayoutDecorator Run his after we already deduct the fee from the account with the ante.NewDeductFeeDecorator() decorator. We pull funds from the FeeCollector ModuleAccount

func NewFeeSharePayoutDecorator

func NewFeeSharePayoutDecorator(bk bankkeeper.Keeper, fs keeper.Keeper) FeeSharePayoutDecorator

func (FeeSharePayoutDecorator) AnteHandle

func (fsd FeeSharePayoutDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

func (FeeSharePayoutDecorator) FeeSharePayout

func (FeeSharePayoutDecorator) FeeSharePayout(ctx sdk.Context, bankKeeper bankkeeper.Keeper, totalFees sdk.Coins, fsk keeper.Keeper, msgs []sdk.Msg) error

FeeSharePayout takes the total fees and redistributes 50% (or param set) to the contract developers provided they opted-in to payments.

type FeeSharePayoutEventOutput

type FeeSharePayoutEventOutput struct {
	WithdrawAddress sdk.AccAddress `json:"withdraw_address"`
	FeesPaid        sdk.Coins      `json:"fees_paid"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL