From cd3b8c411856aa346cdcc75db3b819447990d327 Mon Sep 17 00:00:00 2001 From: Aleksandr Kuperman Date: Thu, 24 Oct 2024 17:09:30 +0100 Subject: [PATCH 1/4] chore: add to static audit script --- docs/configuration.json | 308 ------------------ scripts/audit_chains/audit_contracts_setup.js | 152 +++++---- scripts/deployment/globals_mainnet.json | 2 +- .../deployment/l2/globals_mode_mainnet.json | 2 +- 4 files changed, 99 insertions(+), 365 deletions(-) diff --git a/docs/configuration.json b/docs/configuration.json index 4e4fd65a..20739823 100644 --- a/docs/configuration.json +++ b/docs/configuration.json @@ -65,57 +65,6 @@ } ] }, - { - "name": "goerli", - "chainId": "5", - "contracts": [ - { - "name": "ComponentRegistry", - "artifact": "abis/0.8.15/ComponentRegistry.json", - "address": "0x7Fd1F4b764fA41d19fe3f63C85d12bf64d2bbf68" - }, - { - "name": "AgentRegistry", - "artifact": "abis/0.8.15/AgentRegistry.json", - "address": "0xEB5638eefE289691EcE01943f768EDBF96258a80" - }, - { - "name": "RegistriesManager", - "artifact": "abis/0.8.15/RegistriesManager.json", - "address": "0x10c5525F77F13b28f42c5626240c001c2D57CAd4" - }, - { - "name": "ServiceRegistry", - "artifact": "abis/0.8.15/ServiceRegistry.json", - "address": "0x1cEe30D08943EB58EFF84DD1AB44a6ee6FEff63a" - }, - { - "name": "ServiceRegistryTokenUtility", - "artifact": "abis/0.8.19/ServiceRegistryTokenUtility.json", - "address": "0x6d9b08701Af43D68D991c074A27E4d90Af7f2276" - }, - { - "name": "ServiceManagerToken", - "artifact": "abis/0.8.19/ServiceManagerToken.json", - "address": "0x1d333b46dB6e8FFd271b6C2D2B254868BD9A2dbd" - }, - { - "name": "GnosisSafeMultisig", - "artifact": "abis/0.8.15/GnosisSafeMultisig.json", - "address": "0x65dD51b02049ad1B6FF7fa9Ea3322E1D2CAb1176" - }, - { - "name": "GnosisSafeSameAddressMultisig", - "artifact": "abis/0.8.21/GnosisSafeSameAddressMultisig.json", - "address": "0x06467Cb835da623384a22aa902647784C1c9f5Ae" - }, - { - "name": "OperatorWhitelist", - "artifact": "abis/0.8.19/OperatorWhitelist.json", - "address": "0x0338893fB1A1D9Df03F72CC53D8f786487d3D03E" - } - ] - }, { "name": "polygon", "chainId": "137", @@ -172,47 +121,6 @@ } ] }, - { - "name": "polygonMumbai", - "chainId": "80001", - "contracts": [ - { - "name": "ServiceRegistryL2", - "artifact": "abis/0.8.19/ServiceRegistryL2.json", - "address": "0xf805DfF246CC208CD2F08ffaD242b7C32bc93623" - }, - { - "name": "ServiceManager", - "artifact": "abis/0.8.19/ServiceManager.json", - "address": "0x43d28764bB39936185c84906983fB57A8A905a4F" - }, - { - "name": "ServiceRegistryTokenUtility", - "artifact": "abis/0.8.23/ServiceRegistryTokenUtility.json", - "address": "0x131b5551c81e9B3E89E9ACE30A5B3D45144E3e42" - }, - { - "name": "ServiceManagerToken", - "artifact": "abis/0.8.23/ServiceManagerToken.json", - "address": "0xE16adc7777B7C2a0d35033bd3504C028AB28EE8b" - }, - { - "name": "GnosisSafeMultisig", - "artifact": "abis/0.8.19/GnosisSafeMultisig.json", - "address": "0x9dEc6B62c197268242A768dc3b153AE7a2701396" - }, - { - "name": "GnosisSafeSameAddressMultisig", - "artifact": "abis/0.8.19/GnosisSafeSameAddressMultisig.json", - "address": "0xd6AA4Ec948d84f6Db8EEf25104CeE0Ecd280C74e" - }, - { - "name": "OperatorWhitelist", - "artifact": "abis/0.8.23/OperatorWhitelist.json", - "address": "0x118173028162C1b7c6Bf8488bd5dA2abd7c30F9D" - } - ] - }, { "name": "gnosis", "chainId": "100", @@ -264,42 +172,6 @@ } ] }, - { - "name": "chiado", - "chainId": "10200", - "contracts": [ - { - "name": "ServiceRegistryL2", - "artifact": "abis/0.8.19/ServiceRegistryL2.json", - "address": "0x31D3202d8744B16A120117A053459DDFAE93c855" - }, - { - "name": "ServiceRegistryTokenUtility", - "artifact": "abis/0.8.19/ServiceRegistryTokenUtility.json", - "address": "0xc2c7E40674f1C7Bb99eFe5680Efd79842502bED4" - }, - { - "name": "ServiceManagerToken", - "artifact": "abis/0.8.19/ServiceManagerToken.json", - "address": "0xc965a32185590Eb5a5fffDba29E96126b7650eDe" - }, - { - "name": "OperatorWhitelist", - "artifact": "abis/0.8.19/OperatorWhitelist.json", - "address": "0x6f7661F52fE1919996d0A4F68D09B344093a349d" - }, - { - "name": "GnosisSafeMultisig", - "artifact": "abis/0.8.19/GnosisSafeMultisig.json", - "address": "0xeB49bE5DF00F74bd240DE4535DDe6Bc89CEfb994" - }, - { - "name": "GnosisSafeSameAddressMultisig", - "artifact": "abis/0.8.21/GnosisSafeSameAddressMultisig.json", - "address": "0xE16adc7777B7C2a0d35033bd3504C028AB28EE8b" - } - ] - }, { "name": "arbitrumOne", "chainId": "42161", @@ -351,42 +223,6 @@ } ] }, - { - "name": "arbitrumSepolia", - "chainId": "421614", - "contracts": [ - { - "name": "ServiceRegistryL2", - "artifact": "abis/0.8.23/ServiceRegistryL2.json", - "address": "0x31D3202d8744B16A120117A053459DDFAE93c855" - }, - { - "name": "ServiceRegistryTokenUtility", - "artifact": "abis/0.8.23/ServiceRegistryTokenUtility.json", - "address": "0xeB49bE5DF00F74bd240DE4535DDe6Bc89CEfb994" - }, - { - "name": "ServiceManagerToken", - "artifact": "abis/0.8.23/ServiceManagerToken.json", - "address": "0x5BA58970c2Ae16Cf6218783018100aF2dCcFc915" - }, - { - "name": "OperatorWhitelist", - "artifact": "abis/0.8.23/OperatorWhitelist.json", - "address": "0x29086141ecdc310058fc23273F8ef7881d20C2f7" - }, - { - "name": "GnosisSafeMultisig", - "artifact": "abis/0.8.23/GnosisSafeMultisig.json", - "address": "0x19936159B528C66750992C3cBcEd2e71cF4E4824" - }, - { - "name": "GnosisSafeSameAddressMultisig", - "artifact": "abis/0.8.23/GnosisSafeSameAddressMultisig.json", - "address": "0x10100e74b7F706222F8A7C0be9FC7Ae1717Ad8B2" - } - ] - }, { "name": "optimistic", "chainId": "10", @@ -438,42 +274,6 @@ } ] }, - { - "name": "optimisticSepolia", - "chainId": "11155420", - "contracts": [ - { - "name": "ServiceRegistryL2", - "artifact": "abis/0.8.23/ServiceRegistryL2.json", - "address": "0x31D3202d8744B16A120117A053459DDFAE93c855" - }, - { - "name": "ServiceRegistryTokenUtility", - "artifact": "abis/0.8.23/ServiceRegistryTokenUtility.json", - "address": "0xeB49bE5DF00F74bd240DE4535DDe6Bc89CEfb994" - }, - { - "name": "ServiceManagerToken", - "artifact": "abis/0.8.23/ServiceManagerToken.json", - "address": "0x5BA58970c2Ae16Cf6218783018100aF2dCcFc915" - }, - { - "name": "OperatorWhitelist", - "artifact": "abis/0.8.23/OperatorWhitelist.json", - "address": "0x29086141ecdc310058fc23273F8ef7881d20C2f7" - }, - { - "name": "GnosisSafeMultisig", - "artifact": "abis/0.8.23/GnosisSafeMultisig.json", - "address": "0x19936159B528C66750992C3cBcEd2e71cF4E4824" - }, - { - "name": "GnosisSafeSameAddressMultisig", - "artifact": "abis/0.8.23/GnosisSafeSameAddressMultisig.json", - "address": "0x10100e74b7F706222F8A7C0be9FC7Ae1717Ad8B2" - } - ] - }, { "name": "base", "chainId": "8453", @@ -525,42 +325,6 @@ } ] }, - { - "name": "baseSepolia", - "chainId": "84532", - "contracts": [ - { - "name": "ServiceRegistryL2", - "artifact": "abis/0.8.23/ServiceRegistryL2.json", - "address": "0x31D3202d8744B16A120117A053459DDFAE93c855" - }, - { - "name": "ServiceRegistryTokenUtility", - "artifact": "abis/0.8.23/ServiceRegistryTokenUtility.json", - "address": "0xeB49bE5DF00F74bd240DE4535DDe6Bc89CEfb994" - }, - { - "name": "ServiceManagerToken", - "artifact": "abis/0.8.23/ServiceManagerToken.json", - "address": "0x5BA58970c2Ae16Cf6218783018100aF2dCcFc915" - }, - { - "name": "OperatorWhitelist", - "artifact": "abis/0.8.23/OperatorWhitelist.json", - "address": "0x29086141ecdc310058fc23273F8ef7881d20C2f7" - }, - { - "name": "GnosisSafeMultisig", - "artifact": "abis/0.8.23/GnosisSafeMultisig.json", - "address": "0x19936159B528C66750992C3cBcEd2e71cF4E4824" - }, - { - "name": "GnosisSafeSameAddressMultisig", - "artifact": "abis/0.8.23/GnosisSafeSameAddressMultisig.json", - "address": "0x10100e74b7F706222F8A7C0be9FC7Ae1717Ad8B2" - } - ] - }, { "name": "celo", "chainId": "42220", @@ -612,42 +376,6 @@ } ] }, - { - "name": "celoAlfajores", - "chainId": "44787", - "contracts": [ - { - "name": "ServiceRegistryL2", - "artifact": "abis/0.8.23/ServiceRegistryL2.json", - "address": "0x31D3202d8744B16A120117A053459DDFAE93c855" - }, - { - "name": "ServiceRegistryTokenUtility", - "artifact": "abis/0.8.23/ServiceRegistryTokenUtility.json", - "address": "0xeB49bE5DF00F74bd240DE4535DDe6Bc89CEfb994" - }, - { - "name": "ServiceManagerToken", - "artifact": "abis/0.8.23/ServiceManagerToken.json", - "address": "0x5BA58970c2Ae16Cf6218783018100aF2dCcFc915" - }, - { - "name": "OperatorWhitelist", - "artifact": "abis/0.8.23/OperatorWhitelist.json", - "address": "0x29086141ecdc310058fc23273F8ef7881d20C2f7" - }, - { - "name": "GnosisSafeMultisig", - "artifact": "abis/0.8.23/GnosisSafeMultisig.json", - "address": "0x19936159B528C66750992C3cBcEd2e71cF4E4824" - }, - { - "name": "GnosisSafeSameAddressMultisig", - "artifact": "abis/0.8.23/GnosisSafeSameAddressMultisig.json", - "address": "0x10100e74b7F706222F8A7C0be9FC7Ae1717Ad8B2" - } - ] - }, { "name": "mode", "chainId": "34443", @@ -703,41 +431,5 @@ "address": "0x75D529FAe220bC8db714F0202193726b46881B76" } ] - }, - { - "name": "modeSepolia", - "chainId": "919", - "contracts": [ - { - "name": "ServiceRegistryL2", - "artifact": "abis/0.8.28/ServiceRegistryL2.json", - "address": "0x5BA58970c2Ae16Cf6218783018100aF2dCcFc915" - }, - { - "name": "ServiceRegistryTokenUtility", - "artifact": "abis/0.8.28/ServiceRegistryTokenUtility.json", - "address": "0x10100e74b7F706222F8A7C0be9FC7Ae1717Ad8B2" - }, - { - "name": "ServiceManagerToken", - "artifact": "abis/0.8.28/ServiceManagerToken.json", - "address": "0x7bedCA17D29e53C8062d10902a6219F8d1E3B9B5" - }, - { - "name": "OperatorWhitelist", - "artifact": "abis/0.8.28/OperatorWhitelist.json", - "address": "0x19936159B528C66750992C3cBcEd2e71cF4E4824" - }, - { - "name": "GnosisSafeMultisig", - "artifact": "abis/0.8.28/GnosisSafeMultisig.json", - "address": "0x0a50009D55Ed5700ac8FF713709d5Ad5fa843896" - }, - { - "name": "GnosisSafeSameAddressMultisig", - "artifact": "abis/0.8.28/GnosisSafeSameAddressMultisig.json", - "address": "0x77290FF625fc576f465D0256F6a12Ce4480a5b8a" - } - ] } ] \ No newline at end of file diff --git a/scripts/audit_chains/audit_contracts_setup.js b/scripts/audit_chains/audit_contracts_setup.js index 6dd0b10f..8ebe0eac 100644 --- a/scripts/audit_chains/audit_contracts_setup.js +++ b/scripts/audit_chains/audit_contracts_setup.js @@ -77,7 +77,7 @@ async function findContractInstance(provider, configContracts, contractName) { // Check the contract owner async function checkOwner(chainId, contract, globalsInstance, log) { const owner = await contract.owner(); - if (chainId === "1" || chainId === "5") { + if (chainId === "1") { // Timelock for L1 customExpect(owner, globalsInstance["timelockAddress"], log + ", function: owner()"); } else { @@ -167,17 +167,12 @@ async function checkServiceRegistry(chainId, provider, globalsInstance, configCo // Check manager const manager = await serviceRegistry.manager(); - if (chainId !== "80001") { - // ServiceRegistryManagerToken for L1 and L2 that currently have the full setup - customExpect(manager, globalsInstance["serviceManagerTokenAddress"], log + ", function: manager()"); - } else { - // ServiceRegistryManager for L2 - customExpect(manager, globalsInstance["serviceManagerAddress"], log + ", function: manager()"); - } + // ServiceRegistryManagerToken + customExpect(manager, globalsInstance["serviceManagerTokenAddress"], log + ", function: manager()"); // Check drainer const drainer = await serviceRegistry.drainer(); - if (chainId === "1" || chainId === "5") { + if (chainId === "1") { // Treasury for L1 customExpect(drainer, globalsInstance["treasuryAddress"], log + ", function: drainer()"); } else { @@ -188,7 +183,7 @@ async function checkServiceRegistry(chainId, provider, globalsInstance, configCo } // Check agent registry for L1 only - if (chainId === "1" || chainId === "5") { + if (chainId === "1") { const agentRegistry = await serviceRegistry.agentRegistry(); customExpect(agentRegistry, globalsInstance["agentRegistryAddress"], log + ", function: agentRegistry()"); } @@ -220,21 +215,18 @@ async function checkServiceManager(chainId, provider, globalsInstance, configCon const paused = await serviceManager.paused(); customExpect(paused, false, log + ", function: paused()"); - // Checks for L1 and L2 that currently have the full setup - if (chainId !== "80001") { - // Version - const version = await serviceManager.version(); - customExpect(version, "1.1.1", log + ", function: version()"); + // Version + const version = await serviceManager.version(); + customExpect(version, "1.1.1", log + ", function: version()"); - // ServiceRegistryTokenUtility - const serviceRegistryTokenUtility = await serviceManager.serviceRegistryTokenUtility(); - customExpect(serviceRegistryTokenUtility, globalsInstance["serviceRegistryTokenUtilityAddress"], - log + ", function: serviceRegistryTokenUtility()"); + // ServiceRegistryTokenUtility + const serviceRegistryTokenUtility = await serviceManager.serviceRegistryTokenUtility(); + customExpect(serviceRegistryTokenUtility, globalsInstance["serviceRegistryTokenUtilityAddress"], + log + ", function: serviceRegistryTokenUtility()"); - // OperatorWhitelist - const operatorWhitelist = await serviceManager.operatorWhitelist(); - customExpect(operatorWhitelist, globalsInstance["operatorWhitelistAddress"], log + ", function: operatorWhitelist()"); - } + // OperatorWhitelist + const operatorWhitelist = await serviceManager.operatorWhitelist(); + customExpect(operatorWhitelist, globalsInstance["operatorWhitelistAddress"], log + ", function: operatorWhitelist()"); } // Check service registry token utility: chain Id, provider, parsed globals, configuration contracts, contract name @@ -256,7 +248,7 @@ async function checkServiceRegistryTokenUtility(chainId, provider, globalsInstan // Check drainer const drainer = await serviceRegistryTokenUtility.drainer(); - if (chainId === "1" || chainId === "5") { + if (chainId === "1") { customExpect(drainer, globalsInstance["timelockAddress"], log + ", function: drainer()"); } else { customExpect(drainer, globalsInstance["bridgeMediatorAddress"], log + ", function: drainer()"); @@ -314,10 +306,72 @@ async function checkGnosisSafeSameAddressImplementation(chainId, provider, globa customExpect(defaultDataLength, 20, log + ", function: DEFAULT_DATA_LENGTH()"); } +// Check staking verifier: chain Id, provider, parsed globals, configuration contracts, contract name +async function checkStakingVerifier(chainId, provider, globalsInstance, configContracts, contractName, log) { + // Check the bytecode + await checkBytecode(provider, configContracts, contractName, log); + + // Get the contract instance + const serviceVerifier = await findContractInstance(provider, configContracts, contractName); + + // Check owner + checkOwner(chainId, serviceVerifier, globalsInstance, log); + + log += ", address: " + serviceVerifier.address; + // Check OLAS + const olas = await serviceVerifier.olas(); + customExpect(olas, globalsInstance["olasAddress"], log + ", function: olas()"); + + // Check service registry + const serviceRegistry = await serviceVerifier.serviceRegistry(); + customExpect(serviceRegistry, globalsInstance["serviceRegistryAddress"], log + ", function: serviceRegistry()"); + + // Check service registry token utility + const serviceRegistryTokenUtility = await serviceVerifier.serviceRegistryTokenUtility(); + customExpect(serviceRegistryTokenUtility, globalsInstance["serviceRegistryTokenUtilityAddress"], log + ", function: serviceRegistryTokenUtility()"); + + // Check min staking deposit limit + const minStakingDepositLimit = await serviceVerifier.minStakingDepositLimit(); + customExpect(minStakingDepositLimit.toString(), globalsInstance["minStakingDepositLimit"], log + ", function: minStakingDepositLimit()"); + + // Check time for emissions limit + const timeForEmissionsLimit = await serviceVerifier.timeForEmissionsLimit(); + customExpect(timeForEmissionsLimit.toString(), globalsInstance["timeForEmissionsLimit"], log + ", function: timeForEmissionsLimit()"); + + // Check num services limit + const numServicesLimit = await serviceVerifier.numServicesLimit(); + customExpect(numServicesLimit.toString(), globalsInstance["numServicesLimit"], log + ", function: numServicesLimit()"); + + // Check APY limit + const apyLimit = await serviceVerifier.apyLimit(); + customExpect(apyLimit.toString(), globalsInstance["apyLimit"], log + ", function: apyLimit()"); + + // Check implementations check + const implementationsCheck = await serviceVerifier.implementationsCheck(); + customExpect(implementationsCheck, true, log + ", function: implementationsCheck()"); +} + +// Check staking factory: chain Id, provider, parsed globals, configuration contracts, contract name +async function checkStakingFactory(chainId, provider, globalsInstance, configContracts, contractName, log) { + // Check the bytecode + await checkBytecode(provider, configContracts, contractName, log); + + // Get the contract instance + const stakingFactory = await findContractInstance(provider, configContracts, contractName); + + // Check owner + checkOwner(chainId, stakingFactory, globalsInstance, log); + + log += ", address: " + stakingFactory.address; + // Check staking verifier + const verifier = await stakingFactory.verifier(); + customExpect(verifier, globalsInstance["stakingVerifierAddress"], log + ", function: verifier()"); +} + + 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_MATIC) { console.log("Check API keys!"); return; } @@ -334,9 +388,7 @@ async function main() { // For now gnosis chains are not supported const networks = { "mainnet": "etherscan", - "goerli": "goerli.etherscan", "polygon": "polygonscan", - "polygonMumbai": "testnet.polygonscan", "arbitrumOne": "arbiscan", "optimistic": "optimistic.etherscan" }; @@ -372,36 +424,24 @@ async function main() { if (verifySetup) { const globalNames = { "mainnet": "scripts/deployment/globals_mainnet.json", - "goerli": "scripts/deployment/globals_goerli.json", "polygon": "scripts/deployment/l2/globals_polygon_mainnet.json", - "polygonMumbai": "scripts/deployment/l2/globals_polygon_mumbai.json", "gnosis": "scripts/deployment/l2/globals_gnosis_mainnet.json", - "chiado": "scripts/deployment/l2/globals_gnosis_chiado.json", "arbitrumOne": "scripts/deployment/l2/globals_arbitrum_one.json", - "arbitrumSepolia": "scripts/deployment/l2/globals_arbitrum_sepolia.json", "optimistic": "scripts/deployment/l2/globals_optimistic_mainnet.json", - "optimisticSepolia": "scripts/deployment/l2/globals_optimistic_sepolia.json", "base": "scripts/deployment/l2/globals_base_mainnet.json", - "baseSepolia": "scripts/deployment/l2/globals_base_sepolia.json", "celo": "scripts/deployment/l2/globals_celo_mainnet.json", - "celoAlfajores": "scripts/deployment/l2/globals_celo_alfajores.json" + "mode": "scripts/deployment/l2/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", "arbitrumOne": "https://arb1.arbitrum.io/rpc", - "arbitrumSepolia": "https://sepolia-rollup.arbitrum.io/rpc", "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 @@ -417,13 +457,14 @@ async function main() { console.log("\nVerifying deployed contracts setup... If no error is output, then the contracts are correct."); for (let i = 0; i < numChains; i++) { + if (i == 4) continue; console.log("\n######## Verifying setup on CHAIN ID", configs[i]["chainId"]); const initLog = "ChainId: " + configs[i]["chainId"] + ", network: " + configs[i]["name"]; let log; // L1 only contracts - if (i < 2) { + if (i == 0) { log = initLog + ", contract: " + "ComponentRegistry"; await checkComponentRegistry(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ComponentRegistry", log); @@ -432,7 +473,7 @@ async function main() { } log = initLog + ", contract: " + "ServiceRegistry"; - if (i < 2) { + if (i == 0) { await checkServiceRegistry(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ServiceRegistry", log); } else { // L2 contracts addition @@ -441,25 +482,26 @@ async function main() { } // Path for chains that operate with the ServiceManagerToken - if (configs[i]["chainId"] !== "80001") { - log = initLog + ", contract: " + "ServiceManagerToken"; - await checkServiceManager(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ServiceManagerToken", log); + log = initLog + ", contract: " + "ServiceManagerToken"; + await checkServiceManager(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ServiceManagerToken", log); - log = initLog + ", contract: " + "ServiceRegistryTokenUtility"; - await checkServiceRegistryTokenUtility(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ServiceRegistryTokenUtility", log); + log = initLog + ", contract: " + "ServiceRegistryTokenUtility"; + await checkServiceRegistryTokenUtility(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ServiceRegistryTokenUtility", log); - log = initLog + ", contract: " + "OperatorWhitelist"; - await checkOperatorWhitelist(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "OperatorWhitelist", log); - } else { - log = initLog + ", contract: " + "ServiceManager"; - await checkServiceManager(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ServiceManager", log); - } + log = initLog + ", contract: " + "OperatorWhitelist"; + await checkOperatorWhitelist(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "OperatorWhitelist", log); log = initLog + ", contract: " + "GnosisSafeMultisig"; await checkGnosisSafeImplementation(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "GnosisSafeMultisig", log); log = initLog + ", contract: " + "GnosisSafeSameAddressMultisig"; await checkGnosisSafeSameAddressImplementation(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "GnosisSafeSameAddressMultisig", log); + + log = initLog + ", contract: " + "StakingVerifier"; + await checkStakingVerifier(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "StakingVerifier", log); + + log = initLog + ", contract: " + "StakingFactory"; + await checkStakingFactory(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "StakingFactory", log); } } // ################################# /VERIFY CONTRACTS SETUP ################################# diff --git a/scripts/deployment/globals_mainnet.json b/scripts/deployment/globals_mainnet.json index 08368853..901daafc 100644 --- a/scripts/deployment/globals_mainnet.json +++ b/scripts/deployment/globals_mainnet.json @@ -1 +1 @@ -{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"mainnet","gnosisSafeAddress":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","gnosisSafeProxyFactoryAddress":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","baseURI":"https://gateway.autonolas.tech/ipfs/","componentRegistryName":"Component Registry","componentRegistrySymbol":"AUTONOLAS-COMPONENT-V1","agentRegistryName":"Agent Registry","agentRegistrySymbol":"AUTONOLAS-AGENT-V1","serviceRegistryName":"Service Registry","serviceRegistrySymbol":"AUTONOLAS-SERVICE-V1","componentRegistryAddress":"0x15bd56669F57192a97dF41A2aa8f4403e9491776","agentRegistryAddress":"0x2F1f7D38e4772884b88f3eCd8B6b9faCdC319112","registriesManagerAddress":"0x9eC9156dEF5C613B2a7D4c46C383F9B58DfcD6fE","serviceRegistryAddress":"0x48b6af7B12C71f09e2fC8aF4855De4Ff54e775cA","serviceManagerAddress":"0x38b062d11CD7596Ab5aDFe4d0e9F0dC3218E5389","gnosisSafeMultisigImplementationAddress":"0x46C0D07F55d4F9B5Eed2Fc9680B5953e5fd7b461","gnosisSafeSameAddressMultisigImplementationAddress":"0xfa517d01DaA100cB1932FA4345F68874f7E7eF46","operatorWhitelistAddress":"0x42042799B0DE38AdD2a70dc996f69f98E1a85260","serviceRegistryTokenUtilityAddress":"0x3Fb926116D454b95c669B6Bf2E7c3bad8d19affA","serviceManagerTokenAddress":"0x2EA682121f815FBcF86EA3F3CaFdd5d67F2dB143","treasuryAddress":"0xa0DA53447C0f6C4987964d8463da7e6628B30f82","multisigProxyHash130":"0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000"} \ No newline at end of file +{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"mainnet","gnosisSafeAddress":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","gnosisSafeProxyFactoryAddress":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","baseURI":"https://gateway.autonolas.tech/ipfs/","componentRegistryName":"Component Registry","componentRegistrySymbol":"AUTONOLAS-COMPONENT-V1","agentRegistryName":"Agent Registry","agentRegistrySymbol":"AUTONOLAS-AGENT-V1","serviceRegistryName":"Service Registry","serviceRegistrySymbol":"AUTONOLAS-SERVICE-V1","componentRegistryAddress":"0x15bd56669F57192a97dF41A2aa8f4403e9491776","agentRegistryAddress":"0x2F1f7D38e4772884b88f3eCd8B6b9faCdC319112","registriesManagerAddress":"0x9eC9156dEF5C613B2a7D4c46C383F9B58DfcD6fE","serviceRegistryAddress":"0x48b6af7B12C71f09e2fC8aF4855De4Ff54e775cA","serviceManagerAddress":"0x38b062d11CD7596Ab5aDFe4d0e9F0dC3218E5389","gnosisSafeMultisigImplementationAddress":"0x46C0D07F55d4F9B5Eed2Fc9680B5953e5fd7b461","gnosisSafeSameAddressMultisigImplementationAddress":"0xfa517d01DaA100cB1932FA4345F68874f7E7eF46","operatorWhitelistAddress":"0x42042799B0DE38AdD2a70dc996f69f98E1a85260","serviceRegistryTokenUtilityAddress":"0x3Fb926116D454b95c669B6Bf2E7c3bad8d19affA","serviceManagerTokenAddress":"0x2EA682121f815FBcF86EA3F3CaFdd5d67F2dB143","treasuryAddress":"0xa0DA53447C0f6C4987964d8463da7e6628B30f82","multisigProxyHash130":"0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000","olasAddress":"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0","minStakingDepositLimit":"10000000000000000000000","timeForEmissionsLimit":"2592000","numServicesLimit":"100","apyLimit":"3000000000000000000","stakingVerifierAddress":"0x4503b79d468e81Ad2d4bd6Db991810da269bA777","stakingFactoryAddress":"0xEBdde456EA288b49f7D5975E7659bA1Ccf607efc"} \ No newline at end of file diff --git a/scripts/deployment/l2/globals_mode_mainnet.json b/scripts/deployment/l2/globals_mode_mainnet.json index 51fe79f9..d749758d 100644 --- a/scripts/deployment/l2/globals_mode_mainnet.json +++ b/scripts/deployment/l2/globals_mode_mainnet.json @@ -1 +1 @@ -{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"base","networkURL":"https://mainnet.mode.network","gasPriceInGwei":"1","gnosisSafeAddress":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","gnosisSafeProxyFactoryAddress":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","baseURI":"https://gateway.autonolas.tech/ipfs/","serviceRegistryName":"Service Registry L2","serviceRegistrySymbol":"AUTONOLAS-SERVICE-L2-V1","bridgeMediatorAddress":"0x9338b5153AE39BB89f50468E608eD9d764B755fD","olasAddress":"0xcfD1D50ce23C46D3Cf6407487B2F8934e96DC8f9","multisigProxyHash130":"0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000","serviceRegistryAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","operatorWhitelistAddress":"0x3d77596beb0f130a4415df3D2D8232B3d3D31e44","serviceRegistryTokenUtilityAddress":"0x34C895f302D0b5cf52ec0Edd3945321EB0f83dd5","serviceManagerTokenAddress":"0x63e66d7ad413C01A7b49C7FF4e3Bb765C4E4bd1b","gnosisSafeMultisigImplementationAddress":"0xBb7e1D6Cb6F243D6bdE81CE92a9f2aFF7Fbe7eac","gnosisSafeSameAddressMultisigImplementationAddress":"0xFbBEc0C8b13B38a9aC0499694A69a10204c5E2aB","stakingTokenAddress":"0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA","stakingNativeTokenAddress":"0x88DE734655184a09B70700aE4F72364d1ad23728","minStakingDepositLimit":"10000000000000000000000","timeForEmissionsLimit":"2592000","numServicesLimit":"100","apyLimit":"3000000000000000000","stakingVerifierAddress":"0x87c511c8aE3fAF0063b3F3CF9C6ab96c4AA5C60c","stakingFactoryAddress":"0x75D529FAe220bC8db714F0202193726b46881B76","L1CrossDomainMessengerProxyAddress":"0x95bDCA6c8EdEB69C98Bd5bd17660BaCef1298A6f"} \ No newline at end of file +{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"mode","networkURL":"https://mainnet.mode.network","gasPriceInGwei":"1","gnosisSafeAddress":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","gnosisSafeProxyFactoryAddress":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","baseURI":"https://gateway.autonolas.tech/ipfs/","serviceRegistryName":"Service Registry L2","serviceRegistrySymbol":"AUTONOLAS-SERVICE-L2-V1","bridgeMediatorAddress":"0x9338b5153AE39BB89f50468E608eD9d764B755fD","olasAddress":"0xcfD1D50ce23C46D3Cf6407487B2F8934e96DC8f9","multisigProxyHash130":"0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000","serviceRegistryAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","operatorWhitelistAddress":"0x3d77596beb0f130a4415df3D2D8232B3d3D31e44","serviceRegistryTokenUtilityAddress":"0x34C895f302D0b5cf52ec0Edd3945321EB0f83dd5","serviceManagerTokenAddress":"0x63e66d7ad413C01A7b49C7FF4e3Bb765C4E4bd1b","gnosisSafeMultisigImplementationAddress":"0xBb7e1D6Cb6F243D6bdE81CE92a9f2aFF7Fbe7eac","gnosisSafeSameAddressMultisigImplementationAddress":"0xFbBEc0C8b13B38a9aC0499694A69a10204c5E2aB","stakingTokenAddress":"0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA","stakingNativeTokenAddress":"0x88DE734655184a09B70700aE4F72364d1ad23728","minStakingDepositLimit":"10000000000000000000000","timeForEmissionsLimit":"2592000","numServicesLimit":"100","apyLimit":"3000000000000000000","stakingVerifierAddress":"0x87c511c8aE3fAF0063b3F3CF9C6ab96c4AA5C60c","stakingFactoryAddress":"0x75D529FAe220bC8db714F0202193726b46881B76","L1CrossDomainMessengerProxyAddress":"0x95bDCA6c8EdEB69C98Bd5bd17660BaCef1298A6f"} \ No newline at end of file From 13701070a099f3a12502155da0bec60804f4b9ba Mon Sep 17 00:00:00 2001 From: Aleksandr Kuperman Date: Thu, 24 Oct 2024 17:13:19 +0100 Subject: [PATCH 2/4] chore: linters --- .gitleaksignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitleaksignore b/.gitleaksignore index 09fc9598..2b60ace1 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -427,4 +427,8 @@ eff9ec09651b73fcbd7270f070b2747e6f408157:scripts/deployment/l2/globals_arbitrum_ b5ca8da1a582e0e91c3d292f72c91411874756f0:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:1 b5ca8da1a582e0e91c3d292f72c91411874756f0:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 c71519f1ffae8a411ee44ee49de26d13ec6a0ce2:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:1 -c71519f1ffae8a411ee44ee49de26d13ec6a0ce2:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 \ No newline at end of file +c71519f1ffae8a411ee44ee49de26d13ec6a0ce2:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 +00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:1 +00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/globals_mainnet.json:generic-api-key:1 +00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 +00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/globals_mainnet.json:generic-api-key:2 \ No newline at end of file From e517499695f329463b82f03a5e339d5abde32eab Mon Sep 17 00:00:00 2001 From: Aleksandr Kuperman Date: Thu, 24 Oct 2024 17:15:40 +0100 Subject: [PATCH 3/4] chore: linters --- .gitleaksignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitleaksignore b/.gitleaksignore index 2b60ace1..b0d1b94a 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -431,4 +431,6 @@ c71519f1ffae8a411ee44ee49de26d13ec6a0ce2:scripts/deployment/l2/globals_mode_main 00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:1 00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/globals_mainnet.json:generic-api-key:1 00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 -00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/globals_mainnet.json:generic-api-key:2 \ No newline at end of file +00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/globals_mainnet.json:generic-api-key:2 +cd3b8c411856aa346cdcc75db3b819447990d327:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:1 +cd3b8c411856aa346cdcc75db3b819447990d327:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 \ No newline at end of file From b96b2e08b2ad54f3278ca59567d5835d04dc96c1 Mon Sep 17 00:00:00 2001 From: Aleksandr Kuperman Date: Thu, 24 Oct 2024 17:23:09 +0100 Subject: [PATCH 4/4] chore: linters --- .gitleaksignore | 4 +++- scripts/audit_chains/audit_contracts_setup.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitleaksignore b/.gitleaksignore index b0d1b94a..4d520e11 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -433,4 +433,6 @@ c71519f1ffae8a411ee44ee49de26d13ec6a0ce2:scripts/deployment/l2/globals_mode_main 00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 00fd9d42b7bbdd4c38082ced0e4e00d538237373:scripts/deployment/globals_mainnet.json:generic-api-key:2 cd3b8c411856aa346cdcc75db3b819447990d327:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:1 -cd3b8c411856aa346cdcc75db3b819447990d327:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 \ No newline at end of file +cd3b8c411856aa346cdcc75db3b819447990d327:scripts/deployment/l2/globals_mode_mainnet.json:generic-api-key:2 +cd3b8c411856aa346cdcc75db3b819447990d327:scripts/deployment/globals_mainnet.json:generic-api-key:1 +cd3b8c411856aa346cdcc75db3b819447990d327:scripts/deployment/globals_mainnet.json:generic-api-key:2 \ No newline at end of file diff --git a/scripts/audit_chains/audit_contracts_setup.js b/scripts/audit_chains/audit_contracts_setup.js index 8ebe0eac..6b662b1f 100644 --- a/scripts/audit_chains/audit_contracts_setup.js +++ b/scripts/audit_chains/audit_contracts_setup.js @@ -457,7 +457,6 @@ async function main() { console.log("\nVerifying deployed contracts setup... If no error is output, then the contracts are correct."); for (let i = 0; i < numChains; i++) { - if (i == 4) continue; console.log("\n######## Verifying setup on CHAIN ID", configs[i]["chainId"]); const initLog = "ChainId: " + configs[i]["chainId"] + ", network: " + configs[i]["name"];