Interoperable

Git Source

Inherits: IInteroperable, ISetRegistryAdmin

State Variables

_setRegistry

address internal _setRegistry;

_omniRegistry

address internal _omniRegistry;

_kindRegistry

address internal _kindRegistry;

_elemRegistry

address internal _elemRegistry;

_setId

uint64 internal _setId;

_setRev

uint32 internal _setRev;

Functions

onlySetRegistry

modifier onlySetRegistry();

onlyOmniRegistry

modifier onlyOmniRegistry();

constructor

constructor(address setr);

registerSet

Registers the set represented by the calling contract

function registerSet(bytes32 data) external override returns (uint64 id, Descriptor memory desc);

Parameters

NameTypeDescription
databytes32Content hash (e.g., metadata or schema)

Returns

NameTypeDescription
iduint64Newly assigned set ID
descDescriptorDescriptor of the registered set

updateSet

Updates the content hash for the set represented by the calling contract

function updateSet(bytes32 data) external returns (uint64 id, Descriptor memory desc);

Parameters

NameTypeDescription
databytes32New content hash

Returns

NameTypeDescription
iduint64Set ID
descDescriptorUpdated descriptor

upgradeSet

Upgrades the kind or set revision of the set represented by the calling contract

Pass 0 to skip updating either revision

function upgradeSet(uint32 kindRev0, uint32 setRev0) external returns (uint64 id, Descriptor memory desc);

Parameters

NameTypeDescription
kindRev0uint32New kind revision (0 = no change)
setRev0uint32New set revision (0 = no change)

Returns

NameTypeDescription
iduint64Set ID
descDescriptorDescriptor after upgrade

touchSet

Increments the revision of the set represented by the calling contract

function touchSet() external returns (uint64 id, Descriptor memory desc);

Returns

NameTypeDescription
iduint64Set ID
descDescriptorDescriptor after revision bump

onSetRegister

Called before a set is registered

function onSetRegister(uint64 set, Descriptor memory meta) external virtual override onlySetRegistry returns (bytes4);

Parameters

NameTypeDescription
setuint64Set ID
metaDescriptor

Returns

NameTypeDescription
<none>bytes4selector Must return onSetRegister.selector

onSetUpdate

Called before a set is updated

function onSetUpdate(uint64 set, Descriptor memory meta) external virtual override onlySetRegistry returns (bytes4);

Parameters

NameTypeDescription
setuint64Set ID
metaDescriptor

Returns

NameTypeDescription
<none>bytes4selector Must return onSetUpdate.selector

onSetUpgrade

Called before a set is upgraded

function onSetUpgrade(uint64 set, Descriptor memory meta) external virtual override onlySetRegistry returns (bytes4);

Parameters

NameTypeDescription
setuint64Set ID
metaDescriptor

Returns

NameTypeDescription
<none>bytes4selector Must return onSetUpgrade.selector

onSetTouch

Called before a set is touched (revision bump with no content change)

function onSetTouch(uint64 set, Descriptor memory meta) external virtual override onlySetRegistry returns (bytes4);

Parameters

NameTypeDescription
setuint64Set ID
metaDescriptor

Returns

NameTypeDescription
<none>bytes4selector Must return onSetTouch.selector

supportsInterface

Query if a contract implements an interface

Interface identification is specified in ERC-165. This function uses less than 30,000 gas.

function supportsInterface(bytes4 interfaceId) external pure virtual override returns (bool supported);

Parameters

NameTypeDescription
interfaceIdbytes4

Returns

NameTypeDescription
supportedbooltrue if the contract implements interfaceID and interfaceID is not 0xffffffff, false otherwise

Errors

InvalidRegistryAddress

error InvalidRegistryAddress();

CallerNotSetRegistry

error CallerNotSetRegistry();

CallerNotOmniRegistry

error CallerNotOmniRegistry();