generator

package
v0.0.0-...-5f61169 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: LGPL-2.1 Imports: 9 Imported by: 1

Documentation

Overview

Package generator provides means to generate state tests for Ethereum.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateProgram

func GenerateProgram(f *filler.Filler) (*fuzzing.GstMaker, []byte)

GenerateProgram creates a new evm program and returns a gstMaker based on it as well as its program code.

func Probability

func Probability(strat Strategy, sum int) byte

Probability returns the probability of this strategy, given the sum of all strategies on scale 1-255.

Types

type Environment

type Environment struct {
	// contains filtered or unexported fields
}

type Jumptable

type Jumptable struct {
	// contains filtered or unexported fields
}

func NewJumptable

func NewJumptable(minDist uint64) *Jumptable

NewJumptable creates a new Jumptable with a minimum jump distance.

func (*Jumptable) InsertJumps

func (j *Jumptable) InsertJumps(bytecode []byte) []byte

func (*Jumptable) Pop

func (j *Jumptable) Pop(pc uint64) uint64

Pop stores where a destination from the jumptable is needed. Returns a full uint64 as a placeholder

func (*Jumptable) Push

func (j *Jumptable) Push(pc, dest uint64)

Push pushes a new destination on the jumptable.

type Strategy

type Strategy interface {
	// Execute executes the strategy.
	// adds the resulting opcodes to the program.
	Execute(env Environment)
	// Importance returns the importance of this strategy.
	// This is needed to calculate the probability of this strategy.
	// Should be on a scale of 1-100.
	Importance() int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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