types

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types defines types used by the specops package, which is intended to be dot-imported so requires a minimal footprint of exported symbols.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytecodeHolder

type BytecodeHolder interface {
	Bytecoder
	Bytecoders() []Bytecoder
}

A BytecodeHolder is a concatenation of Bytecoders.

type Bytecoder

type Bytecoder interface {
	Bytecode() ([]byte, error)
}

A Bytecoder returns raw EVM bytecode. If the returned bytecode is the concatenation of multiple Bytecoder outputs, the type MUST also implement BytecodeHolder.

func BytecoderFromStackPusher

func BytecoderFromStackPusher(s StackPusher) Bytecoder

BytecoderFromStackPusher returns a Bytecoder that calls s.ToPush() and prepends the appropriate PUSH<N> opcode to the returned bytecode.

type OpCode

type OpCode vm.OpCode

An OpCode converts a standard geth OpCode into a Bytecoder that returns itself.

func (OpCode) Bytecode

func (o OpCode) Bytecode() ([]byte, error)

Bytecode returns `[]byte{o}, nil`.

func (OpCode) String

func (o OpCode) String() string

String returns `vm.OpCode(o).String()`.

type StackPusher

type StackPusher interface {
	ToPush() []byte
}

A StackPusher returns [1,32] bytes to be pushed to the stack.

Jump to

Keyboard shortcuts

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