instructions

package
v2.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstructionsTable

func GetInstructionsTable() [opcodes.MaxOpCodesCount]opCodeInstruction

func IntArr2BigInt added in v2.3.7

func IntArr2BigInt(a *IntArr, res *evmutils.Int)

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
	ContractVersion string

	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

type IntArr added in v2.3.7

type IntArr [4]uint64

Jump to

Keyboard shortcuts

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