keeper

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

type Keeper struct {
	Sudoers       collections.Item[sudo.Sudoers]
	ZeroGasActors collections.Item[sudo.ZeroGasActors]
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey types.StoreKey,
) Keeper

func (Keeper) AddContracts

func (k Keeper) AddContracts(
	goCtx context.Context, msg *sudo.MsgEditSudoers,
) (msgResp *sudo.MsgEditSudoersResponse, err error)

AddContracts executes a MsgEditSudoers message with action type "add_contracts". This adds contract addresses to the sudoer set.

func (Keeper) ChangeRoot added in v2.8.0

func (k Keeper) ChangeRoot(
	goCtx context.Context,
	msg *sudo.MsgChangeRoot,
) (*sudo.MsgChangeRootResponse, error)

func (Keeper) CheckPermissions

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

CheckPermissions Checks if a contract is contained within the set of sudo contracts defined in the x/sudo module. These smart contracts are able to execute certain permissioned functions.

func (Keeper) EditSudoers added in v2.8.0

func (k Keeper) EditSudoers(
	goCtx context.Context, msg *sudo.MsgEditSudoers,
) (*sudo.MsgEditSudoersResponse, error)

EditSudoers adds or removes sudo contracts from state.

func (Keeper) EditZeroGasActors added in v2.8.0

func (k Keeper) EditZeroGasActors(
	goCtx context.Context,
	msg *sudo.MsgEditZeroGasActors,
) (*sudo.MsgEditZeroGasActorsResponse, error)

func (Keeper) ExportGenesis added in v2.8.0

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

ExportGenesis returns the module's exported genesis state. This fn assumes Keeper.InitGenesis has already been called.

func (Keeper) GetRootAddr

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

Returns the root address of the sudo module.

func (Keeper) GetZeroGasActors added in v2.8.0

func (k Keeper) GetZeroGasActors(ctx sdk.Context) sudo.ZeroGasActors

func (Keeper) GetZeroGasEvmContracts added in v2.11.0

func (k Keeper) GetZeroGasEvmContracts(ctx sdk.Context) map[gethcommon.Address]struct{}

GetZeroGasEvmContracts loads the ZeroGasActors state and returns a set (map) of EVM contract addresses that can be parsed from the zero-gas list, for O(1) lookup. Used by the EVM module via the evm.SudoKeeper interface without depending on x/sudo-specific types.

func (Keeper) InitGenesis added in v2.8.0

func (k Keeper) InitGenesis(ctx sdk.Context, genState sudo.GenesisState)

InitGenesis initializes the module's state from a provided genesis state JSON.

func (Keeper) QuerySudoers added in v2.8.0

func (k Keeper) QuerySudoers(
	goCtx context.Context,
	req *sudo.QuerySudoersRequest,
) (resp *sudo.QuerySudoersResponse, err error)

func (Keeper) QueryZeroGasActors added in v2.8.0

func (k Keeper) QueryZeroGasActors(
	goCtx context.Context,
	_ *sudo.QueryZeroGasActorsRequest,
) (resp *sudo.QueryZeroGasActorsResponse, err error)

func (Keeper) RemoveContracts

func (k Keeper) RemoveContracts(
	goCtx context.Context, msg *sudo.MsgEditSudoers,
) (msgResp *sudo.MsgEditSudoersResponse, err error)

type Sudoers

type Sudoers struct {
	Root      string          `json:"root"`
	Contracts set.Set[string] `json:"contracts"`
}

func SudoersFromPb

func SudoersFromPb(pbSudoers sudo.Sudoers) Sudoers

func (*Sudoers) AddContracts

func (sudoers *Sudoers) AddContracts(
	contracts []string,
) (out set.Set[string], err error)

AddContracts adds contract addresses to the sudoer set.

func (*Sudoers) RemoveContracts

func (sudoers *Sudoers) RemoveContracts(contracts []string)

func (Sudoers) String

func (sudoers Sudoers) String() string

func (Sudoers) ToPb

func (sudoers Sudoers) ToPb() sudo.Sudoers

Jump to

Keyboard shortcuts

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