erc20mintable

package
v0.0.0-...-b1d75aa Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MintableTokenInterface

type MintableTokenInterface interface {
	Mint(stub shim.ChaincodeStubInterface,
		args []string,
		getOwner func(shim.ChaincodeStubInterface) (string, error),
		getBalanceOf func(shim.ChaincodeStubInterface, []string) (*big.Int, error),
		getTotalSupply func(shim.ChaincodeStubInterface) (*big.Int, error),
	) error
}

MintableTokenInterface consists of Mint, this method should be very restricted

type Token

type Token struct{}

Token mintable implements MintableTokenInterface

func (*Token) Mint

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

Mint tokens, add to the `total supply` and `balance` of minter. This function call only be called by token owner.

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

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

* `getOwner` - specifies the function of getting the current owner of token.

* `getBalanceOf` - specifies the function of getting the initial balance of minter.

* `getTotalSupply` - specifies the function of getting the current total supply of tokens.

Jump to

Keyboard shortcuts

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