tokensale

package
v0.90.0-pre Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(operation string, args []interface{}) interface{}

Main smart contract entry point.

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.

func NewTokenConfig

func NewTokenConfig() TokenConfig

NewTokenConfig returns the initialized TokenConfig.

func (TokenConfig) AddToCirculation

func (t TokenConfig) AddToCirculation(ctx storage.Context, amount int) bool

AddToCirculation sets the given amount as "in circulation" in the storage.

func (TokenConfig) InCirculation

func (t TokenConfig) InCirculation(ctx storage.Context) int

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

func (TokenConfig) TokenSaleAvailableAmount

func (t TokenConfig) TokenSaleAvailableAmount(ctx storage.Context) int

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

Jump to

Keyboard shortcuts

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