evm

package
v0.0.0-...-ae97bcf Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEVM

func GetEVM() *evm

Types

type Context

type Context struct {
	ProgramCounter int16    // evm smart contract has max. size of 24kb => 24.576b
	Stack          [][]byte // reverse stack => len(Stack)-1 is top
	Memory         []byte
	ReturnData     []byte
	SubContext     *Context
}

func NewContext

func NewContext() Context

type Contract

type Contract struct {
	Address  string
	Bytecode []byte
	Storage  [][]byte
}

func NewContract

func NewContract(bytecode []byte) Contract

func (*Contract) ExecuteCode

func (o *Contract) ExecuteCode(code byte, tx *Tx, ctx *Context) (bool, error)

type Tx

type Tx struct {
	Origin string // origin sender address
	Value  []byte
	Data   []byte
}

Jump to

Keyboard shortcuts

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