contracts

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: GPL-3.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Erc20AbiString string = `` /* 719-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Erc20Contract

type Erc20Contract struct {
	// contains filtered or unexported fields
}

Simple binding for ERC20 tokens

func NewErc20Contract

func NewErc20Contract(address common.Address, client eth.IExecutionClient, queryMgr *eth.QueryManager, txMgr *eth.TransactionManager, opts *bind.CallOpts) (*Erc20Contract, error)

Creates a contract wrapper for the ERC20 at the given address

func (*Erc20Contract) Address

func (c *Erc20Contract) Address() common.Address

The address of the token

func (*Erc20Contract) BalanceOf

func (c *Erc20Contract) BalanceOf(mc *batch.MultiCaller, balance_Out **big.Int, address common.Address)

Get the token balance for an address

func (*Erc20Contract) Decimals

func (c *Erc20Contract) Decimals() uint8

Get the number of decimal places the token uses

func (*Erc20Contract) Name

func (c *Erc20Contract) Name() string

Get the full name of the token

func (*Erc20Contract) Symbol

func (c *Erc20Contract) Symbol() string

Get the token tracker symbol

func (*Erc20Contract) Transfer

func (c *Erc20Contract) Transfer(to common.Address, amount *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)

Get info for transferring the ERC20 to another address

type IErc20Token

type IErc20Token interface {
	// The address of the token
	Address() common.Address

	// Get the full name of the token
	Name() string

	// Get the token tracker symbol
	Symbol() string

	// Get the number of decimal places the token uses
	Decimals() uint8

	// The token balance of the given address
	BalanceOf(mc *batch.MultiCaller, balance_Out **big.Int, address common.Address)

	// Transfer tokens to a different address
	Transfer(to common.Address, amount *big.Int, opts *bind.TransactOpts) (*eth.TransactionInfo, error)
}

Simple binding for ERC20 tokens

Jump to

Keyboard shortcuts

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