keeper

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.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.DevFeeInfo

BuildFeeInfo returns DevFeeInfo given the contract and deployer addresses

func (Keeper) CancelDevFeeInfo

func (k Keeper) CancelDevFeeInfo(
	goCtx context.Context,
	msg *types.MsgCancelDevFeeInfo,
) (*types.MsgCancelDevFeeInfoResponse, error)

CancelDevFeeInfo deletes the fee for a 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) DeleteFee

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

DeleteFee removes a registered contract

func (Keeper) DeleteFeeInverse

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

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

func (Keeper) DeleteWithdrawal

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

DeleteWithdrawal deletes the withdrawal address for a registered contract

func (Keeper) DevFeeInfo

DevFeeInfo returns a given registered contract

func (Keeper) DevFeeInfos

DevFeeInfos returns all registered contracts for fee distribution

func (Keeper) DevFeeInfosPerDeployer

DevFeeInfosPerDeployer returns the fee information for all contracts that a deployer has registered

func (Keeper) GetAllFees

func (k Keeper) GetAllFees(ctx sdk.Context) []types.DevFeeInfo

GetAllFees - get all registered DevFeeInfo instances

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

func (k Keeper) GetFeeInfo(ctx sdk.Context, contract common.Address) (types.DevFeeInfo, bool)

GetFeeInfo returns DevFeeInfo for a registered contract

func (Keeper) GetFeesInverse

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

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

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

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

IsFeeInverseRegistered 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.DevFeeInfo) (stop bool),
)

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

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

func (k Keeper) RegisterDevFeeInfo(
	goCtx context.Context,
	msg *types.MsgRegisterDevFeeInfo,
) (*types.MsgRegisterDevFeeInfoResponse, error)

RegisterDevFeeInfo 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) 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) SetFeeInverse

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

SetFeeInverse stores a registered contract inverse mapping

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

func (k Keeper) UpdateDevFeeInfo(
	goCtx context.Context,
	msg *types.MsgUpdateDevFeeInfo,
) (*types.MsgUpdateDevFeeInfoResponse, error)

UpdateDevFeeInfo updates the withdraw address for a contract

Jump to

Keyboard shortcuts

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