Skip to content

Commit

Permalink
Merge pull request #126 from valory-xyz/packages_update
Browse files Browse the repository at this point in the history
chore: L2 deployment, hardhat and other packages update
  • Loading branch information
mariapiamo authored Mar 8, 2024
2 parents c1b51e0 + 5d09a87 commit 4c98af0
Show file tree
Hide file tree
Showing 23 changed files with 443 additions and 326 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,6 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false

docker:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: valory/${{ github.event.repository.name }}:dev
# - name: Login to DockerHub
# uses: docker/login-action@v1
# if: github.ref == 'refs/heads/main'
# with:
# username: valory
# password: ${{ secrets.ACCESS_TOKEN }}
# - name: Push
# uses: docker/build-push-action@v2
# if: github.ref == 'refs/heads/main'
# with:
# context: .
# push: true
# tags: valory/${{ github.event.repository.name }}:main # note need to get the base ref to force for the branch

scan:
name: gitleaks
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.

The format is based on [Common Changelog](https://common-changelog.org).

[1.1.10]: https://github.com/valory-xyz/autonolas-governance/compare/v1.1.9...v1.1.10
[1.1.9]: https://github.com/valory-xyz/autonolas-governance/compare/v1.1.8...v1.1.9
[1.1.8]: https://github.com/valory-xyz/autonolas-governance/compare/v1.1.7-post-internal-audit...v1.1.8
[1.1.7]: https://github.com/valory-xyz/autonolas-governance/compare/v1.1.6...v1.1.7-post-internal-audit
Expand All @@ -16,6 +17,13 @@ The format is based on [Common Changelog](https://common-changelog.org).
[1.0.1]: https://github.com/valory-xyz/autonolas-governance/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/valory-xyz/autonolas-governance/releases/tag/v1.0.0

## [v1.1.10] - 2024-03-08
- Created `OptimismMessenger` contract to serve as a bridge mediator on Optimism and Base networks ([#114](https://github.com/valory-xyz/autonolas-governance/pull/114/files))
- Created `WormholeMessenger` contracts to serve as a bridge mediator on Celo and other L2 networks ([#116](https://github.com/valory-xyz/autonolas-governance/pull/116/files))
- Deploying `OptimismMessenger` to Optimism and Base, deploying `WormholeMessenger` on Celo
- Updated documentation
- Tests coverage

## [v1.1.9] - 2024-01-19
- Refactor `GuardCM` reacting to C4A findings ([#107](https://github.com/valory-xyz/autonolas-governance/pull/107/files))
- Deployment of refactored `GuardCM` contract
Expand Down
12 changes: 6 additions & 6 deletions docs/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": ""
"address": "0x87c511c8aE3fAF0063b3F3CF9C6ab96c4AA5C60c"
}
]
},
Expand All @@ -173,7 +173,7 @@
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": "0x670Ac235EE13C0B2a5065282bBB0c61cfB354592"
"address": "0xaC26774616bbeD41b0CB69EA2ae7de366F430b23"
}
]
},
Expand All @@ -184,7 +184,7 @@
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": ""
"address": "0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA"
}
]
},
Expand All @@ -195,7 +195,7 @@
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": "0xeDd71796B90eaCc56B074C39BAC90ED2Ca6D93Ee"
"address": "0x6f7661F52fE1919996d0A4F68D09B344093a349d"
}
]
},
Expand All @@ -206,7 +206,7 @@
{
"name": "WormholeMessenger",
"artifact": "abis/0.8.23/WormholeMessenger.json",
"address": ""
"address": "0x397125902ED2cA2d42104F621f448A2cE1bC8Fb7"
}
]
},
Expand All @@ -217,7 +217,7 @@
{
"name": "WormholeMessenger",
"artifact": "abis/0.8.23/WormholeMessenger.json",
"address": "0x945550dECe7E40ae70C6ebf5699637927eAF13E9"
"address": "0xadBBC3FE82836366Bb178Fd210d4dd915e9B3415"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ require("hardhat-contract-sizer");
require("hardhat-deploy");
require("hardhat-deploy-ethers");
require("hardhat-gas-reporter");
require("hardhat-tracer");
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("@nomicfoundation/hardhat-toolbox");
//require("hardhat-tracer");

const ALCHEMY_API_KEY_MAINNET = process.env.ALCHEMY_API_KEY_MAINNET;
const ALCHEMY_API_KEY_MATIC = process.env.ALCHEMY_API_KEY_MATIC;
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,25 @@
"devDependencies": {
"@gnosis.pm/safe-contracts": "^1.3.0",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
"@nomicfoundation/hardhat-network-helpers": "^1.0.10",
"@nomicfoundation/hardhat-toolbox": "^2.0.2",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@typechain/ethers-v5": "^11.1.2",
"hardhat": "^2.21.0",
"@typechain/hardhat": "^9.1.0",
"@types/mocha": "^10.0.3",
"chai": "^4.3.10",
"eslint": "^8.52.0",
"ethers": "^5.7.2",
"hardhat": "^2.18.2",
"@typechain/ethers-v5": "^11.1.2",
"@types/mocha": "^10.0.6",
"chai": "^4.3.7",
"eslint": "^8.57.0",
"solhint": "^4.1.1",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-deploy": "^0.11.43",
"hardhat-deploy-ethers": "^0.3.0-beta.13",
"hardhat-gas-reporter": "^1.0.9",
"hardhat-tracer": "^2.6.0",
"solidity-coverage": "^0.8.5"
"hardhat-deploy": "^0.12.1",
"hardhat-deploy-ethers": "^0.4.1",
"hardhat-gas-reporter": "^1.0.10",
"hardhat-tracer": "^2.8.1",
"solidity-coverage": "^0.8.10"
},
"dependencies": {
"@openzeppelin/contracts": "=4.8.3",
Expand All @@ -48,7 +50,6 @@
"@ethersproject/wallet": "^5.7.0",
"eth-permit": "^0.2.3",
"ethereum-sources-downloader": "^0.1.21",
"solhint": "^3.6.2",
"fx-portal": "^1.0.3"
}
}
19 changes: 7 additions & 12 deletions scripts/audit_chains/audit_contracts_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { ethers } = require("ethers");
const { expect } = require("chai");
const fs = require("fs");

