IInteroperable
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
Name | Type | Description |
---|---|---|
id | uint64 | Object ID from this set (acts as the head) |
rel | uint64 | Relation ID |
data | uint64 | Encoded relation-specific data (optional, uint64) |
tailSet | uint64 | Set ID of the tail object |
tailId | uint64 | Object ID of the tail |
tailKind | uint64 | Kind ID of the tail object |
Returns
Name | Type | Description |
---|---|---|
od | Descriptor | Updated 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
Name | Type | Description |
---|---|---|
id | uint64 | Object ID from this set (acts as the head) |
rel | uint64 | Relation ID |
data | uint64 | Encoded relation-specific data (optional, uint64) |
tailSet | uint64 | Set ID of the tail object |
tailId | uint64 | Object ID of the tail |
tailKind | uint64 | Kind ID of the tail object |
Returns
Name | Type | Description |
---|---|---|
od | Descriptor | Updated 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
Name | Type | Description |
---|---|---|
id | uint64 | Object ID being transferred |
from | address | Current owner address |
to | address | New owner address |
Returns
Name | Type | Description |
---|---|---|
selector | bytes4 | Must return onObjectTransfer.selector to confirm and proceed |