sputnikvm

package
v0.0.0-...-0d67187 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2019 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

This is a go binding for SputnikVM, an Ethereum Virtual Machine.

Copyright (c) ETC Dev Team 2017. Licensed under Apache-2.0. Authored by Wei Tang <hi@that.world>

Index

Constants

View Source
const (
	AccountChangeIncreaseBalance = iota
	AccountChangeDecreaseBalance
	AccountChangeFull
	AccountChangeCreate
	AccountChangeRemoved
)
View Source
const (
	RequireNone = iota
	RequireAccount
	RequireAccountCode
	RequireAccountStorage
	RequireBlockhash
)

Variables

This section is empty.

Functions

func FromCAddress

func FromCAddress(v C.sputnikvm_address) common.Address

func FromCGas

func FromCGas(v C.sputnikvm_gas) *big.Int

func FromCH256

func FromCH256(v C.sputnikvm_h256) common.Hash

func FromCU256

func FromCU256(v C.sputnikvm_u256) *big.Int

func PrintCU256

func PrintCU256(v C.sputnikvm_u256)

func SetCustomInitialNonce

func SetCustomInitialNonce(nonce *big.Int)

func ToCAddress

func ToCAddress(v common.Address) C.sputnikvm_address

func ToCGas

func ToCGas(v *big.Int) C.sputnikvm_gas

func ToCH256

func ToCH256(v common.Hash) C.sputnikvm_h256

func ToCHeaderParams

func ToCHeaderParams(header *HeaderParams) *C.sputnikvm_header_params

func ToCU256

func ToCU256(v *big.Int) C.sputnikvm_u256

Types

type AccountChange

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

func (*AccountChange) Address

func (change *AccountChange) Address() common.Address

func (*AccountChange) Balance

func (change *AccountChange) Balance() *big.Int

func (*AccountChange) ChangedAmount

func (change *AccountChange) ChangedAmount() *big.Int

func (*AccountChange) ChangedStorage

func (change *AccountChange) ChangedStorage() []AccountChangeStorageItem

func (*AccountChange) Code

func (change *AccountChange) Code() []byte

func (*AccountChange) Nonce

func (change *AccountChange) Nonce() *big.Int

func (*AccountChange) Storage

func (change *AccountChange) Storage() []AccountChangeStorageItem

func (*AccountChange) Typ

func (change *AccountChange) Typ() AccountChangeType

type AccountChangeStorageItem

type AccountChangeStorageItem struct {
	Key   *big.Int
	Value *big.Int
}

type AccountChangeType

type AccountChangeType int

type HeaderParams

type HeaderParams struct {
	Beneficiary common.Address
	Timestamp   uint64
	Number      *big.Int
	Difficulty  *big.Int
	GasLimit    *big.Int
}

type Log

type Log struct {
	Address common.Address
	Topics  []common.Hash
	Data    []byte
}

type Require

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

func (*Require) Address

func (require *Require) Address() common.Address

func (*Require) BlockNumber

func (require *Require) BlockNumber() *big.Int

func (*Require) StorageKey

func (require *Require) StorageKey() *big.Int

func (*Require) Typ

func (require *Require) Typ() RequireType

type RequireType

type RequireType int

type Transaction

type Transaction struct {
	Caller   common.Address
	GasPrice *big.Int
	GasLimit *big.Int
	Address  *common.Address // If it is nil, then we take it as a Create transaction.
	Value    *big.Int
	Input    []byte
	Nonce    *big.Int
}

type VM

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

func NewCustomEIP150

func NewCustomEIP150(transaction *Transaction, header *HeaderParams) *VM

func NewCustomEIP160

func NewCustomEIP160(transaction *Transaction, header *HeaderParams) *VM

func NewCustomFrontier

func NewCustomFrontier(transaction *Transaction, header *HeaderParams) *VM

func NewCustomHomestead

func NewCustomHomestead(transaction *Transaction, header *HeaderParams) *VM

func NewEIP150

func NewEIP150(transaction *Transaction, header *HeaderParams) *VM

func NewEIP160

func NewEIP160(transaction *Transaction, header *HeaderParams) *VM

func NewFrontier

func NewFrontier(transaction *Transaction, header *HeaderParams) *VM

func NewGallactic

func NewGallactic(transaction *Transaction, header *HeaderParams) *VM

func NewHomestead

func NewHomestead(transaction *Transaction, header *HeaderParams) *VM

func NewModernEIP150

func NewModernEIP150(transaction *Transaction, header *HeaderParams) *VM

func NewModernEIP160

func NewModernEIP160(transaction *Transaction, header *HeaderParams) *VM

func NewModernFrontier

func NewModernFrontier(transaction *Transaction, header *HeaderParams) *VM

func NewModernHomestead

func NewModernHomestead(transaction *Transaction, header *HeaderParams) *VM

func (*VM) AccountChanges

func (vm *VM) AccountChanges() []AccountChange

func (*VM) CommitAccount

func (vm *VM) CommitAccount(address common.Address, nonce *big.Int, balance *big.Int, code []byte)

func (*VM) CommitAccountCode

func (vm *VM) CommitAccountCode(address common.Address, code []byte)

func (*VM) CommitAccountStorage

func (vm *VM) CommitAccountStorage(address common.Address, key *big.Int, value *big.Int)

func (*VM) CommitBlockhash

func (vm *VM) CommitBlockhash(number *big.Int, hash common.Hash)

func (*VM) CommitNonexist

func (vm *VM) CommitNonexist(address common.Address)

func (*VM) Failed

func (vm *VM) Failed() bool

func (*VM) Fire

func (vm *VM) Fire() Require

func (*VM) Free

func (vm *VM) Free()

func (*VM) Logs

func (vm *VM) Logs() []Log

func (*VM) OutLen

func (vm *VM) OutLen() uint

func (*VM) Output

func (vm *VM) Output() []uint8

func (*VM) UsedGas

func (vm *VM) UsedGas() *big.Int

Jump to

Keyboard shortcuts

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