nft

package
v0.97.2-pre Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package nft contains non-divisible non-fungible NEP11-compatible token implementation. This token can be minted with GAS transfer to contract address, it will hash some data (including data provided in transfer) and produce base64-encoded string that is your NFT. Since it's based on hashing and basically you own a hash it's HASHY.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BalanceOf

func BalanceOf(holder interop.Hash160) int

BalanceOf returns the number of tokens owned by specified address.

func Decimals

func Decimals() int

Decimals returns token decimals, this NFT is non-divisible, so it's 0.

func Destroy

func Destroy()

Destroy destroys the contract, only owner can do that.

func OnNEP17Payment

func OnNEP17Payment(from interop.Hash160, amount int, data interface{})

OnNEP17Payment mints tokens if at least 10 GAS is provided. You don't call this method directly, instead it's called by GAS contract when you transfer GAS from your address to the address of this NFT contract.

func OwnerOf

func OwnerOf(token []byte) interop.Hash160

OwnerOf returns owner of specified token.

func Properties added in v0.95.0

func Properties(id []byte) map[string]string

Properties returns properties of the given NFT.

func Symbol

func Symbol() string

Symbol returns token symbol, it's HASHY.

func Tokens added in v0.95.0

func Tokens() iterator.Iterator

Tokens returns an iterator that contains all of the tokens minted by the contract.

func TokensOf

func TokensOf(holder interop.Hash160) iterator.Iterator

TokensOf returns an iterator with all tokens held by specified address.

func TotalSupply

func TotalSupply() int

TotalSupply is a contract method that returns the number of tokens minted.

func Transfer

func Transfer(to interop.Hash160, token []byte, data interface{}) bool

Transfer token from its owner to another user, notice that it only has three parameters because token owner can be deduced from token ID itself.

func Update

func Update(nef, manifest []byte)

Update updates the contract, only owner can do that.

func Verify

func Verify() bool

Verify allows owner to manage contract's address, including earned GAS transfer from contract's address to somewhere else. It just checks for transaction to also be signed by contract owner, so contract's witness should be empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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