keeper

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrontRunningError added in v1.0.1

type FrontRunningError struct{}

FrontRunningError defines a custom error type for detecting front-running or sandwich attacks.

func NewFrontRunningError added in v1.0.1

func NewFrontRunningError() *FrontRunningError

func (FrontRunningError) Error added in v1.0.1

func (e FrontRunningError) Error() string

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	distrKeeper types.DistributionKeeper,
	stakingKeeper types.StakingKeeper,
	authority string,
) Keeper

NewKeeper is a wrapper around NewKeeperWithRewardsAddressProvider for backwards compatibility.

func NewKeeperWithRewardsAddressProvider added in v1.0.2

func NewKeeperWithRewardsAddressProvider(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	rewardsAddressProvider types.RewardsAddressProvider,
	authority string,
) Keeper

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns a GenesisState for a given context.

func (Keeper) FrontRunningProtectionEnabled

func (k Keeper) FrontRunningProtectionEnabled(ctx sdk.Context) (bool, error)

FrontRunningProtectionEnabled returns true if front-running protection is enabled.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the address that is capable of executing a MsgUpdateParams message.

func (Keeper) GetEscrowAccount

func (k Keeper) GetEscrowAccount(ctx sdk.Context) (sdk.AccAddress, error)

GetEscrowAccount returns the builder module's escrow account.

func (Keeper) GetMaxBundleSize

func (k Keeper) GetMaxBundleSize(ctx sdk.Context) (uint32, error)

GetMaxBundleSize returns the maximum number of transactions that can be included in a bundle.

func (Keeper) GetMinBidIncrement

func (k Keeper) GetMinBidIncrement(ctx sdk.Context) (sdk.Coin, error)

GetMinBidIncrement returns the minimum bid increment for the builder.

func (Keeper) GetParams

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

GetParams returns the builder module's parameters.

func (Keeper) GetProposerFee

func (k Keeper) GetProposerFee(ctx sdk.Context) (sdk.Dec, error)

GetProposerFee returns the proposer fee for the builder module.

func (Keeper) GetReserveFee

func (k Keeper) GetReserveFee(ctx sdk.Context) (sdk.Coin, error)

GetReserveFee returns the reserve fee of the builder module.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState)

InitGenesis initializes the builder module's state from a given genesis state.

func (Keeper) Logger

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

Logger returns a builder module-specific logger.

func (Keeper) SetParams

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

SetParams sets the builder module's parameters.

func (Keeper) ValidateAuctionBid

func (k Keeper) ValidateAuctionBid(ctx sdk.Context, bidder sdk.AccAddress, bid, highestBid sdk.Coin) error

ValidateAuctionBid validates that the bidder has sufficient funds to participate in the auction and that the bid amount is sufficiently high enough.

func (Keeper) ValidateAuctionBundle

func (k Keeper) ValidateAuctionBundle(bidder sdk.AccAddress, bundleSigners []map[string]struct{}) error

ValidateAuctionBundle validates the ordering of the referenced transactions. Bundles are valid if

  1. all of the transactions are signed by the signer.
  2. some subset of contiguous transactions starting from the first tx are signed by the same signer, and all other tranasctions are signed by the bidder.

example:

  1. valid: [tx1, tx2, tx3] where tx1 is signed by the signer 1 and tx2 and tx3 are signed by the bidder.
  2. valid: [tx1, tx2, tx3, tx4] where tx1 - tx4 are signed by the bidder.
  3. invalid: [tx1, tx2, tx3] where tx1 and tx3 are signed by the bidder and tx2 is signed by some other signer. (possible sandwich attack)
  4. invalid: [tx1, tx2, tx3] where tx1 is signed by the bidder, and tx2 - tx3 are signed by some other signer. (possible front-running attack)

func (Keeper) ValidateBidInfo

func (k Keeper) ValidateBidInfo(ctx sdk.Context, highestBid sdk.Coin, bidInfo *mempool.AuctionBidInfo) error

ValidateBidInfo validates that the bid can be included in the auction.

type MsgServer

type MsgServer struct {
	Keeper
}

MsgServer is the wrapper for the builder module's msg service.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) *MsgServer

NewMsgServerImpl returns an implementation of the builder MsgServer interface.

func (MsgServer) AuctionBid

func (MsgServer) UpdateParams

type QueryServer

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

QueryServer defines the builder module's gRPC querier service.

func NewQueryServer

func NewQueryServer(keeper Keeper) *QueryServer

NewQueryServer creates a new gRPC query server for the builder module.

func (QueryServer) Params

Params queries all parameters of the builder module.

Jump to

Keyboard shortcuts

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