Set Registry

Set registration and management.

Functions

register

Registers a new set in the registry.

function register(address impl, bytes32 data) external returns (uint64);

Parameters

NameTypeDescription
impladdressThe address of the set contract.
databytes32The material hash of the set's data.

Returns

NameTypeDescription
<none>uint64The ID of the newly registered set.

update

Updates the metadata and description of a set.

function update(uint64 id, bytes32 data) external returns (Meta memory);

Parameters

NameTypeDescription
iduint64The ID of the set to update.
databytes32The updated metadata or description hash.

Returns

NameTypeDescription
<none>MetaThe updated metadata of the set.

upgrade

Upgrades a set's kind and/or set to a newer revision.

function upgrade(uint64 id, uint32 kindRev, uint32 setRev) external returns (Meta memory);

Parameters

NameTypeDescription
iduint64The ID of the set to upgrade.
kindRevuint32The newer revision of the set's kind object (0 indicates no upgrade).
setRevuint32The newer revision of the set's set object (0 indicates no upgrade).

Returns

NameTypeDescription
<none>MetaThe metadata of the set after the upgrade.

touch

Touches the set to trigger a revision bump.

function touch(uint64 id) external returns (Meta memory);

Parameters

NameTypeDescription
iduint64The ID of the set.

Returns

NameTypeDescription
<none>MetaThe metadata of the set after touch.

transfer

Transfers ownership of a set to a new address.

function transfer(uint64 id, address to) external;

Parameters

NameTypeDescription
iduint64The ID of the set.
toaddressThe address of the new owner.

ownerOf

Returns the owner of a specific set.

function ownerOf(uint64 id) external view returns (address);

Parameters

NameTypeDescription
iduint64The ID of the set.

Returns

NameTypeDescription
<none>addressThe address of the set owner.

implOf

Returns the implementation address of a set.

function implOf(uint64 id) external view returns (address);

Parameters

NameTypeDescription
iduint64The ID of the set.

Returns

NameTypeDescription
<none>addressThe address of the set's implementation.

metaAt

Returns the metadata of a set at a specific revision.

function metaAt(uint64 id, uint32 rev) external view returns (Meta memory);

Parameters

NameTypeDescription
iduint64The ID of the set.
revuint32The revision number (0 indicates the latest revision).

Returns

NameTypeDescription
<none>MetaThe metadata of the set at the specified revision.

stateAt

Returns the elements of a set at a specific revision.

function stateAt(uint64 id, uint32 rev) external view returns (bytes32[] memory);

Parameters

NameTypeDescription
iduint64The ID of the set.
revuint32The revision number (0 indicates the latest revision).

Returns

NameTypeDescription
<none>bytes32[]The elements of the set at the specified revision.

revAt

Checks if a revision of a set is valid.

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

Parameters

NameTypeDescription
iduint64The ID of the set.
revuint32The revision number to check (0 indicates the latest revision).

Returns

NameTypeDescription
<none>uint32The valid revision number, or 0 if the revision is invalid.

Events

SetRegistered

Emitted when a new set is registered.

event SetRegistered(uint64 id, Meta meta, address impl, bytes32 data, address owner);

Parameters

NameTypeDescription
iduint64The ID of the set.
metaMetaThe intial metadata of the set.
impladdressThe address of the set's contract.
databytes32The material hash of the set's data
owneraddressThe address of the set's owner.

SetUpdated

Emitted when a set is updated.

event SetUpdated(uint64 id, Meta meta, bytes32 data);

Parameters

NameTypeDescription
iduint64The ID of the set.
metaMetaUpdated metadata of the set.
databytes32Updated material hash of the set's data.

SetUpgraded

Emitted when a set is upgraded.

event SetUpgraded(uint64 id, Meta meta);

Parameters

NameTypeDescription
iduint64The unique ID of the set.
metaMetaThe metadata of the set after upgrade.

SetTouched

Emitted when a set is touched.

event SetTouched(uint64 id, Meta meta);

Parameters

NameTypeDescription
iduint64The ID of the set.
metaMetaThe metadata of the set after touch.

SetTransferred

Emitted when ownership of a set is transferred.

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

Parameters

NameTypeDescription
iduint64The ID of the set.
fromaddressThe address of the previous owner.
toaddressThe address of the new owner.