token

package
v0.0.0-...-fe383f3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUsableAddress

func IsUsableAddress(addr []byte) bool

IsUsableAddress checks if the sender is either the correct NEO address or SC address

Types

type Token

type Token struct {
	// Token name
	Name string
	// Ticker symbol
	Symbol string
	// Amount of decimals
	Decimals int
	// Token owner address
	Owner []byte
	// TotalSupply Key for supply value
	TotalSupply int
	// Storage key for circulation value
	CirculationKey string
}

Token holds all token info

func (Token) BalanceOf

func (t Token) BalanceOf(ctx storage.Context, holder []byte) int

BalanceOf gets the token balance of a specific address

func (Token) CanTransfer

func (t Token) CanTransfer(ctx storage.Context, from []byte, to []byte, amount int) int

CanTransfer returns the amount it can transfer

func (Token) GetSupply

func (t Token) GetSupply(ctx storage.Context) int

GetSupply gets the token totalSupply value from VM storage

func (Token) Mint

func (t Token) Mint(ctx storage.Context, to interop.Hash160) bool

Mint supply of tokens

func (Token) MintContinual

func (t Token) MintContinual(ctx storage.Context, to interop.Hash160, amount int) bool

Mint supply of tokens

func (Token) Transfer

func (t Token) Transfer(ctx storage.Context, from, to interop.Hash160, amount int, data interface{}) bool

Transfer token from one user to another

Jump to

Keyboard shortcuts

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