tokenregistry

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

smart contract code implements Token Registry. User can mint any number of new colored tokens to own address and in the same transaction can register the whole Supply of new tokens in the TokenRegistry. TokenRegistry contains metadata of the supply minted this way. It can be changed by the owner of the record Initially the owner is the minter. Owner can transfer ownership of the metadata record to another address

Index

Constants

View Source
const (
	RequestInitSC            = sctransaction.RequestCode(uint16(0)) // NOP
	RequestMintSupply        = sctransaction.RequestCode(uint16(1))
	RequestUpdateMetadata    = sctransaction.RequestCode(uint16(2))
	RequestTransferOwnership = sctransaction.RequestCode(uint16(3))

	// state vars
	VarStateTheRegistry = "tr"
	VarStateListColors  = "lc" // for testing only

	// request vars
	VarReqDescription         = "dscr"
	VarReqUserDefinedMetadata = "ud"
)
View Source
const ProgramHash = "8h2RGcbsUgKckh9rZ4VUF75NUfxP4bj1FC66oSF9us6p"

program hash is an ID of the smart contract program

Variables

This section is empty.

Functions

func GetProcessor

func GetProcessor() vmtypes.Processor

Point to link statically with the Wasp

Types

type TokenMetadata

type TokenMetadata struct {
	Supply      int64
	MintedBy    address.Address // originator
	Owner       address.Address // who can update metadata
	Created     int64           // when created record
	Updated     int64           // when recordt last updated
	Description string          // any text
	UserDefined []byte          // any other data (marshalled json etc)
}

TokenMetadata is a structure for one supply

func (*TokenMetadata) Read

func (tm *TokenMetadata) Read(r io.Reader) error

func (*TokenMetadata) Write

func (tm *TokenMetadata) Write(w io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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