precompiles

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVMDenomPrefix      = "evm/"
	MintMethodName      = "mint"
	BurnMethodName      = "burn"
	BalanceOfMethodName = "balanceOf"
	TransferMethodName  = "transfer"
)

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

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 NativeMessage

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

type Registrable

type Registrable interface {
	RegistryKey() common.Address
}

Jump to

Keyboard shortcuts

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