IInteroperable

Git Source

Inherits: IERC165

Interface for set contracts that support object-level interoperability

Enables a set to react to registry lifecycle events and object interactions. These callbacks are invoked before the respective action is finalized. The protocol requires that the callback returns the expected value for the action to proceed.

Functions

onSetRegister

Called before a set is registered

function onSetRegister(uint64 set, Descriptor memory od) external returns (bytes4 selector);

Parameters

NameTypeDescription
setuint64Set ID
odDescriptorDescriptor of the set

Returns

NameTypeDescription
selectorbytes4Must return onSetRegister.selector

onSetUpdate

Called before a set is updated

function onSetUpdate(uint64 set, Descriptor memory od) external returns (bytes4 selector);

Parameters

NameTypeDescription
setuint64Set ID
odDescriptorUpdated descriptor

Returns

NameTypeDescription
selectorbytes4Must return onSetUpdate.selector

onSetUpgrade

Called before a set is upgraded

function onSetUpgrade(uint64 set, Descriptor memory od) external returns (bytes4 selector);

Parameters

NameTypeDescription
setuint64Set ID
odDescriptorDescriptor after upgrade

Returns

NameTypeDescription
selectorbytes4Must return onSetUpgrade.selector

onSetTouch

Called before a set is touched (revision bump with no content change)

function onSetTouch(uint64 set, Descriptor memory od) external returns (bytes4 selector);

Parameters

NameTypeDescription
setuint64Set ID
odDescriptorDescriptor after touch

Returns

NameTypeDescription
selectorbytes4Must return onSetTouch.selector

onObjectRelate

Called before an object from this set is linked to another object

function onObjectRelate(uint64 id, uint64 rel, uint64 data, uint64 tailSet, uint64 tailId, uint64 tailKind)
    external
    returns (Descriptor memory od);

Parameters

NameTypeDescription
iduint64Head object ID (belongs to this set)
reluint64Relation ID
datauint64Optional relation data (uint64 encoded)
tailSetuint64Set ID of the tail object
tailIduint64ID of the tail object
tailKinduint64Kind ID of the tail object

Returns

NameTypeDescription
odDescriptorUpdated descriptor of the head object

onObjectUnrelate

Called before an object from this set is unlinked from another object

function onObjectUnrelate(uint64 id, uint64 rel, uint64 data, uint64 tailSet, uint64 tailId, uint64 tailKind)
    external
    returns (Descriptor memory od);

Parameters

NameTypeDescription
iduint64Head object ID (belongs to this set)
reluint64Relation ID
datauint64Optional relation data (uint64 encoded)
tailSetuint64Set ID of the tail object
tailIduint64ID of the tail object
tailKinduint64Kind ID of the tail object

Returns

NameTypeDescription
odDescriptorUpdated descriptor of the head object

onObjectTransfer

Called before ownership of an object from this set is transferred as part of a relation or unrelation operation.

function onObjectTransfer(uint64 id, address from, address to) external returns (bytes4 selector);

Parameters

NameTypeDescription
iduint64ID of the object being transferred
fromaddressCurrent owner
toaddressNew owner

Returns

NameTypeDescription
selectorbytes4Must return onObjectTransfer.selector to proceed