Interoperable

Git Source

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

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
    override
    onlyOmniRegistry
    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
    override
    onlyOmniRegistry
    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

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();