Interface for registering and managing sets

Functions

setRegister

Registers a new set

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

Parameters

NameTypeDescription
databytes32Hash of external content (e.g. metadata or schema)

Returns

NameTypeDescription
iduint64ID of the new set
descDescriptorDescriptor after registration

setUpdate

Updates the data hash of an existing set

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

Parameters

NameTypeDescription
databytes32New data hash

Returns

NameTypeDescription
iduint64ID of the updated set
descDescriptorUpdated descriptor

setUpgrade

Upgrades the kind or set revision

function setUpgrade(uint32 kindRev, uint32 setRev) external returns (uint64 id, Descriptor memory desc);

Parameters

NameTypeDescription
kindRevuint32New kind revision (0 to skip)
setRevuint32New set revision (0 to skip)

Returns

NameTypeDescription
iduint64ID of the set
descDescriptorDescriptor after upgrade

setTouch

Touches a set (increments revision without any changes)

function setTouch() external returns (uint64 id, Descriptor memory desc);

Returns

NameTypeDescription
iduint64ID of the set
descDescriptorDescriptor after touch

setRevision

Resolves and validates a specific revision

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

Parameters

NameTypeDescription
iduint64Set ID
rev0uint32Requested revision (0 = latest)

Returns

NameTypeDescription
revuint32Validated revision (0 if not found)

setDescriptor

Returns the descriptor at a given revision

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

Parameters

NameTypeDescription
iduint64Set ID
rev0uint32Revision to query (0 = latest)

Returns

NameTypeDescription
descDescriptorDescriptor of the set at the specified revision

setSnapshot

Returns descriptor and elements of a set at a specific revision

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

Parameters

NameTypeDescription
iduint64Set ID
rev0uint32Revision to query (0 = latest)

Returns

NameTypeDescription
descDescriptorDescriptor at the revision
elemsbytes32[]Packed element list

setOwner

Returns the current owner of a set

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

Parameters

NameTypeDescription
iduint64Set ID

Returns

NameTypeDescription
owneraddressOwner address

setSota

Returns the latest descriptor and current owner

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

Parameters

NameTypeDescription
iduint64Set ID

Returns

NameTypeDescription
descDescriptorLatest descriptor
owneraddressCurrent owner

setStatus

Checks whether all provided set IDs are active

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

Parameters

NameTypeDescription
idsuint64[]List of set IDs

Returns

NameTypeDescription
activeboolTrue if all sets have a revision > 0

setContract

Returns the contract address associated with a set

function setContract(uint64 id) external view returns (address code);

Parameters

NameTypeDescription
iduint64Set ID

Returns

NameTypeDescription
codeaddressAddress of the deployed contract

Events

SetRegistered

Emitted when a new set is registered

event SetRegistered(uint64 id, Descriptor desc, address code, bytes32 data, address owner);

Parameters

NameTypeDescription
iduint64ID of the new set
descDescriptorSet descriptor after registration
codeaddressAddress of the associated set contract
databytes32Hash of the associated matter (external content)
owneraddressOwner address of the set

SetUpdated

Emitted when a set is updated

event SetUpdated(uint64 id, Descriptor desc, bytes32 data);

Parameters

NameTypeDescription
iduint64ID of the set
descDescriptorUpdated descriptor
databytes32New data hash

SetUpgraded

Emitted when a set is upgraded

event SetUpgraded(uint64 id, Descriptor desc);

Parameters

NameTypeDescription
iduint64ID of the set
descDescriptorDescriptor after upgrade

SetTouched

Emitted when a set is touched (revision bumped without content change)

event SetTouched(uint64 id, Descriptor desc);

Parameters

NameTypeDescription
iduint64ID of the set
descDescriptorDescriptor after touch