wasm

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeContractAddr

func ComputeContractAddr(code []byte, args []byte, nonce []byte) common.Address

func ComputeContractAddrByHash

func ComputeContractAddrByHash(codeHash []byte, args []byte, nonce []byte) common.Address

func ComputeContractAddrWithUnpackedArgs

func ComputeContractAddrWithUnpackedArgs(code []byte, args [][]byte, nonce []byte) common.Address

func CreateContractAddr

func CreateContractAddr(tx *types.Transaction) common.Address

Types

type BlockHeaderProvider

type BlockHeaderProvider interface {
	GetBlockHeaderByHeight(height uint64) *types.Header
}

type ContractContext

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

func NewContractContext

func NewContractContext(tx *types.Transaction) *ContractContext

func (*ContractContext) Caller

func (c *ContractContext) Caller() common.Address

func (*ContractContext) ContractAddr

func (c *ContractContext) ContractAddr() common.Address

func (*ContractContext) CreateSubContext

func (c *ContractContext) CreateSubContext(contract lib.Address, amount *big.Int) *ContractContext

func (*ContractContext) Epoch

func (c *ContractContext) Epoch() uint16

func (*ContractContext) Nonce

func (c *ContractContext) Nonce() uint32

func (*ContractContext) PayAmount

func (c *ContractContext) PayAmount() *big.Int

type ContractData

type ContractData struct {
	Code []byte
}

type WasmEnv

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

func NewWasmEnv

func NewWasmEnv(appState *appstate.AppState, blockHeaderProvider BlockHeaderProvider, ctx *ContractContext, head *types.Header, method string, isDebug bool) *WasmEnv

func (*WasmEnv) AddBalance

func (w *WasmEnv) AddBalance(meter *lib.GasMeter, address lib.Address, amount *big.Int)

func (*WasmEnv) Balance

func (w *WasmEnv) Balance(meter *lib.GasMeter) *big.Int

func (*WasmEnv) BlockHeader

func (w *WasmEnv) BlockHeader(meter *lib.GasMeter, height uint64) []byte

func (*WasmEnv) BlockNumber

func (w *WasmEnv) BlockNumber(meter *lib.GasMeter) uint64

func (*WasmEnv) BlockSeed

func (w *WasmEnv) BlockSeed(meter *lib.GasMeter) []byte

func (*WasmEnv) BlockTimestamp

func (w *WasmEnv) BlockTimestamp(meter *lib.GasMeter) int64

func (*WasmEnv) Burn

func (w *WasmEnv) Burn(meter *lib.GasMeter, amount *big.Int) error

func (*WasmEnv) Caller

func (w *WasmEnv) Caller(meter *lib.GasMeter) lib.Address

func (*WasmEnv) CodeHash

func (w *WasmEnv) CodeHash(meter *lib.GasMeter) []byte

func (*WasmEnv) Commit

func (w *WasmEnv) Commit()

func (*WasmEnv) ContractAddr

func (w *WasmEnv) ContractAddr(meter *lib.GasMeter, code []byte, args []byte, nonce []byte) lib.Address

func (*WasmEnv) ContractAddrByHash

func (w *WasmEnv) ContractAddrByHash(meter *lib.GasMeter, hash []byte, args []byte, nonce []byte) lib.Address

func (*WasmEnv) ContractAddress

func (w *WasmEnv) ContractAddress(meter *lib.GasMeter) lib.Address

func (*WasmEnv) ContractCodeHash

func (w *WasmEnv) ContractCodeHash(addr lib.Address) *[]byte

func (*WasmEnv) CreateSubEnv

func (w *WasmEnv) CreateSubEnv(contract lib.Address, method string, payAmount *big.Int, isDeploy bool) (lib.HostEnv, error)

func (*WasmEnv) Deploy

func (w *WasmEnv) Deploy(code []byte)

func (*WasmEnv) Ecrecover

func (w *WasmEnv) Ecrecover(meter *lib.GasMeter, data []byte, signature []byte) []byte

func (*WasmEnv) Epoch

func (w *WasmEnv) Epoch(meter *lib.GasMeter) uint16

func (*WasmEnv) Event

func (w *WasmEnv) Event(meter *lib.GasMeter, name string, args ...[]byte)

func (*WasmEnv) GetCode

func (w *WasmEnv) GetCode(addr lib.Address) []byte

func (*WasmEnv) GetStorage

func (w *WasmEnv) GetStorage(meter *lib.GasMeter, key []byte) []byte

func (*WasmEnv) GlobalState

func (w *WasmEnv) GlobalState(meter *lib.GasMeter) []byte

func (*WasmEnv) Identity

func (w *WasmEnv) Identity(meter *lib.GasMeter, address lib.Address) []byte

func (*WasmEnv) InternalCommit

func (w *WasmEnv) InternalCommit() []*types.TxEvent

func (*WasmEnv) IsDebug

func (w *WasmEnv) IsDebug() bool

func (*WasmEnv) Keccak256

func (w *WasmEnv) Keccak256(meter *lib.GasMeter, data []byte) []byte

func (*WasmEnv) MinFeePerGas

func (w *WasmEnv) MinFeePerGas(meter *lib.GasMeter) *big.Int

func (*WasmEnv) NetworkSize

func (w *WasmEnv) NetworkSize(meter *lib.GasMeter) uint64

func (*WasmEnv) OriginalCaller

func (w *WasmEnv) OriginalCaller(meter *lib.GasMeter) lib.Address

func (*WasmEnv) OwnCode

func (w *WasmEnv) OwnCode(meter *lib.GasMeter) []byte

func (*WasmEnv) PayAmount

func (w *WasmEnv) PayAmount(meter *lib.GasMeter) *big.Int

func (*WasmEnv) ReadContractData

func (w *WasmEnv) ReadContractData(meter *lib.GasMeter, address lib.Address, key []byte) []byte

func (*WasmEnv) RemoveStorage

func (w *WasmEnv) RemoveStorage(meter *lib.GasMeter, key []byte)

func (*WasmEnv) SetStorage

func (w *WasmEnv) SetStorage(meter *lib.GasMeter, key []byte, value []byte)

func (*WasmEnv) SubBalance

func (w *WasmEnv) SubBalance(meter *lib.GasMeter, amount *big.Int) error

type WasmVM

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

func NewWasmVM

func NewWasmVM(appState *appstate.AppState, blockHeaderProvider BlockHeaderProvider, head *types.Header, isDebug bool) *WasmVM

func (*WasmVM) Run

func (vm *WasmVM) Run(tx *types.Transaction, wasmGasLimit uint64) *types.TxReceipt

Jump to

Keyboard shortcuts

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