nep17

package
v0.94.1-pre Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 6 Imported by: 0

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
	// Total tokens * multiplier
	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 initial 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