Interface for registering and managing values

Functions

valueRegister

Registers a new value token

function valueRegister(address code, bytes32 data, TokenStandard std, uint8 decimals, string memory symbol)
    external
    returns (uint64 id, Descriptor memory desc);

Parameters

NameTypeDescription
codeaddressToken contract address
databytes32Hash of the underlying matter or metadata
stdTokenStandardToken standard (e.g. ERC20)
decimalsuint8Token’s decimal precision
symbolstringDisplay symbol (max 30 characters)

Returns

NameTypeDescription
iduint64New value ID
descDescriptorDescriptor after registration

valueUpdate

Updates the data hash of an existing value

function valueUpdate(uint64 id, bytes32 data) external returns (Descriptor memory desc);

Parameters

NameTypeDescription
iduint64Value ID
databytes32New data hash

Returns

NameTypeDescription
descDescriptorUpdated descriptor (revision bumped)

valueUpdate

Updates the data hash and symbol of an existing value

function valueUpdate(uint64 id, bytes32 data, string memory symbol) external returns (Descriptor memory desc);

Parameters

NameTypeDescription
iduint64Value ID
databytes32New data hash
symbolstringNew display symbol

Returns

NameTypeDescription
descDescriptorUpdated descriptor

valueUpgrade

Upgrades the kind/set revision of a value

function valueUpgrade(uint64 id, uint32 kindRev0, uint32 setRev0) external returns (Descriptor memory desc);

Parameters

NameTypeDescription
iduint64Value ID
kindRev0uint32New kind revision (0 = no change)
setRev0uint32New set revision (0 = no change)

Returns

NameTypeDescription
descDescriptorDescriptor after upgrade

valueTouch

Touches a value, bumping its revision without changing its content

function valueTouch(uint64 id) external returns (Descriptor memory desc);

Parameters

NameTypeDescription
iduint64Value ID

Returns

NameTypeDescription
descDescriptorDescriptor after touch

valueTransfer

Transfers ownership of a value to a new address

function valueTransfer(uint64 id, address to) external returns (address from);

Parameters

NameTypeDescription
iduint64Value ID
toaddressAddress to transfer ownership to

Returns

NameTypeDescription
fromaddressAddress of the previous owner

valueRevision

Resolves and validates a revision of a value

function valueRevision(uint64 id, uint32 rev0) external view returns (uint32 rev);

Parameters

NameTypeDescription
iduint64Value ID
rev0uint32Requested revision (0 = latest)

Returns

NameTypeDescription
revuint32Validated revision (0 = not found)

valueDescriptor

Returns the descriptor of a value at a specific revision

function valueDescriptor(uint64 id, uint32 rev0) external view returns (Descriptor memory desc);

Parameters

NameTypeDescription
iduint64Value ID
rev0uint32Revision to query (0 = latest)

Returns

NameTypeDescription
descDescriptorDescriptor at the given revision

valueSnapshot

Returns descriptor and elements of a value at a specific revision

function valueSnapshot(uint64 id, uint32 rev0) external view returns (Descriptor memory desc, bytes32[] memory elems);

Parameters

NameTypeDescription
iduint64Value ID
rev0uint32Revision to query (0 = latest)

Returns

NameTypeDescription
descDescriptorDescriptor at the given revision
elemsbytes32[]Element values at the given revision

valueOwner

Returns the current owner of a value

function valueOwner(uint64 id) external view returns (address owner);

Parameters

NameTypeDescription
iduint64Value ID

Returns

NameTypeDescription
owneraddressCurrent owner’s address

valueSota

Returns the latest descriptor and current owner of a value

function valueSota(uint64 id) external view returns (Descriptor memory desc, address owner);

Parameters

NameTypeDescription
iduint64Value ID

Returns

NameTypeDescription
descDescriptorLatest descriptor
owneraddressCurrent owner’s address

valueStatus

Checks whether all specified values are active (revision > 0)

function valueStatus(uint64[] memory ids) external view returns (bool active);

Parameters

NameTypeDescription
idsuint64[]Array of value IDs

Returns

NameTypeDescription
activeboolTrue if all values exist and are active

Events

ValueRegistered

Emitted when a new value is registered

event ValueRegistered(uint64 id, Descriptor desc, address code, bytes32 data, TokenSpec spec, address owner);

Parameters

NameTypeDescription
iduint64ID of the newly registered value
descDescriptorDescriptor of the value
codeaddressToken contract address
databytes32Hash of the underlying asset or metadata
specTokenSpecToken specification (standard, decimals, symbol)
owneraddressAddress of the initial owner

ValueUpdated

Emitted when a value is updated

event ValueUpdated(uint64 id, Descriptor desc, bytes32 data, TokenSpec spec);

Parameters

NameTypeDescription
iduint64ID of the value
descDescriptorUpdated descriptor (with bumped revision)
databytes32New hash of the asset or metadata
specTokenSpecUpdated or unchanged token specification

ValueUpgraded

Emitted when a value is upgraded (revision of kind/set updated)

event ValueUpgraded(uint64 id, Descriptor desc);

Parameters

NameTypeDescription
iduint64ID of the value
descDescriptorDescriptor after upgrade

ValueTouched

Emitted when a value is touched (revision bump only, no content change)

event ValueTouched(uint64 id, Descriptor desc);

Parameters

NameTypeDescription
iduint64ID of the value
descDescriptorDescriptor after touch

ValueTransferred

Emitted when ownership of a value is transferred

event ValueTransferred(uint64 id, address from, address to);

Parameters

NameTypeDescription
iduint64ID of the value
fromaddressPrevious owner address
toaddressNew owner address