OmnichainProxy
Contract for sending messages between chains and executing operations on other chains
_This contract is an OApp that can send messages to other chains and execute operations on them The supported operations are the read and write operations to DataObjects and the check if an account is admin of a DataPoint. With the respective callback support for they responses.
UnknownOperation
Error thrown when the operation is unknown
Operation
Operations supported by the contract
Parameters
Name | Type | Description |
---|
CallbackData
Callback data for sent messages
Parameters
Name | Type | Description |
---|
_dataIndex
Data Index Diamond implementation
_callbackData
Mapping of GUID to CallbackData
constructor
Parameters
Name | Type | Description |
---|---|---|
_endpoint | address | The address of the LOCAL Layer Zero endpoint |
_initialOwner | address | Owner of the contract, also capable of making OApp configurations inside of the endpoint |
setDataIndexImplementation
Set new Data Index implementation
implementation should support IERC165, IOmnichainData and IOmnichainGovernance interfaces
Parameters
Name | Type | Description |
---|---|---|
dataIndex | address | Address of new Data Index implementation |
queryIsDataPointAdmin
Query DataPoint Registry on the chain where DataPoint was generated and check if requested address is admin
Sender should implement IOmnichainCallbackReceiver
to receive callback with query result
Parameters
Name | Type | Description |
---|---|---|
dp | DataPoint | DataPoint to check |
account | address | Address to check |
destinationGasLimit | uint128 | Gas limit for the call on destination chain |
callbackGasLimit | uint128 | Gas limit for result callback (on current chain) |
refundAddress | address payable | Address to send refund to |
Return Values
Name | Type | Description |
---|---|---|
[0] | bytes32 | ID of request (used for callback) |
queryApproveDataManager
estimateApproveDataManager
queryDataObjectRead
Query DataObject.read() on another chain
Sender should implement IOmnichainCallbackReceiver
to receive callback with query result
Parameters
Name | Type | Description |
---|---|---|
chainId | uint32 | Chain to read from |
dobj | address | Address of DataObject |
dp | DataPoint | DataPoint to work with |
operation | bytes4 | Operation to execute |
data | bytes | Data for the operation |
destinationGasLimit | uint128 | Gas limit for the call on destination chain |
callbackGasLimit | uint128 | Gas limit for result callback (on current chain) |
refundAddress | address payable | Address to send refund to |
queryDataObjectWrite
Query DataObject.write() on another chain
Sender should implement IOmnichainCallbackReceiver
to receive callback with query result
Parameters
Name | Type | Description |
---|---|---|
chainId | uint32 | Chain to write |
dobj | address | Address of DataObject |
dp | DataPoint | DataPoint to work with |
operation | bytes4 | Operation to execute |
data | bytes | Data for the operation |
destinationGasLimit | uint128 | Gas limit for the call on destination chain |
callbackGasLimit | uint128 | Gas limit for result callback (on current chain) |
refundAddress | address payable | Address to send refund to |
nextRequestId
pause
Pause the contract
Only the owner can call this function
unpause
Unpause the contract
Only the owner can call this function
_executeOperation
_executeIsDataPointAdmin
_executeApproveDataManager
_executeDataObjectRead
_executeDataObjectWrite
_requireDataIndexImplIsValid
_sendMessage
Send a message to target chain
Parameters
Name | Type | Description |
---|---|---|
eid | uint32 | EID of destination chain |
op | enum OmnichainProxy.Operation | Operation to execute |
opData | bytes | Encoded data for the operation |
destinationGasLimit | uint128 | Gas limit to use for the call on destination chain |
callbackGasLimit | uint128 | Gas limit to use for callback |
refundAddress | address | Address to send refund to |
Return Values
Name | Type | Description |
---|---|---|
[0] | bytes32 | GUID of the sent message |
_sendMessageWithoutCallback
Send a message to target chain and NOT expect callback with result
Parameters
Name | Type | Description |
---|---|---|
eid | uint32 | EID of destination chain |
op | enum OmnichainProxy.Operation | Operation to execute |
opData | bytes | Encoded data for the operation |
destinationGasLimit | uint128 | Gas limit to use for the call on destination chain |
refundAddress | address | Address to send refund to |
Return Values
Name | Type | Description |
---|---|---|
[0] | bytes32 | GUID of the sent message |
_estimateMessageWithoutCallback
_convertSourceValueToDestinationValue
_executeCallback
_lzReceive
Internal function override to handle incoming messages from another chain
Parameters
Name | Type | Description |
---|---|---|
_origin | struct Origin | A struct containing information about the message sender |
_guid | bytes32 | A unique global packet identifier for the message |
payload | bytes | The encoded message payload being received NOTE: The following params are unused in the current implementation of the OApp _executor The address of the Executor responsible for processing the message _extraData Arbitrary data appended by the Executor to the message Decodes the received payload and processes it as per the business logic defined in the function |
address | ||
bytes |