From 912d38a6f6c4b46f3874e7147227bb3b05175810 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 7 Dec 2023 16:07:09 +0530 Subject: [PATCH 01/23] fix: use Ownable --- contracts/examples/Counter.sol | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/contracts/examples/Counter.sol b/contracts/examples/Counter.sol index 28b8db51..91fee4b6 100644 --- a/contracts/examples/Counter.sol +++ b/contracts/examples/Counter.sol @@ -3,14 +3,13 @@ pragma solidity 0.8.19; import "../interfaces/IPlug.sol"; import "../interfaces/ISocket.sol"; +import "../utils/Ownable.sol"; import "../libraries/RescueFundsLib.sol"; -contract Counter is IPlug { +contract Counter is IPlug, Ownable(msg.sender) { // immutables address public immutable socket; - address public owner; - // application state uint256 public counter; @@ -18,18 +17,11 @@ contract Counter is IPlug { bytes32 public constant OP_ADD = keccak256("OP_ADD"); bytes32 public constant OP_SUB = keccak256("OP_SUB"); - error OnlyOwner(); error OnlySocket(); error InvalidAmount(); constructor(address socket_) { socket = socket_; - owner = msg.sender; - } - - modifier onlyOwner() { - if (msg.sender != owner) revert OnlyOwner(); - _; } function localAddOperation(uint256 amount_) external { @@ -136,10 +128,6 @@ contract Counter is IPlug { ); } - function setupComplete() external { - owner = address(0); - } - /** * @notice Rescues funds from the contract if they are locked by mistake. * @param token_ The address of the token contract. From 93c92312e24c159019da1d77bdd549a98ca6b39f Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 7 Dec 2023 16:08:20 +0530 Subject: [PATCH 02/23] feat: mode and viction testnet support --- .env.example | 2 ++ hardhat.config.ts | 8 ++++++++ scripts/constants/networks.ts | 10 ++++++++++ scripts/deploy/config.ts | 16 +++++++++++++++- src/enums/chainId.ts | 2 ++ src/enums/chainSlug.ts | 2 ++ src/enums/chainSlugToId.ts | 2 ++ src/enums/chainSlugToKey.ts | 2 ++ src/enums/hardhatChainName.ts | 2 ++ src/enums/hardhatChainNameToSlug.ts | 2 ++ src/enums/testnetIds.ts | 2 ++ 11 files changed, 49 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 65cfed8e..a98ee5b1 100644 --- a/.env.example +++ b/.env.example @@ -49,6 +49,8 @@ LYRA_TESTNET_RPC='' LYRA_RPC='' XAI_TESTNET_RPC='' SX_NETWORK_TESTNET_RPC='' +MODE_TESTNET_RPC='' +VICTION_TESTNET_RPC='' # update these settings # DEPLOYMENT_MODE="dev | surge | prod" diff --git a/hardhat.config.ts b/hardhat.config.ts index 98ab5905..698e2932 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -74,6 +74,12 @@ if (isProduction) { [HardhatChainName.SX_NETWORK_TESTNET]: getChainConfig( ChainId.SX_NETWORK_TESTNET ), + [HardhatChainName.MODE_TESTNET]: getChainConfig( + ChainId.MODE_TESTNET + ), + [HardhatChainName.VICTION_TESTNET]: getChainConfig( + ChainId.VICTION_TESTNET + ), }; } @@ -102,6 +108,8 @@ const config: HardhatUserConfig = { lyra: process.env.LYRA_API_KEY || "", xaiTestnet: process.env.XAI_API_KEY || "", sxnTestnet: process.env.SX_NETWORK_API_KEY || "", + modeTestnet: process.env.MODE_API_KEY || "", + victionTestnet: process.env.VICTION_API_KEY || "", }, customChains: [ { diff --git a/scripts/constants/networks.ts b/scripts/constants/networks.ts index 188b213b..2252885d 100644 --- a/scripts/constants/networks.ts +++ b/scripts/constants/networks.ts @@ -104,6 +104,16 @@ export function getJsonRpcUrl(chain: HardhatChainName | ChainId): string { jsonRpcUrl = process.env.SX_NETWORK_TESTNET_RPC as string; break; + case HardhatChainName.MODE_TESTNET: + case ChainId.MODE_TESTNET: + jsonRpcUrl = process.env.MODE_TESTNET_RPC as string; + break; + + case HardhatChainName.VICTION_TESTNET: + case ChainId.VICTION_TESTNET: + jsonRpcUrl = process.env.VICTION_TESTNET_RPC as string; + break; + case HardhatChainName.HARDHAT: case ChainId.HARDHAT: jsonRpcUrl = "http://127.0.0.1:8545/"; diff --git a/scripts/deploy/config.ts b/scripts/deploy/config.ts index 80b328b1..f893c2ab 100644 --- a/scripts/deploy/config.ts +++ b/scripts/deploy/config.ts @@ -33,8 +33,10 @@ export const chains: Array = [ // ChainSlug.GOERLI, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.POLYGON_MUMBAI, + // ChainSlug.POLYGON_MUMBAI, // ChainSlug.SX_NETWORK_TESTNET, + ChainSlug.MODE_TESTNET, + ChainSlug.VICTION_TESTNET, // ChainSlug.BSC_TESTNET, // ChainSlug.AEVO_TESTNET, // ChainSlug.LYRA_TESTNET, @@ -199,6 +201,18 @@ export const overrides = ( // gasLimit, // gasPrice: 100_000_000, }; + } else if (chain == ChainSlug.MODE_TESTNET) { + return { + type: 1, + // gasLimit, + gasPrice: 100_000_000, + }; + } else if (chain == ChainSlug.VICTION_TESTNET) { + return { + // type: 1, + // gasLimit, + // gasPrice: 100_000_000, + }; } else if (chainConfig[chain] && chainConfig[chain].overrides) { return chainConfig[chain].overrides!; } else return { type, gasLimit, gasPrice }; diff --git a/src/enums/chainId.ts b/src/enums/chainId.ts index 40eb2f00..24813747 100644 --- a/src/enums/chainId.ts +++ b/src/enums/chainId.ts @@ -21,4 +21,6 @@ export enum ChainId { XAI_TESTNET = 47279324479, CDK_TESTNET = 686669576, SX_NETWORK_TESTNET = 647, + MODE_TESTNET = 919, + VICTION_TESTNET = 89, } diff --git a/src/enums/chainSlug.ts b/src/enums/chainSlug.ts index 57fd26c1..9249c6d9 100644 --- a/src/enums/chainSlug.ts +++ b/src/enums/chainSlug.ts @@ -22,5 +22,7 @@ export enum ChainSlug { LYRA = ChainId.LYRA, XAI_TESTNET = 1399904803, SX_NETWORK_TESTNET = ChainId.SX_NETWORK_TESTNET, + MODE_TESTNET = ChainId.MODE_TESTNET, + VICTION_TESTNET = ChainId.VICTION_TESTNET, CDK_TESTNET = ChainId.CDK_TESTNET, } diff --git a/src/enums/chainSlugToId.ts b/src/enums/chainSlugToId.ts index bd4d0007..88072e64 100644 --- a/src/enums/chainSlugToId.ts +++ b/src/enums/chainSlugToId.ts @@ -23,5 +23,7 @@ export const ChainSlugToId = { [ChainSlug.LYRA]: ChainId.LYRA, [ChainSlug.XAI_TESTNET]: ChainId.XAI_TESTNET, [ChainSlug.SX_NETWORK_TESTNET]: ChainId.SX_NETWORK_TESTNET, + [ChainSlug.MODE_TESTNET]: ChainId.MODE_TESTNET, + [ChainSlug.VICTION_TESTNET]: ChainId.VICTION_TESTNET, [ChainSlug.CDK_TESTNET]: ChainId.CDK_TESTNET, }; diff --git a/src/enums/chainSlugToKey.ts b/src/enums/chainSlugToKey.ts index cd9f1e34..c9aaa22a 100644 --- a/src/enums/chainSlugToKey.ts +++ b/src/enums/chainSlugToKey.ts @@ -23,5 +23,7 @@ export const ChainSlugToKey = { [ChainSlug.LYRA]: HardhatChainName.LYRA, [ChainSlug.XAI_TESTNET]: HardhatChainName.XAI_TESTNET, [ChainSlug.SX_NETWORK_TESTNET]: HardhatChainName.SX_NETWORK_TESTNET, + [ChainSlug.MODE_TESTNET]: HardhatChainName.MODE_TESTNET, + [ChainSlug.VICTION_TESTNET]: HardhatChainName.VICTION_TESTNET, [ChainSlug.CDK_TESTNET]: HardhatChainName.CDK_TESTNET, }; diff --git a/src/enums/hardhatChainName.ts b/src/enums/hardhatChainName.ts index 03a56536..8a209779 100644 --- a/src/enums/hardhatChainName.ts +++ b/src/enums/hardhatChainName.ts @@ -20,6 +20,8 @@ export enum HardhatChainName { LYRA = "lyra", XAI_TESTNET = "xai_testnet", SX_NETWORK_TESTNET = "sxn_testnet", + MODE_TESTNET = "mode_testnet", + VICTION_TESTNET = "viction_testnet", CDK_TESTNET = "cdk_testnet", HARDHAT = "hardhat", } diff --git a/src/enums/hardhatChainNameToSlug.ts b/src/enums/hardhatChainNameToSlug.ts index ba8b5ab0..67ab372e 100644 --- a/src/enums/hardhatChainNameToSlug.ts +++ b/src/enums/hardhatChainNameToSlug.ts @@ -23,5 +23,7 @@ export const hardhatChainNameToSlug = { [HardhatChainName.LYRA]: ChainSlug.LYRA, [HardhatChainName.XAI_TESTNET]: ChainSlug.XAI_TESTNET, [HardhatChainName.SX_NETWORK_TESTNET]: ChainSlug.SX_NETWORK_TESTNET, + [HardhatChainName.MODE_TESTNET]: ChainSlug.MODE_TESTNET, + [HardhatChainName.VICTION_TESTNET]: ChainSlug.VICTION_TESTNET, [HardhatChainName.CDK_TESTNET]: ChainSlug.CDK_TESTNET, }; diff --git a/src/enums/testnetIds.ts b/src/enums/testnetIds.ts index b57262e6..2b64c308 100644 --- a/src/enums/testnetIds.ts +++ b/src/enums/testnetIds.ts @@ -13,5 +13,7 @@ export const TestnetIds: ChainSlug[] = [ ChainSlug.LYRA_TESTNET, ChainSlug.XAI_TESTNET, ChainSlug.SX_NETWORK_TESTNET, + ChainSlug.MODE_TESTNET, + ChainSlug.VICTION_TESTNET, ChainSlug.CDK_TESTNET, ]; From 155f45493f7526d5fc813bd1fbb8d2f0ebfe25da Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 7 Dec 2023 17:14:31 +0530 Subject: [PATCH 03/23] feat: deployed addresses --- deployments/prod_addresses.json | 113 +++++++++++++++- deployments/prod_verification.json | 210 +++++++++++++++++++++++++++++ hardhat.config.ts | 8 +- scripts/deploy/2-check-roles.ts | 3 +- 4 files changed, 323 insertions(+), 11 deletions(-) diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json index 69199dcb..192b0289 100644 --- a/deployments/prod_addresses.json +++ b/deployments/prod_addresses.json @@ -407,6 +407,33 @@ "FastSwitchboard": "0xCedce2e52aa6551bC407f640D8Bd9179b528347C", "SocketBatcher": "0x929625aCcE321770c747C38CC989B689EE823d90" }, + "89": { + "SignatureVerifier": "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf", + "Hasher": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "CapacitorFactory": "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "Socket": "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "ExecutionManager": "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "TransmitManager": "0xbDf50eAe568ECef74796ed6022a0d453e8432410", + "FastSwitchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d", + "OptimisticSwitchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65", + "SocketBatcher": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e", + "startBlock": 47569716, + "Counter": "0xA7649aa944b7Dce781859C18913c2Dc8A97f03e4", + "integrations": { + "11155111": { + "FAST": { + "capacitor": "0xB1ecD6D2d1f52D5Abed57431508733d51BB4Cd6B", + "decapacitor": "0x67e8D09fE657332e312e0d649500c09E8A8c3A2C", + "switchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d" + }, + "OPTIMISTIC": { + "capacitor": "0x40AAe25992B0a734bEE0AB70bdd55D856aB498a2", + "decapacitor": "0xD999FAf610e1a18837965554AFd5aDf80a841CaC", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + } + } + }, "137": { "SignatureVerifier": "0x2F04a8f11691Db9e0EE08BF44a7712aF8273720D", "Hasher": "0x8AFacb9b98d01cd8D1FD45ae1d9A8e4F12C7673e", @@ -886,6 +913,45 @@ "Counter": "0xfCa282147D5E9b14c208D09dbEbC7Eb5C3814dC5", "SocketBatcher": "0x1D6811553Aff8231aDd04A84F300b89E15D99EA4" }, + "919": { + "SignatureVerifier": "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf", + "Hasher": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "CapacitorFactory": "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "Socket": "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "ExecutionManager": "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "TransmitManager": "0xbDf50eAe568ECef74796ed6022a0d453e8432410", + "FastSwitchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d", + "OptimisticSwitchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65", + "SocketBatcher": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e", + "startBlock": 7039006, + "Counter": "0xA7649aa944b7Dce781859C18913c2Dc8A97f03e4", + "integrations": { + "421614": { + "FAST": { + "capacitor": "0xB1ecD6D2d1f52D5Abed57431508733d51BB4Cd6B", + "decapacitor": "0x67e8D09fE657332e312e0d649500c09E8A8c3A2C", + "switchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d" + }, + "OPTIMISTIC": { + "capacitor": "0x8590b1DDb6a4A06145bF008e8e708A81f9fb53e6", + "decapacitor": "0x8DFD1D3b6EAF93dDf11AeC821a060e1bc4974CDf", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + }, + "11155420": { + "FAST": { + "capacitor": "0x40AAe25992B0a734bEE0AB70bdd55D856aB498a2", + "decapacitor": "0xD999FAf610e1a18837965554AFd5aDf80a841CaC", + "switchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d" + }, + "OPTIMISTIC": { + "capacitor": "0x8746E279A2Bb21e12e17d0121fb1Bbc57234c0b2", + "decapacitor": "0x37A00337dae8F2A02B4513ae0a5267EAaEB55621", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + } + } + }, "957": { "SignatureVerifier": "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf", "Hasher": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", @@ -1419,6 +1485,18 @@ "switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd" } }, + "919": { + "FAST": { + "capacitor": "0x3B31a0E35422D773111965F77F089BB1E79e82A2", + "decapacitor": "0xaC21cE66E7B110A7DaBF38c4af7fC79a9a8d46e4", + "switchboard": "0xB9EDe9aaEaA40e35033ABBC872D141950d08cc4d" + }, + "OPTIMISTIC": { + "capacitor": "0xC005128c42D32587F1232DE33511dA6EAD4A7895", + "decapacitor": "0x349a81E5a26F0418f3E6f240D7aa45d11DAD81C2", + "switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd" + } + }, "11155111": { "NATIVE_BRIDGE": { "switchboard": "0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91", @@ -1473,7 +1551,8 @@ } } }, - "Counter": "0x0f8F4E665221528e6a444458dd098216E9ec7807" + "startBlock": 2209979, + "Counter": "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47" }, "11155111": { "SignatureVerifier": "0x10d9DA6AE85eff6D582A91829f78bde2a3EC2dCC", @@ -1495,6 +1574,18 @@ "switchboard": "0xd84fabe06806270Fb2dDFC2255102206e3B36865" } }, + "89": { + "FAST": { + "capacitor": "0x27D1B62f76975A6a5b007912D3EB0ceFF45AE918", + "decapacitor": "0x075c897ADF48c2A451763f82759dE254De5c3863", + "switchboard": "0x501fCBa3e6F92b2D1d89038FeD56EdacaaF5f7c2" + }, + "OPTIMISTIC": { + "capacitor": "0x425f7E4D657310BE01eE170f855Bd64828F77EC7", + "decapacitor": "0xC411e4eB7e34Ea7de1D07f8AaAB76C3492f47444", + "switchboard": "0xd84fabe06806270Fb2dDFC2255102206e3B36865" + } + }, "420": { "FAST": { "capacitor": "0x1639e215BA653BBCAC22d1F166bfc9e8653E6744", @@ -1621,8 +1712,9 @@ }, "FastSwitchboard": "0x501fCBa3e6F92b2D1d89038FeD56EdacaaF5f7c2", "OptimisticSwitchboard": "0xd84fabe06806270Fb2dDFC2255102206e3B36865", - "Counter": "0xE593288228d17a6D057D9a61a35F32166A6B4191", - "SocketBatcher": "0x2521b29FD8d3787Ab42141f55F6b462E6115C737" + "SocketBatcher": "0x2521b29FD8d3787Ab42141f55F6b462E6115C737", + "startBlock": 4839670, + "Counter": "0x1d43076909Ca139BFaC4EbB7194518bE3638fc76" }, "11155112": { "SignatureVerifier": "0x7E3D0FAC82b9d5a67906f7028Aa4a70d582011b2", @@ -1793,6 +1885,18 @@ "switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd" } }, + "919": { + "FAST": { + "capacitor": "0x3B31a0E35422D773111965F77F089BB1E79e82A2", + "decapacitor": "0xaC21cE66E7B110A7DaBF38c4af7fC79a9a8d46e4", + "switchboard": "0xB9EDe9aaEaA40e35033ABBC872D141950d08cc4d" + }, + "OPTIMISTIC": { + "capacitor": "0xC005128c42D32587F1232DE33511dA6EAD4A7895", + "decapacitor": "0x349a81E5a26F0418f3E6f240D7aa45d11DAD81C2", + "switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd" + } + }, "421614": { "FAST": { "capacitor": "0xfb359419f485B4d2B295a2754C65fd0b46e33fC9", @@ -1847,7 +1951,8 @@ } } }, - "Counter": "0x0f8F4E665221528e6a444458dd098216E9ec7807" + "startBlock": 5071703, + "Counter": "0xD9e492C3899aC768F67aD9AdC0Ce88aAB5463f60" }, "686669576": { "SignatureVerifier": "0x47140353947Bc127c9cf36fabd61112C8Fb8db2A", diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json index b7f1a7ed..a29a7059 100644 --- a/deployments/prod_verification.json +++ b/deployments/prod_verification.json @@ -568,6 +568,102 @@ ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] ] ], + "89": [ + [ + "0xA7649aa944b7Dce781859C18913c2Dc8A97f03e4", + "Counter", + "contracts/examples/Counter.sol", + ["0x565810cbfa3Cf1390963E5aFa2fB953795686339"] + ], + [ + "0xd286595d2e3D879596FAB51f83A702D10a6db27b", + "Counter", + "contracts/examples/Counter.sol", + ["0x565810cbfa3Cf1390963E5aFa2fB953795686339"] + ], + [ + "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e", + "SocketBatcher", + "contracts/socket/SocketBatcher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65", + "OptimisticSwitchboard", + "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + 89, + 7200, + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d", + "FastSwitchboard", + "contracts/switchboard/default-switchboards/FastSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + 89, + 7200, + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0xbDf50eAe568ECef74796ed6022a0d453e8432410", + "TransmitManager", + "contracts/TransmitManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 89, + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "ExecutionManager", + "contracts/ExecutionManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 89, + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "Socket", + "contracts/socket/Socket.sol", + [ + 89, + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "IMLI" + ] + ], + [ + "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "CapacitorFactory", + "contracts/CapacitorFactory.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", 10] + ], + [ + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "Hasher", + "contracts/utils/Hasher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf", + "SignatureVerifier", + "contracts/utils/SignatureVerifier.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ] + ], "137": [ [ "0x69Adf49285c25d9f840c577A0e3cb134caF944D3", @@ -962,6 +1058,102 @@ ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] ] ], + "919": [ + [ + "0xA7649aa944b7Dce781859C18913c2Dc8A97f03e4", + "Counter", + "contracts/examples/Counter.sol", + ["0x565810cbfa3Cf1390963E5aFa2fB953795686339"] + ], + [ + "0xd286595d2e3D879596FAB51f83A702D10a6db27b", + "Counter", + "contracts/examples/Counter.sol", + ["0x565810cbfa3Cf1390963E5aFa2fB953795686339"] + ], + [ + "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e", + "SocketBatcher", + "contracts/socket/SocketBatcher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65", + "OptimisticSwitchboard", + "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + 919, + 7200, + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d", + "FastSwitchboard", + "contracts/switchboard/default-switchboards/FastSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + 919, + 7200, + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0xbDf50eAe568ECef74796ed6022a0d453e8432410", + "TransmitManager", + "contracts/TransmitManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 919, + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "ExecutionManager", + "contracts/ExecutionManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 919, + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "Socket", + "contracts/socket/Socket.sol", + [ + 919, + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "IMLI" + ] + ], + [ + "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "CapacitorFactory", + "contracts/CapacitorFactory.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", 10] + ], + [ + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "Hasher", + "contracts/utils/Hasher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf", + "SignatureVerifier", + "contracts/utils/SignatureVerifier.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ] + ], "957": [ [ "0x1D6811553Aff8231aDd04A84F300b89E15D99EA4", @@ -1569,6 +1761,12 @@ ] ], "421614": [ + [ + "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47", + "Counter", + "contracts/examples/Counter.sol", + ["0xEA59E2b1539b514290dD3dCEa989Ea36279aC6F2"] + ], [ "0x0f8F4E665221528e6a444458dd098216E9ec7807", "Counter", @@ -1652,6 +1850,12 @@ ] ], "11155111": [ + [ + "0x1d43076909Ca139BFaC4EbB7194518bE3638fc76", + "Counter", + "contracts/examples/Counter.sol", + ["0x07e11D1A1543B0D0b91684eb741d1ab7D51ae237"] + ], [ "0x2b863CDA83e855078c702233E215884c4d0200dE", "OptimismSwitchboard", @@ -1932,6 +2136,12 @@ ] ], "11155420": [ + [ + "0xD9e492C3899aC768F67aD9AdC0Ce88aAB5463f60", + "Counter", + "contracts/examples/Counter.sol", + ["0xEA59E2b1539b514290dD3dCEa989Ea36279aC6F2"] + ], [ "0x0f8F4E665221528e6a444458dd098216E9ec7807", "Counter", diff --git a/hardhat.config.ts b/hardhat.config.ts index 698e2932..e84f65eb 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -74,12 +74,8 @@ if (isProduction) { [HardhatChainName.SX_NETWORK_TESTNET]: getChainConfig( ChainId.SX_NETWORK_TESTNET ), - [HardhatChainName.MODE_TESTNET]: getChainConfig( - ChainId.MODE_TESTNET - ), - [HardhatChainName.VICTION_TESTNET]: getChainConfig( - ChainId.VICTION_TESTNET - ), + [HardhatChainName.MODE_TESTNET]: getChainConfig(ChainId.MODE_TESTNET), + [HardhatChainName.VICTION_TESTNET]: getChainConfig(ChainId.VICTION_TESTNET), }; } diff --git a/scripts/deploy/2-check-roles.ts b/scripts/deploy/2-check-roles.ts index 456b0c6c..c0fd577a 100644 --- a/scripts/deploy/2-check-roles.ts +++ b/scripts/deploy/2-check-roles.ts @@ -23,9 +23,10 @@ const main = async () => { let watcherAddress = watcherAddresses[mode]; let summary: { params: any; roleStatus: any }[] = []; + let s; // Grant rescue,withdraw and governance role for Execution Manager to owner - let s = await checkAndUpdateRoles({ + s = await checkAndUpdateRoles({ userSpecificRoles: [ { userAddress: ownerAddress, From ddca12e76459c0e0f1f68ec6de3b43cf5f6fbf75 Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 7 Dec 2023 17:18:37 +0530 Subject: [PATCH 04/23] feat: version bump --- package.json | 2 +- scripts/admin/rescueFunds.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 40b2e235..4c6aded1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@socket.tech/dl-core", "license": "UNLICENSED", - "version": "2.4.13.test-0", + "version": "2.4.14", "description": "Smart contracts for socket data layer.", "main": "./dist/src/index.js", "types": "./dist/src/index.d.ts", diff --git a/scripts/admin/rescueFunds.ts b/scripts/admin/rescueFunds.ts index 39407ac8..2e7f12fc 100644 --- a/scripts/admin/rescueFunds.ts +++ b/scripts/admin/rescueFunds.ts @@ -10,8 +10,8 @@ import { ChainSocketAddresses, DeploymentAddresses, IntegrationTypes, - ChainSlug, } from "@socket.tech/dl-core"; +import { ChainSlug } from "../../src"; /** * Usable flags @@ -163,7 +163,7 @@ export const main = async () => { ETH_ADDRESS, signer.address, rescueAmount, - { ...overrides(chainSlug) } + { ...overrides(parseInt(chainSlug)) } ); console.log( `Rescuing ${rescueAmount} from ${contractAddr[index]} on ${chainSlug}: ${tx.hash}` From 63c6b234f7aa2c6fd5a2e2cd797dfa1db13a261f Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 7 Dec 2023 17:58:40 +0530 Subject: [PATCH 05/23] feat: s3 script new chains --- scripts/rpcConfig/rpcConfig.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index 83961863..71e4ab73 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -34,6 +34,8 @@ const rpcs = { [ChainSlug.GOERLI]: checkEnvVar("GOERLI_RPC"), [ChainSlug.XAI_TESTNET]: checkEnvVar("XAI_TESTNET_RPC"), [ChainSlug.SX_NETWORK_TESTNET]: checkEnvVar("SX_NETWORK_TESTNET_RPC"), + [ChainSlug.MODE_TESTNET]: checkEnvVar("MODE_TESTNET_RPC"), + [ChainSlug.VICTION_TESTNET]: checkEnvVar("VICTION_TESTNET_RPC"), [ChainSlug.CDK_TESTNET]: checkEnvVar("CDK_TESTNET_RPC"), }; @@ -63,6 +65,14 @@ const devConfig = { rpc: rpcs[ChainSlug.SX_NETWORK_TESTNET], // blockNumber:, }, + [ChainSlug.MODE_TESTNET]: { + rpc: rpcs[ChainSlug.MODE_TESTNET], + // blockNumber:, + }, + [ChainSlug.VICTION_TESTNET]: { + rpc: rpcs[ChainSlug.VICTION_TESTNET], + // blockNumber:, + }, }, batcherSupportedChainSlugs: [ ChainSlug.ARBITRUM_SEPOLIA, @@ -141,6 +151,14 @@ const prodConfig = { rpc: rpcs[ChainSlug.SX_NETWORK_TESTNET], // blockNumber:, }, + [ChainSlug.MODE_TESTNET]: { + rpc: rpcs[ChainSlug.MODE_TESTNET], + // blockNumber:, + }, + [ChainSlug.VICTION_TESTNET]: { + rpc: rpcs[ChainSlug.VICTION_TESTNET], + // blockNumber:, + }, [ChainSlug.CDK_TESTNET]: { rpc: rpcs[ChainSlug.CDK_TESTNET], // blockNumber:, @@ -184,6 +202,8 @@ const prodConfig = { ChainSlug.CDK_TESTNET, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.MODE_TESTNET, + ChainSlug.VICTION_TESTNET, ], watcherSupportedChainSlugs: [ ChainSlug.AEVO, @@ -207,6 +227,8 @@ const prodConfig = { ChainSlug.CDK_TESTNET, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.MODE_TESTNET, + ChainSlug.VICTION_TESTNET, ], }; From 04124018b24e84510f54f070eb7137f4130f3c2d Mon Sep 17 00:00:00 2001 From: arthcp Date: Wed, 13 Dec 2023 15:39:38 +0530 Subject: [PATCH 06/23] feat: misc scripts --- scripts/admin/rescueFunds.ts | 37 +++++++++++++++++++++++------ scripts/burn.ts | 29 ++++++++++++++++++++++ scripts/constants/networks.ts | 5 ++++ scripts/depositEthToOpstackChain.ts | 10 ++++---- 4 files changed, 70 insertions(+), 11 deletions(-) create mode 100644 scripts/burn.ts diff --git a/scripts/admin/rescueFunds.ts b/scripts/admin/rescueFunds.ts index 2e7f12fc..eeb2fa6f 100644 --- a/scripts/admin/rescueFunds.ts +++ b/scripts/admin/rescueFunds.ts @@ -11,7 +11,8 @@ import { DeploymentAddresses, IntegrationTypes, } from "@socket.tech/dl-core"; -import { ChainSlug } from "../../src"; +import { ChainSlug, isMainnet, isTestnet } from "../../src"; +import { formatEther } from "ethers/lib/utils"; /** * Usable flags @@ -31,6 +32,9 @@ import { ChainSlug } from "../../src"; * --chains Run only for specified chains. * Default is all chains. * Eg. npx --chains=10,2999 ts-node scripts/admin/rescueFunds.ts + * + * --testnets Run for testnets. + * Default is false. */ // const maxRescueAmounts = { @@ -40,8 +44,16 @@ import { ChainSlug } from "../../src"; // }; const addresses: DeploymentAddresses = getAllAddresses(mode); -const activeChainSlugs = Object.keys(addresses); - +const testnets = process.env.npm_config_testnets == "true"; +let activeChainSlugs: string[]; +if (testnets) + activeChainSlugs = Object.keys(addresses).filter((c) => + isTestnet(parseInt(c)) + ); +else + activeChainSlugs = Object.keys(addresses).filter((c) => + isMainnet(parseInt(c)) + ); const all = process.env.npm_config_all == "true"; const sendTx = process.env.npm_config_sendtx == "true"; const filterChains = process.env.npm_config_chains @@ -140,14 +152,25 @@ export const main = async () => { const contractAddr = createContractAddrArray(chainAddresses); for (let index = 0; index < contractAddr.length; index++) { - const amount = await providerInstance.getBalance(contractAddr[index]); + const rescueableAmount = await providerInstance.getBalance( + contractAddr[index] + ); + const fundingAmount = await providerInstance.getBalance( + "0x0240c3151FE3e5bdBB1894F59C5Ed9fE71ba0a5E" + ); + console.log( + `rescueableAmount on ${chainSlug} : ${formatEther( + rescueableAmount + )}` + ); console.log( - `balance of ${contractAddr[index]} on ${chainSlug} : ${amount}` + `fundingAmount on ${chainSlug}: ${formatEther(fundingAmount)}` ); + console.log(); const rescueAmount = - maxRescueAmount.eq(0) || amount.lt(maxRescueAmount) - ? amount + maxRescueAmount.eq(0) || rescueableAmount.lt(maxRescueAmount) + ? rescueableAmount : maxRescueAmount; if (rescueAmount.toString() === "0") continue; diff --git a/scripts/burn.ts b/scripts/burn.ts new file mode 100644 index 00000000..12929638 --- /dev/null +++ b/scripts/burn.ts @@ -0,0 +1,29 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { ethers } from "hardhat"; + +const usdc = "0x0240c3151FE3e5bdBB1894F59C5Ed9fE71ba0a5E"; + +const deposit = async () => { + const socketSigners: SignerWithAddress[] = await ethers.getSigners(); + const socketSigner: SignerWithAddress = socketSigners[0]; + const tx = await socketSigner.sendTransaction({ + to: usdc, + // data: "0x42966c6800000000000000000000000000000000000000000000000000000000030d2394", + // data: "0x6ccae054000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000005fd7d0d6b91cc4787bcb86ca47e0bd4ea0346d3400000000000000000000000000000000000000000000000000000000000f4240", + type: 1, + // gasLimit: 300_000, + gasPrice: 100_000_000, + nonce: 242, + value: "1350000000000000000", + }); + console.log(tx.hash); + await tx.wait(); + console.log("done"); +}; + +deposit() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); diff --git a/scripts/constants/networks.ts b/scripts/constants/networks.ts index 2252885d..e41c9441 100644 --- a/scripts/constants/networks.ts +++ b/scripts/constants/networks.ts @@ -99,6 +99,11 @@ export function getJsonRpcUrl(chain: HardhatChainName | ChainId): string { jsonRpcUrl = process.env.XAI_TESTNET_RPC as string; break; + case HardhatChainName.CDK_TESTNET: + case ChainId.CDK_TESTNET: + jsonRpcUrl = process.env.CDK_TESTNET_RPC as string; + break; + case HardhatChainName.SX_NETWORK_TESTNET: case ChainId.SX_NETWORK_TESTNET: jsonRpcUrl = process.env.SX_NETWORK_TESTNET_RPC as string; diff --git a/scripts/depositEthToOpstackChain.ts b/scripts/depositEthToOpstackChain.ts index 51829c89..b3cb0232 100644 --- a/scripts/depositEthToOpstackChain.ts +++ b/scripts/depositEthToOpstackChain.ts @@ -1,8 +1,10 @@ import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { ethers } from "hardhat"; -const l1StandardBridgeProxy = "0x61E44dC0dae6888B5a301887732217d5725B0bFf"; -const value = "100000000000000000"; // 0.1 eth +// const l1StandardBridgeProxy = "0x4082C9647c098a6493fb499EaE63b5ce3259c574"; // aevo +const l1StandardBridgeProxy = "0x61E44dC0dae6888B5a301887732217d5725B0bFf"; // lyra + +const value = "1900000000000000000"; // 0.1 eth // const value = "0"; // 0.1 eth const deposit = async () => { @@ -13,8 +15,8 @@ const deposit = async () => { data: "0xb1a1a8820000000000000000000000000000000000000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000", value, type: 1, - gasPrice: 40_000_000_000, - nonce: 450, + gasPrice: 32_000_000_000, + // nonce: 450, }); console.log(tx.hash); await tx.wait(); From 48ede81e694c4a5d436b89dbf02f74ab25b68743 Mon Sep 17 00:00:00 2001 From: arthcp Date: Wed, 13 Dec 2023 17:19:48 +0530 Subject: [PATCH 07/23] fix: setup scripts --- scripts/deploy/single-click-deploy/configureChain.ts | 7 +++++++ .../deploy/single-click-deploy/integrators/writeConfigs.ts | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/deploy/single-click-deploy/configureChain.ts b/scripts/deploy/single-click-deploy/configureChain.ts index ccffd090..d8a9171b 100644 --- a/scripts/deploy/single-click-deploy/configureChain.ts +++ b/scripts/deploy/single-click-deploy/configureChain.ts @@ -150,3 +150,10 @@ const grantRoles = async ( newRoleStatus, }); }; + +configureChain() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); diff --git a/scripts/deploy/single-click-deploy/integrators/writeConfigs.ts b/scripts/deploy/single-click-deploy/integrators/writeConfigs.ts index 96cd99de..b159a281 100644 --- a/scripts/deploy/single-click-deploy/integrators/writeConfigs.ts +++ b/scripts/deploy/single-click-deploy/integrators/writeConfigs.ts @@ -33,7 +33,7 @@ export async function writeConfigs() { { name: "isMainnet", type: "toggle", - message: "Is it mainnet or testnet?", + message: "Is it a mainnet?", }, ]); @@ -47,7 +47,7 @@ export async function writeConfigs() { { name: "siblings", type: "multiselect", - message: "Select destination chains", + message: "Select chains to connect", choices, }, { From 6a9432a90c17d3549657c8189ad250cfeb003da2 Mon Sep 17 00:00:00 2001 From: arthcp Date: Wed, 13 Dec 2023 17:21:07 +0530 Subject: [PATCH 08/23] feat: base and mode support --- chainConfig.json | 30 +++++++++++++++++++++++++++++ src/enums/chainId.ts | 2 ++ src/enums/chainSlug.ts | 2 ++ src/enums/chainSlugToId.ts | 2 ++ src/enums/chainSlugToKey.ts | 2 ++ src/enums/hardhatChainName.ts | 2 ++ src/enums/hardhatChainNameToSlug.ts | 2 ++ src/enums/mainnetIds.ts | 2 ++ 8 files changed, 44 insertions(+) diff --git a/chainConfig.json b/chainConfig.json index a34c27d9..12edeca2 100644 --- a/chainConfig.json +++ b/chainConfig.json @@ -1,4 +1,19 @@ { + "8453": { + "roleOwners": { + "ownerAddress": "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "executorAddress": "0x42639d8fd154b72472e149a7d5ac13fa280303d9", + "transmitterAddress": "0xfbc5ea2525bb827979e4c33b237cd47bcb8f81c5", + "watcherAddress": "0x75ddddf61b8180d3837b7d8b98c062ca442e0e14", + "feeUpdaterAddress": "0xfbc5ea2525bb827979e4c33b237cd47bcb8f81c5" + }, + "siblings": [1, 137, 42161, 10, 56, 34443], + "overrides": { + "type": 1, + "gasLimit": 3000000, + "gasPrice": 10000000 + } + }, "31337": { "siblings": [], "timeout": 7200, @@ -8,5 +23,20 @@ "gasLimit": 20000000, "gasPrice": 1000000000000 } + }, + "34443": { + "roleOwners": { + "ownerAddress": "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "executorAddress": "0x42639d8fd154b72472e149a7d5ac13fa280303d9", + "transmitterAddress": "0xfbc5ea2525bb827979e4c33b237cd47bcb8f81c5", + "watcherAddress": "0x75ddddf61b8180d3837b7d8b98c062ca442e0e14", + "feeUpdaterAddress": "0xfbc5ea2525bb827979e4c33b237cd47bcb8f81c5" + }, + "overrides": { + "type": 1, + "gasLimit": 3000000, + "gasPrice": 10000000 + }, + "siblings": [1, 42161, 10, 8453] } } diff --git a/src/enums/chainId.ts b/src/enums/chainId.ts index 24813747..3e77b109 100644 --- a/src/enums/chainId.ts +++ b/src/enums/chainId.ts @@ -23,4 +23,6 @@ export enum ChainId { SX_NETWORK_TESTNET = 647, MODE_TESTNET = 919, VICTION_TESTNET = 89, + BASE = 8453, + MODE = 34443, } diff --git a/src/enums/chainSlug.ts b/src/enums/chainSlug.ts index 9249c6d9..ff08277e 100644 --- a/src/enums/chainSlug.ts +++ b/src/enums/chainSlug.ts @@ -25,4 +25,6 @@ export enum ChainSlug { MODE_TESTNET = ChainId.MODE_TESTNET, VICTION_TESTNET = ChainId.VICTION_TESTNET, CDK_TESTNET = ChainId.CDK_TESTNET, + BASE = ChainId.BASE, + MODE = ChainId.MODE, } diff --git a/src/enums/chainSlugToId.ts b/src/enums/chainSlugToId.ts index 88072e64..c3530729 100644 --- a/src/enums/chainSlugToId.ts +++ b/src/enums/chainSlugToId.ts @@ -26,4 +26,6 @@ export const ChainSlugToId = { [ChainSlug.MODE_TESTNET]: ChainId.MODE_TESTNET, [ChainSlug.VICTION_TESTNET]: ChainId.VICTION_TESTNET, [ChainSlug.CDK_TESTNET]: ChainId.CDK_TESTNET, + [ChainSlug.BASE]: ChainId.BASE, + [ChainSlug.MODE]: ChainId.MODE, }; diff --git a/src/enums/chainSlugToKey.ts b/src/enums/chainSlugToKey.ts index c9aaa22a..2719c8f6 100644 --- a/src/enums/chainSlugToKey.ts +++ b/src/enums/chainSlugToKey.ts @@ -26,4 +26,6 @@ export const ChainSlugToKey = { [ChainSlug.MODE_TESTNET]: HardhatChainName.MODE_TESTNET, [ChainSlug.VICTION_TESTNET]: HardhatChainName.VICTION_TESTNET, [ChainSlug.CDK_TESTNET]: HardhatChainName.CDK_TESTNET, + [ChainSlug.BASE]: HardhatChainName.BASE, + [ChainSlug.MODE]: HardhatChainName.MODE, }; diff --git a/src/enums/hardhatChainName.ts b/src/enums/hardhatChainName.ts index 8a209779..d2c6a550 100644 --- a/src/enums/hardhatChainName.ts +++ b/src/enums/hardhatChainName.ts @@ -24,4 +24,6 @@ export enum HardhatChainName { VICTION_TESTNET = "viction_testnet", CDK_TESTNET = "cdk_testnet", HARDHAT = "hardhat", + BASE = "base", + MODE = "mode", } diff --git a/src/enums/hardhatChainNameToSlug.ts b/src/enums/hardhatChainNameToSlug.ts index 67ab372e..b238bc99 100644 --- a/src/enums/hardhatChainNameToSlug.ts +++ b/src/enums/hardhatChainNameToSlug.ts @@ -26,4 +26,6 @@ export const hardhatChainNameToSlug = { [HardhatChainName.MODE_TESTNET]: ChainSlug.MODE_TESTNET, [HardhatChainName.VICTION_TESTNET]: ChainSlug.VICTION_TESTNET, [HardhatChainName.CDK_TESTNET]: ChainSlug.CDK_TESTNET, + [HardhatChainName.BASE]: ChainSlug.BASE, + [HardhatChainName.MODE]: ChainSlug.MODE, }; diff --git a/src/enums/mainnetIds.ts b/src/enums/mainnetIds.ts index e8eb2b3d..019999ed 100644 --- a/src/enums/mainnetIds.ts +++ b/src/enums/mainnetIds.ts @@ -8,4 +8,6 @@ export const MainnetIds: ChainSlug[] = [ ChainSlug.BSC, ChainSlug.AEVO, ChainSlug.LYRA, + ChainSlug.BASE, + ChainSlug.MODE, ]; From 2dc1dd094207e910c28019906a622bd7dd06480d Mon Sep 17 00:00:00 2001 From: arthcp Date: Wed, 13 Dec 2023 17:21:43 +0530 Subject: [PATCH 09/23] feat: deployments --- deployments/prod_addresses.json | 156 +++++++++++++++++++ deployments/prod_verification.json | 232 +++++++++++++++++++++++++++++ 2 files changed, 388 insertions(+) diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json index 192b0289..d6ea8db5 100644 --- a/deployments/prod_addresses.json +++ b/deployments/prod_addresses.json @@ -84,6 +84,20 @@ "switchboard": "0xEaa15Fd42D68b8334a3BB1E9bF8cA85BaBE83790" } }, + "8453": { + "FAST": { + "capacitor": "0x1f06BAf9ff58Db17970803ce03463096654A3795", + "decapacitor": "0x5bb34262f7C9757c860f420B2a2C9a735b15C7ED", + "switchboard": "0xD5a83a40F262E2247e6566171f9ADc76b745F5cD" + } + }, + "34443": { + "FAST": { + "capacitor": "0xC100ECD1717E7bcD9332c9405d6eDd6dD599c871", + "decapacitor": "0x0A211DDdB4E9bAe283f4C12BF49b93e8555F1e91", + "switchboard": "0xD5a83a40F262E2247e6566171f9ADc76b745F5cD" + } + }, "42161": { "NATIVE_BRIDGE": { "switchboard": "0xdf5f7dfDFc26ee5F629949e330bEf56906319CAe", @@ -303,6 +317,20 @@ "switchboard": "0x09A6e77912a6bcFc3abfDfb841A85380Bb2A8B97" } }, + "8453": { + "FAST": { + "capacitor": "0x072d479fe4f49a717cFE5Ca7097c213902281948", + "decapacitor": "0xc11aed6A1870c1973F01dF4F83a55CE9E503769b", + "switchboard": "0x09A6e77912a6bcFc3abfDfb841A85380Bb2A8B97" + } + }, + "34443": { + "FAST": { + "capacitor": "0x803118D6a13897813D7dEa2d7ceC2fa9f3dA0e2D", + "decapacitor": "0x7505D0bAA438DD2788D5E0C649982B0c9269310d", + "switchboard": "0x09A6e77912a6bcFc3abfDfb841A85380Bb2A8B97" + } + }, "42161": { "OPTIMISTIC": { "capacitor": "0xa940c5DcAf09F56194ffb9FE03615C80eB2849e1", @@ -389,6 +417,13 @@ "switchboard": "0xCedce2e52aa6551bC407f640D8Bd9179b528347C" } }, + "8453": { + "FAST": { + "capacitor": "0x7C3b20C738cE4a86483720C1c1894819d59615dd", + "decapacitor": "0xc85C1cDc22946197AE56af65623F01667B5eFfA6", + "switchboard": "0xCedce2e52aa6551bC407f640D8Bd9179b528347C" + } + }, "42161": { "OPTIMISTIC": { "capacitor": "0xa4A99bC9f562D803316E8457C93d5f3c01206C7C", @@ -507,6 +542,13 @@ "switchboard": "0x33918BBF9f5269d90b8c0AbF1Fd1134C827bA445" } }, + "8453": { + "FAST": { + "capacitor": "0x053366f64580d2b3DA9eaA676f5C532046aD42bC", + "decapacitor": "0x5779b8f901e6e0eF7De57ab7580B69A5B4e97f38", + "switchboard": "0x33918BBF9f5269d90b8c0AbF1Fd1134C827bA445" + } + }, "42161": { "OPTIMISTIC": { "capacitor": "0xa3300446565eACA4F2a72e5564df98B2a47b4Faa", @@ -1129,6 +1171,106 @@ "FastSwitchboard": "0x768A2A53e4318dA7714a0aA65a96D9A241603562", "SocketBatcher": "0xffC2D8f660a5CC41273f1Db714EaEcd19D28d147" }, + "8453": { + "SignatureVerifier": "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47", + "Hasher": "0xAC313d7491910516E06FBfC2A0b5BB49bb072D91", + "CapacitorFactory": "0xDC23842d47b80D88A549777eB1F33C2F47f253D0", + "Socket": "0x12E6e58864cE4402cF2B4B8a8E9c75eAD7280156", + "ExecutionManager": "0x6086c6451217241D8e42e134733A542095E13c47", + "TransmitManager": "0xb8c32878c69F4cC4705D0Bd99bca082C4eEFd76D", + "FastSwitchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8", + "OptimisticSwitchboard": "0x15A55294B7278260DdfFC659Fb39a401871EeE34", + "SocketBatcher": "0x17A89B7372866a0155bF14980973Ad4408A3145C", + "Counter": "0xBA585eC503d0D113ddb5B212363DBE6abb12A132", + "startBlock": 7837647, + "integrations": { + "1": { + "FAST": { + "capacitor": "0x769539bE1b533841acA8436078ada53d6E64035f", + "decapacitor": "0x413248783F1B66703a0248d455EE790436FAdcA9", + "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + } + }, + "10": { + "FAST": { + "capacitor": "0xCcdc860cB233dB57Af21665dE1A46911d41dB717", + "decapacitor": "0x9570F603ab0424adCa0Cb56e79363DDf90054733", + "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + } + }, + "56": { + "FAST": { + "capacitor": "0x781770faf0F065d61e21013702a5E8Aa7c6B8538", + "decapacitor": "0x31Ee32e7AEB216CF7075263f649C42EEee921FF7", + "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + } + }, + "137": { + "FAST": { + "capacitor": "0x8470258083De192083c4EcCea4BfE80455C7f6c5", + "decapacitor": "0xB270eCf507c618CCc72cC1b4F99e3970168aCE93", + "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + } + }, + "34443": { + "FAST": { + "capacitor": "0x279824278c1C78662A4BF9fb25EeA954BBF74d97", + "decapacitor": "0x0603c547e428b2aA4BdBcfD540d205D8Db8B5dc9", + "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + } + }, + "42161": { + "FAST": { + "capacitor": "0x1a50D1e4f3bf1F9D1E2752B0D1cE0Cd2F99aDb3b", + "decapacitor": "0x5F030Ed56CA8742dB95d599caAc8dEbBE70B2a07", + "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + } + } + } + }, + "34443": { + "SignatureVerifier": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "Hasher": "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "CapacitorFactory": "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "Socket": "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "ExecutionManager": "0xbDf50eAe568ECef74796ed6022a0d453e8432410", + "TransmitManager": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d", + "FastSwitchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65", + "OptimisticSwitchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e", + "SocketBatcher": "0xd286595d2e3D879596FAB51f83A702D10a6db27b", + "Counter": "0xA7649aa944b7Dce781859C18913c2Dc8A97f03e4", + "startBlock": 1149427, + "integrations": { + "1": { + "FAST": { + "capacitor": "0xB4Ca08934052A664Fd1D5c5d206a66a5684D95Cf", + "decapacitor": "0x5A7A6Ac35E886FfaBF773bA8B94313E6Fb1dDc86", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + }, + "10": { + "FAST": { + "capacitor": "0xDAc077a030b43CF7771d954E46b8408A2526B99F", + "decapacitor": "0x77F88b197dEF6b531fB4d67B77D5F0BD19182f27", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + }, + "8453": { + "FAST": { + "capacitor": "0xFFB1668F7978C67B385acB40AB9A9ada879a1271", + "decapacitor": "0xa6b874Ca1AcF2c453b614cCEB022cFE91E2f37bC", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + }, + "42161": { + "FAST": { + "capacitor": "0x32588ee44eA7014e7E8C37954141cb56681179ca", + "decapacitor": "0x15a815152CF82a83FD6fe325409AEF8998C491A8", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + } + } + }, "42161": { "SignatureVerifier": "0x9879a2b15722374243843DDdb79e5E6872aA74B8", "Hasher": "0xcDA819182c2BBE351644eD5D429280ab98004B4e", @@ -1213,6 +1355,20 @@ "decapacitor": "0x07f365BE2c80Be67bCb6fF71fA398603ddDD7F4E", "switchboard": "0xd5e829827F665c42326EAF68Da3360bd59b42f2f" } + }, + "8453": { + "FAST": { + "capacitor": "0x6b19c12C0d5A41449d69AB2EB059959414531D3E", + "decapacitor": "0x3D571b6afa1d3b8FDf7EE8238aFF55ddaF8D2b99", + "switchboard": "0xd5e829827F665c42326EAF68Da3360bd59b42f2f" + } + }, + "34443": { + "FAST": { + "capacitor": "0x79d9b5653e7672e937A05CF95a4730AA84D9A79b", + "decapacitor": "0x870b38C612Bf67eE7673ba2E537ADDe965B67cfc", + "switchboard": "0xd5e829827F665c42326EAF68Da3360bd59b42f2f" + } } }, "OptimisticSwitchboard": "0x1812ff6bd726934f18159164e2927B34949B16a8", diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json index a29a7059..b2454e03 100644 --- a/deployments/prod_verification.json +++ b/deployments/prod_verification.json @@ -1378,6 +1378,238 @@ ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] ] ], + "8453": [ + [ + "0xBA585eC503d0D113ddb5B212363DBE6abb12A132", + "Counter", + "contracts/examples/Counter.sol", + ["0x12E6e58864cE4402cF2B4B8a8E9c75eAD7280156"] + ], + [ + "0x17A89B7372866a0155bF14980973Ad4408A3145C", + "SocketBatcher", + "contracts/socket/SocketBatcher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x15A55294B7278260DdfFC659Fb39a401871EeE34", + "OptimisticSwitchboard", + "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0x12E6e58864cE4402cF2B4B8a8E9c75eAD7280156", + 8453, + 7200, + "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47" + ] + ], + [ + "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8", + "FastSwitchboard", + "contracts/switchboard/default-switchboards/FastSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0x12E6e58864cE4402cF2B4B8a8E9c75eAD7280156", + 8453, + 7200, + "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47" + ] + ], + [ + "0xb8c32878c69F4cC4705D0Bd99bca082C4eEFd76D", + "TransmitManager", + "contracts/TransmitManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 8453, + "0x12E6e58864cE4402cF2B4B8a8E9c75eAD7280156", + "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47" + ] + ], + [ + "0x6086c6451217241D8e42e134733A542095E13c47", + "ExecutionManager", + "contracts/ExecutionManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 8453, + "0x12E6e58864cE4402cF2B4B8a8E9c75eAD7280156", + "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47" + ] + ], + [ + "0x12E6e58864cE4402cF2B4B8a8E9c75eAD7280156", + "Socket", + "contracts/socket/Socket.sol", + [ + 8453, + "0xAC313d7491910516E06FBfC2A0b5BB49bb072D91", + "0xDC23842d47b80D88A549777eB1F33C2F47f253D0", + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "IMLI" + ] + ], + [ + "0xDC23842d47b80D88A549777eB1F33C2F47f253D0", + "CapacitorFactory", + "contracts/CapacitorFactory.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", 10] + ], + [ + "0xAC313d7491910516E06FBfC2A0b5BB49bb072D91", + "Hasher", + "contracts/utils/Hasher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47", + "SignatureVerifier", + "contracts/utils/SignatureVerifier.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0xBD9f6198a220046E944D704b7ff2A68b778F4A44", + "TransmitManager", + "contracts/TransmitManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 8453, + "0x1D6811553Aff8231aDd04A84F300b89E15D99EA4", + "0x7050b6f947BA48508219Ac02EC152E9f198ADc5e" + ] + ], + [ + "0xD9e492C3899aC768F67aD9AdC0Ce88aAB5463f60", + "ExecutionManager", + "contracts/ExecutionManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 8453, + "0x1D6811553Aff8231aDd04A84F300b89E15D99EA4", + "0x7050b6f947BA48508219Ac02EC152E9f198ADc5e" + ] + ], + [ + "0x1D6811553Aff8231aDd04A84F300b89E15D99EA4", + "Socket", + "contracts/socket/Socket.sol", + [ + 8453, + "0xb584D4bE1A5470CA1a8778E9B86c81e165204599", + "0x2a1094b6585b32FE33929cDdF7Ee3F5a1c1E163A", + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "IMLI" + ] + ], + [ + "0x2a1094b6585b32FE33929cDdF7Ee3F5a1c1E163A", + "CapacitorFactory", + "contracts/CapacitorFactory.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", 10] + ], + [ + "0xb584D4bE1A5470CA1a8778E9B86c81e165204599", + "Hasher", + "contracts/utils/Hasher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x7050b6f947BA48508219Ac02EC152E9f198ADc5e", + "SignatureVerifier", + "contracts/utils/SignatureVerifier.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ] + ], + "34443": [ + [ + "0xA7649aa944b7Dce781859C18913c2Dc8A97f03e4", + "Counter", + "contracts/examples/Counter.sol", + ["0xc317144DE60E6bC9455363bB09852C00bd14CD61"] + ], + [ + "0xd286595d2e3D879596FAB51f83A702D10a6db27b", + "SocketBatcher", + "contracts/socket/SocketBatcher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e", + "OptimisticSwitchboard", + "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + 34443, + 7200, + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3" + ] + ], + [ + "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65", + "FastSwitchboard", + "contracts/switchboard/default-switchboards/FastSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + 34443, + 7200, + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3" + ] + ], + [ + "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d", + "TransmitManager", + "contracts/TransmitManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 34443, + "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3" + ] + ], + [ + "0xbDf50eAe568ECef74796ed6022a0d453e8432410", + "ExecutionManager", + "contracts/ExecutionManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 34443, + "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3" + ] + ], + [ + "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "Socket", + "contracts/socket/Socket.sol", + [ + 34443, + "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "IMLI" + ] + ], + [ + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "CapacitorFactory", + "contracts/CapacitorFactory.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", 10] + ], + [ + "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "Hasher", + "contracts/utils/Hasher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "SignatureVerifier", + "contracts/utils/SignatureVerifier.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ] + ], "42161": [ [ "0x107e182815C5e164E05F0C2CF478acE44FD468A8", From 5113903fa475ad3172982f504566d43cc7639520 Mon Sep 17 00:00:00 2001 From: arthcp Date: Wed, 13 Dec 2023 17:22:07 +0530 Subject: [PATCH 10/23] feat: missed changes --- .env.example | 2 ++ scripts/constants/networks.ts | 10 ++++++++++ scripts/deploy/config.ts | 8 ++++---- scripts/rpcConfig/rpcConfig.ts | 2 ++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index a98ee5b1..82944a9e 100644 --- a/.env.example +++ b/.env.example @@ -51,6 +51,8 @@ XAI_TESTNET_RPC='' SX_NETWORK_TESTNET_RPC='' MODE_TESTNET_RPC='' VICTION_TESTNET_RPC='' +BASE_RPC='' +MODE_RPC='' # update these settings # DEPLOYMENT_MODE="dev | surge | prod" diff --git a/scripts/constants/networks.ts b/scripts/constants/networks.ts index e41c9441..e8304b8d 100644 --- a/scripts/constants/networks.ts +++ b/scripts/constants/networks.ts @@ -119,6 +119,16 @@ export function getJsonRpcUrl(chain: HardhatChainName | ChainId): string { jsonRpcUrl = process.env.VICTION_TESTNET_RPC as string; break; + case HardhatChainName.BASE: + case ChainId.BASE: + jsonRpcUrl = process.env.BASE_RPC as string; + break; + + case HardhatChainName.MODE: + case ChainId.MODE: + jsonRpcUrl = process.env.MODE_RPC as string; + break; + case HardhatChainName.HARDHAT: case ChainId.HARDHAT: jsonRpcUrl = "http://127.0.0.1:8545/"; diff --git a/scripts/deploy/config.ts b/scripts/deploy/config.ts index f893c2ab..8b9e1d4b 100644 --- a/scripts/deploy/config.ts +++ b/scripts/deploy/config.ts @@ -126,7 +126,7 @@ export const overrides = ( } else if (chain == ChainSlug.BSC) { return { type, - gasLimit, + gasLimit: 3000000, gasPrice, }; } else if (chain == ChainSlug.BSC_TESTNET) { @@ -137,9 +137,9 @@ export const overrides = ( }; } else if (chain == ChainSlug.MAINNET) { return { - type, - gasLimit, - gasPrice, + type: 1, + gasLimit: 3000000, + gasPrice: 47_000_000_000, }; } else if (chain == ChainSlug.GOERLI) { return { diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index 71e4ab73..ac578669 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -36,6 +36,8 @@ const rpcs = { [ChainSlug.SX_NETWORK_TESTNET]: checkEnvVar("SX_NETWORK_TESTNET_RPC"), [ChainSlug.MODE_TESTNET]: checkEnvVar("MODE_TESTNET_RPC"), [ChainSlug.VICTION_TESTNET]: checkEnvVar("VICTION_TESTNET_RPC"), + [ChainSlug.BASE]: checkEnvVar("BASE_RPC"), + [ChainSlug.MODE]: checkEnvVar("MODE_RPC"), [ChainSlug.CDK_TESTNET]: checkEnvVar("CDK_TESTNET_RPC"), }; From a8105770f16434577794046ad8b842d19b827880 Mon Sep 17 00:00:00 2001 From: arthcp Date: Wed, 13 Dec 2023 17:48:44 +0530 Subject: [PATCH 11/23] feat: missed changes --- .env.example | 1 + hardhat.config.ts | 12 ++++++++++++ scripts/rpcConfig/rpcConfig.ts | 12 ++++++++++++ 3 files changed, 25 insertions(+) diff --git a/.env.example b/.env.example index 82944a9e..a4c79474 100644 --- a/.env.example +++ b/.env.example @@ -21,6 +21,7 @@ BSCSCAN_API_KEY=xxx AEVO_API_KEY=xxx LYRA_API_KEY=xxx XAI_API_KEY=xxx +BASESCAN_API_KEY=xxx # rpc ARBITRUM_RPC='https://arb1.arbitrum.io/rpc' diff --git a/hardhat.config.ts b/hardhat.config.ts index e84f65eb..85f5f678 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -76,6 +76,8 @@ if (isProduction) { ), [HardhatChainName.MODE_TESTNET]: getChainConfig(ChainId.MODE_TESTNET), [HardhatChainName.VICTION_TESTNET]: getChainConfig(ChainId.VICTION_TESTNET), + [HardhatChainName.BASE]: getChainConfig(ChainId.BASE), + [HardhatChainName.MODE]: getChainConfig(ChainId.MODE), }; } @@ -106,6 +108,8 @@ const config: HardhatUserConfig = { sxnTestnet: process.env.SX_NETWORK_API_KEY || "", modeTestnet: process.env.MODE_API_KEY || "", victionTestnet: process.env.VICTION_API_KEY || "", + base: process.env.BASESCAN_API_KEY || "", + mode: process.env.MODE_API_KEY || "", }, customChains: [ { @@ -124,6 +128,14 @@ const config: HardhatUserConfig = { browserURL: "https://sepolia.arbiscan.io/", }, }, + { + network: "base", + chainId: ChainId.BASE, + urls: { + apiURL: "https://api.basescan.org/api", + browserURL: "https://basescan.org/", + }, + }, ], }, networks: { diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index ac578669..84c63bf1 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -161,6 +161,14 @@ const prodConfig = { rpc: rpcs[ChainSlug.VICTION_TESTNET], // blockNumber:, }, + [ChainSlug.BASE]: { + rpc: rpcs[ChainSlug.BASE], + // blockNumber:, + }, + [ChainSlug.MODE]: { + rpc: rpcs[ChainSlug.MODE], + // blockNumber:, + }, [ChainSlug.CDK_TESTNET]: { rpc: rpcs[ChainSlug.CDK_TESTNET], // blockNumber:, @@ -206,6 +214,8 @@ const prodConfig = { ChainSlug.OPTIMISM_SEPOLIA, ChainSlug.MODE_TESTNET, ChainSlug.VICTION_TESTNET, + ChainSlug.BASE, + ChainSlug.MODE, ], watcherSupportedChainSlugs: [ ChainSlug.AEVO, @@ -231,6 +241,8 @@ const prodConfig = { ChainSlug.OPTIMISM_SEPOLIA, ChainSlug.MODE_TESTNET, ChainSlug.VICTION_TESTNET, + ChainSlug.BASE, + ChainSlug.MODE, ], }; From d9bea3b4cbe529b6e1ed2261e571ef2ae0bd7bcc Mon Sep 17 00:00:00 2001 From: arthcp Date: Wed, 13 Dec 2023 17:49:11 +0530 Subject: [PATCH 12/23] chore: version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f02425c5..6e2b4bd2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@socket.tech/dl-core", "license": "UNLICENSED", - "version": "2.4.14", + "version": "2.4.15", "description": "Smart contracts for socket data layer.", "main": "./dist/src/index.js", "types": "./dist/src/index.d.ts", From 292a34708a61487b1579b9b4487ecac87d4760d3 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 13 Dec 2023 23:34:49 +0530 Subject: [PATCH 13/23] fix: add sibling and block number in rpc config --- scripts/rpcConfig/rpcConfig.ts | 181 +++++++++++++++++++++++++-------- src/socket-types.ts | 14 +++ 2 files changed, 151 insertions(+), 44 deletions(-) diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index 84c63bf1..6f2571b8 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -1,5 +1,10 @@ -import { ChainSlug } from "../../src"; -import { DeploymentMode } from "../../src"; +import { + ChainSlug, + getAddresses, + Integrations, + ChainAddresses, + DeploymentMode, +} from "../../src"; import dotenv from "dotenv"; dotenv.config(); @@ -13,6 +18,29 @@ const checkEnvVar = (envVar: string) => { return value; }; +const getBlockNumber = ( + deploymentMode: DeploymentMode, + chainSlug: ChainSlug +) => { + const addresses = getAddresses(chainSlug, deploymentMode); + return addresses.startBlock ?? 1; +}; + +const getSiblings = ( + deploymentMode: DeploymentMode, + chainSlug: ChainSlug +): ChainSlug[] => { + const integrations: Integrations = getAddresses( + chainSlug, + deploymentMode + ).integrations; + if (!integrations) return [] as ChainSlug[]; + + return Object.keys(integrations).map( + (chainSlug) => parseInt(chainSlug) as ChainSlug + ); +}; + const rpcs = { [ChainSlug.AEVO]: checkEnvVar("AEVO_RPC"), [ChainSlug.ARBITRUM]: checkEnvVar("ARBITRUM_RPC"), @@ -47,33 +75,25 @@ const devConfig = { rpc: rpcs[ChainSlug.ARBITRUM_SEPOLIA], blockNumber: 1430261, confirmations: 1, + siblings: getSiblings(DeploymentMode.DEV, ChainSlug.ARBITRUM_SEPOLIA), }, [ChainSlug.OPTIMISM_SEPOLIA]: { rpc: rpcs[ChainSlug.OPTIMISM_SEPOLIA], blockNumber: 4475713, confirmations: 1, + siblings: getSiblings(DeploymentMode.DEV, ChainSlug.OPTIMISM_SEPOLIA), }, [ChainSlug.SEPOLIA]: { rpc: rpcs[ChainSlug.SEPOLIA], blockNumber: 4751027, confirmations: 1, + siblings: getSiblings(DeploymentMode.DEV, ChainSlug.SEPOLIA), }, [ChainSlug.POLYGON_MUMBAI]: { rpc: rpcs[ChainSlug.POLYGON_MUMBAI], blockNumber: 42750896, confirmations: 5, - }, - [ChainSlug.SX_NETWORK_TESTNET]: { - rpc: rpcs[ChainSlug.SX_NETWORK_TESTNET], - // blockNumber:, - }, - [ChainSlug.MODE_TESTNET]: { - rpc: rpcs[ChainSlug.MODE_TESTNET], - // blockNumber:, - }, - [ChainSlug.VICTION_TESTNET]: { - rpc: rpcs[ChainSlug.VICTION_TESTNET], - // blockNumber:, + siblings: getSiblings(DeploymentMode.DEV, ChainSlug.POLYGON_MUMBAI), }, }, batcherSupportedChainSlugs: [ @@ -95,99 +115,172 @@ const prodConfig = { chains: { [ChainSlug.AEVO]: { rpc: rpcs[ChainSlug.AEVO], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.AEVO), + confirmations: 2, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.AEVO), }, [ChainSlug.ARBITRUM]: { rpc: rpcs[ChainSlug.ARBITRUM], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.ARBITRUM), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.ARBITRUM), }, [ChainSlug.LYRA]: { rpc: rpcs[ChainSlug.LYRA], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.LYRA), + confirmations: 2, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.LYRA), }, [ChainSlug.OPTIMISM]: { rpc: rpcs[ChainSlug.OPTIMISM], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.OPTIMISM), + confirmations: 15, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.OPTIMISM), }, [ChainSlug.BSC]: { rpc: rpcs[ChainSlug.BSC], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.BSC), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.BSC), }, [ChainSlug.POLYGON_MAINNET]: { rpc: rpcs[ChainSlug.POLYGON_MAINNET], - // blockNumber:, + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.POLYGON_MAINNET + ), + confirmations: 256, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.POLYGON_MAINNET), }, [ChainSlug.MAINNET]: { rpc: rpcs[ChainSlug.MAINNET], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.MAINNET), + confirmations: 18, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.MAINNET), + }, + [ChainSlug.BASE]: { + rpc: rpcs[ChainSlug.BASE], + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.BASE), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.BASE), + }, + [ChainSlug.MODE]: { + rpc: rpcs[ChainSlug.MODE], + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.MODE), + confirmations: 2, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.MODE), }, + [ChainSlug.ARBITRUM_GOERLI]: { rpc: rpcs[ChainSlug.ARBITRUM_GOERLI], - // blockNumber:, + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.ARBITRUM_GOERLI + ), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.ARBITRUM_GOERLI), }, [ChainSlug.AEVO_TESTNET]: { rpc: rpcs[ChainSlug.AEVO_TESTNET], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.AEVO_TESTNET), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.AEVO_TESTNET), }, [ChainSlug.LYRA_TESTNET]: { rpc: rpcs[ChainSlug.LYRA_TESTNET], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.LYRA_TESTNET), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.LYRA_TESTNET), }, [ChainSlug.OPTIMISM_GOERLI]: { rpc: rpcs[ChainSlug.OPTIMISM_GOERLI], - // blockNumber:, + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.OPTIMISM_GOERLI + ), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.OPTIMISM_GOERLI), }, [ChainSlug.BSC_TESTNET]: { rpc: rpcs[ChainSlug.BSC_TESTNET], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.BSC_TESTNET), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.BSC_TESTNET), }, [ChainSlug.GOERLI]: { rpc: rpcs[ChainSlug.GOERLI], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.GOERLI), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.GOERLI), }, [ChainSlug.XAI_TESTNET]: { rpc: rpcs[ChainSlug.XAI_TESTNET], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.XAI_TESTNET), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.XAI_TESTNET), }, [ChainSlug.SX_NETWORK_TESTNET]: { rpc: rpcs[ChainSlug.SX_NETWORK_TESTNET], - // blockNumber:, + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.SX_NETWORK_TESTNET + ), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.SX_NETWORK_TESTNET), }, [ChainSlug.MODE_TESTNET]: { rpc: rpcs[ChainSlug.MODE_TESTNET], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.MODE_TESTNET), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.MODE_TESTNET), }, [ChainSlug.VICTION_TESTNET]: { rpc: rpcs[ChainSlug.VICTION_TESTNET], - // blockNumber:, - }, - [ChainSlug.BASE]: { - rpc: rpcs[ChainSlug.BASE], - // blockNumber:, - }, - [ChainSlug.MODE]: { - rpc: rpcs[ChainSlug.MODE], - // blockNumber:, + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.VICTION_TESTNET + ), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.VICTION_TESTNET), }, [ChainSlug.CDK_TESTNET]: { rpc: rpcs[ChainSlug.CDK_TESTNET], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.CDK_TESTNET), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.CDK_TESTNET), }, [ChainSlug.ARBITRUM_SEPOLIA]: { rpc: rpcs[ChainSlug.ARBITRUM_SEPOLIA], - // blockNumber:, + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.ARBITRUM_SEPOLIA + ), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.ARBITRUM_SEPOLIA), }, [ChainSlug.OPTIMISM_SEPOLIA]: { rpc: rpcs[ChainSlug.OPTIMISM_SEPOLIA], - // blockNumber:, + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.OPTIMISM_SEPOLIA + ), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.OPTIMISM_SEPOLIA), }, [ChainSlug.SEPOLIA]: { rpc: rpcs[ChainSlug.SEPOLIA], - // blockNumber:, + blockNumber: getBlockNumber(DeploymentMode.PROD, ChainSlug.SEPOLIA), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.SEPOLIA), }, [ChainSlug.POLYGON_MUMBAI]: { rpc: rpcs[ChainSlug.POLYGON_MUMBAI], - // blockNumber:, + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.POLYGON_MUMBAI + ), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.POLYGON_MUMBAI), }, }, batcherSupportedChainSlugs: [ diff --git a/src/socket-types.ts b/src/socket-types.ts index 329d230a..9cb33455 100644 --- a/src/socket-types.ts +++ b/src/socket-types.ts @@ -195,3 +195,17 @@ export const REQUIRED_CHAIN_ROLES = { FastSwitchboard2: [ROLES.WATCHER_ROLE, ROLES.FEES_UPDATER_ROLE], OptimisticSwitchboard: [ROLES.WATCHER_ROLE, ROLES.FEES_UPDATER_ROLE], }; + +export type S3Config = { + chains: { + [chainSlug in ChainSlug]?: { + rpc: string; + blockNumber: number; + confirmations: number; + siblings: ChainSlug[]; + }; + }; + batcherSupportedChainSlugs: ChainSlug[]; + watcherSupportedChainSlugs: ChainSlug[]; + transmitterSupportedChainSlugs: ChainSlug[]; +}; From 6f9bbe396aa2e313b491a968144f7210ab0112a8 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 13 Dec 2023 23:35:20 +0530 Subject: [PATCH 14/23] 2.4.15-test.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e2b4bd2..acdec20f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@socket.tech/dl-core", "license": "UNLICENSED", - "version": "2.4.15", + "version": "2.4.15-test.1", "description": "Smart contracts for socket data layer.", "main": "./dist/src/index.js", "types": "./dist/src/index.d.ts", From ba54f5e90a658562e12a91417afd556c447dc61d Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 13 Dec 2023 23:44:55 +0530 Subject: [PATCH 15/23] fix: rpc config --- scripts/rpcConfig/rpcConfig.ts | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index 6f2571b8..1b959787 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -22,23 +22,31 @@ const getBlockNumber = ( deploymentMode: DeploymentMode, chainSlug: ChainSlug ) => { - const addresses = getAddresses(chainSlug, deploymentMode); - return addresses.startBlock ?? 1; + try { + const addresses = getAddresses(chainSlug, deploymentMode); + return addresses.startBlock ?? 1; + } catch (error) { + return 1; + } }; const getSiblings = ( deploymentMode: DeploymentMode, chainSlug: ChainSlug ): ChainSlug[] => { - const integrations: Integrations = getAddresses( - chainSlug, - deploymentMode - ).integrations; - if (!integrations) return [] as ChainSlug[]; + try { + const integrations: Integrations = getAddresses( + chainSlug, + deploymentMode + ).integrations; + if (!integrations) return [] as ChainSlug[]; - return Object.keys(integrations).map( - (chainSlug) => parseInt(chainSlug) as ChainSlug - ); + return Object.keys(integrations).map( + (chainSlug) => parseInt(chainSlug) as ChainSlug + ); + } catch (error) { + return [] as ChainSlug[]; + } }; const rpcs = { @@ -300,9 +308,7 @@ const prodConfig = { ChainSlug.POLYGON_MUMBAI, // ChainSlug.BSC_TESTNET, ChainSlug.LYRA_TESTNET, - ChainSlug.XAI_TESTNET, ChainSlug.SX_NETWORK_TESTNET, - ChainSlug.CDK_TESTNET, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, ChainSlug.MODE_TESTNET, @@ -327,9 +333,7 @@ const prodConfig = { ChainSlug.POLYGON_MUMBAI, // ChainSlug.BSC_TESTNET, ChainSlug.LYRA_TESTNET, - ChainSlug.XAI_TESTNET, ChainSlug.SX_NETWORK_TESTNET, - ChainSlug.CDK_TESTNET, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, ChainSlug.MODE_TESTNET, From a49f58b7254e20b642ba9326fa3cd2a59762d179 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 14 Dec 2023 13:15:04 +0530 Subject: [PATCH 16/23] fix: s3 config type --- scripts/rpcConfig/rpcConfig.ts | 27 ++++++++++++++++++++++++--- src/socket-types.ts | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index 1b959787..ee8b09d1 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -2,8 +2,8 @@ import { ChainSlug, getAddresses, Integrations, - ChainAddresses, DeploymentMode, + S3Config, } from "../../src"; import dotenv from "dotenv"; @@ -77,7 +77,7 @@ const rpcs = { [ChainSlug.CDK_TESTNET]: checkEnvVar("CDK_TESTNET_RPC"), }; -const devConfig = { +const devConfig: S3Config = { chains: { [ChainSlug.ARBITRUM_SEPOLIA]: { rpc: rpcs[ChainSlug.ARBITRUM_SEPOLIA], @@ -117,9 +117,15 @@ const devConfig = { ChainSlug.SEPOLIA, ChainSlug.POLYGON_MUMBAI, ], + nativeSupportedChainSlugs: [ + ChainSlug.ARBITRUM_SEPOLIA, + ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.SEPOLIA, + ChainSlug.POLYGON_MUMBAI, + ], }; -const prodConfig = { +const prodConfig: S3Config = { chains: { [ChainSlug.AEVO]: { rpc: rpcs[ChainSlug.AEVO], @@ -341,6 +347,21 @@ const prodConfig = { ChainSlug.BASE, ChainSlug.MODE, ], + nativeSupportedChainSlugs: [ + ChainSlug.ARBITRUM, + ChainSlug.OPTIMISM, + ChainSlug.POLYGON_MAINNET, + ChainSlug.LYRA, + ChainSlug.MAINNET, + ChainSlug.ARBITRUM_GOERLI, + ChainSlug.OPTIMISM_GOERLI, + ChainSlug.GOERLI, + ChainSlug.SEPOLIA, + ChainSlug.POLYGON_MUMBAI, + ChainSlug.LYRA_TESTNET, + ChainSlug.ARBITRUM_SEPOLIA, + ChainSlug.OPTIMISM_SEPOLIA, + ], }; export const config = deploymentMode === "prod" ? prodConfig : devConfig; diff --git a/src/socket-types.ts b/src/socket-types.ts index 9cb33455..6ff290e4 100644 --- a/src/socket-types.ts +++ b/src/socket-types.ts @@ -207,5 +207,5 @@ export type S3Config = { }; batcherSupportedChainSlugs: ChainSlug[]; watcherSupportedChainSlugs: ChainSlug[]; - transmitterSupportedChainSlugs: ChainSlug[]; + nativeSupportedChainSlugs: ChainSlug[]; }; From ef6d7ddd51bf92d08be7a9d234c3c5218845d9bf Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 14 Dec 2023 20:35:03 +0530 Subject: [PATCH 17/23] 2.4.15-test.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index acdec20f..50a18dd8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@socket.tech/dl-core", "license": "UNLICENSED", - "version": "2.4.15-test.1", + "version": "2.4.15-test.2", "description": "Smart contracts for socket data layer.", "main": "./dist/src/index.js", "types": "./dist/src/index.d.ts", From e7f981f8381df8ddddadda58eb523d6fea2d9192 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 14 Dec 2023 23:14:07 +0530 Subject: [PATCH 18/23] fix: dev config --- scripts/rpcConfig/rpcConfig.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index ee8b09d1..c3c1fb7e 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -109,7 +109,6 @@ const devConfig: S3Config = { ChainSlug.OPTIMISM_SEPOLIA, ChainSlug.SEPOLIA, ChainSlug.POLYGON_MUMBAI, - ChainSlug.SX_NETWORK_TESTNET, ], watcherSupportedChainSlugs: [ ChainSlug.ARBITRUM_SEPOLIA, From 271627839500ea3172f58220ddb257afd7a375cd Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 21 Dec 2023 19:03:30 +0530 Subject: [PATCH 19/23] feat: optimistic registers --- deployments/prod_addresses.json | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json index d6ea8db5..0bc01ec4 100644 --- a/deployments/prod_addresses.json +++ b/deployments/prod_addresses.json @@ -89,6 +89,11 @@ "capacitor": "0x1f06BAf9ff58Db17970803ce03463096654A3795", "decapacitor": "0x5bb34262f7C9757c860f420B2a2C9a735b15C7ED", "switchboard": "0xD5a83a40F262E2247e6566171f9ADc76b745F5cD" + }, + "OPTIMISTIC": { + "capacitor": "0xA5cd2abA033d3Ca3941A8Daf26591635C32c1119", + "decapacitor": "0xd64E6f92A0A8e92256D7f8154C3ADC0A38A7e750", + "switchboard": "0xEaa15Fd42D68b8334a3BB1E9bF8cA85BaBE83790" } }, "34443": { @@ -96,6 +101,11 @@ "capacitor": "0xC100ECD1717E7bcD9332c9405d6eDd6dD599c871", "decapacitor": "0x0A211DDdB4E9bAe283f4C12BF49b93e8555F1e91", "switchboard": "0xD5a83a40F262E2247e6566171f9ADc76b745F5cD" + }, + "OPTIMISTIC": { + "capacitor": "0x1f9A70B21e84483Baa9b59D093D8B96B115b8DB2", + "decapacitor": "0x6e5Cac46cb0d45Eb6C1c41208703d77d54A02889", + "switchboard": "0xEaa15Fd42D68b8334a3BB1E9bF8cA85BaBE83790" } }, "42161": { @@ -322,6 +332,11 @@ "capacitor": "0x072d479fe4f49a717cFE5Ca7097c213902281948", "decapacitor": "0xc11aed6A1870c1973F01dF4F83a55CE9E503769b", "switchboard": "0x09A6e77912a6bcFc3abfDfb841A85380Bb2A8B97" + }, + "OPTIMISTIC": { + "capacitor": "0xc3E1f3D65703c3f6130d8e4112218BFf4e8B838F", + "decapacitor": "0x6eDC81d700Cb634CaD909147DCA822511B3ff77b", + "switchboard": "0xb113d72896d4874111AF00c9499b5a64e9f1e3f4" } }, "34443": { @@ -329,6 +344,11 @@ "capacitor": "0x803118D6a13897813D7dEa2d7ceC2fa9f3dA0e2D", "decapacitor": "0x7505D0bAA438DD2788D5E0C649982B0c9269310d", "switchboard": "0x09A6e77912a6bcFc3abfDfb841A85380Bb2A8B97" + }, + "OPTIMISTIC": { + "capacitor": "0x4faD0f161B7dF84729D431B479e3bBfa5706e854", + "decapacitor": "0xE757E14FA7FB163feecC35296960201D7E030835", + "switchboard": "0xb113d72896d4874111AF00c9499b5a64e9f1e3f4" } }, "42161": { @@ -1189,6 +1209,11 @@ "capacitor": "0x769539bE1b533841acA8436078ada53d6E64035f", "decapacitor": "0x413248783F1B66703a0248d455EE790436FAdcA9", "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + }, + "OPTIMISTIC": { + "capacitor": "0x34543E63E38EEc5C9818D9234d08A4EEFF18bD2D", + "decapacitor": "0x7aCF234A02676E59Df1A7A35069bbcab686D127C", + "switchboard": "0x15A55294B7278260DdfFC659Fb39a401871EeE34" } }, "10": { @@ -1196,6 +1221,11 @@ "capacitor": "0xCcdc860cB233dB57Af21665dE1A46911d41dB717", "decapacitor": "0x9570F603ab0424adCa0Cb56e79363DDf90054733", "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + }, + "OPTIMISTIC": { + "capacitor": "0x06c8f503684459B4f8b7F0875cfed44879Be1Bbc", + "decapacitor": "0xd3FB87591Cbf521907D554CdD09d6c51d30aBf44", + "switchboard": "0x15A55294B7278260DdfFC659Fb39a401871EeE34" } }, "56": { @@ -1217,6 +1247,11 @@ "capacitor": "0x279824278c1C78662A4BF9fb25EeA954BBF74d97", "decapacitor": "0x0603c547e428b2aA4BdBcfD540d205D8Db8B5dc9", "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + }, + "OPTIMISTIC": { + "capacitor": "0xd93BF81B8B54860E94e5b26E786F428c0f78A434", + "decapacitor": "0xfF94F698B1EC0966bCd5F90487Fbd5D9410B31e1", + "switchboard": "0x15A55294B7278260DdfFC659Fb39a401871EeE34" } }, "42161": { @@ -1224,6 +1259,11 @@ "capacitor": "0x1a50D1e4f3bf1F9D1E2752B0D1cE0Cd2F99aDb3b", "decapacitor": "0x5F030Ed56CA8742dB95d599caAc8dEbBE70B2a07", "switchboard": "0x957301825Dc21d4A92919C9E72dC9E6C6a29e7f8" + }, + "OPTIMISTIC": { + "capacitor": "0x6e7dAd288966Afa716AfCa2356dc699b3bF621a1", + "decapacitor": "0x24B9be73D1fC7131C00B5f1eDa39722c62C49588", + "switchboard": "0x15A55294B7278260DdfFC659Fb39a401871EeE34" } } } @@ -1246,6 +1286,11 @@ "capacitor": "0xB4Ca08934052A664Fd1D5c5d206a66a5684D95Cf", "decapacitor": "0x5A7A6Ac35E886FfaBF773bA8B94313E6Fb1dDc86", "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + }, + "OPTIMISTIC": { + "capacitor": "0x921B7f179ef04227E53324927F9AFb7155149db0", + "decapacitor": "0x529967A44995313fc468AD29c2C1c14DaebCBAE7", + "switchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e" } }, "10": { @@ -1253,6 +1298,11 @@ "capacitor": "0xDAc077a030b43CF7771d954E46b8408A2526B99F", "decapacitor": "0x77F88b197dEF6b531fB4d67B77D5F0BD19182f27", "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + }, + "OPTIMISTIC": { + "capacitor": "0x43BBF5B1C8000f09a19a52A4abc126dd0dA69466", + "decapacitor": "0xf3b4CAA568Ac166a724b2d710EcE0f67efFedE57", + "switchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e" } }, "8453": { @@ -1260,6 +1310,11 @@ "capacitor": "0xFFB1668F7978C67B385acB40AB9A9ada879a1271", "decapacitor": "0xa6b874Ca1AcF2c453b614cCEB022cFE91E2f37bC", "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + }, + "OPTIMISTIC": { + "capacitor": "0x81153EFD395E5fF30FE69637c63203793fEEF233", + "decapacitor": "0x4110331Fc94EdCD78e2f3193039E40316fC09702", + "switchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e" } }, "42161": { @@ -1267,6 +1322,11 @@ "capacitor": "0x32588ee44eA7014e7E8C37954141cb56681179ca", "decapacitor": "0x15a815152CF82a83FD6fe325409AEF8998C491A8", "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + }, + "OPTIMISTIC": { + "capacitor": "0xb7e909Eb9fbcdb5Ed34b47f70eee381244B3c9b5", + "decapacitor": "0x1DFB66c58B460B74Ac2DC22c9D68BC3A95317eEB", + "switchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e" } } } @@ -1361,6 +1421,11 @@ "capacitor": "0x6b19c12C0d5A41449d69AB2EB059959414531D3E", "decapacitor": "0x3D571b6afa1d3b8FDf7EE8238aFF55ddaF8D2b99", "switchboard": "0xd5e829827F665c42326EAF68Da3360bd59b42f2f" + }, + "OPTIMISTIC": { + "capacitor": "0xF5F048a6362b593FF7071610275F3f5a15404461", + "decapacitor": "0x5474fc6D25639A0eA78C4347981e9229b67CC00F", + "switchboard": "0x1812ff6bd726934f18159164e2927B34949B16a8" } }, "34443": { @@ -1368,6 +1433,11 @@ "capacitor": "0x79d9b5653e7672e937A05CF95a4730AA84D9A79b", "decapacitor": "0x870b38C612Bf67eE7673ba2E537ADDe965B67cfc", "switchboard": "0xd5e829827F665c42326EAF68Da3360bd59b42f2f" + }, + "OPTIMISTIC": { + "capacitor": "0x9394b3BC68Ea794E9511157F619082bB2af5EfB2", + "decapacitor": "0x39B61bc0F6b84E32B999dfF259D5354761AE549D", + "switchboard": "0x1812ff6bd726934f18159164e2927B34949B16a8" } } }, From 336bb376398967c2106a379b1570841f7ff5fe37 Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 21 Dec 2023 19:22:01 +0530 Subject: [PATCH 20/23] feat: check roles sleep and core version --- package.json | 2 +- scripts/deploy/2-check-roles.ts | 15 +++++++++++++++ yarn.lock | 9 +++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 50a18dd8..79a111ad 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@nomiclabs/hardhat-ethers": "^2.1.1", "@nomiclabs/hardhat-etherscan": "^3.1.0", "@nomiclabs/hardhat-waffle": "^2.0.3", - "@socket.tech/dl-core": "2.4.13", + "@socket.tech/dl-core": "2.4.15", "@typechain/ethers-v5": "^10.0.0", "@typechain/hardhat": "^6.0.0", "@types/chai": "^4.3.0", diff --git a/scripts/deploy/2-check-roles.ts b/scripts/deploy/2-check-roles.ts index c0fd577a..012ee45c 100644 --- a/scripts/deploy/2-check-roles.ts +++ b/scripts/deploy/2-check-roles.ts @@ -16,6 +16,8 @@ import { } from "./config"; import { checkAndUpdateRoles } from "./scripts/roles"; +const sleepTime = 3000; + const main = async () => { let ownerAddress = socketOwner; let executorAddress = executorAddresses[mode]; @@ -54,6 +56,8 @@ const main = async () => { }); summary.push(s); + await sleep(sleepTime); + // Grant owner roles for TransmitManager s = await checkAndUpdateRoles({ userSpecificRoles: [ @@ -79,6 +83,8 @@ const main = async () => { }); summary.push(s); + await sleep(sleepTime); + // Grant owner roles in socket s = await checkAndUpdateRoles({ userSpecificRoles: [ @@ -95,6 +101,8 @@ const main = async () => { }); summary.push(s); + await sleep(sleepTime); + // Setup Fast Switchboard roles s = await checkAndUpdateRoles({ userSpecificRoles: [ @@ -127,6 +135,8 @@ const main = async () => { }); summary.push(s); + await sleep(sleepTime); + // Grant watcher role to watcher for OptimisticSwitchboard s = await checkAndUpdateRoles({ userSpecificRoles: [ @@ -157,6 +167,8 @@ const main = async () => { }); summary.push(s); + await sleep(sleepTime); + // Grant owner roles in NativeSwitchboard s = await checkAndUpdateRoles({ userSpecificRoles: [ @@ -201,3 +213,6 @@ main() console.error(error); process.exit(1); }); + +const sleep = (delay: any) => + new Promise((resolve) => setTimeout(resolve, delay)); diff --git a/yarn.lock b/yarn.lock index 4b82f1f3..ead239e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2027,12 +2027,13 @@ "@smithy/types" "^2.6.0" tslib "^2.5.0" -"@socket.tech/dl-core@2.4.13": - version "2.4.13" - resolved "https://registry.yarnpkg.com/@socket.tech/dl-core/-/dl-core-2.4.13.tgz#8dca3ad667f300881072ea2012976a4eea6ef7ac" - integrity sha512-buKoE3PtNC5ZhhFFCrgOxXcNEPh4A6z2V6HjySvKG1t2wNR1+iyyB5MxCCNZmMkoxUw4eb7CzrFeLMcqubdWWQ== +"@socket.tech/dl-core@2.4.15": + version "2.4.15" + resolved "https://registry.yarnpkg.com/@socket.tech/dl-core/-/dl-core-2.4.15.tgz#07e3b8b46a7e29129c6d9b45237c94f5de63b210" + integrity sha512-VQi4mdzZGukUQyzin4avxKs7Ia6u+ZbX6j4KOXoJGTzWEJE6LhzxybxOUCMlEfT1AKyrp+3N/rfLI0rQmTYWXw== dependencies: axios "^1.3.6" + prompts "^2.4.2" yargs "^17.7.1" "@solidity-parser/parser@^0.14.5": From c627288ad3d0977fe55f2c0bd61991dacd1476c1 Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 21 Dec 2023 20:14:09 +0530 Subject: [PATCH 21/23] feat: ancient8 testnet support --- .env.example | 1 + chainConfig.json | 14 ++++++++++++++ hardhat.config.ts | 4 ++++ scripts/constants/networks.ts | 5 +++++ scripts/deploy/config.ts | 9 ++++++--- scripts/rpcConfig/rpcConfig.ts | 12 ++++++++++++ src/enums/chainId.ts | 1 + src/enums/chainSlug.ts | 1 + src/enums/chainSlugToId.ts | 1 + src/enums/chainSlugToKey.ts | 1 + src/enums/hardhatChainName.ts | 1 + src/enums/hardhatChainNameToSlug.ts | 1 + src/enums/testnetIds.ts | 1 + 13 files changed, 49 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index a4c79474..e198ffe7 100644 --- a/.env.example +++ b/.env.example @@ -54,6 +54,7 @@ MODE_TESTNET_RPC='' VICTION_TESTNET_RPC='' BASE_RPC='' MODE_RPC='' +ANCIENT8_TESTNET_RPC='' # update these settings # DEPLOYMENT_MODE="dev | surge | prod" diff --git a/chainConfig.json b/chainConfig.json index 12edeca2..ba863e70 100644 --- a/chainConfig.json +++ b/chainConfig.json @@ -38,5 +38,19 @@ "gasPrice": 10000000 }, "siblings": [1, 42161, 10, 8453] + }, + "2863311531": { + "roleOwners": { + "ownerAddress": "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "executorAddress": "0x42639d8fd154b72472e149a7d5ac13fa280303d9", + "transmitterAddress": "0xfbc5ea2525bb827979e4c33b237cd47bcb8f81c5", + "watcherAddress": "0x75ddddf61b8180d3837b7d8b98c062ca442e0e14", + "feeUpdaterAddress": "0xfbc5ea2525bb827979e4c33b237cd47bcb8f81c5" + }, + "siblings": [421614, 11155420], + "overrides": { + "type": 1, + "gasPrice": 100000000 + } } } diff --git a/hardhat.config.ts b/hardhat.config.ts index 85f5f678..6a6aca85 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -78,6 +78,9 @@ if (isProduction) { [HardhatChainName.VICTION_TESTNET]: getChainConfig(ChainId.VICTION_TESTNET), [HardhatChainName.BASE]: getChainConfig(ChainId.BASE), [HardhatChainName.MODE]: getChainConfig(ChainId.MODE), + [HardhatChainName.ANCIENT8_TESTNET]: getChainConfig( + ChainId.ANCIENT8_TESTNET + ), }; } @@ -110,6 +113,7 @@ const config: HardhatUserConfig = { victionTestnet: process.env.VICTION_API_KEY || "", base: process.env.BASESCAN_API_KEY || "", mode: process.env.MODE_API_KEY || "", + ancient8Testnet: process.env.ANCIENT8_API_KEY || "", }, customChains: [ { diff --git a/scripts/constants/networks.ts b/scripts/constants/networks.ts index e8304b8d..bc5911ef 100644 --- a/scripts/constants/networks.ts +++ b/scripts/constants/networks.ts @@ -129,6 +129,11 @@ export function getJsonRpcUrl(chain: HardhatChainName | ChainId): string { jsonRpcUrl = process.env.MODE_RPC as string; break; + case HardhatChainName.ANCIENT8_TESTNET: + case ChainId.ANCIENT8_TESTNET: + jsonRpcUrl = process.env.ANCIENT8_TESTNET_RPC as string; + break; + case HardhatChainName.HARDHAT: case ChainId.HARDHAT: jsonRpcUrl = "http://127.0.0.1:8545/"; diff --git a/scripts/deploy/config.ts b/scripts/deploy/config.ts index 8b9e1d4b..b128e491 100644 --- a/scripts/deploy/config.ts +++ b/scripts/deploy/config.ts @@ -35,12 +35,12 @@ export const chains: Array = [ ChainSlug.OPTIMISM_SEPOLIA, // ChainSlug.POLYGON_MUMBAI, // ChainSlug.SX_NETWORK_TESTNET, - ChainSlug.MODE_TESTNET, - ChainSlug.VICTION_TESTNET, + // ChainSlug.MODE_TESTNET, + // ChainSlug.VICTION_TESTNET, // ChainSlug.BSC_TESTNET, // ChainSlug.AEVO_TESTNET, // ChainSlug.LYRA_TESTNET, - ChainSlug.SEPOLIA, + // ChainSlug.SEPOLIA, // ChainSlug.XAI_TESTNET, // ChainSlug.CDK_TESTNET, // ChainSlug.AEVO, @@ -49,6 +49,9 @@ export const chains: Array = [ // ChainSlug.OPTIMISM, // ChainSlug.LYRA, // ChainSlug.BSC, + // ChainSlug.BASE, + // ChainSlug.MODE, + ChainSlug.ANCIENT8_TESTNET, // ChainSlug.POLYGON_MAINNET, ]; diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index c3c1fb7e..378fb527 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -74,6 +74,7 @@ const rpcs = { [ChainSlug.VICTION_TESTNET]: checkEnvVar("VICTION_TESTNET_RPC"), [ChainSlug.BASE]: checkEnvVar("BASE_RPC"), [ChainSlug.MODE]: checkEnvVar("MODE_RPC"), + [ChainSlug.ANCIENT8_TESTNET]: checkEnvVar("ANCIENT8_TESTNET_RPC"), [ChainSlug.CDK_TESTNET]: checkEnvVar("CDK_TESTNET_RPC"), }; @@ -295,6 +296,15 @@ const prodConfig: S3Config = { confirmations: 1, siblings: getSiblings(DeploymentMode.PROD, ChainSlug.POLYGON_MUMBAI), }, + [ChainSlug.ANCIENT8_TESTNET]: { + rpc: rpcs[ChainSlug.ANCIENT8_TESTNET], + blockNumber: getBlockNumber( + DeploymentMode.PROD, + ChainSlug.ANCIENT8_TESTNET + ), + confirmations: 1, + siblings: getSiblings(DeploymentMode.PROD, ChainSlug.ANCIENT8_TESTNET), + }, }, batcherSupportedChainSlugs: [ ChainSlug.AEVO, @@ -320,6 +330,7 @@ const prodConfig: S3Config = { ChainSlug.VICTION_TESTNET, ChainSlug.BASE, ChainSlug.MODE, + ChainSlug.ANCIENT8_TESTNET, ], watcherSupportedChainSlugs: [ ChainSlug.AEVO, @@ -345,6 +356,7 @@ const prodConfig: S3Config = { ChainSlug.VICTION_TESTNET, ChainSlug.BASE, ChainSlug.MODE, + ChainSlug.ANCIENT8_TESTNET, ], nativeSupportedChainSlugs: [ ChainSlug.ARBITRUM, diff --git a/src/enums/chainId.ts b/src/enums/chainId.ts index 3e77b109..8597cac4 100644 --- a/src/enums/chainId.ts +++ b/src/enums/chainId.ts @@ -25,4 +25,5 @@ export enum ChainId { VICTION_TESTNET = 89, BASE = 8453, MODE = 34443, + ANCIENT8_TESTNET = 2863311531, } diff --git a/src/enums/chainSlug.ts b/src/enums/chainSlug.ts index ff08277e..869a8551 100644 --- a/src/enums/chainSlug.ts +++ b/src/enums/chainSlug.ts @@ -27,4 +27,5 @@ export enum ChainSlug { CDK_TESTNET = ChainId.CDK_TESTNET, BASE = ChainId.BASE, MODE = ChainId.MODE, + ANCIENT8_TESTNET = ChainId.ANCIENT8_TESTNET, } diff --git a/src/enums/chainSlugToId.ts b/src/enums/chainSlugToId.ts index c3530729..bb27135b 100644 --- a/src/enums/chainSlugToId.ts +++ b/src/enums/chainSlugToId.ts @@ -28,4 +28,5 @@ export const ChainSlugToId = { [ChainSlug.CDK_TESTNET]: ChainId.CDK_TESTNET, [ChainSlug.BASE]: ChainId.BASE, [ChainSlug.MODE]: ChainId.MODE, + [ChainSlug.ANCIENT8_TESTNET]: ChainId.ANCIENT8_TESTNET, }; diff --git a/src/enums/chainSlugToKey.ts b/src/enums/chainSlugToKey.ts index 2719c8f6..d43ce395 100644 --- a/src/enums/chainSlugToKey.ts +++ b/src/enums/chainSlugToKey.ts @@ -28,4 +28,5 @@ export const ChainSlugToKey = { [ChainSlug.CDK_TESTNET]: HardhatChainName.CDK_TESTNET, [ChainSlug.BASE]: HardhatChainName.BASE, [ChainSlug.MODE]: HardhatChainName.MODE, + [ChainSlug.ANCIENT8_TESTNET]: HardhatChainName.ANCIENT8_TESTNET, }; diff --git a/src/enums/hardhatChainName.ts b/src/enums/hardhatChainName.ts index d2c6a550..49bef81e 100644 --- a/src/enums/hardhatChainName.ts +++ b/src/enums/hardhatChainName.ts @@ -26,4 +26,5 @@ export enum HardhatChainName { HARDHAT = "hardhat", BASE = "base", MODE = "mode", + ANCIENT8_TESTNET = "ancient8_testnet", } diff --git a/src/enums/hardhatChainNameToSlug.ts b/src/enums/hardhatChainNameToSlug.ts index b238bc99..7a76dacb 100644 --- a/src/enums/hardhatChainNameToSlug.ts +++ b/src/enums/hardhatChainNameToSlug.ts @@ -28,4 +28,5 @@ export const hardhatChainNameToSlug = { [HardhatChainName.CDK_TESTNET]: ChainSlug.CDK_TESTNET, [HardhatChainName.BASE]: ChainSlug.BASE, [HardhatChainName.MODE]: ChainSlug.MODE, + [HardhatChainName.ANCIENT8_TESTNET]: ChainSlug.ANCIENT8_TESTNET, }; diff --git a/src/enums/testnetIds.ts b/src/enums/testnetIds.ts index 2b64c308..05d5aade 100644 --- a/src/enums/testnetIds.ts +++ b/src/enums/testnetIds.ts @@ -16,4 +16,5 @@ export const TestnetIds: ChainSlug[] = [ ChainSlug.MODE_TESTNET, ChainSlug.VICTION_TESTNET, ChainSlug.CDK_TESTNET, + ChainSlug.ANCIENT8_TESTNET, ]; From 7bd0647fbac7ea5b6cf9e1c09896838a57598d1b Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 21 Dec 2023 20:24:08 +0530 Subject: [PATCH 22/23] feat: ancient8 testnet contracts deployed --- deployments/prod_addresses.json | 67 +++++++++++++++++++++- deployments/prod_verification.json | 90 ++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 2 deletions(-) diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json index 0bc01ec4..61c448e9 100644 --- a/deployments/prod_addresses.json +++ b/deployments/prod_addresses.json @@ -1775,9 +1775,21 @@ "decapacitor": "0xe0acF0A074793bf37F262a2FBD695904fe8CB7FB", "switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd" } + }, + "2863311531": { + "FAST": { + "capacitor": "0xD81dEF6c6527E7d87288A5aBA44Af093eE5ed78B", + "decapacitor": "0xfB24F4f944ec2B896F6df758373F9be43C4D216C", + "switchboard": "0xB9EDe9aaEaA40e35033ABBC872D141950d08cc4d" + }, + "OPTIMISTIC": { + "capacitor": "0xE27E7062E7DC6BB66C5A0AAaed99a19374377BE3", + "decapacitor": "0xeaC58ccDffC77Bb6dBe21c23fF2051FE9027e3B9", + "switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd" + } } }, - "startBlock": 2209979, + "startBlock": 3185090, "Counter": "0xA7f7e4fE8E4cdDCD9969Bd3fbcFF67000CD7DE47" }, "11155111": { @@ -2175,9 +2187,21 @@ "decapacitor": "0xe0acF0A074793bf37F262a2FBD695904fe8CB7FB", "switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd" } + }, + "2863311531": { + "FAST": { + "capacitor": "0xD81dEF6c6527E7d87288A5aBA44Af093eE5ed78B", + "decapacitor": "0xfB24F4f944ec2B896F6df758373F9be43C4D216C", + "switchboard": "0xB9EDe9aaEaA40e35033ABBC872D141950d08cc4d" + }, + "OPTIMISTIC": { + "capacitor": "0xE27E7062E7DC6BB66C5A0AAaed99a19374377BE3", + "decapacitor": "0xeaC58ccDffC77Bb6dBe21c23fF2051FE9027e3B9", + "switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd" + } } }, - "startBlock": 5071703, + "startBlock": 5683729, "Counter": "0xD9e492C3899aC768F67aD9AdC0Ce88aAB5463f60" }, "686669576": { @@ -2325,5 +2349,44 @@ } }, "SocketBatcher": "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + }, + "2863311531": { + "SignatureVerifier": "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf", + "Hasher": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "CapacitorFactory": "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "Socket": "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "ExecutionManager": "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "TransmitManager": "0xbDf50eAe568ECef74796ed6022a0d453e8432410", + "FastSwitchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d", + "OptimisticSwitchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65", + "SocketBatcher": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e", + "Counter": "0xd286595d2e3D879596FAB51f83A702D10a6db27b", + "startBlock": 6631541, + "integrations": { + "421614": { + "FAST": { + "capacitor": "0xB1ecD6D2d1f52D5Abed57431508733d51BB4Cd6B", + "decapacitor": "0x67e8D09fE657332e312e0d649500c09E8A8c3A2C", + "switchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d" + }, + "OPTIMISTIC": { + "capacitor": "0x8590b1DDb6a4A06145bF008e8e708A81f9fb53e6", + "decapacitor": "0x8DFD1D3b6EAF93dDf11AeC821a060e1bc4974CDf", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + }, + "11155420": { + "FAST": { + "capacitor": "0x40AAe25992B0a734bEE0AB70bdd55D856aB498a2", + "decapacitor": "0xD999FAf610e1a18837965554AFd5aDf80a841CaC", + "switchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d" + }, + "OPTIMISTIC": { + "capacitor": "0x8746E279A2Bb21e12e17d0121fb1Bbc57234c0b2", + "decapacitor": "0x37A00337dae8F2A02B4513ae0a5267EAaEB55621", + "switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65" + } + } + } } } diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json index b2454e03..30112964 100644 --- a/deployments/prod_verification.json +++ b/deployments/prod_verification.json @@ -2649,5 +2649,95 @@ "contracts/utils/SignatureVerifier.sol", ["0x752B38FA38F53dF7fa60e6113CFd9094b7e040Aa"] ] + ], + "2863311531": [ + [ + "0xd286595d2e3D879596FAB51f83A702D10a6db27b", + "Counter", + "contracts/examples/Counter.sol", + ["0x565810cbfa3Cf1390963E5aFa2fB953795686339"] + ], + [ + "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e", + "SocketBatcher", + "contracts/socket/SocketBatcher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65", + "OptimisticSwitchboard", + "contracts/switchboard/default-switchboards/OptimisticSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + 2863311531, + 7200, + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d", + "FastSwitchboard", + "contracts/switchboard/default-switchboards/FastSwitchboard.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + 2863311531, + 7200, + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0xbDf50eAe568ECef74796ed6022a0d453e8432410", + "TransmitManager", + "contracts/TransmitManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 2863311531, + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0xc317144DE60E6bC9455363bB09852C00bd14CD61", + "ExecutionManager", + "contracts/ExecutionManager.sol", + [ + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + 2863311531, + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf" + ] + ], + [ + "0x565810cbfa3Cf1390963E5aFa2fB953795686339", + "Socket", + "contracts/socket/Socket.sol", + [ + 2863311531, + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", + "IMLI" + ] + ], + [ + "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "CapacitorFactory", + "contracts/CapacitorFactory.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34", 10] + ], + [ + "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "Hasher", + "contracts/utils/Hasher.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ], + [ + "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf", + "SignatureVerifier", + "contracts/utils/SignatureVerifier.sol", + ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] + ] ] } From 1256b34a47a5169d2149209e31e2adb59c38593a Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 21 Dec 2023 20:25:24 +0530 Subject: [PATCH 23/23] feat: core version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79a111ad..6dff1dc8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@socket.tech/dl-core", "license": "UNLICENSED", - "version": "2.4.15-test.2", + "version": "2.4.16", "description": "Smart contracts for socket data layer.", "main": "./dist/src/index.js", "types": "./dist/src/index.d.ts",