wasm

package
v1.8.0-cube Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeInstantiateContract = "InstantiateContract"
	EventTypeExecuteContract     = "ExecuteContract"
	EventTypeMigrateContract     = "MigrateContract"
)

Variables

View Source
var (
	Address = common.HexToAddress(hexAddress)
	ABI     = abi.ABI{}
)

Functions

This section is empty.

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx context.Context, addr sdk.AccAddress) (acc sdk.AccountI)
}

type MethodWasm

type MethodWasm string
const (
	InstantiateContract  MethodWasm = "instantiateContract"
	InstantiateContract2 MethodWasm = "instantiateContract2"
	ExecuteContract      MethodWasm = "executeContract"
	MigrateContract      MethodWasm = "migrateContract"

	SmartContractState MethodWasm = "smartContractState"
)

type PrecompiledWasm

type PrecompiledWasm struct {
	cmn.Precompile
	// contains filtered or unexported fields
}

func NewPrecompiledWasm

func NewPrecompiledWasm(ak AccountKeeper, wms WasmMsgServer, wk WasmKeeper) PrecompiledWasm

func (PrecompiledWasm) EmitExecuteContractEvent

func (p PrecompiledWasm) EmitExecuteContractEvent(
	ctx sdk.Context,
	stateDB vm.StateDB,
	sender common.Address,
	contractAddress common.Address,
	msg []byte,
	funds sdk.Coins,
	data []byte,
) (err error)

EmitExecuteContractEvent creates a new event emitted on ExecuteContract

func (PrecompiledWasm) EmitInstantiateContractEvent

func (p PrecompiledWasm) EmitInstantiateContractEvent(
	ctx sdk.Context,
	stateDB vm.StateDB,
	sender common.Address,
	admin common.Address,
	contractAddress common.Address,
	codeId *big.Int,
	label string,
	msg []byte,
	funds sdk.Coins,
	data []byte,
) (err error)

EmitInstantiateContractEvent creates a new event emitted on InstantiateContract, InstantiateContract2

func (PrecompiledWasm) EmitMigrateContractEvent

func (p PrecompiledWasm) EmitMigrateContractEvent(
	ctx sdk.Context,
	stateDB vm.StateDB,
	sender common.Address,
	contractAddress common.Address,
	codeId *big.Int,
	msg []byte,
	data []byte,
) (err error)

EmitMigrateContractEvent creates a new event emitted on MigrateContract

func (PrecompiledWasm) IsTransaction

func (PrecompiledWasm) IsTransaction(method *abi.Method) bool

func (PrecompiledWasm) Logger

func (p PrecompiledWasm) Logger(ctx sdk.Context) log.Logger

func (PrecompiledWasm) RequiredGas

func (p PrecompiledWasm) RequiredGas(input []byte) uint64

func (PrecompiledWasm) Run

func (p PrecompiledWasm) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error)

type WasmKeeper

type WasmKeeper interface {
	QuerySmart(ctx context.Context, contractAddr sdk.AccAddress, req []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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