erc20token

package
v0.76.8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Manually compile and create Go-Bindings

  1. Select main Solidity file (e.g. TokenBase.sol)
  2. Check which version of Solidity to use (e.g. 0.8.16)
  3. Generate ABI, compile and generate Go bindings
  4. Store: TokenBase.abi, TokenBase.bin, TokenBase.go only.

Generate ABI and compile

docker run -v "$(pwd)":/sources -w /sources \
    ethereum/solc:0.8.16 \
        --abi \
        --bin \
        --overwrite \
        --optimize --optimize-runs 200 \
         -o . \
        TokenBase.sol

Generate Go Bindings

docker run -v "$(pwd)":/sources -w /sources --pull always \
    ethereum/client-go:alltools-latest \
        abigen \
        --abi=TokenBase.abi \
        --bin=TokenBase.bin \
        --pkg=TokenBase \
        --out=TokenBase.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Common added in v0.76.8

type Common interface {
	Name(opts *bind.CallOpts) (string, error)
	Symbol(opts *bind.CallOpts) (string, error)
	Decimals(opts *bind.CallOpts) (uint8, error)
}

type ERC20Token

type ERC20Token struct {
	Standard
	Common
	Testing
	Address common.Address
	// contains filtered or unexported fields
}

func NewERC20Token

func NewERC20Token(ethClient *ethclient.Client, hexAddress string) (*ERC20Token, error)

func (*ERC20Token) Allowance added in v0.76.8

func (t *ERC20Token) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error)

func (*ERC20Token) Approve added in v0.76.8

func (t *ERC20Token) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error)

func (*ERC20Token) BalanceOf added in v0.76.8

func (t *ERC20Token) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error)

func (*ERC20Token) IncreaseAllowance added in v0.76.8

func (t *ERC20Token) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error)

func (*ERC20Token) Mint

func (t *ERC20Token) Mint(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error)

func (*ERC20Token) TotalSupply added in v0.76.8

func (t *ERC20Token) TotalSupply(opts *bind.CallOpts) (*big.Int, error)

func (*ERC20Token) Transfer added in v0.76.8

func (t *ERC20Token) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error)

func (*ERC20Token) TransferFrom added in v0.76.8

func (t *ERC20Token) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error)

type Standard added in v0.76.8

type Standard interface {
	BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error)
	TotalSupply(opts *bind.CallOpts) (*big.Int, error)
	Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error)
	Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error)
	TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error)
	Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error)
	IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error)
}

type Testing added in v0.76.8

type Testing interface {
	Faucet(opts *bind.TransactOpts) (*types.Transaction, error)
	Mint(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error)
	SetBurnEnabled(opts *bind.TransactOpts, burnEnabled_ bool) (*types.Transaction, error)
	BurnEnabled(opts *bind.CallOpts) (bool, error)
	SetFaucetAmount(opts *bind.TransactOpts, faucetAmount_ *big.Int) (*types.Transaction, error)
	SetFaucetCallLimit(opts *bind.TransactOpts, faucetCallLimit_ *big.Int) (*types.Transaction, error)
	FaucetCallLimit(opts *bind.CallOpts) (*big.Int, error)
	FaucetAmount(opts *bind.CallOpts) (*big.Int, error)

	GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error)
	MINTERROLE(opts *bind.CallOpts) ([32]byte, error)
	GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error)
	RenounceRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error)
	RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error)
	HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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