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
Name | Type | Description |
---|---|---|
impl | address | The address of the set contract. |
data | bytes32 | The material hash of the set's data. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint64 | The 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
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set to update. |
data | bytes32 | The updated metadata or description hash. |
Returns
Name | Type | Description |
---|---|---|
<none> | Meta | The 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
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set to upgrade. |
kindRev | uint32 | The newer revision of the set's kind object (0 indicates no upgrade). |
setRev | uint32 | The newer revision of the set's set object (0 indicates no upgrade). |
Returns
Name | Type | Description |
---|---|---|
<none> | Meta | The 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
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
Returns
Name | Type | Description |
---|---|---|
<none> | Meta | The metadata of the set after touch. |
transfer
Transfers ownership of a set to a new address.
function transfer(uint64 id, address to) external;
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
to | address | The address of the new owner. |
ownerOf
Returns the owner of a specific set.
function ownerOf(uint64 id) external view returns (address);
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the set owner. |
implOf
Returns the implementation address of a set.
function implOf(uint64 id) external view returns (address);
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
Returns
Name | Type | Description |
---|---|---|
<none> | address | The 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
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
rev | uint32 | The revision number (0 indicates the latest revision). |
Returns
Name | Type | Description |
---|---|---|
<none> | Meta | The 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
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
rev | uint32 | The revision number (0 indicates the latest revision). |
Returns
Name | Type | Description |
---|---|---|
<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
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
rev | uint32 | The revision number to check (0 indicates the latest revision). |
Returns
Name | Type | Description |
---|---|---|
<none> | uint32 | The 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
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
meta | Meta | The intial metadata of the set. |
impl | address | The address of the set's contract. |
data | bytes32 | The material hash of the set's data |
owner | address | The address of the set's owner. |
SetUpdated
Emitted when a set is updated.
event SetUpdated(uint64 id, Meta meta, bytes32 data);
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
meta | Meta | Updated metadata of the set. |
data | bytes32 | Updated material hash of the set's data. |
SetUpgraded
Emitted when a set is upgraded.
event SetUpgraded(uint64 id, Meta meta);
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | The unique ID of the set. |
meta | Meta | The metadata of the set after upgrade. |
SetTouched
Emitted when a set is touched.
event SetTouched(uint64 id, Meta meta);
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
meta | Meta | The metadata of the set after touch. |
SetTransferred
Emitted when ownership of a set is transferred.
event SetTransferred(uint64 id, address from, address to);
Parameters
Name | Type | Description |
---|---|---|
id | uint64 | The ID of the set. |
from | address | The address of the previous owner. |
to | address | The address of the new owner. |