keeper

package
v6.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: LGPL-3.0 Imports: 19 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 implements EvmHooks.PostTxProcessing. After each successful interaction with a registered contract, the contract deployer receives a share from the transaction fees paid by the user.

type Keeper

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

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

func NewKeeper

func NewKeeper(
	storeKey sdk.StoreKey,
	cdc codec.BinaryCodec,
	ps paramtypes.Subspace,
	bk types.BankKeeper,
	evmKeeper types.EVMKeeper,
	feeCollector string,
) Keeper

NewKeeper creates new instances of the fees Keeper

func (Keeper) BuildFeeInfo

func (k Keeper) BuildFeeInfo(ctx sdk.Context, contract common.Address, deployerAddress sdk.AccAddress) types.Fee

BuildFeeInfo returns Fee given the contract and deployer addresses

func (Keeper) CancelFee

func (k Keeper) CancelFee(
	goCtx context.Context,
	msg *types.MsgCancelFee,
) (*types.MsgCancelFeeResponse, error)

CancelFee deletes the Fee of a given contract

func (Keeper) DeleteDeployer

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

DeleteDeployer deletes the deployer address for a registered contract

func (Keeper) DeleteDeployerFees

func (k Keeper) DeleteDeployerFees(ctx sdk.Context, deployerAddress sdk.AccAddress, contractAddress common.Address)

DeleteDeployerFees removes a registered contract from a deployer's KVStore of registered contracts

func (Keeper) DeleteFee

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

DeleteFee removes a registered contract

func (Keeper) DeleteWithdrawal

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

DeleteWithdrawal deletes the withdrawal address for a registered contract

func (Keeper) DeployerFees

DeployerFees returns all Fees that have been registered for fee distribution by a given deployer

func (Keeper) Fee

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

func (Keeper) Fees

Fees returns all Fees that have been registered for fee distribution

func (Keeper) GetDeployer

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

GetDeployer returns the deployer address for a registered contract

func (Keeper) GetDeployerFees

func (k Keeper) GetDeployerFees(ctx sdk.Context, deployerAddress sdk.AccAddress) []common.Address

GetDeployerFees returns all contracts registered by a deployer as []common.Address

func (Keeper) GetFee

func (k Keeper) GetFee(ctx sdk.Context, contract common.Address) (types.Fee, bool)

GetFee returns Fee for a registered contract

func (Keeper) GetFees

func (k Keeper) GetFees(ctx sdk.Context) []types.Fee

GetFees - get all registered Fee instances

func (Keeper) GetParams

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

GetParams returns the total set of fees parameters.

func (Keeper) GetWithdrawal

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

GetWithdrawal returns the withdrawal address for a registered contract

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Hooks return the wrapper hooks struct for the Keeper

func (Keeper) IsDeployerFeesRegistered

func (k Keeper) IsDeployerFeesRegistered(
	ctx sdk.Context,
	deployerAddress sdk.AccAddress,
	contractAddress common.Address,
) bool

IsDeployerFeesRegistered checks if a contract exists in a deployer's KVStore of registered contracts

func (Keeper) IsFeeRegistered

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

IsFeeRegistered checks if a contract was registered for receiving fees

func (Keeper) IterateFees

func (k Keeper) IterateFees(
	ctx sdk.Context,
	handlerFn func(fee types.Fee) (stop bool),
)

IterateFees iterates over all registered contracts and performs a callback with the corresponding Fee.

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) RegisterFee

func (k Keeper) RegisterFee(
	goCtx context.Context,
	msg *types.MsgRegisterFee,
) (*types.MsgRegisterFeeResponse, error)

RegisterFee registers a contract to receive transaction fees

func (Keeper) SetDeployer

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

SetDeployer stores the deployer address for a registered contract

func (Keeper) SetDeployerFees

func (k Keeper) SetDeployerFees(ctx sdk.Context, deployerAddress sdk.AccAddress, contractAddress common.Address)

SetDeployerFees stores a registered contract inverse mapping

func (Keeper) SetFee

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

SetFee stores the developer fee information for a registered contract

func (Keeper) SetParams

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

SetParams sets the fees parameters to the param space.

func (Keeper) SetWithdrawal

func (k Keeper) SetWithdrawal(ctx sdk.Context, contract common.Address, withdrawal sdk.AccAddress)

SetWithdrawal stores the withdrawal address for a registered contract

func (Keeper) UpdateFee

func (k Keeper) UpdateFee(
	goCtx context.Context,
	msg *types.MsgUpdateFee,
) (*types.MsgUpdateFeeResponse, error)

UpdateFee updates the withdraw address of a given Fee

Jump to

Keyboard shortcuts

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