generated from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from gnosis/feat/reporter
feat: reporter, relayer, executor for Hashi v0.2
- Loading branch information
Showing
49 changed files
with
3,108 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
**/.coverage_contracts | ||
**/dist | ||
**/node_modules | ||
**/types | ||
**/.yarn | ||
|
||
# files | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: "3.8" | ||
|
||
services: | ||
mongodb: | ||
image: mongo:latest | ||
container_name: mongodb | ||
ports: | ||
- "27017:27017" | ||
networks: | ||
- mongo-network | ||
volumes: | ||
- mongo-data:/data/db | ||
|
||
hashi_relayer: | ||
build: | ||
context: . | ||
dockerfile: packages/relayer/Dockerfile | ||
container_name: hashi_relayer | ||
networks: | ||
- mongo-network | ||
depends_on: | ||
- mongodb | ||
|
||
hashi_executor: | ||
build: | ||
context: . | ||
dockerfile: packages/executor/Dockerfile | ||
container_name: hashi_executor | ||
networks: | ||
- mongo-network | ||
depends_on: | ||
- mongodb | ||
|
||
hashi_reporter: | ||
build: | ||
context: . | ||
dockerfile: packages/reporter/Dockerfile | ||
container_name: hashi_reporter | ||
|
||
networks: | ||
mongo-network: | ||
driver: bridge | ||
|
||
volumes: | ||
mongo-data: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
types/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
packages/evm/contracts/adapters/LayerZero/interfaces/ILayerZeroEndpointV2.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity >=0.8.0; | ||
|
||
struct MessagingParams { | ||
uint32 dstEid; | ||
bytes32 receiver; | ||
bytes message; | ||
bytes options; | ||
bool payInLzToken; | ||
} | ||
|
||
struct MessagingReceipt { | ||
bytes32 guid; | ||
uint64 nonce; | ||
MessagingFee fee; | ||
} | ||
|
||
struct MessagingFee { | ||
uint256 nativeFee; | ||
uint256 lzTokenFee; | ||
} | ||
|
||
struct Origin { | ||
uint32 srcEid; | ||
bytes32 sender; | ||
uint64 nonce; | ||
} | ||
|
||
interface ILayerZeroEndpointV2 { | ||
event PacketSent(bytes encodedPayload, bytes options, address sendLibrary); | ||
|
||
event PacketVerified(Origin origin, address receiver, bytes32 payloadHash); | ||
|
||
event PacketDelivered(Origin origin, address receiver); | ||
|
||
event LzReceiveAlert( | ||
address indexed receiver, | ||
address indexed executor, | ||
Origin origin, | ||
bytes32 guid, | ||
uint256 gas, | ||
uint256 value, | ||
bytes message, | ||
bytes extraData, | ||
bytes reason | ||
); | ||
|
||
event LzTokenSet(address token); | ||
|
||
event DelegateSet(address sender, address delegate); | ||
|
||
function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory); | ||
|
||
function send( | ||
MessagingParams calldata _params, | ||
address _refundAddress | ||
) external payable returns (MessagingReceipt memory); | ||
|
||
function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external; | ||
|
||
function verifiable(Origin calldata _origin, address _receiver) external view returns (bool); | ||
|
||
function initializable(Origin calldata _origin, address _receiver) external view returns (bool); | ||
|
||
function lzReceive( | ||
Origin calldata _origin, | ||
address _receiver, | ||
bytes32 _guid, | ||
bytes calldata _message, | ||
bytes calldata _extraData | ||
) external payable; | ||
|
||
// oapp can burn messages partially by calling this function with its own business logic if messages are verified in order | ||
function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external; | ||
|
||
function setLzToken(address _lzToken) external; | ||
|
||
function lzToken() external view returns (address); | ||
|
||
function nativeToken() external view returns (address); | ||
|
||
function setDelegate(address _delegate) external; | ||
} |
18 changes: 12 additions & 6 deletions
18
packages/evm/contracts/adapters/LayerZero/interfaces/ILayerZeroReceiver.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
pragma solidity ^0.8.20; | ||
import { Origin } from "./ILayerZeroEndpointV2.sol"; | ||
|
||
interface ILayerZeroReceiver { | ||
// @notice LayerZero endpoint will invoke this function to deliver the message on the destination | ||
// @param _srcChainId - the source endpoint identifier | ||
// @param _srcAddress - the source sending contract address from the source chain | ||
// @param _nonce - the ordered message nonce | ||
// @param _payload - the signed payload is the UA bytes has encoded to be sent | ||
function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external; | ||
function lzReceive( | ||
Origin calldata _origin, | ||
bytes32 _guid, | ||
bytes calldata _message, | ||
address _executor, | ||
bytes calldata _extraData | ||
) external payable; | ||
|
||
function allowInitializePath(Origin calldata _origin) external view returns (bool); | ||
|
||
function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.