precompiles

package
v2.0.0-...-b0ece9e Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVMDenomPrefix      = "evm/"
	MintMethodName      = "mint"
	BurnMethodName      = "burn"
	BalanceOfMethodName = "balanceOf"
	TransferMethodName  = "transfer"
)
View Source
const (
	RegisterAccountMethodName = "registerAccount"
	QueryAccountMethodName    = "queryAccount"
	SubmitMsgsMethodName      = "submitMsgs"
)
View Source
const (
	CreateClient                         = "createClient"
	UpdateClient                         = "updateClient"
	UpgradeClient                        = "upgradeClient"
	SubmitMisbehaviour                   = "submitMisbehaviour"
	ConnectionOpenInit                   = "connectionOpenInit"
	ConnectionOpenTry                    = "connectionOpenTry"
	ConnectionOpenAck                    = "connectionOpenAck"
	ConnectionOpenConfirm                = "connectionOpenConfirm"
	ChannelOpenInit                      = "channelOpenInit"
	ChannelOpenTry                       = "channelOpenTry"
	ChannelOpenAck                       = "channelOpenAck"
	ChannelOpenConfirm                   = "channelOpenConfirm"
	ChannelCloseInit                     = "channelCloseInit"
	ChannelCloseConfirm                  = "channelCloseConfirm"
	RecvPacket                           = "recvPacket"
	Acknowledgement                      = "acknowledgement"
	Timeout                              = "timeout"
	TimeoutOnClose                       = "timeoutOnClose"
	UpdateClientAndConnectionOpenInit    = "updateClientAndConnectionOpenInit"
	UpdateClientAndConnectionOpenTry     = "updateClientAndConnectionOpenTry"
	UpdateClientAndConnectionOpenAck     = "updateClientAndConnectionOpenAck"
	UpdateClientAndConnectionOpenConfirm = "updateClientAndConnectionOpenConfirm"
	UpdateClientAndChannelOpenInit       = "updateClientAndChannelOpenInit"
	UpdateClientAndChannelOpenTry        = "updateClientAndChannelOpenTry"
	UpdateClientAndChannelOpenAck        = "updateClientAndChannelOpenAck"
	UpdateClientAndChannelCloseInit      = "updateClientAndChannelCloseInit"
	UpdateClientAndChannelCloseConfirm   = "updateClientAndChannelCloseConfirm"
	UpdateClientAndChannelOpenConfirm    = "updateClientAndChannelOpenConfirm"
	UpdateClientAndRecvPacket            = "updateClientAndRecvPacket"
	UpdateClientAndAcknowledgement       = "updateClientAndAcknowledgement"
	UpdateClientAndTimeout               = "updateClientAndTimeout"
	UpdateClientAndTimeoutOnClose        = "updateClientAndTimeoutOnClose"
)

Variables

This section is empty.

Functions

func EVMDenom

func EVMDenom(token common.Address) string

func NewBankContract

func NewBankContract(bankKeeper types.BankKeeper, cdc codec.Codec, kvGasConfig storetypes.GasConfig) vm.PrecompiledContract

NewBankContract creates the precompiled contract to manage native tokens

func NewIcaContract

func NewIcaContract(ctx sdk.Context, icaauthKeeper types.Icaauthkeeper, cronosKeeper types.CronosKeeper, cdc codec.Codec, kvGasConfig storetypes.GasConfig) vm.PrecompiledContract

func NewRelayerContract

func NewRelayerContract(ibcKeeper types.IbcKeeper, cdc codec.Codec, rules params.Rules, logger log.Logger) vm.PrecompiledContract

func OnPacketResultCallback

func OnPacketResultCallback(args ...interface{}) ([]byte, error)

Types

type BankContract

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

func (*BankContract) Address

func (bc *BankContract) Address() common.Address

func (*BankContract) RequiredGas

func (bc *BankContract) RequiredGas(input []byte) uint64

RequiredGas calculates the contract gas use

func (*BankContract) Run

func (bc *BankContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ([]byte, error)

type BaseContract

type BaseContract interface {
	Registrable
}

func NewBaseContract

func NewBaseContract(address common.Address) BaseContract

type Executor

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

type ExtStateDB

type ExtStateDB interface {
	vm.StateDB
	ExecuteNativeAction(contract common.Address, converter statedb.EventConverter, action func(ctx sdk.Context) error) error
	CacheContext() sdk.Context
}

ExtStateDB defines extra methods of statedb to support stateful precompiled contracts

type IcaContract

type IcaContract struct {
	BaseContract
	// contains filtered or unexported fields
}

func (*IcaContract) Address

func (ic *IcaContract) Address() common.Address

func (*IcaContract) RequiredGas

func (ic *IcaContract) RequiredGas(input []byte) uint64

RequiredGas calculates the contract gas use

func (*IcaContract) Run

func (ic *IcaContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ([]byte, error)

type NativeMessage

type NativeMessage interface {
	codec.ProtoMarshaler
	GetSigners() []sdk.AccAddress
}

type Registrable

type Registrable interface {
	RegistryKey() common.Address
}

type RelayerContract

type RelayerContract struct {
	BaseContract
	// contains filtered or unexported fields
}

func (*RelayerContract) Address

func (bc *RelayerContract) Address() common.Address

func (*RelayerContract) RequiredGas

func (bc *RelayerContract) RequiredGas(input []byte) (gas uint64)

RequiredGas calculates the contract gas use `max(0, len(input) * DefaultTxSizeCostPerByte + requiredGasTable[methodPrefix] - intrinsicGas)`

func (*RelayerContract) Run

func (bc *RelayerContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ([]byte, error)

Jump to

Keyboard shortcuts

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