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 ¶
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 ¶
func (e *IERC20BurnableInteractions) Burn(qty *big.Int) (*types.Transaction, error)
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.