ODCdataIndexomnichain

AccessManagerOmnichainFacet

Facet to manage access of Omnichain Data Managers to DataObjects

approveOmnichainDataManager

function approveOmnichainDataManager(DataPoint dp, address dm, bool approved) external payable

Approves a DataManager for a DataPoint allocated on another chain

Caller SHOULD send native coin with this call to pay omnichain fees Refund will be sent to the caller, so if it's a contract it should have receive() function

Parameters

NameTypeDescription
dpDataPointDataPoint
dmaddressDataManager
approvedboolapprove (true) or remove approval (false)

approveOmnichainDataManager

function approveOmnichainDataManager(DataPoint dp, OmnichainAddress dm, bool approved) external payable

Approves a DataManager for a DataPoint allocated on another chain

Function SHOULD be restricted to DataPoint maintainer only Caller SHOULD send native coin with this call to pay omnichain fees Refund will be sent to the caller, so if it's a contract it should have receive() function NOTE: Here we support: - Local DataPoint & local DataManager (send zero msg.value) - Local DataPoint & remote DataManager - Remote DataPoint & local DataManager

Parameters

NameTypeDescription
dpDataPointDataPoint
dmOmnichainAddressDataManager, can be on another chain
approvedboolapprove (true) or remove approval (false)

approveOmnichainDataManagers

function approveOmnichainDataManagers(DataPoint dp, OmnichainAddress[] dms, bool approved, address payable refundAddress) external payable

Approves a list of DataManagers in different chains

Caller SHOULD send native coin with this call to pay omnichain fees Amount can be calculated with estimateApproveOmnichainDataManagers() NOTE: We only support local DataPoints here, DataManager can be both remote and local

Parameters

NameTypeDescription
dpDataPointDataPoint (Should be allocated on current chain!)
dmsOmnichainAddress[]List of DataManagers to approve
approvedboolapprove (true) or remove approval (false), this value will be applied to all DataManagers
refundAddressaddress payablewho will receive refund, if any

estimateApproveOmnichainDataManagers

function estimateApproveOmnichainDataManagers(DataPoint dp, OmnichainAddress[] dms, bool approved) external view returns (uint256)

Calculates native coin fee required to call approveOmnichainDataManagers()

Parameters

NameTypeDescription
dpDataPointDataPoint (Should be allocated on current chain!)
dmsOmnichainAddress[]List of DataManagers to approve
approvedboolapprove (true) or remove approval (false), this value will be applied to all DataManagers

Return Values

NameTypeDescription
[0]uint256native coin fee, which should be sent as msg.value

approvedDataManager

function approvedDataManager(DataPoint dp, OmnichainAddress dm) external view returns (bool)

Verifies if DataManager is allowed to write in specific DataPoint

Parameters

NameTypeDescription
dpDataPointIdentifier of the DataPoint
dmOmnichainAddressDataManager, can be on another chain

Return Values

NameTypeDescription
[0]boolif write access is allowed

approveDataManager

function approveDataManager(DataPoint dp, OmnichainAddress dm, bool approved) external

Defines if DataManager is allowed to write in specific DataPoint

Function SHOULD be restricted to DataPoint maintainer only

Parameters

NameTypeDescription
dpDataPointIdentifier of the DataPoint
dmOmnichainAddressDataManager, can be on another chain
approvedboolif DataManager should be approved for the DataPoint

approvedOmnichainDataObject

function approvedOmnichainDataObject(OmnichainAddress remoteDataObject) external view returns (bool)

Verifies if remote DataObject is approved to access local one (with same address) via writeOmnichain() call

Parameters

NameTypeDescription
remoteDataObjectOmnichainAddressAddress and chainId of remote DataObject

approveOmnichainDataObject

function approveOmnichainDataObject(uint32[] chains, bool approved) external

Approves DataObjects with same address as caller's local address to write to the caller for all DataPoints

Parameters

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