precompiles

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package precompiles provides Uptick's EVM static precompile configuration.

Now uses cosmos/evm v0.6.1's ERC20 keeper directly (concrete type) instead of the cmn.ERC20Keeper interface, since Uptick has moved to cosmos/evm's x/erc20 module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStaticPrecompiles

func DefaultStaticPrecompiles(
	stakingKeeper stakingkeeper.Keeper,
	distributionKeeper distributionkeeper.Keeper,
	bankKeeper cmn.BankKeeper,
	erc20Keeper *erc20keeper.Keeper,
	transferKeeper *transferkeeper.Keeper,
	channelKeeper *channelkeeper.Keeper,
	govKeeper govkeeper.Keeper,
	slashingKeeper slashingkeeper.Keeper,
	codec codec.Codec,
	opts ...Option,
) map[common.Address]vm.PrecompiledContract

DefaultStaticPrecompiles returns Uptick's list of static precompiled contracts. Uses cosmos/evm v0.6.1's ERC20 keeper (concrete type) directly.

Types

type Option

type Option func(opts *Optionals)

Option customizes the precompiles' optional params.

func WithAddressCodec

func WithAddressCodec(codec address.Codec) Option

WithAddressCodec sets the address codec.

func WithConsensusAddrCodec

func WithConsensusAddrCodec(codec address.Codec) Option

WithConsensusAddrCodec sets the consensus address codec.

func WithValidatorAddrCodec

func WithValidatorAddrCodec(codec address.Codec) Option

WithValidatorAddrCodec sets the validator address codec.

type Optionals

type Optionals struct {
	AddressCodec       address.Codec // used by gov/staking
	ValidatorAddrCodec address.Codec // used by slashing
	ConsensusAddrCodec address.Codec // used by slashing
}

Optionals define some optional params that can be applied to _some_ precompiles.

type StaticPrecompiles

type StaticPrecompiles map[common.Address]vm.PrecompiledContract

StaticPrecompiles is a map of precompile addresses to contracts.

func NewStaticPrecompiles

func NewStaticPrecompiles() StaticPrecompiles

NewStaticPrecompiles returns an empty static precompiles map.

func (StaticPrecompiles) WithBankPrecompile

func (s StaticPrecompiles) WithBankPrecompile(
	bankKeeper cmn.BankKeeper,
	erc20Keeper *erc20keeper.Keeper,
) StaticPrecompiles

WithBankPrecompile adds the bank precompile with cosmos/evm v0.6.1 ERC20 keeper.

func (StaticPrecompiles) WithBech32Precompile

func (s StaticPrecompiles) WithBech32Precompile() StaticPrecompiles

WithBech32Precompile adds the bech32 precompile.

func (StaticPrecompiles) WithDistributionPrecompile

func (s StaticPrecompiles) WithDistributionPrecompile(
	distributionKeeper distributionkeeper.Keeper,
	stakingKeeper stakingkeeper.Keeper,
	bankKeeper cmn.BankKeeper,
	opts ...Option,
) StaticPrecompiles

WithDistributionPrecompile adds the distribution precompile.

func (StaticPrecompiles) WithGovPrecompile

func (s StaticPrecompiles) WithGovPrecompile(
	govKeeper govkeeper.Keeper,
	bankKeeper cmn.BankKeeper,
	codec codec.Codec,
	opts ...Option,
) StaticPrecompiles

WithGovPrecompile adds the gov precompile.

func (StaticPrecompiles) WithICS20Precompile

func (s StaticPrecompiles) WithICS20Precompile(
	bankKeeper cmn.BankKeeper,
	stakingKeeper stakingkeeper.Keeper,
	transferKeeper *transferkeeper.Keeper,
	channelKeeper *channelkeeper.Keeper,
	erc20Keeper *erc20keeper.Keeper,
) StaticPrecompiles

WithICS20Precompile adds the ICS20 (transfer) precompile with cosmos/evm v0.6.1 ERC20 keeper. The concrete *erc20keeper.Keeper satisfies cmn.ERC20Keeper.

func (StaticPrecompiles) WithP256Precompile

func (s StaticPrecompiles) WithP256Precompile() StaticPrecompiles

WithP256Precompile adds the P256 precompile.

func (StaticPrecompiles) WithPraguePrecompiles

func (s StaticPrecompiles) WithPraguePrecompiles() StaticPrecompiles

WithPraguePrecompiles adds the Prague precompiles.

func (StaticPrecompiles) WithSlashingPrecompile

func (s StaticPrecompiles) WithSlashingPrecompile(
	slashingKeeper slashingkeeper.Keeper,
	bankKeeper cmn.BankKeeper,
	opts ...Option,
) StaticPrecompiles

WithSlashingPrecompile adds the slashing precompile.

func (StaticPrecompiles) WithStakingPrecompile

func (s StaticPrecompiles) WithStakingPrecompile(
	stakingKeeper stakingkeeper.Keeper,
	bankKeeper cmn.BankKeeper,
	opts ...Option,
) StaticPrecompiles

WithStakingPrecompile adds the staking precompile.

Jump to

Keyboard shortcuts

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