abiutil

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package abiutil contains helpers for parsing contract metadata

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSelectorByName

func GetSelectorByName(name string, metadata *bind.MetaData) ([4]byte, error)

GetSelectorByName takes a function name and a pointer to a `bind.MetaData` object, searches for the first function testContract in the `Sigs` map of the metadata object that matches the function name, and returns the first four bytes of the keccak256 hash of the function testContract as a `[4]byte` array.

func GetStringSelectorByName

func GetStringSelectorByName(name string, metadata *bind.MetaData) (string, error)

GetStringSelectorByName takes a function name and a pointer to a `bind.MetaData` object, searches for the first function testContract in the `Sigs` map of the metadata object that matches the function name, and returns the first four bytes of the keccak256 hash of the function testContract as a string.

func MustGetSelectorByName

func MustGetSelectorByName(name string, metadata *bind.MetaData) [4]byte

MustGetSelectorByName is a wrapper around `GetSelectorByName` that panics if an error is returned.

func UnpackInputData

func UnpackInputData(input []byte, metadata *bind.MetaData) ([]interface{}, error)

UnpackInputData takes a function name and a pointer to a `bind.MetaData` object,.

func UnpackInputDataToInterface

func UnpackInputDataToInterface(v interface{}, input []byte, metadata *bind.MetaData) error

UnpackInputDataToInterface unpacks input data to interface.

Types

This section is empty.

Directories

Path Synopsis
Package internal contains test data for the abi package
Package internal contains test data for the abi package

Jump to

Keyboard shortcuts

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