Interoperable
Inherits: IInteroperable
Base contract to enable object-level interoperability via the OmniRegistry.
Implements the IInteroperable interface and restricts callbacks to only the configured OmniRegistry.
Functions
onlyOmniRegistry
Restricts execution to only the configured OmniRegistry.
modifier onlyOmniRegistry();
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
override
onlyOmniRegistry
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
override
onlyOmniRegistry
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
override
onlyOmniRegistry
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 |
supportsInterface
Returns true if this contract implements the interface defined by
interfaceId
. See the corresponding
https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
to learn more about how these ids are created.
This function call must use less than 30 000 gas.
function supportsInterface(bytes4 interfaceId) external pure virtual override returns (bool);
Errors
CallerNotOmniRegistry
error CallerNotOmniRegistry();