precompile_util

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 7 Imported by: 0 modules, 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 (
	ErrDifferentOrigin = "tx origin address %s does not match the sender address %s"
)

Variables

This section is empty.

Functions

func ConvertToStringArray

func ConvertToStringArray(arg interface{}, argPosition int) ([]string, error)

ConvertToStringArray converts an interface value to a string array. It handles both direct []string types and []interface{} that contains strings. argPosition is used in error messages to identify which argument had the issue.

func EmitEventWithArguments

func EmitEventWithArguments(
	ctx sdk.Context,
	p cmn.Precompile,
	stateDB vm.StateDB,
	eventType string,
	senderAddress common.Address,
	packedArguments ...interface{},
) error

EmitEventWithArguments creates a new event with the specified event type, sender address, and additional arguments. It properly handles indexed topics and non-indexed data.

func ExecuteMsg

func ExecuteMsg(
	ctx sdk.Context,
	origin common.Address,
	contract *vm.Contract,
	_ vm.StateDB,
	method *abi.Method,
	args []interface{},
	msgCreator func([]interface{}) (interface{}, common.Address, error),
	msgHandler func(ctx sdk.Context, msg interface{}) error,
	errorPrefix string,
) ([]byte, error)

ExecuteMsg is a helper function that handles the common pattern of executing a message

func ParseAddressFrom

func ParseAddressFrom(args []interface{}, argIndex int) (common.Address, error)

func ParseStringFrom

func ParseStringFrom(args []interface{}, argIndex int) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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