Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ObjectInteractionHook

Git Source

Inherits: IObjectInteractionHook

Title: Interoperable

Base contract to enable object-level interoperability via the OmniRegistry.

Implements the IInteroperable interface and restricts callbacks to only the configured OmniRegistry.

Functions

_ObjectInteractionHook_initialize

function _ObjectInteractionHook_initialize(address omniRegistry) internal;

_ObjectInteractionHook_initializeFrom

function _ObjectInteractionHook_initializeFrom(address setRegistry) internal;

onlyOmniRegistry

Restricts execution to only the configured OmniRegistry.

modifier onlyOmniRegistry() ;

_onlyOmniRegistry

function _onlyOmniRegistry() internal view;

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

_ObjectInteractionHook_supportsInterface

function _ObjectInteractionHook_supportsInterface(bytes4 interfaceId) internal pure returns (bool supported);

Errors

NotOmniRegistry

error NotOmniRegistry();