Documentation
¶
Index ¶
- Constants
- Variables
- type DelegatePrecompile
- type MethodWasm
- type PrecompiledWasm
- func (p PrecompiledWasm) EmitExecuteContractEvent(ctx sdk.Context, stateDB vm.StateDB, sender common.Address, ...) (err error)
- func (p PrecompiledWasm) EmitInstantiateContractEvent(ctx sdk.Context, stateDB vm.StateDB, sender common.Address, ...) (err error)
- func (p PrecompiledWasm) EmitMigrateContractEvent(ctx sdk.Context, stateDB vm.StateDB, sender common.Address, ...) (err error)
- func (p PrecompiledWasm) Execute(ctx sdk.Context, stateDB vm.StateDB, contract *vm.Contract, readOnly bool, ...) ([]byte, error)
- func (PrecompiledWasm) IsTransaction(method *abi.Method) bool
- func (p PrecompiledWasm) Logger(ctx sdk.Context) log.Logger
- func (p PrecompiledWasm) RequiredGas(input []byte) uint64
- func (p *PrecompiledWasm) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) (bz []byte, err error)
- func (p *PrecompiledWasm) RunDelegate(evm *vm.EVM, contract *vm.Contract, readonly bool) (bz []byte, err error)
- type WasmKeeper
- type WasmMsgServer
Constants ¶
const ( EventTypeInstantiateContract = "InstantiateContract" EventTypeExecuteContract = "ExecuteContract" EventTypeMigrateContract = "MigrateContract" )
Variables ¶
var ( Address = common.HexToAddress(hexAddress) DelegatecallAddress = common.HexToAddress(delegatecallHexAddress) ABI = abi.ABI{} )
Functions ¶
This section is empty.
Types ¶
type DelegatePrecompile ¶ added in v1.14.0
type DelegatePrecompile struct {
*PrecompiledWasm
}
DelegatePrecompile routes calls through Wasm delegate execution.
func NewDelegatePrecompile ¶ added in v1.14.0
func NewDelegatePrecompile(precompile *PrecompiledWasm) DelegatePrecompile
NewDelegatePrecompile shares the provided Wasm precompile for delegate execution.
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) IsTransaction ¶
func (PrecompiledWasm) IsTransaction(method *abi.Method) bool
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.
func (*PrecompiledWasm) RunDelegate ¶ added in v1.9.0
func (p *PrecompiledWasm) RunDelegate(evm *vm.EVM, contract *vm.Contract, readonly bool) (bz []byte, err error)
RunDelegate is the entry point for the delegatecall-only precompile.
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)
}
type WasmMsgServer ¶
type WasmMsgServer interface {
InstantiateContract(ctx context.Context, msg *wasmtypes.MsgInstantiateContract) (*wasmtypes.MsgInstantiateContractResponse, error)
InstantiateContract2(ctx context.Context, msg *wasmtypes.MsgInstantiateContract2) (*wasmtypes.MsgInstantiateContract2Response, error)
ExecuteContract(ctx context.Context, msg *wasmtypes.MsgExecuteContract) (*wasmtypes.MsgExecuteContractResponse, error)
MigrateContract(ctx context.Context, msg *wasmtypes.MsgMigrateContract) (*wasmtypes.MsgMigrateContractResponse, error)
}