wasm

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 MethodWasm

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

	Balance            MethodWasm = "balance"
	SmartContractState MethodWasm = "smartContractState"
)

type PrecompiledWasm

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

func NewPrecompiledWasm

func NewPrecompiledWasm(wms WasmMsgServer, wk WasmKeeper, bk pbank.BankKeeper) *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 uint64,
	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 uint64,
	msg []byte,
	data []byte,
) (err error)

EmitMigrateContractEvent creates a new event emitted on MigrateContract

func (PrecompiledWasm) Execute added in v1.9.0

func (p PrecompiledWasm) Execute(ctx sdk.Context, stateDB vm.StateDB, contract *vm.Contract, readOnly bool, caller common.Address) ([]byte, error)

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)

Run is the entry point for the basic call.

type WasmKeeper

type WasmKeeper interface {
	ResolveContractAddress(ctx context.Context, evmAddr sdk.AccAddress) (sdk.AccAddress, error)
	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