nep5

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 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) 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