erc20burnable

package
v0.0.0-...-d8468af Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BurnableTokenInterface

type BurnableTokenInterface interface {
	Burn(stub shim.ChaincodeStubInterface,
		args []string,
		getTotalSupply func(stub shim.ChaincodeStubInterface) (*big.Int, error),
		getBalanceOf func(stub shim.ChaincodeStubInterface, args []string) (*big.Int, error),
	) error

	BurnFrom(stub shim.ChaincodeStubInterface,
		args []string,
		getAllowance func(stub shim.ChaincodeStubInterface, args []string) (*big.Int, error),
		getTotalSupply func(stub shim.ChaincodeStubInterface) (*big.Int, error),
		getBalanceOf func(stub shim.ChaincodeStubInterface, args []string) (*big.Int, error),
	) error
}

BurnableTokenInterface consists of Burn & BurnFrom

type Token

type Token struct{}

Token burnable implementation of BurnableTokenInterface

func (*Token) Burn

func (t *Token) Burn(stub shim.ChaincodeStubInterface,
	args []string,
	getTotalSupply func(stub shim.ChaincodeStubInterface) (*big.Int, error),
	getBalanceOf func(stub shim.ChaincodeStubInterface, args []string) (*big.Int, error),
) error

Burn destroys an amount of tokens of the invoking identity, and total supply.

* `args[0]` - the amount that will be burnt

func (*Token) BurnFrom

func (t *Token) BurnFrom(stub shim.ChaincodeStubInterface,
	args []string,
	getAllowance func(stub shim.ChaincodeStubInterface, args []string) (*big.Int, error),
	getTotalSupply func(stub shim.ChaincodeStubInterface) (*big.Int, error),
	getBalanceOf func(stub shim.ChaincodeStubInterface, args []string) (*big.Int, error),
) error

BurnFrom burns a specific amount of tokens from the target identity and total supply, the chaincode invoker must have sufficient allowance from burnee.

* `args[0]` - the ID of burnee.

* `args[1]` - the burn amount.

Jump to

Keyboard shortcuts

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