precompiledContracts

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CustomPrecompiledStart uint64 = 0x10000
	CustomPrecompiledEnd   uint64 = 0x1FFFF
)
View Source
const (
	WithStoragePrecompiledStart uint64 = 0x20000
	WithStoragePrecompiledEnd   uint64 = 0x2FFFF
)

Variables

This section is empty.

Functions

func IsPrecompiledContract

func IsPrecompiledContract(address types.Address) bool

func IsWithStoragePrecompiled added in v0.5.7

func IsWithStoragePrecompiled(addr types.Address) bool

func PrecompiledContractCount

func PrecompiledContractCount() uint64

func RegisterContractWithStorage added in v0.5.7

func RegisterContractWithStorage(addr types.Address, c IWithStoragePrecompiledContract) error

func RegisterContracts

func RegisterContracts(addr types.Address, c PrecompiledContract) error

Types

type IWithStoragePrecompiledContract added in v0.5.7

type IWithStoragePrecompiledContract interface {
	GasCost(addr types.Address, input []byte, dataBlock storage.IDataBlockStorage) uint64
	Execute(addr types.Address, input []byte, dataBlock storage.IDataBlockStorage) ([]byte, error)
}

func GetWithStoragePrecompiledContract added in v0.5.7

func GetWithStoragePrecompiledContract(addr types.Address) IWithStoragePrecompiledContract

type PrecompiledContract

type PrecompiledContract interface {
	GasCost(input []byte) uint64
	Execute(input []byte) ([]byte, error)
}

func GetContract

func GetContract(addr uint64) PrecompiledContract

Jump to

Keyboard shortcuts

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