diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json index 67e72770..53084721 100644 --- a/deployments/prod_verification.json +++ b/deployments/prod_verification.json @@ -653,29 +653,6 @@ ] ], "130": [ - [ - "0xcd620187f4846ba5a42ab41270aC550467dc9FbB", - "SwitchboardSimulator", - "contracts/mocks/fee-updater/SwitchboardSimulator.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x8c36353db4F3a2DDDeed38405199d13DCF8a1B82", - 130, - 1000, - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0x09A03E0d298AA13a07A9a3e36a606d4F6a4b8bB7", - "SimulatorUtils", - "contracts/mocks/fee-updater/SimulatorUtils.sol", - [ - "0x8c36353db4F3a2DDDeed38405199d13DCF8a1B82", - "0x1CAdCd88fC148D3966eDe75D029937C886f66009", - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 130 - ] - ], [ "0x8c36353db4F3a2DDDeed38405199d13DCF8a1B82", "SocketSimulator", @@ -688,114 +665,17 @@ "IMLI" ] ], - [ - "0xb4Db1838d0B97BD58C7663b3E487eEbC9a996472", - "Counter", - "contracts/examples/Counter.sol", - ["0x0CC93650bF4D98237628DACf87f94E443956D8dF"] - ], - [ - "0xd9E3a8Ba9Be55919C5C0De6694e3103F5a35820E", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0x3043Ad9C9e01664bc3A68477f0870Df35dC4bFf8", - "OptimisticSwitchboard", - "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - 130, - 7200, - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0x525a6489a1df5fF1ae077fAf628E43b7F52298eF", - "FastSwitchboard", - "contracts/switchboard/default-switchboards/FastSwitchboard.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - 130, - 7200, - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0x657e72B305Dc1c41e98d9efC2350EC10e3c83E21", - "TransmitManager", - "contracts/TransmitManager.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 130, - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0xb3314456567986e657d4C65Ec9e8cB736B92d11D", - "ExecutionManagerDF", - "contracts/ExecutionManagerDF.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 130, - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - "Socket", - "contracts/socket/Socket.sol", - [ - 130, - "0x9B8c323468AEC7A7Cb041CeD48F92559bFF33705", - "0xb4Ef469c9d8317851270346070dA0ecE24616E6b", - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "IMLI" - ] - ], [ "0xb4Ef469c9d8317851270346070dA0ecE24616E6b", "CapacitorFactory", "contracts/CapacitorFactory.sol", ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", 10] ], - [ - "0x9B8c323468AEC7A7Cb041CeD48F92559bFF33705", - "Hasher", - "contracts/utils/Hasher.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0x1CAdCd88fC148D3966eDe75D029937C886f66009", - "SignatureVerifier", - "contracts/utils/SignatureVerifier.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0xbe7241e9D11EC2D1Ac86CE217c4A37b7aD1701cE", - "MultiSigWrapper", - "contracts/utils/multisig/MultiSigWrapper.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x4d81b1d31d5cb1E5021d3CA525DEc9ad5D3Dead1" - ] - ], [ "0x1F6bc87f3309B5D31Eb0BdaBE3ED7d3110d3B9c3", "SafeProxyFactory", "contracts/utils/multisig/proxies/SafeProxyFactory.sol", [] - ], - [ - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead", - "SafeL2", - "contracts/utils/multisig/SafeL2.sol", - [] ] ], "137": [ @@ -1093,68 +973,12 @@ ] ], "146": [ - [ - "0xE0aCD26E4c97af97c893e66825BF798Fa83DBa56", - "MultiSigWrapper", - "contracts/utils/multisig/MultiSigWrapper.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x1C4E51f453df3208A01EE8AF9f6420FDf02D373a" - ] - ], [ "0xeA964e160dEaed1960E31a20c1fA57D079d4e616", "SafeProxyFactory", "contracts/utils/multisig/proxies/SafeProxyFactory.sol", [] ], - [ - "0x1C4E51f453df3208A01EE8AF9f6420FDf02D373a", - "SafeL2", - "contracts/utils/multisig/SafeL2.sol", - [] - ], - [ - "0xf0fA7929546aA1987b6ce47aC16A9F8921207F07", - "SafeL2", - "contracts/utils/multisig/SafeL2.sol", - [] - ], - [ - "0xe8F4558f3051DaD88e65A3e15a285Ae1E0614A4B", - "SafeL2", - "contracts/utils/multisig/SafeL2.sol", - [] - ], - [ - "0xF522AdbDBe0a7b6F6c96443bF9F5474B223AC80C", - "SafeL2", - "contracts/utils/multisig/SafeL2.sol", - [] - ], - [ - "0xd9E3a8Ba9Be55919C5C0De6694e3103F5a35820E", - "SwitchboardSimulator", - "contracts/mocks/fee-updater/SwitchboardSimulator.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x525a6489a1df5fF1ae077fAf628E43b7F52298eF", - 146, - 1000, - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead" - ] - ], - [ - "0x3043Ad9C9e01664bc3A68477f0870Df35dC4bFf8", - "SimulatorUtils", - "contracts/mocks/fee-updater/SimulatorUtils.sol", - [ - "0x525a6489a1df5fF1ae077fAf628E43b7F52298eF", - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead", - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 146 - ] - ], [ "0x525a6489a1df5fF1ae077fAf628E43b7F52298eF", "SocketSimulator", @@ -1167,93 +991,11 @@ "IMLI" ] ], - [ - "0x657e72B305Dc1c41e98d9efC2350EC10e3c83E21", - "Counter", - "contracts/examples/Counter.sol", - ["0xbe7241e9D11EC2D1Ac86CE217c4A37b7aD1701cE"] - ], - [ - "0xb3314456567986e657d4C65Ec9e8cB736B92d11D", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - "OptimisticSwitchboard", - "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0xbe7241e9D11EC2D1Ac86CE217c4A37b7aD1701cE", - 146, - 7200, - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead" - ] - ], - [ - "0xb4Ef469c9d8317851270346070dA0ecE24616E6b", - "FastSwitchboard", - "contracts/switchboard/default-switchboards/FastSwitchboard.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0xbe7241e9D11EC2D1Ac86CE217c4A37b7aD1701cE", - 146, - 7200, - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead" - ] - ], - [ - "0x9B8c323468AEC7A7Cb041CeD48F92559bFF33705", - "TransmitManager", - "contracts/TransmitManager.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 146, - "0xbe7241e9D11EC2D1Ac86CE217c4A37b7aD1701cE", - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead" - ] - ], - [ - "0x1CAdCd88fC148D3966eDe75D029937C886f66009", - "ExecutionManagerDF", - "contracts/ExecutionManagerDF.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 146, - "0xbe7241e9D11EC2D1Ac86CE217c4A37b7aD1701cE", - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead" - ] - ], - [ - "0xbe7241e9D11EC2D1Ac86CE217c4A37b7aD1701cE", - "Socket", - "contracts/socket/Socket.sol", - [ - 146, - "0x1F6bc87f3309B5D31Eb0BdaBE3ED7d3110d3B9c3", - "0x6C593aD4C0Fa4E293a0f1240F9ca3CF0e8a28619", - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "IMLI" - ] - ], [ "0x6C593aD4C0Fa4E293a0f1240F9ca3CF0e8a28619", "CapacitorFactory", "contracts/CapacitorFactory.sol", ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", 10] - ], - [ - "0x1F6bc87f3309B5D31Eb0BdaBE3ED7d3110d3B9c3", - "Hasher", - "contracts/utils/Hasher.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead", - "SignatureVerifier", - "contracts/utils/SignatureVerifier.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] ] ], "169": [ @@ -4014,29 +3756,6 @@ ] ], "8333": [ - [ - "0xcd620187f4846ba5a42ab41270aC550467dc9FbB", - "SwitchboardSimulator", - "contracts/mocks/fee-updater/SwitchboardSimulator.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x8c36353db4F3a2DDDeed38405199d13DCF8a1B82", - 8333, - 1000, - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0x09A03E0d298AA13a07A9a3e36a606d4F6a4b8bB7", - "SimulatorUtils", - "contracts/mocks/fee-updater/SimulatorUtils.sol", - [ - "0x8c36353db4F3a2DDDeed38405199d13DCF8a1B82", - "0x1CAdCd88fC148D3966eDe75D029937C886f66009", - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 8333 - ] - ], [ "0x8c36353db4F3a2DDDeed38405199d13DCF8a1B82", "SocketSimulator", @@ -4049,114 +3768,17 @@ "IMLI" ] ], - [ - "0xb4Db1838d0B97BD58C7663b3E487eEbC9a996472", - "Counter", - "contracts/examples/Counter.sol", - ["0x0CC93650bF4D98237628DACf87f94E443956D8dF"] - ], - [ - "0xd9E3a8Ba9Be55919C5C0De6694e3103F5a35820E", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0x3043Ad9C9e01664bc3A68477f0870Df35dC4bFf8", - "OptimisticSwitchboard", - "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - 8333, - 7200, - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0x525a6489a1df5fF1ae077fAf628E43b7F52298eF", - "FastSwitchboard", - "contracts/switchboard/default-switchboards/FastSwitchboard.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - 8333, - 7200, - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0x657e72B305Dc1c41e98d9efC2350EC10e3c83E21", - "TransmitManager", - "contracts/TransmitManager.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 8333, - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0xb3314456567986e657d4C65Ec9e8cB736B92d11D", - "ExecutionManagerDF", - "contracts/ExecutionManagerDF.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 8333, - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - "0x1CAdCd88fC148D3966eDe75D029937C886f66009" - ] - ], - [ - "0x0CC93650bF4D98237628DACf87f94E443956D8dF", - "Socket", - "contracts/socket/Socket.sol", - [ - 8333, - "0x9B8c323468AEC7A7Cb041CeD48F92559bFF33705", - "0xb4Ef469c9d8317851270346070dA0ecE24616E6b", - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "IMLI" - ] - ], [ "0xb4Ef469c9d8317851270346070dA0ecE24616E6b", "CapacitorFactory", "contracts/CapacitorFactory.sol", ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", 10] ], - [ - "0x9B8c323468AEC7A7Cb041CeD48F92559bFF33705", - "Hasher", - "contracts/utils/Hasher.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0x1CAdCd88fC148D3966eDe75D029937C886f66009", - "SignatureVerifier", - "contracts/utils/SignatureVerifier.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0xbe7241e9D11EC2D1Ac86CE217c4A37b7aD1701cE", - "MultiSigWrapper", - "contracts/utils/multisig/MultiSigWrapper.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x73fd754e8a2E6b01A8cAF851c9ee3e3298405005" - ] - ], [ "0x1F6bc87f3309B5D31Eb0BdaBE3ED7d3110d3B9c3", "SafeProxyFactory", "contracts/utils/multisig/proxies/SafeProxyFactory.sol", [] - ], - [ - "0xc8a4D2fd77c155fd52e65Ab07F337aBF84495Ead", - "SafeL2", - "contracts/utils/multisig/SafeL2.sol", - [] ] ], "8453": [ @@ -6095,29 +5717,6 @@ ] ], "80094": [ - [ - "0xa4BC320775c0196176B5D4C31a76f7a1b6d89161", - "SwitchboardSimulator", - "contracts/mocks/fee-updater/SwitchboardSimulator.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x3431fCFB44597f18E38744a3156a916A388BA4D0", - 80094, - 1000, - "0xF34411eE2940Fe5fc6c6228130e2EeF12b1f3E49" - ] - ], - [ - "0x3B250ef646f970Dc56AE8EebDdB01f7707e757fF", - "SimulatorUtils", - "contracts/mocks/fee-updater/SimulatorUtils.sol", - [ - "0x3431fCFB44597f18E38744a3156a916A388BA4D0", - "0xF34411eE2940Fe5fc6c6228130e2EeF12b1f3E49", - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 80094 - ] - ], [ "0x3431fCFB44597f18E38744a3156a916A388BA4D0", "SocketSimulator", @@ -6130,18 +5729,6 @@ "IMLI" ] ], - [ - "0xb1b93173FecaDBd89cb94F446a1E6bCEF50e8344", - "Counter", - "contracts/examples/Counter.sol", - ["0x3F19e30d9022c89f1E40B68baaC0dbA380e6C77d"] - ], - [ - "0x511B2cb97E3DD25083C1654c54b57EB1CF0824b7", - "SocketBatcher", - "contracts/socket/SocketBatcher.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], [ "0x032dd149Cb081FAd716334D9F0bd81fa3F002F11", "OptimisticSwitchboard", @@ -6154,90 +5741,17 @@ "0xF34411eE2940Fe5fc6c6228130e2EeF12b1f3E49" ] ], - [ - "0x043bcF7aaE818a6E9f509d9D7304e5c7D039FE5d", - "FastSwitchboard", - "contracts/switchboard/default-switchboards/FastSwitchboard.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x3F19e30d9022c89f1E40B68baaC0dbA380e6C77d", - 80094, - 7200, - "0xF34411eE2940Fe5fc6c6228130e2EeF12b1f3E49" - ] - ], - [ - "0x5A4518bC61088EB0154D715dC61D0Bf801a744e9", - "TransmitManager", - "contracts/TransmitManager.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 80094, - "0x3F19e30d9022c89f1E40B68baaC0dbA380e6C77d", - "0xF34411eE2940Fe5fc6c6228130e2EeF12b1f3E49" - ] - ], - [ - "0xb40FdECfCa4EF29CACc37222Ce4dB1fd0f561a00", - "ExecutionManagerDF", - "contracts/ExecutionManagerDF.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - 80094, - "0x3F19e30d9022c89f1E40B68baaC0dbA380e6C77d", - "0xF34411eE2940Fe5fc6c6228130e2EeF12b1f3E49" - ] - ], - [ - "0x3F19e30d9022c89f1E40B68baaC0dbA380e6C77d", - "Socket", - "contracts/socket/Socket.sol", - [ - 80094, - "0xCD83F432491c3Ed08B34F74Df7341EEb060dB34e", - "0xB2f07C30dF3bf4049428f5704397bE57dBAc35e9", - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "IMLI" - ] - ], [ "0xB2f07C30dF3bf4049428f5704397bE57dBAc35e9", "CapacitorFactory", "contracts/CapacitorFactory.sol", ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", 10] ], - [ - "0xCD83F432491c3Ed08B34F74Df7341EEb060dB34e", - "Hasher", - "contracts/utils/Hasher.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0xF34411eE2940Fe5fc6c6228130e2EeF12b1f3E49", - "SignatureVerifier", - "contracts/utils/SignatureVerifier.sol", - ["0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836"] - ], - [ - "0xf3c840490dD6Cc6b32daBEfcbC410107737BA596", - "MultiSigWrapper", - "contracts/utils/multisig/MultiSigWrapper.sol", - [ - "0xB0BBff6311B7F245761A7846d3Ce7B1b100C1836", - "0x583ac2952fEB7c785f3BD4a81C370a9401d41479" - ] - ], [ "0x10C700641F48DA53434439BF2dA21A4C27091221", "SafeProxyFactory", "contracts/utils/multisig/proxies/SafeProxyFactory.sol", [] - ], - [ - "0xC7f534aA1443B947b7B9A09B497B49FFA1B30dA9", - "SafeL2", - "contracts/utils/multisig/SafeL2.sol", - [] ] ], "81457": [ diff --git a/hardhat.config.ts b/hardhat.config.ts index 9469ed03..523c5731 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -5,6 +5,7 @@ import "hardhat-preprocessor"; import "hardhat-deploy"; import "hardhat-abi-exporter"; import "hardhat-change-network"; +import "@nomicfoundation/hardhat-verify"; // import "@matterlabs/hardhat-zksync"; import { config as dotenvConfig } from "dotenv"; @@ -120,6 +121,9 @@ if (isProduction) { [HardhatChainName.OPBNB]: getChainConfig(ChainSlug.OPBNB), [HardhatChainName.GEIST]: getChainConfig(ChainSlug.GEIST), [HardhatChainName.SONIC]: getChainConfig(ChainSlug.SONIC), + [HardhatChainName.BERA]: getChainConfig(ChainSlug.BERA), + [HardhatChainName.B3]: getChainConfig(ChainSlug.B3), + [HardhatChainName.UNICHAIN]: getChainConfig(ChainSlug.UNICHAIN), }; } @@ -172,7 +176,10 @@ const config: HardhatUserConfig = { manta_pacific: process.env.MANTA_PACIFIC_API_KEY || "none", opbnb: process.env.OPBNB_API_KEY || "none", geist: process.env.GEIST_API_KEY || "none", - sonic: process.env.SONIC_API_KEY || "none", + sonic: process.env.SONICSCAN_API_KEY || "", + berascan: process.env.BERASCAN_API_KEY || "", + b3: process.env.B3_API_KEY || "none", + unichain: process.env.UNICHAIN_API_KEY || "none", }, customChains: [ { @@ -339,8 +346,32 @@ const config: HardhatUserConfig = { network: "sonic", chainId: ChainId.SONIC, urls: { - apiURL: "https://api.soniclabs.com/api", - browserURL: "https://rpc.soniclabs.com/", + apiURL: "https://api.sonicscan.org/api", + browserURL: "https://sonicscan.org/", + }, + }, + { + network: "berascan", + chainId: ChainId.BERA, + urls: { + apiURL: "https://api.berascan.com/api", + browserURL: "https://berascan.com/", + }, + }, + { + network: "b3", + chainId: ChainId.B3, + urls: { + apiURL: "https://explorer.b3.fun/api", + browserURL: "https://explorer.b3.fun/", + }, + }, + { + network: "unichain", + chainId: ChainId.UNICHAIN, + urls: { + apiURL: "https://unichain.blockscout.com/api", + browserURL: "https://unichain.blockscout.com/", }, }, ], diff --git a/package.json b/package.json index cd81fa0a..152611df 100644 --- a/package.json +++ b/package.json @@ -21,14 +21,15 @@ "@aws-sdk/client-s3": "^3.465.0", "@eth-optimism/sdk": "^3.2.3", "@ethersproject/bytes": "^5.7.0", - "@matterlabs/hardhat-zksync": "^1.2.0", "@fxportal/maticjs-fxportal": "^1.1.1", "@maticnetwork/maticjs": "^3.5.0", "@maticnetwork/maticjs-ethers": "^1.0.2", + "@matterlabs/hardhat-zksync": "^1.2.0", + "@nomicfoundation/hardhat-verify": "^2.0.12", "@nomiclabs/hardhat-ethers": "^2.1.1", "@nomiclabs/hardhat-etherscan": "^3.1.0", - "@socket.tech/dl-core": "2.17.0-test.3", "@socket.tech/dl-common": "1.0.12-test.1", + "@socket.tech/dl-core": "2.17.0-test.3", "@typechain/ethers-v5": "^10.0.0", "@typechain/hardhat": "^6.0.0", "@types/node": "^18.11.9", diff --git a/scripts/admin/rotate-owner/1-nominate-multisig.ts b/scripts/admin/rotate-owner/1-nominate-multisig.ts index 3331772e..a68f5208 100644 --- a/scripts/admin/rotate-owner/1-nominate-multisig.ts +++ b/scripts/admin/rotate-owner/1-nominate-multisig.ts @@ -19,29 +19,18 @@ dotenvConfig(); /** * Usage * - * --newowner Specify the new owner to be nominated. - * This flag is required. - * Eg. npx --newowner=0x5f34 ts-node scripts/admin/rotate-owner/1-nominate.ts - * * --sendtx Send nominate tx along with ownership check. * Default is only check owner, nominee. - * Eg. npx --newowner=0x5f34 --sendtx ts-node scripts/admin/rotate-owner/1-nominate.ts + * Eg. npx --sendtx ts-node scripts/admin/rotate-owner/1-nominate-multisig.ts * * --chains Run only for specified chains. * Default is all chains. - * Eg. npx --newowner=0x5f34 --chains=10,2999 ts-node scripts/admin/rotate-owner/1-nominate.ts + * Eg. npx --chains=10,2999 ts-node scripts/admin/rotate-owner/1-nominate-multisig.ts * * --testnets Run for testnets. * Default is false. */ -// let newOwner = process.env.npm_config_newowner; -// if (!newOwner) { -// console.error("Error: newowner flag is required"); -// process.exit(1); -// } -// newOwner = newOwner.toLowerCase(); - const signerKey = process.env.SOCKET_SIGNER_KEY; if (!signerKey) { console.error("Error: SOCKET_SIGNER_KEY is required"); diff --git a/scripts/admin/rotate-owner/2-claim-with-multisig.ts b/scripts/admin/rotate-owner/2-claim-with-multisig.ts index 4a2598e1..7e9e21f6 100644 --- a/scripts/admin/rotate-owner/2-claim-with-multisig.ts +++ b/scripts/admin/rotate-owner/2-claim-with-multisig.ts @@ -21,11 +21,11 @@ dotenvConfig(); * * --sendtx Send claim tx along with ownership check. * Default is only check owner, nominee. - * Eg. npx --sendtx ts-node scripts/admin/rotate-owner/claim.ts + * Eg. npx --sendtx ts-node scripts/admin/rotate-owner/2-claim-with-multisig.ts * * --chains Run only for specified chains. * Default is all chains. - * Eg. npx --chains=10,2999 ts-node scripts/admin/rotate-owner/claim.ts + * Eg. npx --chains=10,2999 ts-node scripts/admin/rotate-owner/2-claim-with-multisig.ts * * --testnets Run for testnets. * Default is false. diff --git a/scripts/admin/rotate-owner/3-migrate-roles-to-multisig.ts b/scripts/admin/rotate-owner/3-migrate-roles-to-multisig.ts new file mode 100644 index 00000000..65ff76b4 --- /dev/null +++ b/scripts/admin/rotate-owner/3-migrate-roles-to-multisig.ts @@ -0,0 +1,218 @@ +import { config as dotenvConfig } from "dotenv"; +import { + CORE_CONTRACTS, + ChainSlug, + ChainSocketAddresses, + DeploymentAddresses, + ROLES, + getAllAddresses, + isMainnet, + isTestnet, +} from "../../../src"; +import { + executionManagerVersion, + mode, + ownerAddresses, +} from "../../deploy/config/config"; +import { Wallet, ethers } from "ethers"; +import { checkAndUpdateRoles } from "../../deploy/scripts/roles"; +import { sleep } from "@socket.tech/dl-common"; + +dotenvConfig(); + +/** + * Usage + * + * --sendtx Send nominate tx along with ownership check. + * Default is only check owner, nominee. + * Eg. npx --sendtx ts-node scripts/admin/rotate-owner/3-migrate-roles-to-multisig.ts + * + * --chains Run only for specified chains. + * Default is all chains. + * Eg. npx --chains=10,2999 ts-node scripts/admin/rotate-owner/3-migrate-roles-to-multisig.ts + * + * --testnets Run for testnets. + * Default is false. + */ + +const signerKey = process.env.SOCKET_SIGNER_KEY; +if (!signerKey) { + console.error("Error: SOCKET_SIGNER_KEY is required"); +} + +const sendTransaction = process.env.npm_config_sendtx == "true"; + +const testnets = process.env.npm_config_testnets == "true"; +const filterChainsParam = process.env.npm_config_chains + ? process.env.npm_config_chains.split(",") + : null; + +const addresses: DeploymentAddresses = getAllAddresses(mode); +let allChainSlugs: string[]; +if (testnets) + allChainSlugs = Object.keys(addresses).filter((c) => isTestnet(parseInt(c))); +else + allChainSlugs = Object.keys(addresses).filter((c) => isMainnet(parseInt(c))); + +const filteredChainSlugs = !filterChainsParam + ? allChainSlugs + : allChainSlugs.filter((c) => filterChainsParam.includes(c)); + +const wallet: Wallet = new ethers.Wallet(signerKey); +const signerAddress = wallet.address.toLowerCase(); +const signingOwnerAddress = ownerAddresses[mode].toLowerCase(); + +if (signingOwnerAddress != signerAddress) { + console.error("Error: signingOwnerAddress is not the same as signerAddress"); + process.exit(1); +} + +const sleepTime = 1; +const summary: { params: any; roleStatus: any }[] = []; + +export const main = async () => { + await Promise.all( + filteredChainSlugs + .map((c) => parseInt(c) as ChainSlug) + .map(async (chainSlug) => { + let chainAddresses: ChainSocketAddresses = addresses[chainSlug]; + + const safeAddress = chainAddresses["SocketSafeProxy"]; + + if (!safeAddress) { + console.error(`Error: safeAddress not found for ${chainSlug}`); + return; + } + + const siblings = ( + !!chainAddresses.integrations + ? Object.keys(chainAddresses.integrations) + : [] + ).map((s) => parseInt(s) as ChainSlug); + + for (const contract of Object.keys(rolesToGrant)) { + const roles = rolesToGrant[contract]; + const s = await checkAndUpdateRoles( + { + userSpecificRoles: [ + { + userAddress: safeAddress, + filterRoles: roles, + }, + ], + contractName: contract as CORE_CONTRACTS, + filterChains: [chainSlug], + filterSiblingChains: siblings, + safeChains: [chainSlug], + sendTransaction, + newRoleStatus: true, + }, + addresses + ); + + summary.push(s); + await sleep(sleepTime); + } + + for (const contract of Object.keys(rolesToRevoke)) { + const roles = rolesToRevoke[contract]; + const s = await checkAndUpdateRoles( + { + userSpecificRoles: [ + { + userAddress: signingOwnerAddress, + filterRoles: roles, + }, + ], + contractName: contract as CORE_CONTRACTS, + filterChains: [chainSlug], + filterSiblingChains: siblings, + safeChains: [chainSlug], + sendTransaction, + newRoleStatus: false, + }, + addresses + ); + + summary.push(s); + await sleep(sleepTime); + } + }) + ); + + console.log(JSON.stringify(summary)); +}; + +const rolesToGrant = { + [executionManagerVersion]: [ + ROLES.RESCUE_ROLE, + ROLES.GOVERNANCE_ROLE, + ROLES.WITHDRAW_ROLE, + ROLES.FEES_UPDATER_ROLE, + ], + [CORE_CONTRACTS.TransmitManager]: [ + ROLES.RESCUE_ROLE, + ROLES.GOVERNANCE_ROLE, + ROLES.WITHDRAW_ROLE, + ROLES.FEES_UPDATER_ROLE, + ], + [CORE_CONTRACTS.Socket]: [ROLES.RESCUE_ROLE, ROLES.GOVERNANCE_ROLE], + [CORE_CONTRACTS.FastSwitchboard]: [ + ROLES.RESCUE_ROLE, + ROLES.GOVERNANCE_ROLE, + ROLES.TRIP_ROLE, + ROLES.UN_TRIP_ROLE, + ROLES.WITHDRAW_ROLE, + ROLES.FEES_UPDATER_ROLE, + ], + [CORE_CONTRACTS.OptimisticSwitchboard]: [ + ROLES.TRIP_ROLE, + ROLES.UN_TRIP_ROLE, + ROLES.RESCUE_ROLE, + ROLES.GOVERNANCE_ROLE, + ROLES.FEES_UPDATER_ROLE, + ], + [CORE_CONTRACTS.NativeSwitchboard]: [ + ROLES.TRIP_ROLE, + ROLES.UN_TRIP_ROLE, + ROLES.GOVERNANCE_ROLE, + ROLES.WITHDRAW_ROLE, + ROLES.RESCUE_ROLE, + ROLES.FEES_UPDATER_ROLE, + ], +}; + +const rolesToRevoke = { + [executionManagerVersion]: [ + ROLES.RESCUE_ROLE, + ROLES.GOVERNANCE_ROLE, + ROLES.WITHDRAW_ROLE, + ], + [CORE_CONTRACTS.TransmitManager]: [ + ROLES.RESCUE_ROLE, + ROLES.GOVERNANCE_ROLE, + ROLES.WITHDRAW_ROLE, + ], + [CORE_CONTRACTS.Socket]: [ROLES.RESCUE_ROLE, ROLES.GOVERNANCE_ROLE], + [CORE_CONTRACTS.FastSwitchboard]: [ + ROLES.RESCUE_ROLE, + ROLES.GOVERNANCE_ROLE, + ROLES.WITHDRAW_ROLE, + ], + [CORE_CONTRACTS.OptimisticSwitchboard]: [ + ROLES.RESCUE_ROLE, + ROLES.GOVERNANCE_ROLE, + ], + [CORE_CONTRACTS.NativeSwitchboard]: [ + ROLES.GOVERNANCE_ROLE, + ROLES.WITHDRAW_ROLE, + ROLES.RESCUE_ROLE, + ], +}; + +main() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); diff --git a/yarn.lock b/yarn.lock index c5dc40ad..9e749562 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4338,7 +4338,7 @@ debug "^4.1.1" lodash.isequal "^4.5.0" -"@nomicfoundation/hardhat-verify@^2.0.0", "@nomicfoundation/hardhat-verify@^2.0.8": +"@nomicfoundation/hardhat-verify@^2.0.0", "@nomicfoundation/hardhat-verify@^2.0.12", "@nomicfoundation/hardhat-verify@^2.0.8": version "2.0.12" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.12.tgz#480819a245a2db0b127e473c62079f7b4f16daa8" integrity sha512-Lg3Nu7DCXASQRVI/YysjuAX2z8jwOCbS0w5tz2HalWGSTZThqA0v9N0v0psHbKNqzPJa8bNOeapIVSziyJTnAg==