Skip to content

Commit

Permalink
chore: adding addresses on Mode and adjusting static audit
Browse files Browse the repository at this point in the history
  • Loading branch information
kupermind committed Oct 16, 2024
1 parent f028f95 commit b3c7937
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 156 deletions.
111 changes: 0 additions & 111 deletions docs/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,57 +55,6 @@
}
]
},
{
"name": "goerli",
"chainId": "5",
"contracts": [
{
"name": "OLAS",
"artifact": "abis/0.8.15/OLAS.json",
"address": "0xEdfc28215B1Eb6eb0be426f1f529cf691A5C2400"
},
{
"name": "Timelock",
"artifact": "abis/0.8.15/Timelock.json",
"address": "0x34C895f302D0b5cf52ec0Edd3945321EB0f83dd5"
},
{
"name": "veOLAS",
"artifact": "abis/0.8.15/veOLAS.json",
"address": "0xf8B20e160557c747E8640CdcE77E1dd44bCaAfbB"
},
{
"name": "buOLAS",
"artifact": "abis/0.8.15/buOLAS.json",
"address": "0x397125902ED2cA2d42104F621f448A2cE1bC8Fb7"
},
{
"name": "wveOLAS",
"artifact": "abis/0.8.19/wveOLAS.json",
"address": "0xa2AA89938805836077aB0724f335142da7A27085"
},
{
"name": "GovernorOLAS",
"artifact": "abis/0.8.20/GovernorOLAS.json",
"address": "0x63b0f322837a7160B7E3d95C60aAaeB4EF1aECcb"
},
{
"name": "GuardCM",
"artifact": "abis/0.8.23/GuardCM.json",
"address": "0xe07949B74bED0dac21BA74B4371155520FE6a560"
},
{
"name": "BridgedERC20",
"artifact": "abis/0.8.23/BridgedERC20.json",
"address": "0x0CF8ad7AD779157a253964036af0e95f625EA27c"
},
{
"name": "FxERC20RootTunnel",
"artifact": "abis/0.8.23/FxERC20RootTunnel.json",
"address": "0x7E335396a9804097Fd7c04F8b3adc314Ca9398A0"
}
]
},
{
"name": "polygon",
"chainId": "137",
Expand All @@ -122,22 +71,6 @@
}
]
},
{
"name": "polygonMumbai",
"chainId": "80001",
"contracts": [
{
"name": "FxGovernorTunnel",
"artifact": "abis/0.8.19/FxGovernorTunnel.json",
"address": "0x17806E2a12d5E0F48C9803cd397DB3F044DA3b77"
},
{
"name": "FxERC20ChildTunnel",
"artifact": "abis/0.8.23/FxERC20ChildTunnel.json",
"address": "0x5b5C7BA8424e6B48f92Ac02980FFc2531c3196DF"
}
]
},
{
"name": "gnosis",
"chainId": "100",
Expand All @@ -149,17 +82,6 @@
}
]
},
{
"name": "chiado",
"chainId": "10200",
"contracts": [
{
"name": "HomeMediator",
"artifact": "abis/0.8.19/HomeMediator.json",
"address": "0x670Ac235EE13C0B2a5065282bBB0c61cfB354592"
}
]
},
{
"name": "optimistic",
"chainId": "10",
Expand All @@ -171,17 +93,6 @@
}
]
},
{
"name": "optimisticSepolia",
"chainId": "11155420",
"contracts": [
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": "0xaC26774616bbeD41b0CB69EA2ae7de366F430b23"
}
]
},
{
"name": "base",
"chainId": "8453",
Expand All @@ -193,17 +104,6 @@
}
]
},
{
"name": "baseSepolia",
"chainId": "84532",
"contracts": [
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": "0x6f7661F52fE1919996d0A4F68D09B344093a349d"
}
]
},
{
"name": "celo",
"chainId": "42220",
Expand All @@ -215,17 +115,6 @@
}
]
},
{
"name": "celoAlfajores",
"chainId": "44787",
"contracts": [
{
"name": "WormholeMessenger",
"artifact": "abis/0.8.23/WormholeMessenger.json",
"address": "0xadBBC3FE82836366Bb178Fd210d4dd915e9B3415"
}
]
},
{
"name": "mode",
"chainId": "34443",
Expand Down
7 changes: 4 additions & 3 deletions docs/olas_bridging.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ In a table below one can find OLAS token addresses on corresponding chains and b
| Polygon PoS | [0xFEF5d947472e72Efbb2E388c730B7428406F2F95](https://polygonscan.com/token/0xFEF5d947472e72Efbb2E388c730B7428406F2F95) | [Polygon Portal](https://portal.polygon.technology/bridge) |
| Solana | [Ez3nzG9ofodYCvEmw73XhQ87LWNYVRM2s7diB5tBZPyM](https://solscan.io/token/Ez3nzG9ofodYCvEmw73XhQ87LWNYVRM2s7diB5tBZPyM) | [Wormhole Portal](https://portalbridge.com/advanced-tools/#/transfer) |
| Arbitrum | [0x064f8b858c2a603e1b106a2039f5446d32dc81c1](https://arbiscan.io/token/0x064f8b858c2a603e1b106a2039f5446d32dc81c1) | [Arbitrum Bridge](https://bridge.arbitrum.io) |
| Optimism | [0xFC2E6e6BCbd49ccf3A5f029c79984372DcBFE527](https://optimistic.etherscan.io/token/0xFC2E6e6BCbd49ccf3A5f029c79984372DcBFE527) | [Optimism Bridge](https://app.optimism.io/bridge/deposit) |
| Base | [0x54330d28ca3357F294334BDC454a032e7f353416](https://basescan.org/token/0x54330d28ca3357F294334BDC454a032e7f353416) | [Base Bridge](https://bridge.base.org/deposit) |
| Celo | [0xaCFfAe8e57Ec6E394Eb1b41939A8CF7892DbDc51](https://celoscan.io/token/0xacffae8e57ec6e394eb1b41939a8cf7892dbdc51) | [Wormhole Portal](https://portalbridge.com/advanced-tools/#/transfer) |
| Optimism | [0xFC2E6e6BCbd49ccf3A5f029c79984372DcBFE527](https://optimistic.etherscan.io/token/0xFC2E6e6BCbd49ccf3A5f029c79984372DcBFE527) | [Optimism Bridge](https://superbridge.app/optimism) |
| Base | [0x54330d28ca3357F294334BDC454a032e7f353416](https://basescan.org/token/0x54330d28ca3357F294334BDC454a032e7f353416) | [Base Bridge](https://superbridge.app/base) |
| Celo | [0xaCFfAe8e57Ec6E394Eb1b41939A8CF7892DbDc51](https://celoscan.io/token/0xacffae8e57ec6e394eb1b41939a8cf7892dbdc51) | [Wormhole Portal](https://portalbridge.com/advanced-tools/#/transfer) |
| Mode | [0xcfD1D50ce23C46D3Cf6407487B2F8934e96DC8f9](https://explorer.mode.network/address/0xcfD1D50ce23C46D3Cf6407487B2F8934e96DC8f9) | [Mode Bridge](https://superbridge.app/mode) |
70 changes: 28 additions & 42 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 = true;
const verifyRepo = false;
const verifySetup = true;

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

async function main() {
// Check for the API keys
if (!process.env.ALCHEMY_API_KEY_MAINNET || !process.env.ALCHEMY_API_KEY_GOERLI ||
!process.env.ALCHEMY_API_KEY_MATIC || !process.env.ALCHEMY_API_KEY_MUMBAI) {
if (!process.env.ALCHEMY_API_KEY_MAINNET || !process.env.ALCHEMY_API_KEY_SEPOLIA ||
!process.env.ALCHEMY_API_KEY_MATIC || !process.env.ALCHEMY_API_KEY_AMOY) {
console.log("Check API keys!");
return;
}
Expand All @@ -410,17 +410,15 @@ async function main() {
// For now gnosis chains are not supported
const networks = {
"mainnet": "etherscan",
"goerli": "goerli.etherscan",
"polygon": "polygonscan",
"polygonMumbai": "testnet.polygonscan",
"optimistic": "optimistic.etherscan"
};

console.log("\nVerifying deployed contracts vs the repo... If no error is output, then the contracts are correct.");

// Traverse all chains
for (let i = 0; i < numChains; i++) {
// Skip gnosis chains
// Skip unsupported chains
if (!networks[configs[i]["name"]]) {
continue;
}
Expand All @@ -447,32 +445,22 @@ async function main() {
if (verifySetup) {
const globalNames = {
"mainnet": "scripts/deployment/globals_mainnet.json",
"goerli": "scripts/deployment/globals_goerli.json",
"polygon": "scripts/deployment/bridges/polygon/globals_polygon_mainnet.json",
"polygonMumbai": "scripts/deployment/bridges/polygon/globals_polygon_mumbai.json",
"gnosis": "scripts/deployment/bridges/gnosis/globals_gnosis_mainnet.json",
"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/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"
"mode": "scripts/deployment/bridges/optimistic/globals_mode_mainnet.json"
};

const providerLinks = {
"mainnet": "https://eth-mainnet.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MAINNET,
"goerli": "https://eth-goerli.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_GOERLI,
"polygon": "https://polygon-mainnet.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MATIC,
"polygonMumbai": "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI,
"gnosis": "https://rpc.gnosischain.com",
"chiado": "https://rpc.chiadochain.net",
"optimistic": "https://optimism.drpc.org",
"optimisticSepolia": "https://sepolia.optimism.io",
"base": "https://mainnet.base.org",
"baseSepolia": "https://sepolia.base.org",
"celo": "https://forno.celo.org",
"celoAlfajores": "https://alfajores-forno.celo-testnet.org"
"mode": "https://mainnet.mode.network"
};

// Get all the globals processed
Expand All @@ -488,41 +476,39 @@ async function main() {
console.log("\nVerifying deployed contracts setup... If no error is output, then the contracts are correct.");

// L1 contracts
for (let i = 0; i < 2; i++) {
console.log("\n######## Verifying setup on CHAIN ID", configs[i]["chainId"]);
console.log("\n######## Verifying setup on CHAIN ID", configs[0]["chainId"]);

const initLog = "ChainId: " + configs[i]["chainId"] + ", network: " + configs[i]["name"];
const initLog = "ChainId: " + configs[0]["chainId"] + ", network: " + configs[0]["name"];

let log = initLog + ", contract: " + "OLAS";
await checkOLAS(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "OLAS", log);
let log = initLog + ", contract: " + "OLAS";
await checkOLAS(configs[0]["chainId"], providers[0], globals[0], configs[0]["contracts"], "OLAS", log);

log = initLog + ", contract: " + "Timelock";
await checkTimelock(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "Timelock", log);
log = initLog + ", contract: " + "Timelock";
await checkTimelock(configs[0]["chainId"], providers[0], globals[0], configs[0]["contracts"], "Timelock", log);

log = initLog + ", contract: " + "veOLAS";
await checkVEOLAS(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "veOLAS", log);
log = initLog + ", contract: " + "veOLAS";
await checkVEOLAS(configs[0]["chainId"], providers[0], globals[0], configs[0]["contracts"], "veOLAS", log);

log = initLog + ", contract: " + "buOLAS";
await checkBUOLAS(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "buOLAS", log);
log = initLog + ", contract: " + "buOLAS";
await checkBUOLAS(configs[0]["chainId"], providers[0], globals[0], configs[0]["contracts"], "buOLAS", log);

log = initLog + ", contract: " + "wveOLAS";
await checkWrappedVEOLAS(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "wveOLAS", log);
log = initLog + ", contract: " + "wveOLAS";
await checkWrappedVEOLAS(configs[0]["chainId"], providers[0], globals[0], configs[0]["contracts"], "wveOLAS", log);

log = initLog + ", contract: " + "GovernorOLAS";
await checkGovernorOLAS(configs[i]["chainId"], providers[i], globals[i], globals[0], configs[i]["contracts"], "GovernorOLAS", log);
log = initLog + ", contract: " + "GovernorOLAS";
await checkGovernorOLAS(configs[0]["chainId"], providers[0], globals[0], globals[0], configs[0]["contracts"], "GovernorOLAS", log);

log = initLog + ", contract: " + "GuardCM";
await checkGuardCM(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "GuardCM", log);
log = initLog + ", contract: " + "GuardCM";
await checkGuardCM(configs[0]["chainId"], providers[0], globals[0], configs[0]["contracts"], "GuardCM", log);

log = initLog + ", contract: " + "BridgedERC20";
await checkBridgedERC20(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "BridgedERC20", log);
log = initLog + ", contract: " + "BridgedERC20";
await checkBridgedERC20(configs[0]["chainId"], providers[0], globals[0], configs[0]["contracts"], "BridgedERC20", log);

log = initLog + ", contract: " + "FxERC20RootTunnel";
await checkFxERC20RootTunnel(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "FxERC20RootTunnel", log);
}
log = initLog + ", contract: " + "FxERC20RootTunnel";
await checkFxERC20RootTunnel(configs[0]["chainId"], providers[0], globals[0], configs[0]["contracts"], "FxERC20RootTunnel", log);

// L2 contracts
for (let i = 2; i < numChains; i++) {
for (let i = 1; i < numChains; i++) {
console.log("\n######## Verifying setup on CHAIN ID", configs[i]["chainId"]);

const initLog = "ChainId: " + configs[i]["chainId"] + ", network: " + configs[i]["name"];
Expand All @@ -536,7 +522,7 @@ async function main() {
} else if (configs[i]["chainId"] == "100" || configs[i]["chainId"] == "10200") {
let log = initLog + ", contract: " + "HomeMediator";
await checkHomeMediator(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "HomeMediator", log);
} else if (configs[i]["chainId"] == "10" || configs[i]["chainId"] == "11155420" || configs[i]["chainId"] == "8453" || configs[i]["chainId"] == "84532") {
} else if (configs[i]["chainId"] == "10" || configs[i]["chainId"] == "11155420" || configs[i]["chainId"] == "8453" || configs[i]["chainId"] == "84532" || configs[i]["chainId"] == "34443") {
let log = initLog + ", contract: " + "OptimismMessenger";
await checkOptimismMessenger(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "OptimismMessenger", log);
} else if (configs[i]["chainId"] == "42220" || configs[i]["chainId"] == "44787") {
Expand Down

0 comments on commit b3c7937

Please sign in to comment.