tokensale

package
v0.97.4-pre Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allowance added in v0.91.0

func Allowance(from, to []byte) interface{}

Allowance returns allowance value for specified sender and receiver.

func Approve added in v0.91.0

func Approve(owner, spender []byte, amount int) bool

Approve stores token transfer data if the owner has enough token to send.

func AvailableAmount added in v0.91.0

func AvailableAmount() int

AvailableAmount returns the total amount of available tokens left to be distributed.

func BalanceOf added in v0.91.0

func BalanceOf(holder interop.Hash160) int

BalanceOf returns the amount of token on the specified address

func Decimals added in v0.91.0

func Decimals() int

Decimals returns the token decimals

func InCirculation added in v0.91.0

func InCirculation() int

InCirculation returns the amount of total tokens that are in circulation.

func Mint added in v0.92.0

func Mint(to []byte) bool

Mint initial supply of tokens

func Symbol added in v0.91.0

func Symbol() string

Symbol returns the token symbol

func TotalSupply added in v0.91.0

func TotalSupply() int

TotalSupply returns the token total supply value

func Transfer added in v0.91.0

func Transfer(from, to interop.Hash160, amount int, _ interface{}) bool

Transfer transfers specified amount of token from one user to another

func TransferFrom added in v0.91.0

func TransferFrom(from, to []byte, amount int) bool

TransferFrom transfers specified amount of token from one user to another. It differs from Transfer in that it use allowance value to store the amount of token available to transfer.

Types

type TokenConfig

type TokenConfig struct {
	// Name of the token.
	Name string
	// 3 letter abbreviation of the token.
	Symbol string
	// How decimals this token will have.
	Decimals int
	// Address of the token owner. This is the Uint160 hash.
	Owner []byte
	// The total amount of tokens created. Notice that we need to multiply the
	// amount by 100000000. (10^8)
	TotalSupply int
	// Initial amount is number of tokens that are available for the token sale.
	InitialAmount int
	// How many NEO will be worth 1 token. For example:
	// Lets say 1 euro per token, where 1 NEO is 60 euro. This means buyers
	// will get (60 * 10^8) tokens for 1 NEO.
	AmountPerNEO int
	// How many Gas will be worth 1 token. This is the same calculation as
	// for the AmountPerNEO, except Gas price will have a different value.
	AmountPerGas int
	// The maximum amount you can mint in the limited round. For example:
	// 500 NEO/buyer * 60 tokens/NEO * 10^8
	MaxExchangeLimitRound int
	// When to start the token sale.
	SaleStart int
	// When to end the initial limited round if there is one. For example:
	// SaleStart + 10000
	LimitRoundEnd int
	// The prefix used to store how many tokens there are in circulation.
	CirculationKey []byte
	// The prefix used to store how many tokens there are in the limited round.
	LimitRoundKey []byte
	// The prefix used to store the addresses that are registered with KYC.
	KYCKey []byte
}

TokenConfig holds information about the token we want to use for the sale.

Jump to

Keyboard shortcuts

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