ODCdataobjectsomnichain

OmnichainBaseDataObject

Base contract for Omnichain DataObject implementations

This contract extends the BaseDataObject contract and provides the basic omnichain functionalities for DataObject implementations

ZeroProxyAddress

error ZeroProxyAddress()

Error thrown when the proxy address is zero

ZeroRefundAddress

error ZeroRefundAddress()

Error thrown when the refund address is zero

SenderIsNotOmnichainProxy

error SenderIsNotOmnichainProxy(address sender)

Error thrown when the sender is not the Omnichain proxy

OmnichainProxySet

event OmnichainProxySet(address proxy)

Event emitted when the OmnichainProxy contract is set

Parameters

NameTypeDescription
proxyaddressThe OmnichainProxy contract

DataPointAdminVerificationFailed

event DataPointAdminVerificationFailed(DataPoint dp, address account)

Event emitted when dataPoint admin verification failed when setting Data Index implementation

Parameters

NameTypeDescription
dpDataPointDataPoint identifier
accountaddressAccount that was

OmnichainCallbackHandlerData

Callback handler data

Parameters

NameTypeDescription
struct OmnichainCallbackHandlerData {
  enum OmnichainBaseDataObject.CallbackOperation operation;
  bytes opData;
}

CallbackOperation

Callback operation types

enum CallbackOperation {
  NO_SUPPORTED_OPERATION,
  IS_DATAPOINT_ADMIN_RESPONSE
}

_proxy

contract OmnichainProxy _proxy

The OmnichainProxy contract

_callbackData

mapping(bytes32 => struct OmnichainBaseDataObject.OmnichainCallbackHandlerData) _callbackData

Mapping from rid to operation data

setOmnichainProxy

function setOmnichainProxy(contract OmnichainProxy proxy_) external

Sets the OmnichainProxy contract

Parameters

NameTypeDescription
proxy_contract OmnichainProxyThe OmnichainProxy contract

setOmnichainDataIndexImplementation

function setOmnichainDataIndexImplementation(DataPoint dp, address newImpl, address payable refundAddress) public payable virtual

Sets the Data Index implementation for a DataPoint on a different chain

Parameters

NameTypeDescription
dpDataPointThe DataPoint identifier
newImpladdressThe new Data Index implementation address
refundAddressaddress payableWhere to send refund

approveChains

function approveChains(contract IAccessManagerOmnichain dataIndex, uint32[] chains, bool approved) external

Approves DataObject with same address but on other chains to write to this one

Parameters

NameTypeDescription
dataIndexcontract IAccessManagerOmnichainDataIndex implementation to work with
chainsuint32[]List of chains to approve
approvedboolif provided chains should be approved (true) or removed from approved list (false)

omnichainCallback

function omnichainCallback(bytes32 rid, bytes data) public virtual

Callback function for Omnichain

Function SHOULD be implemented to receive data from Omnichain proxy

Parameters

NameTypeDescription
ridbytes32Request ID (GUID)
databytesData received in the callback

_setOmnichainDataIndexImplementationCallback

function _setOmnichainDataIndexImplementationCallback(bytes opData, bytes result) internal

_omnichainCallback

function _omnichainCallback(bytes32, bytes) internal virtual

Callback function for omnichain operations NOTE: rid Request ID of the message (GUID) data Data received in the callback