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 ¶
- func DefaultStaticPrecompiles(stakingKeeper stakingkeeper.Keeper, ...) map[common.Address]vm.PrecompiledContract
- type Option
- type Optionals
- type StaticPrecompiles
- func (s StaticPrecompiles) WithBankPrecompile(bankKeeper cmn.BankKeeper, erc20Keeper *erc20keeper.Keeper) StaticPrecompiles
- func (s StaticPrecompiles) WithBech32Precompile() StaticPrecompiles
- func (s StaticPrecompiles) WithDistributionPrecompile(distributionKeeper distributionkeeper.Keeper, ...) StaticPrecompiles
- func (s StaticPrecompiles) WithGovPrecompile(govKeeper govkeeper.Keeper, bankKeeper cmn.BankKeeper, codec codec.Codec, ...) StaticPrecompiles
- func (s StaticPrecompiles) WithICS20Precompile(bankKeeper cmn.BankKeeper, stakingKeeper stakingkeeper.Keeper, ...) StaticPrecompiles
- func (s StaticPrecompiles) WithP256Precompile() StaticPrecompiles
- func (s StaticPrecompiles) WithPraguePrecompiles() StaticPrecompiles
- func (s StaticPrecompiles) WithSlashingPrecompile(slashingKeeper slashingkeeper.Keeper, bankKeeper cmn.BankKeeper, ...) StaticPrecompiles
- func (s StaticPrecompiles) WithStakingPrecompile(stakingKeeper stakingkeeper.Keeper, bankKeeper cmn.BankKeeper, opts ...Option) StaticPrecompiles
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 ¶
WithAddressCodec sets the address codec.
func WithConsensusAddrCodec ¶
WithConsensusAddrCodec sets the consensus address codec.
func WithValidatorAddrCodec ¶
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.