Documentation ¶
Index ¶
- Variables
- func TokenAllowance(ctx context.Context, token common.Address, chainId chainid.ChainID, ...) (*big.Int, error)
- func TokenBalanceOf(ctx context.Context, token common.Address, chainId chainid.ChainID, ...) (*big.Int, error)
- func TokenName(ctx context.Context, token common.Address, chainId chainid.ChainID) (string, error)
- func TokenSymbol(ctx context.Context, token common.Address, chainId chainid.ChainID) (string, error)
- type ERC20
- func MustInit(instance *ERC20, err error) *ERC20
- func NewERC20(address common.Address, chainId chainid.ChainID) (*ERC20, error)
- func NewERC20Context(ctx context.Context, address common.Address, chainId chainid.ChainID) (*ERC20, error)
- func NewERC20WithRPC(address common.Address, chainId chainid.ChainID, rpc bind.ContractBackend) (*ERC20, error)
- func (e ERC20) Address() common.Address
- func (e ERC20) Allowance(ctx context.Context, owner, spender common.Address) (*big.Int, error)
- func (e *ERC20) Approve(ctx context.Context, opts *bind.TransactOpts, spender common.Address, ...) (txn *types.Transaction, err error)
- func (e ERC20) BalanceOf(ctx context.Context, owner common.Address) (*big.Int, error)
- func (e ERC20) ChainID() chainid.ChainID
- func (e ERC20) Decimals(ctx context.Context) (uint8, error)
- func (e ERC20) Name(ctx context.Context) (string, error)
- func (e ERC20) Symbol(ctx context.Context) (string, error)
- func (e ERC20) TotalSupply(ctx context.Context) (*big.Int, error)
- func (e *ERC20) Transfer(ctx context.Context, opts *bind.TransactOpts, to common.Address, ...) (txn *types.Transaction, err error)
- func (e *ERC20) TransferFrom(ctx context.Context, opts *bind.TransactOpts, from, to common.Address, ...) (txn *types.Transaction, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxUint256 *big.Int
MaxUint256 is the big.Int representation of 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
View Source
var NilTransactOptsError = fmt.Errorf("param transactOpts (*bind.TransactOpts) cannot be nil")
Functions ¶
func TokenAllowance ¶
func TokenBalanceOf ¶
Types ¶
type ERC20 ¶
type ERC20 struct {
// contains filtered or unexported fields
}
func NewERC20Context ¶
func NewERC20WithRPC ¶
func (*ERC20) Approve ¶
func (e *ERC20) Approve( ctx context.Context, opts *bind.TransactOpts, spender common.Address, amount *big.Int, ) (txn *types.Transaction, err error)
Approve wraps IERC20.Approve(), allowing `spender` to transfer `amount` of this ERC20 token from the `From` address found in `opts`. If `amount` is nil or zero, then it is set to the maximum possible amount (MaxUint256) which is essentially an "infinite" approval.
func (*ERC20) TransferFrom ¶
Click to show internal directories.
Click to hide internal directories.