erc20

package
v0.0.0-...-d48d2ef Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestABICompliance

func TestABICompliance(t *testing.T, cc *seth.CompiledContract)

TestABICompliance tests that the ABI for the contract matches the public interface of an ERC20 token, including constant functions and events.

func TestCompliance

func TestCompliance(t *Token)

TestERC20Compliance is a function that helps verify compliance with the ERC20 standard.

'token' should be the address of the token contract on the chain, and 'owner' should be the owner of the token contract. 'mint' should mint tokens to the given address in the given quantity

Types

type Token

type Token struct {
	*testing.T
	C       *tevm.Chain
	Addr    *seth.Address // address of the contract in the chain
	Owner   *seth.Address // if there is an owner, this address
	Mint    func(t *Token, addr *seth.Address, amt *seth.Int) error
	HasBurn bool // token has 'burn(uint256)' defined
}

func (*Token) Approve

func (t *Token) Approve(sender, to *seth.Address, amt *seth.Int) (bool, error)

func (*Token) BalanceOf

func (t *Token) BalanceOf(addr *seth.Address) *seth.Int

BalanceOf calls token.balanceOf(addr)

func (*Token) TotalSupply

func (t *Token) TotalSupply() *seth.Int

func (*Token) Transfer

func (t *Token) Transfer(sender, to *seth.Address, amt *seth.Int) (bool, error)

func (*Token) TransferFrom

func (t *Token) TransferFrom(sender, from, to *seth.Address, amt *seth.Int) (bool, error)

Jump to

Keyboard shortcuts

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