const verifyRepo = false;
const verifyRepo = true;
const verifySetup = true;

// Custom expect that is wrapped into try / catch block
Expand Down Expand Up @@ -361,8 +361,8 @@ async function checkOptimismMessenger(chainId, provider, globalsInstance, config

log += ", address: " + optimismMessenger.address;
// Check the foreign governor
const foreignGovernor = await optimismMessenger.foreignGovernor();
customExpect(foreignGovernor, globalsInstance["timelockAddress"], log + ", function: foreignGovernor()");
const sourceGovernor = await optimismMessenger.sourceGovernor();
customExpect(sourceGovernor, globalsInstance["timelockAddress"], log + ", function: sourceGovernor()");

// Check L2CrossDomainMessengerAddress
const proxyHome = await optimismMessenger.CDMContractProxyHome();
Expand All @@ -380,15 +380,15 @@ async function checkWormholeMessenger(chainId, provider, globalsInstance, config
log += ", address: " + wormholeMessenger.address;
// Check the source governor
const sourceGovernor = await wormholeMessenger.sourceGovernor();
customExpect(sourceGovernor, globalsInstance["timelockAddress"], log + ", function: sourceGovernor()");
customExpect(sourceGovernor, globalsInstance["timelockAddress"].toLowerCase(), log + ", function: sourceGovernor()");

// Check L2WormholeRelayerAddress
const wormholeRelayer = await wormholeMessenger.wormholeRelayer();
customExpect(wormholeRelayer, globalsInstance["L2WormholeRelayerAddress"], log + ", function: wormholeRelayer()");

// Check source governor chain Id
const sourceGovernorChainId = await wormholeMessenger.sourceGovernorChainId();
customExpect(sourceGovernorChainId, globalsInstance["sourceGovernorChainId"], log + ", function: sourceGovernorChainId()");
customExpect(sourceGovernorChainId.toString(), globalsInstance["sourceGovernorChainId"], log + ", function: sourceGovernorChainId()");
}

async function main() {
Expand Down Expand Up @@ -454,8 +454,8 @@ async function main() {
"chiado": "scripts/deployment/bridges/gnosis/globals_gnosis_chiado.json",
"optimistic": "scripts/deployment/bridges/optimistic/globals_optimistic_mainnet.json",
"optimisticSepolia": "scripts/deployment/bridges/optimistic/globals_optimistic_sepolia.json",
"base": "scripts/deployment/bridges/base/globals_base_mainnet.json",
"baseSepolia": "scripts/deployment/bridges/base/globals_base_sepolia.json",
"base": "scripts/deployment/bridges/optimistic/globals_base_mainnet.json",
"baseSepolia": "scripts/deployment/bridges/optimistic/globals_base_sepolia.json",
"celo": "scripts/deployment/bridges/wormhole/globals_celo_mainnet.json",
"celoAlfajores": "scripts/deployment/bridges/wormhole/globals_celo_alfajores.json"
};
Expand Down Expand Up @@ -523,11 +523,6 @@ async function main() {

// L2 contracts
for (let i = 2; i < numChains; i++) {
// Skip chains that are not yet fully setup
if (configs[i]["chainId"] == "10" || configs[i]["chainId"] == "8453" || configs[i]["chainId"] == "42220") {
continue;
}

console.log("\n######## Verifying setup on CHAIN ID", configs[i]["chainId"]);

const initLog = "ChainId: " + configs[i]["chainId"] + ", network: " + configs[i]["name"];
Expand Down
1 change: 1 addition & 0 deletions scripts/deployment/bridges/gnosis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Parameters of the `globals.json` file:
- `contractVerification`: flag for verifying contracts in deployment scripts (`true`) or skipping it (`false`);
- `useLedger`: flag whether to use the hardware wallet (`true`) or proceed with the seed-phrase accounts (`false`);
- `derivationPath`: string with the derivation path;
- `providerName`: a network type (see `hardhat.config.js` for the network configurations);
- `gasPriceInGwei`: gas price in Gwei;
- `AMBContractProxyHomeAddress`: (Gnosis) AMB Contract Proxy Homeaddress serving as a system processor of inbound calls across the bridge;
- `timelockAddress`: Timelock address on the root L1 network;
Expand Down
4 changes: 3 additions & 1 deletion scripts/deployment/bridges/optimistic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Create a `globals.json` file in the root folder, or copy it from the file with p
Parameters of the `globals.json` file:
- `contractVerification`: flag for verifying contracts in deployment scripts (`true`) or skipping it (`false`);
- `useLedger`: flag whether to use the hardware wallet (`true`) or proceed with the seed-phrase accounts (`false`);
- `derivationPath`: string with the derivation path;
- `providerName`: a network type (see `hardhat.config.js` for the network configurations);
- `gasPriceInGwei`: gas price in Gwei;
- `networkURL`: string with the network RPC URL;
- `gasPriceInGwei`: gas price in Gwei;
- `L2CrossDomainMessengerAddress`: (Optimism and Base) CFM Contract Proxy address serving as a system processor of inbound calls across the bridge;
- `timelockAddress`: Timelock address on the root L1 network;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"base","gasPriceInGwei":"2","networkURL":"https://mainnet.base.org","L1CrossDomainMessengerProxyAddress":"0x866E82a600A1414e583f7F13623F1aC5d58b0Afa","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007"}
{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"base","gasPriceInGwei":"2","networkURL":"https://mainnet.base.org","L1CrossDomainMessengerProxyAddress":"0x866E82a600A1414e583f7F13623F1aC5d58b0Afa","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"baseSepolia","gasPriceInGwei":"2","networkURL":"https://sepolia.base.org","L1CrossDomainMessengerProxyAddress":"0xC34855F4De64F1840e5686e64278da901e261f20","timelockAddress":"0x04A0afD079F14D539B17253Ea93563934A024165","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0xeDd71796B90eaCc56B074C39BAC90ED2Ca6D93Ee"}
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"baseSepolia","gasPriceInGwei":"2","networkURL":"https://sepolia.base.org","L1CrossDomainMessengerProxyAddress":"0xC34855F4De64F1840e5686e64278da901e261f20","timelockAddress":"0x04A0afD079F14D539B17253Ea93563934A024165","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0x6f7661F52fE1919996d0A4F68D09B344093a349d"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"optimistic","gasPriceInGwei":"2","networkURL":"https://optimism.drpc.org","L1CrossDomainMessengerProxyAddress":"0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007"}
{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"optimistic","gasPriceInGwei":"2","networkURL":"https://optimism.drpc.org","L1CrossDomainMessengerProxyAddress":"0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0x87c511c8aE3fAF0063b3F3CF9C6ab96c4AA5C60c"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"optimisticSepolia","gasPriceInGwei":"2","networkURL":"https://sepolia.optimism.io","L1CrossDomainMessengerProxyAddress":"0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef","timelockAddress":"0x43d28764bB39936185c84906983fB57A8A905a4F","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0x670Ac235EE13C0B2a5065282bBB0c61cfB354592"}
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"optimisticSepolia","gasPriceInGwei":"2","networkURL":"https://sepolia.optimism.io","L1CrossDomainMessengerProxyAddress":"0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef","timelockAddress":"0x43d28764bB39936185c84906983fB57A8A905a4F","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0xaC26774616bbeD41b0CB69EA2ae7de366F430b23"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"baseSepolia","gasPriceInGwei":"2","networkURL":"https://sepolia.base.org","L1CrossDomainMessengerProxyAddress":"0xC34855F4De64F1840e5686e64278da901e261f20","timelockAddress":"0x04A0afD079F14D539B17253Ea93563934A024165","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0xeDd71796B90eaCc56B074C39BAC90ED2Ca6D93Ee","childMockERC20Address":"0x17806E2a12d5E0F48C9803cd397DB3F044DA3b77"}
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"baseSepolia","gasPriceInGwei":"2","networkURL":"https://sepolia.base.org","L1CrossDomainMessengerProxyAddress":"0xC34855F4De64F1840e5686e64278da901e261f20","timelockAddress":"0x04A0afD079F14D539B17253Ea93563934A024165","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0x6f7661F52fE1919996d0A4F68D09B344093a349d","childMockERC20Address":"0xc2c7E40674f1C7Bb99eFe5680Efd79842502bED4"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"optimisticSepolia","gasPriceInGwei":"2","networkURL":"https://sepolia.optimism.io","L1CrossDomainMessengerProxyAddress":"0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef","timelockAddress":"0x43d28764bB39936185c84906983fB57A8A905a4F","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0x670Ac235EE13C0B2a5065282bBB0c61cfB354592","childMockERC20Address":"0x118173028162C1b7c6Bf8488bd5dA2abd7c30F9D"}
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"optimisticSepolia","gasPriceInGwei":"2","networkURL":"https://sepolia.optimism.io","L1CrossDomainMessengerProxyAddress":"0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef","timelockAddress":"0x43d28764bB39936185c84906983fB57A8A905a4F","L2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","optimismMessengerAddress":"0xaC26774616bbeD41b0CB69EA2ae7de366F430b23","childMockERC20Address":"0x0338893fB1A1D9Df03F72CC53D8f786487d3D03E"}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function main() {
const CDMProxy = new ethers.Contract(CDMProxyAddress, CDMProxyABI, sepoliaProvider);

// Test deployed OptimismMessenger address on baseSepolia
const optimismMessengerAddress = "0xeDd71796B90eaCc56B074C39BAC90ED2Ca6D93Ee"; // payable process on L2
const optimismMessengerAddress = "0x6f7661F52fE1919996d0A4F68D09B344093a349d"; // payable process on L2
const optimismMessengerJSON = "artifacts/contracts/bridges/OptimismMessenger.sol/OptimismMessenger.json";
contractFromJSON = fs.readFileSync(optimismMessengerJSON, "utf8");
let parsedFile = JSON.parse(contractFromJSON);
Expand All @@ -43,7 +43,7 @@ async function main() {
const mockTimelock = new ethers.Contract(mockTimelockAddress, mockTimelockABI, sepoliaProvider);

// ChildMockERC20 address on baseSepolia
const mockChildERC20Address = "0x17806E2a12d5E0F48C9803cd397DB3F044DA3b77";
const mockChildERC20Address = "0xc2c7E40674f1C7Bb99eFe5680Efd79842502bED4";
const mockChildERC20JSON = "artifacts/contracts/bridges/test/ChildMockERC20.sol/ChildMockERC20.json";
contractFromJSON = fs.readFileSync(mockChildERC20JSON, "utf8");
parsedFile = JSON.parse(contractFromJSON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function main() {
const CDMProxy = new ethers.Contract(CDMProxyAddress, CDMProxyABI, sepoliaProvider);

// Test deployed OptimismMessenger address on optimisticSepolia
const optimismMessengerAddress = "0x670Ac235EE13C0B2a5065282bBB0c61cfB354592"; // payable process on L2
const optimismMessengerAddress = "0xaC26774616bbeD41b0CB69EA2ae7de366F430b23"; // payable process on L2
const optimismMessengerJSON = "artifacts/contracts/bridges/OptimismMessenger.sol/OptimismMessenger.json";
contractFromJSON = fs.readFileSync(optimismMessengerJSON, "utf8");
let parsedFile = JSON.parse(contractFromJSON);
Expand All @@ -43,7 +43,7 @@ async function main() {
const mockTimelock = new ethers.Contract(mockTimelockAddress, mockTimelockABI, sepoliaProvider);

// ChildMockERC20 address on optimisticSepolia
const mockChildERC20Address = "0x118173028162C1b7c6Bf8488bd5dA2abd7c30F9D";
const mockChildERC20Address = "0x0338893fB1A1D9Df03F72CC53D8f786487d3D03E";
const mockChildERC20JSON = "artifacts/contracts/bridges/test/ChildMockERC20.sol/ChildMockERC20.json";
contractFromJSON = fs.readFileSync(mockChildERC20JSON, "utf8");
parsedFile = JSON.parse(contractFromJSON);
Expand Down
Loading

0 comments on commit 4c98af0

Please sign in to comment.