Documentation ¶
Index ¶
- func Allowance(from, to []byte) interface{}
- func Approve(owner, spender []byte, amount int) bool
- func AvailableAmount() int
- func BalanceOf(holder interop.Hash160) int
- func Decimals() int
- func InCirculation() int
- func Mint(to []byte) bool
- func Symbol() string
- func TotalSupply() int
- func Transfer(from, to interop.Hash160, amount int, _ interface{}) bool
- func TransferFrom(from, to []byte, amount int) bool
- type TokenConfig
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
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 InCirculation ¶ added in v0.91.0
func InCirculation() int
InCirculation returns the amount of total tokens that are in circulation.
func TotalSupply ¶ added in v0.91.0
func TotalSupply() int
TotalSupply returns the token total supply value
func Transfer ¶ added in v0.91.0
Transfer transfers specified amount of token from one user to another
func TransferFrom ¶ added in v0.91.0
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.