Documentation ¶
Index ¶
- type FrontRunningError
- type Keeper
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) ExtractBid(ctx sdk.Context, bidder sdk.AccAddress, bid sdk.Coin) error
- func (k Keeper) FrontRunningProtectionEnabled(ctx sdk.Context) (bool, error)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetEscrowAccount(ctx sdk.Context) (sdk.AccAddress, error)
- func (k Keeper) GetMaxBundleSize(ctx sdk.Context) (uint32, error)
- func (k Keeper) GetMinBidIncrement(ctx sdk.Context) (sdk.Coin, error)
- func (k Keeper) GetParams(ctx sdk.Context) (types.Params, error)
- func (k Keeper) GetProposerFee(ctx sdk.Context) (math.LegacyDec, error)
- func (k Keeper) GetReserveFee(ctx sdk.Context) (sdk.Coin, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) ValidateAuctionBid(ctx sdk.Context, bidder sdk.AccAddress, bid, highestBid sdk.Coin) error
- func (k Keeper) ValidateAuctionBundle(bidder sdk.AccAddress, bundleSigners []map[string]struct{}) error
- func (k Keeper) ValidateBidInfo(ctx sdk.Context, highestBid sdk.Coin, bidInfo *types.BidInfo) error
- func (k Keeper) ValidateBundleTimeouts(bidInfo *types.BidInfo) error
- type MsgServer
- type QueryServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FrontRunningError ¶
type FrontRunningError struct{}
FrontRunningError defines a custom error type for detecting front-running or sandwich attacks.
func NewFrontRunningError ¶
func NewFrontRunningError() *FrontRunningError
func (FrontRunningError) Error ¶
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 ¶
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) ExtractBid ¶
ExtractBid extracts the bid amount from the transaction.
func (Keeper) FrontRunningProtectionEnabled ¶
FrontRunningProtectionEnabled returns true if front-running protection is enabled.
func (Keeper) GetAuthority ¶
GetAuthority returns the address that is capable of executing a MsgUpdateParams message.
func (Keeper) GetEscrowAccount ¶
GetEscrowAccount returns the auction module's escrow account.
func (Keeper) GetMaxBundleSize ¶
GetMaxBundleSize returns the maximum number of transactions that can be included in a bundle.
func (Keeper) GetMinBidIncrement ¶
GetMinBidIncrement returns the minimum bid increment for the auction.
func (Keeper) GetProposerFee ¶
GetProposerFee returns the proposer fee for the auction module.
func (Keeper) GetReserveFee ¶
GetReserveFee returns the reserve fee of the auction module.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState)
InitGenesis initializes the auction module's state from a given genesis state.
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
- all of the transactions are signed by the signer.
- 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:
- valid: [tx1, tx2, tx3] where tx1 is signed by the signer 1 and tx2 and tx3 are signed by the bidder.
- valid: [tx1, tx2, tx3, tx4] where tx1 - tx4 are signed by the bidder.
- invalid: [tx1, tx2, tx3] where tx1 and tx3 are signed by the bidder and tx2 is signed by some other signer. (possible sandwich attack)
- 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 ¶
ValidateBidInfo validates that the bid can be included in the auction.
func (Keeper) ValidateBundleTimeouts ¶
ValidateBundleTimeouts validates that the timeouts of the transactions in the bundle are valid. We consider the timeouts valid iff all of the bidders txs in the bundle are equal to the timeout of the bid. This is mandatory as otherwise other searchers can potentially include other searcher's transactions in their bundles.
type MsgServer ¶
type MsgServer struct {
Keeper
}
MsgServer is the wrapper for the auction module's msg service.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the auction MsgServer interface.
func (MsgServer) AuctionBid ¶
func (m MsgServer) AuctionBid(goCtx context.Context, msg *types.MsgAuctionBid) (*types.MsgAuctionBidResponse, error)
AuctionBid is a no-op function that emits an event for the auction bid. The bid is extracted in the antehandler.
func (MsgServer) UpdateParams ¶
func (m MsgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
type QueryServer ¶
type QueryServer struct {
// contains filtered or unexported fields
}
QueryServer defines the auction module's gRPC querier service.
func NewQueryServer ¶
func NewQueryServer(keeper Keeper) *QueryServer
NewQueryServer creates a new gRPC query server for the auction module.
func (QueryServer) Params ¶
func (q QueryServer) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries all parameters of the auction module.