instructions

package
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstructionsTable

func GetInstructionsTable() [opcodes.MaxOpCodesCount]opCodeInstruction

func Load

func Load()

Types

type ClosureExecute

type ClosureExecute func(ClosureParam) ([]byte, error)

type ClosureParam

type ClosureParam struct {
	VM           interface{}
	OpCode       opcodes.OpCode
	GasRemaining *evmutils.Int

	ContractAddress *evmutils.Int
	ContractHash    *evmutils.Int
	ContractCode    []byte

	CallData   []byte
	CallValue  *evmutils.Int
	CreateSalt *evmutils.Int
}

type ConstOpGasCostSetting

type ConstOpGasCostSetting [opcodes.MaxOpCodesCount]uint64

type DynamicGasCostSetting

type DynamicGasCostSetting struct {
	EXPBytesCost   uint64
	SHA3ByteCost   uint64
	MemoryByteCost uint64
	LogByteCost    uint64
}

type GasSetting

type GasSetting struct {
	ActionConstCost [opcodes.MaxOpCodesCount]uint64
	NewAccountCost  uint64
	DynamicCost     DynamicGasCostSetting
}

func DefaultGasSetting

func DefaultGasSetting() *GasSetting

type IInstructions

type IInstructions interface {
	ExecuteContract(isCreate bool) ([]byte, uint64, []byte, []byte, error)
	GetPcCountAndTimeUsed() (uint64, int64)
	SetGasLimit(uint64)
	GetGasLeft() uint64
	SetReadOnly()
	IsReadOnly() bool
	ExitOpCode() opcodes.OpCode
}

func New

func New(
	vm interface{},
	stack *stack.Stack,
	memory *memory.Memory,
	storage *storage.Storage,
	context *environment.Context,
	gasSetting *GasSetting,
	closureExecute ClosureExecute) IInstructions

Jump to

Keyboard shortcuts

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