burnable

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package burnable provides functions to interact with ERC20 burnable properties.

Package burnable provides functions to interact with ERC20 burnable properties.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseError

func ParseError(rawErr any) error

ParseError parses raw contract errors into human-readable error messages for burnable ERC20 operations.

Types

type ERC20BurnableSignatures

type ERC20BurnableSignatures string

ERC20BurnableSignatures represents function signatures for ERC20 burnable token operations

const (
	// Burn represents the burn function signature for burning tokens
	Burn ERC20BurnableSignatures = "burn(uint256)"
	// BurnFrom represents the burnFrom function signature for burning tokens from another address
	BurnFrom ERC20BurnableSignatures = "burnFrom(address,uint256)"
)

func (ERC20BurnableSignatures) GetHex

func (s ERC20BurnableSignatures) GetHex() string

GetHex returns the hex representation of the function signature

func (ERC20BurnableSignatures) GetSelector

func (s ERC20BurnableSignatures) GetSelector() []byte

GetSelector returns the Keccak256 hash selector for the ERC20 burnable signature

func (ERC20BurnableSignatures) String

func (s ERC20BurnableSignatures) String() string

type IERC20BurnableInteractions

type IERC20BurnableInteractions struct {
	*erc20.Interactions
	// contains filtered or unexported fields
}

IERC20BurnableInteractions wraps interactions with an IERC20Burnable contract, extending basic ERC20 interactions.

func NewIERC20Burnable

func NewIERC20Burnable(
	baseIERC20 *erc20.Interactions,
	signatures []ERC20BurnableSignatures,
) (*IERC20BurnableInteractions, error)

NewIERC20Burnable creates a new enumerable interaction instance using the provided base NFT interactions.

func (*IERC20BurnableInteractions) Burn

Burn destroys the specified token from the owner's balance.

func (*IERC20BurnableInteractions) BurnFrom

func (e *IERC20BurnableInteractions) BurnFrom(from common.Address, qty *big.Int) (*types.Transaction, error)

BurnFrom is a wrapper for Burn that calls the token's burnFrom function instead.

Jump to

Keyboard shortcuts

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