evm

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxInt256 represents the maximum value for int256 (2^255 - 1)
	MaxInt256 *big.Int

	// MaxUint256 represents the maximum value for uint256 (2^256 - 1)
	MaxUint256 *big.Int
)
View Source
var (
	ERC20ABI abi.ABI
)

Functions

func DecodeERC20ApproveInput

func DecodeERC20ApproveInput(input []byte) (spender string, amount *big.Int, err error)

func EncodeERC20ApproveInput

func EncodeERC20ApproveInput(spender string, amount *big.Int) ([]byte, error)

func FormatETH

func FormatETH(amount decimal.Decimal) *big.Int

func FormatUnits

func FormatUnits(amount decimal.Decimal, decimals uint8) *big.Int

func GetAddress

func GetAddress(prv *ecdsa.PrivateKey) (common.Address, error)

func GetBalance

func GetBalance(ctx context.Context, ethClient *ethclient.Client, ownerAddress string) (*big.Int, error)

func GetTokenAllowance

func GetTokenAllowance(ctx context.Context, ethClient *ethclient.Client, tokenAddress, ownerAddress, spenderAddress string) (*big.Int, error)

func GetTokenBalance

func GetTokenBalance(ctx context.Context, ethClient *ethclient.Client, tokenAddress, ownerAddress string) (*big.Int, error)

func GetTokenBalanceChanges

func GetTokenBalanceChanges(ctx context.Context, ethClient *ethclient.Client, receipt *types.Receipt, ownerAddress string) (map[common.Address]*big.Int, error)

func ParseETH

func ParseETH(value *big.Int) decimal.Decimal

func ParseUnits

func ParseUnits(value *big.Int, decimals uint8) decimal.Decimal

Types

type Metadata

type Metadata struct {
	Name     string
	Symbol   string
	Decimals uint8
}

func GetTokenMeta

func GetTokenMeta(ctx context.Context, ethClient *ethclient.Client, tokenAddress string) (*Metadata, error)

Jump to

Keyboard shortcuts

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