Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SetRegistryAdmin

Git Source

Title: 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

NameTypeDescription
databytes32Content hash (e.g., metadata or schema reference).

Returns

NameTypeDescription
iduint64Newly assigned set ID.
odDescriptorDescriptor of the registered set.

updateSet

Updates the content hash of the set represented by the calling contract.

function updateSet(uint64 id, bytes32 data) external returns (Descriptor memory od);

Parameters

NameTypeDescription
iduint64Set ID.
databytes32New content hash.

Returns

NameTypeDescription
odDescriptorUpdated 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(uint64 id, uint32 kindRev0, uint32 setRev0) external returns (Descriptor memory od);

Parameters

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

Returns

NameTypeDescription
odDescriptorDescriptor after the upgrade.

touchSet

Increments the revision of the calling contract’s set without changing content.

function touchSet(uint64 id) external returns (Descriptor memory od);

Parameters

NameTypeDescription
iduint64Set ID.

Returns

NameTypeDescription
odDescriptorDescriptor after the touch operation.

_setRegistry

function _setRegistry() private view returns (ISetRegistry);