diff --git a/.gitleaksignore b/.gitleaksignore index 27e97667..09fc9598 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -424,3 +424,7 @@ eff9ec09651b73fcbd7270f070b2747e6f408157:scripts/deployment/l2/globals_arbitrum_ 408d8153bc8dc60d952edbb022229c1994906c7e:scripts/deployment/l2/globals_mode_sepolia.json:generic-api-key:2 08d8153bc8dc60d952edbb022229c1994906c7e:scripts/deployment/l2/globals_mode_sepolia.json:generic-api-key:1 08d8153bc8dc60d952edbb022229c1994906c7e:scripts/deployment/l2/globals_mode_sepolia.json:generic-api-key:2 +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 diff --git a/docs/configuration.json b/docs/configuration.json index ce178871..4e4fd65a 100644 --- a/docs/configuration.json +++ b/docs/configuration.json @@ -655,47 +655,52 @@ { "name": "ServiceRegistryL2", "artifact": "abis/0.8.28/ServiceRegistryL2.json", - "address": "" + "address": "0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE" }, { "name": "ServiceRegistryTokenUtility", "artifact": "abis/0.8.28/ServiceRegistryTokenUtility.json", - "address": "" + "address": "0x34C895f302D0b5cf52ec0Edd3945321EB0f83dd5" }, { "name": "ServiceManagerToken", "artifact": "abis/0.8.28/ServiceManagerToken.json", - "address": "" + "address": "0x63e66d7ad413C01A7b49C7FF4e3Bb765C4E4bd1b" }, { "name": "OperatorWhitelist", "artifact": "abis/0.8.28/OperatorWhitelist.json", - "address": "" + "address": "0x3d77596beb0f130a4415df3D2D8232B3d3D31e44" }, { "name": "GnosisSafeMultisig", "artifact": "abis/0.8.28/GnosisSafeMultisig.json", - "address": "" + "address": "0xBb7e1D6Cb6F243D6bdE81CE92a9f2aFF7Fbe7eac" }, { "name": "GnosisSafeSameAddressMultisig", "artifact": "abis/0.8.28/GnosisSafeSameAddressMultisig.json", - "address": "" + "address": "0xFbBEc0C8b13B38a9aC0499694A69a10204c5E2aB" }, { "name": "StakingToken", - "artifact": "abis/0.8.25/StakingToken.json", - "address": "" + "artifact": "abis/0.8.28/StakingToken.json", + "address": "0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA" + }, + { + "name": "StakingNativeToken", + "artifact": "abis/0.8.28/StakingNativeToken.json", + "address": "0x88DE734655184a09B70700aE4F72364d1ad23728" }, { "name": "StakingVerifier", - "artifact": "abis/0.8.25/StakingVerifier.json", - "address": "" + "artifact": "abis/0.8.28/StakingVerifier.json", + "address": "0x87c511c8aE3fAF0063b3F3CF9C6ab96c4AA5C60c" }, { "name": "StakingFactory", - "artifact": "abis/0.8.25/StakingFactory.json", - "address": "" + "artifact": "abis/0.8.28/StakingFactory.json", + "address": "0x75D529FAe220bC8db714F0202193726b46881B76" } ] }, diff --git a/hardhat.config.js b/hardhat.config.js index a3379d06..d24fb4f5 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -212,8 +212,8 @@ module.exports = { network: "mode", chainId: 34443, urls: { - apiURL: "https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan", - browserURL: "https://modescan.io" + apiURL: "https://explorer.mode.network/api", + browserURL: "https://explorer.mode.network" }, }, { diff --git a/scripts/deployment/l2/deploy_18_service_staking_verifier.js b/scripts/deployment/l2/deploy_18_service_staking_verifier.js index 80c7196b..ba0a6829 100644 --- a/scripts/deployment/l2/deploy_18_service_staking_verifier.js +++ b/scripts/deployment/l2/deploy_18_service_staking_verifier.js @@ -59,7 +59,7 @@ async function main() { console.log("EOA is:", deployer); // Transaction signing and execution - console.log("19. EOA to deploy StakingVerifier"); + console.log("18. EOA to deploy StakingVerifier"); const StakingVerifier = await ethers.getContractFactory("StakingVerifier"); console.log("You are signing the following transaction: StakingVerifier.connect(EOA).deploy()"); const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei"); diff --git a/scripts/deployment/l2/deploy_19_service_staking_factory.js b/scripts/deployment/l2/deploy_19_service_staking_factory.js index 812b9be8..e9d956ec 100644 --- a/scripts/deployment/l2/deploy_19_service_staking_factory.js +++ b/scripts/deployment/l2/deploy_19_service_staking_factory.js @@ -53,7 +53,7 @@ async function main() { console.log("EOA is:", deployer); // Transaction signing and execution - console.log("20. EOA to deploy StakingFactory"); + console.log("19. EOA to deploy StakingFactory"); const StakingFactory = await ethers.getContractFactory("StakingFactory"); console.log("You are signing the following transaction: StakingFactory.connect(EOA).deploy()"); const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei"); diff --git a/scripts/deployment/l2/deploy_20_staking_verifier_set_implementations.js b/scripts/deployment/l2/deploy_20_staking_verifier_set_implementations.js new file mode 100644 index 00000000..6e3044a6 --- /dev/null +++ b/scripts/deployment/l2/deploy_20_staking_verifier_set_implementations.js @@ -0,0 +1,72 @@ +/*global process*/ + +const { ethers } = require("hardhat"); +const { LedgerSigner } = require("@anders-t/ethers-ledger"); + +async function main() { + const fs = require("fs"); + const globalsFile = "globals.json"; + const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); + let parsedData = JSON.parse(dataFromJSON); + const useLedger = parsedData.useLedger; + const derivationPath = parsedData.derivationPath; + const providerName = parsedData.providerName; + const gasPriceInGwei = parsedData.gasPriceInGwei; + const stakingTokenAddress = parsedData.stakingTokenAddress; + const stakingNativeTokenAddress = parsedData.stakingNativeTokenAddress; + const stakingVerifierAddress = parsedData.stakingVerifierAddress; + + let networkURL = parsedData.networkURL; + if (providerName === "mainnet") { + if (!process.env.ALCHEMY_API_KEY_MAINNET) { + console.log("set ALCHEMY_API_KEY_MAINNET env variable"); + } + networkURL += process.env.ALCHEMY_API_KEY_MAINNET; + } + if (providerName === "polygon") { + if (!process.env.ALCHEMY_API_KEY_MATIC) { + console.log("set ALCHEMY_API_KEY_MATIC env variable"); + } + networkURL += process.env.ALCHEMY_API_KEY_MATIC; + } else if (providerName === "polygonAmoy") { + if (!process.env.ALCHEMY_API_KEY_AMOY) { + console.log("set ALCHEMY_API_KEY_AMOY env variable"); + return; + } + networkURL += process.env.ALCHEMY_API_KEY_AMOY; + } + + const provider = new ethers.providers.JsonRpcProvider(networkURL); + const signers = await ethers.getSigners(); + + let EOA; + if (useLedger) { + EOA = new LedgerSigner(provider, derivationPath); + } else { + EOA = signers[0]; + } + // EOA address + const deployer = await EOA.getAddress(); + console.log("EOA is:", deployer); + + // Get the verifier contracts + const stakingVerifier = await ethers.getContractAt("StakingVerifier", stakingVerifierAddress); + + // Gas pricing + const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei"); + + // Transaction signing and execution + console.log("20. You are signing the following transaction: StakingVerifier.connect(EOA).setImplementationsStatuses()"); + let result = await stakingVerifier.connect(EOA).setImplementationsStatuses([stakingTokenAddress, stakingNativeTokenAddress], + [true, true], true, { gasPrice }); + // Transaction details + console.log("Contract address:", stakingVerifierAddress); + console.log("Transaction:", result.hash); +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); diff --git a/scripts/deployment/l2/deploy_20_hash_checkpoint_l2.js b/scripts/deployment/l2/deploy_23_hash_checkpoint_l2.js similarity index 97% rename from scripts/deployment/l2/deploy_20_hash_checkpoint_l2.js rename to scripts/deployment/l2/deploy_23_hash_checkpoint_l2.js index 2f77cd86..f191385a 100644 --- a/scripts/deployment/l2/deploy_20_hash_checkpoint_l2.js +++ b/scripts/deployment/l2/deploy_23_hash_checkpoint_l2.js @@ -63,7 +63,7 @@ async function main() { // Contract verification if (parsedData.contractVerification) { const execSync = require("child_process").execSync; - execSync("npx hardhat verify --contract contracts/utils/HashCheckpoint.sol:HashCheckpoint --constructor-args scripts/deployment/l2/verify_20_hash_checkpoint.js --network " + providerName + " " + hashCheckpoint.address, { encoding: "utf-8" }); + execSync("npx hardhat verify --contract contracts/utils/HashCheckpoint.sol:HashCheckpoint --constructor-args scripts/deployment/l2/verify_23_hash_checkpoint.js --network " + providerName + " " + hashCheckpoint.address, { encoding: "utf-8" }); } } diff --git a/scripts/deployment/l2/globals_mode_mainnet.json b/scripts/deployment/l2/globals_mode_mainnet.json index e41f56dd..51fe79f9 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":"","multisigProxyHash130":"0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000","serviceRegistryAddress":"","operatorWhitelistAddress":"","serviceRegistryTokenUtilityAddress":"","serviceManagerTokenAddress":"","gnosisSafeMultisigImplementationAddress":"","gnosisSafeSameAddressMultisigImplementationAddress":"","stakingTokenAddress":"","stakingNativeTokenAddress":"","minStakingDepositLimit":"10000000000000000000000","timeForEmissionsLimit":"2592000","numServicesLimit":"100","apyLimit":"3000000000000000000","stakingVerifierAddress":"","stakingFactoryAddress":"","L1CrossDomainMessengerProxyAddress":"0x95bDCA6c8EdEB69C98Bd5bd17660BaCef1298A6f"} \ No newline at end of file +{"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 diff --git a/scripts/deployment/l2/verify_20_hash_checkpoint.js b/scripts/deployment/l2/verify_23_hash_checkpoint.js similarity index 100% rename from scripts/deployment/l2/verify_20_hash_checkpoint.js rename to scripts/deployment/l2/verify_23_hash_checkpoint.js