IInteroperable

Git Source

Inherits: IERC165

Interface for set contracts that support object-level interoperability

Enables a set to respond to interactions involving its objects. These hooks are called before the action is finalized. Returning the expected value is required for the operation to proceed.

Functions

onObjectRelate

Hook 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
iduint64Object ID from this set (acts as the head)
reluint64Relation ID
datauint64Encoded relation-specific data (optional, uint64)
tailSetuint64Set ID of the tail object
tailIduint64Object ID of the tail
tailKinduint64Kind ID of the tail object

Returns

NameTypeDescription
odDescriptorUpdated descriptor of the head object

onObjectUnrelate

Hook 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
iduint64Object ID from this set (acts as the head)
reluint64Relation ID
datauint64Encoded relation-specific data (optional, uint64)
tailSetuint64Set ID of the tail object
tailIduint64Object ID of the tail
tailKinduint64Kind ID of the tail object

Returns

NameTypeDescription
odDescriptorUpdated descriptor of the head object

onObjectTransfer

Hook called before ownership of an object from this set is transferred as part of a relation or unrelation

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

Parameters

NameTypeDescription
iduint64Object ID being transferred
fromaddressCurrent owner address
toaddressNew owner address

Returns

NameTypeDescription
selectorbytes4Must return onObjectTransfer.selector to confirm and proceed