SetRegistryAdmin
Helper for managing privileged registration and upgrade operations with the SetRegistry.
Intended to be inherited by set contracts. Assumes SetContext
is correctly configured.
All methods act on the calling contract’s associated set and must be access-controlled.
Functions
registerSet
Registers the calling contract as a new set in the SetRegistry.
function registerSet(bytes32 data) external returns (uint64 id, Descriptor memory od);
Parameters
Name | Type | Description |
---|---|---|
data | bytes32 | Content hash (e.g., metadata or schema reference). |
Returns
Name | Type | Description |
---|---|---|
id | uint64 | Newly assigned set ID. |
od | Descriptor | Descriptor of the registered set. |
updateSet
Updates the content hash of the set represented by the calling contract.
function updateSet(bytes32 data) external returns (uint64 id, Descriptor memory od);
Parameters
Name | Type | Description |
---|---|---|
data | bytes32 | New content hash. |
Returns
Name | Type | Description |
---|---|---|
id | uint64 | Set ID. |
od | Descriptor | Updated descriptor of the set. |
upgradeSet
Upgrades the kind or set revision of the calling contract’s set.
Pass 0 to skip updating either kindRev or setRev.
function upgradeSet(uint32 kindRev0, uint32 setRev0) external returns (uint64 id, Descriptor memory od);
Parameters
Name | Type | Description |
---|---|---|
kindRev0 | uint32 | New kind revision (0 = no change). |
setRev0 | uint32 | New set revision (0 = no change). |
Returns
Name | Type | Description |
---|---|---|
id | uint64 | Set ID. |
od | Descriptor | Descriptor after the upgrade. |
touchSet
Increments the revision of the calling contract’s set without changing content.
function touchSet() external returns (uint64 id, Descriptor memory od);
Returns
Name | Type | Description |
---|---|---|
id | uint64 | Set ID. |
od | Descriptor | Descriptor after the touch operation. |
_setRegistry
function _setRegistry() private view returns (ISetRegistry);