nep5

package
v0.78.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 4 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, hodler []byte) interface{}

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) interface{}

GetSupply gets the token totalSupply value from VM storage

func (Token) Mint added in v0.75.0

func (t Token) Mint(ctx storage.Context, to []byte) bool

Mint initial supply of tokens.

func (Token) Transfer

func (t Token) Transfer(ctx storage.Context, from []byte, to []byte, amount int) 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