keeper

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: LGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks

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

Hooks wrapper struct for fees keeper

func (Hooks) PostTxProcessing

func (h Hooks) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error

PostTxProcessing is a wrapper for calling the EVM PostTxProcessing hook on the module keeper

type Keeper

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

Keeper of this module maintains collections of revenues for contracts registered to receive transaction fees.

func NewKeeper

func NewKeeper(
	storeKey storetypes.StoreKey,
	cdc codec.BinaryCodec,
	authority sdk.AccAddress,
	bk types.BankKeeper,
	evmKeeper types.EVMKeeper,
	feeCollector string,
) Keeper

NewKeeper creates new instances of the fees Keeper

func (Keeper) CancelRevenue

func (k Keeper) CancelRevenue(
	goCtx context.Context,
	msg *types.MsgCancelRevenue,
) (*types.MsgCancelRevenueResponse, error)

CancelRevenue deletes the Revenue for a given contract

func (Keeper) DeleteDeployerMap

func (k Keeper) DeleteDeployerMap(
	ctx sdk.Context,
	deployer sdk.AccAddress,
	contract common.Address,
)

DeleteDeployerMap deletes a contract-by-deployer mapping

func (Keeper) DeleteRevenue

func (k Keeper) DeleteRevenue(ctx sdk.Context, fee types.Revenue)

DeleteRevenue deletes a Revenue of a registered contract.

func (Keeper) DeleteWithdrawerMap

func (k Keeper) DeleteWithdrawerMap(
	ctx sdk.Context,
	withdrawer sdk.AccAddress,
	contract common.Address,
)

DeleteWithdrawMap deletes a contract-by-withdrawer mapping

func (Keeper) DeployerRevenues

DeployerRevenues returns all contracts that have been registered for fee distribution by a given deployer

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of revenue parameters.

func (Keeper) GetRevenue

func (k Keeper) GetRevenue(
	ctx sdk.Context,
	contract common.Address,
) (types.Revenue, bool)

GetRevenue returns the Revenue for a registered contract

func (Keeper) GetRevenues

func (k Keeper) GetRevenues(ctx sdk.Context) []types.Revenue

GetRevenues returns all registered Revenues.

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Hooks return the wrapper hooks struct for the Keeper

func (Keeper) IsDeployerMapSet

func (k Keeper) IsDeployerMapSet(
	ctx sdk.Context,
	deployer sdk.AccAddress,
	contract common.Address,
) bool

IsDeployerMapSet checks if a given contract-by-withdrawer mapping is set in store

func (Keeper) IsRevenueRegistered

func (k Keeper) IsRevenueRegistered(
	ctx sdk.Context,
	contract common.Address,
) bool

IsRevenueRegistered checks if a contract was registered for receiving transaction fees

func (Keeper) IsWithdrawerMapSet

func (k Keeper) IsWithdrawerMapSet(
	ctx sdk.Context,
	withdrawer sdk.AccAddress,
	contract common.Address,
) bool

IsWithdrawerMapSet checks if a giveb contract-by-withdrawer mapping is set in store

func (Keeper) IterateRevenues

func (k Keeper) IterateRevenues(
	ctx sdk.Context,
	handlerFn func(fee types.Revenue) (stop bool),
)

IterateRevenues iterates over all registered contracts and performs a callback with the corresponding Revenue.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

Params returns the fees module params

func (Keeper) PostTxProcessing

func (k Keeper) PostTxProcessing(
	ctx sdk.Context,
	msg core.Message,
	receipt *ethtypes.Receipt,
) error

PostTxProcessing implements EvmHooks.PostTxProcessing. After each successful interaction with a registered contract, the contract deployer (or, if set, the withdraw address) receives a share from the transaction fees paid by the transaction sender.

func (Keeper) RegisterRevenue

func (k Keeper) RegisterRevenue(
	goCtx context.Context,
	msg *types.MsgRegisterRevenue,
) (*types.MsgRegisterRevenueResponse, error)

RegisterRevenue registers a contract to receive transaction fees

func (Keeper) Revenue

Revenue returns the Revenue that has been registered for fee distribution for a given contract

func (Keeper) Revenues

Revenues returns all Revenues that have been registered for fee distribution

func (Keeper) SetDeployerMap

func (k Keeper) SetDeployerMap(
	ctx sdk.Context,
	deployer sdk.AccAddress,
	contract common.Address,
)

SetDeployerMap stores a contract-by-deployer mapping

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error

SetParams sets the revenue params in a single key

func (Keeper) SetRevenue

func (k Keeper) SetRevenue(ctx sdk.Context, revenue types.Revenue)

SetRevenue stores the Revenue for a registered contract.

func (Keeper) SetWithdrawerMap

func (k Keeper) SetWithdrawerMap(
	ctx sdk.Context,
	withdrawer sdk.AccAddress,
	contract common.Address,
)

SetWithdrawerMap stores a contract-by-withdrawer mapping

func (*Keeper) UpdateParams

func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)

UpdateParams implements the gRPC MsgServer interface. When an UpdateParams proposal passes, it updates the module parameters. The update can only be performed if the requested authority is the Cosmos SDK governance module account.

func (Keeper) UpdateRevenue

func (k Keeper) UpdateRevenue(
	goCtx context.Context,
	msg *types.MsgUpdateRevenue,
) (*types.MsgUpdateRevenueResponse, error)

UpdateRevenue updates the withdraw address of a given Revenue. If the given withdraw address is empty or the same as the deployer address, the withdraw address is removed.

func (Keeper) WithdrawerRevenues

WithdrawerRevenues returns all fees for a given withdraw address

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper, legacySubspace types.Subspace) Migrator

NewMigrator returns a new Migrator.

Jump to

Keyboard shortcuts

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