tokenregistry

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0, BSD-2-Clause, Apache-2.0, + 1 more Imports: 1 Imported by: 0

README

tokenregistry

Sample smart contract

Mints and registers colored tokens in a token registry.

Documentation

Index

Constants

View Source
const (
	ScName  = "tokenregistry"
	HScName = wasmlib.ScHname(0xe1ba0c78)
)
View Source
const (
	ParamColor       = wasmlib.Key("color")
	ParamDescription = wasmlib.Key("description")
	ParamUserDefined = wasmlib.Key("userDefined")
)
View Source
const (
	StateColorList = wasmlib.Key("colorList")
	StateRegistry  = wasmlib.Key("registry")
)
View Source
const (
	FuncMintSupply        = "mintSupply"
	FuncTransferOwnership = "transferOwnership"
	FuncUpdateMetadata    = "updateMetadata"
	ViewGetInfo           = "getInfo"
)
View Source
const (
	HFuncMintSupply        = wasmlib.ScHname(0x564349a7)
	HFuncTransferOwnership = wasmlib.ScHname(0xbb9eb5af)
	HFuncUpdateMetadata    = wasmlib.ScHname(0xa26b23b6)
	HViewGetInfo           = wasmlib.ScHname(0xcfedba5f)
)
View Source
const (
	IdxParamColor       = 0
	IdxParamDescription = 1
	IdxParamUserDefined = 2
	IdxStateColorList   = 3
	IdxStateRegistry    = 4
)

Variables

This section is empty.

Functions

func OnLoad

func OnLoad()

Types

type ArrayOfImmutableColor

type ArrayOfImmutableColor struct {
	// contains filtered or unexported fields
}

func (ArrayOfImmutableColor) GetColor

func (ArrayOfImmutableColor) Length

func (a ArrayOfImmutableColor) Length() int32

type ArrayOfMutableColor

type ArrayOfMutableColor struct {
	// contains filtered or unexported fields
}

func (ArrayOfMutableColor) Clear

func (a ArrayOfMutableColor) Clear()

func (ArrayOfMutableColor) GetColor

func (a ArrayOfMutableColor) GetColor(index int32) wasmlib.ScMutableColor

func (ArrayOfMutableColor) Length

func (a ArrayOfMutableColor) Length() int32

type Funcs

type Funcs struct{}
var ScFuncs Funcs

func (Funcs) GetInfo

func (sc Funcs) GetInfo(ctx wasmlib.ScViewCallContext) *GetInfoCall

func (Funcs) MintSupply

func (sc Funcs) MintSupply(ctx wasmlib.ScFuncCallContext) *MintSupplyCall

func (Funcs) TransferOwnership

func (sc Funcs) TransferOwnership(ctx wasmlib.ScFuncCallContext) *TransferOwnershipCall

func (Funcs) UpdateMetadata

func (sc Funcs) UpdateMetadata(ctx wasmlib.ScFuncCallContext) *UpdateMetadataCall

type GetInfoCall

type GetInfoCall struct {
	Func   *wasmlib.ScView
	Params MutableGetInfoParams
}

type GetInfoContext

type GetInfoContext struct {
	Params ImmutableGetInfoParams
	State  ImmutableTokenRegistryState
}

type ImmutableGetInfoParams

type ImmutableGetInfoParams struct {
	// contains filtered or unexported fields
}

func (ImmutableGetInfoParams) Color

type ImmutableMintSupplyParams

type ImmutableMintSupplyParams struct {
	// contains filtered or unexported fields
}

func (ImmutableMintSupplyParams) Description

func (ImmutableMintSupplyParams) UserDefined

type ImmutableToken

type ImmutableToken struct {
	// contains filtered or unexported fields
}

func (ImmutableToken) Exists

func (o ImmutableToken) Exists() bool

func (ImmutableToken) Value

func (o ImmutableToken) Value() *Token

type ImmutableTokenRegistryState

type ImmutableTokenRegistryState struct {
	// contains filtered or unexported fields
}

func (ImmutableTokenRegistryState) ColorList

func (ImmutableTokenRegistryState) Registry

type ImmutableTransferOwnershipParams

type ImmutableTransferOwnershipParams struct {
	// contains filtered or unexported fields
}

func (ImmutableTransferOwnershipParams) Color

type ImmutableUpdateMetadataParams

type ImmutableUpdateMetadataParams struct {
	// contains filtered or unexported fields
}

func (ImmutableUpdateMetadataParams) Color

type MapColorToImmutableToken

type MapColorToImmutableToken struct {
	// contains filtered or unexported fields
}

func (MapColorToImmutableToken) GetToken

type MapColorToMutableToken

type MapColorToMutableToken struct {
	// contains filtered or unexported fields
}

func (MapColorToMutableToken) Clear

func (m MapColorToMutableToken) Clear()

func (MapColorToMutableToken) GetToken

type MintSupplyCall

type MintSupplyCall struct {
	Func   *wasmlib.ScFunc
	Params MutableMintSupplyParams
}

type MintSupplyContext

type MintSupplyContext struct {
	Params ImmutableMintSupplyParams
	State  MutableTokenRegistryState
}

type MutableGetInfoParams

type MutableGetInfoParams struct {
	// contains filtered or unexported fields
}

func (MutableGetInfoParams) Color

type MutableMintSupplyParams

type MutableMintSupplyParams struct {
	// contains filtered or unexported fields
}

func (MutableMintSupplyParams) Description

func (MutableMintSupplyParams) UserDefined

type MutableToken

type MutableToken struct {
	// contains filtered or unexported fields
}

func (MutableToken) Exists

func (o MutableToken) Exists() bool

func (MutableToken) SetValue

func (o MutableToken) SetValue(value *Token)

func (MutableToken) Value

func (o MutableToken) Value() *Token

type MutableTokenRegistryState

type MutableTokenRegistryState struct {
	// contains filtered or unexported fields
}

func (MutableTokenRegistryState) ColorList

func (MutableTokenRegistryState) Registry

type MutableTransferOwnershipParams

type MutableTransferOwnershipParams struct {
	// contains filtered or unexported fields
}

func (MutableTransferOwnershipParams) Color

type MutableUpdateMetadataParams

type MutableUpdateMetadataParams struct {
	// contains filtered or unexported fields
}

func (MutableUpdateMetadataParams) Color

type Token

type Token struct {
	Created     int64             // creation timestamp
	Description string            // description what minted token represents
	MintedBy    wasmlib.ScAgentID // original minter
	Owner       wasmlib.ScAgentID // current owner
	Supply      int64             // amount of tokens originally minted
	Updated     int64             // last update timestamp
	UserDefined string            // any user defined text
}

func NewTokenFromBytes

func NewTokenFromBytes(bytes []byte) *Token

func (*Token) Bytes

func (o *Token) Bytes() []byte

type TransferOwnershipCall

type TransferOwnershipCall struct {
	Func   *wasmlib.ScFunc
	Params MutableTransferOwnershipParams
}

type TransferOwnershipContext

type TransferOwnershipContext struct {
	Params ImmutableTransferOwnershipParams
	State  MutableTokenRegistryState
}

type UpdateMetadataCall

type UpdateMetadataCall struct {
	Func   *wasmlib.ScFunc
	Params MutableUpdateMetadataParams
}

type UpdateMetadataContext

type UpdateMetadataContext struct {
	Params ImmutableUpdateMetadataParams
	State  MutableTokenRegistryState
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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