diff --git a/.env.example b/.env.example index d54774ed..303b08f5 100644 --- a/.env.example +++ b/.env.example @@ -105,3 +105,5 @@ XLAYER_RPC=' ' MANTA_PACIFIC_RPC=' ' OPBNB_RPC=' ' + +GEIST_RPC=' ' diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json index 70e8686f..57981fdc 100644 --- a/deployments/prod_addresses.json +++ b/deployments/prod_addresses.json @@ -1379,6 +1379,18 @@ "switchboard": "0xeF7C79DF9c9AA6BC5d1d4ae308907e9B6a6B4372" } }, + "63157": { + "FAST": { + "capacitor": "0x4785721D150482ccC651A3dF5B02c237134dcbf7", + "decapacitor": "0xfE41B1A4dB563BcA56A959706505D007E27FE672", + "switchboard": "0x33918BBF9f5269d90b8c0AbF1Fd1134C827bA445" + }, + "OPTIMISTIC": { + "capacitor": "0xa197F227283f2F7ffD3b8EF132FCEb582C6033Fa", + "decapacitor": "0x672936478a49567Dc1Ccb0d5d02eEBC9F52bCC72", + "switchboard": "0xeF7C79DF9c9AA6BC5d1d4ae308907e9B6a6B4372" + } + }, "81457": { "FAST": { "capacitor": "0x8a0f43439b49F39cA4bBF63B6eBB117aF1Ed7566", @@ -4150,6 +4162,37 @@ } } }, + "63157": { + "SignatureVerifier": "0x941f0ef5258604Fe10C76AE3858984CE0452b5f2", + "Hasher": "0xFe9DCb3dAba382f46F2Ce69ddEb3b5Df86d96f04", + "CapacitorFactory": "0x5C4186D343EeF952c9ED886E45F8243edf0A503F", + "Socket": "0x34464194a4aCD38F42060D144BF3729F625Ff047", + "ExecutionManagerDF": "0xD3B7bd2A9973b188E096dceCbB3D72FC5649FF56", + "TransmitManager": "0xe1e0d782E3b4985f1d657f77B683897AeA6b7dC9", + "FastSwitchboard": "0xEf3589Fb5CE7a5BfB01BF4F1e35a198BA7F6dF4E", + "OptimisticSwitchboard": "0x06638c0799638d64c9AfbB132f94c451A35C7c09", + "SocketBatcher": "0xc9a998F24DBa0C38293fe0418fcEaE28CD0A403E", + "Counter": "0x2CAd2eCe3A78eF1Ef6ec2E0E43E264dcBEd7E8B0", + "SocketSimulator": "0x22891c72dE565d884Dfd762B8df7C4632888a93A", + "SimulatorUtils": "0xB81598BdD2851F223625Ed2C677ccaBD8049b323", + "SwitchboardSimulator": "0x08c3e46CDbE16993d034e0BA87fD9C0dEF08F477", + "CapacitorSimulator": "0xD02F5a7a682d83504e163FCa62A66ee19B5C2AD9", + "startBlock": 70, + "integrations": { + "137": { + "FAST": { + "capacitor": "0x862ccDd5AC90d3A9CCcEE4672Cb49A343c6A5B73", + "decapacitor": "0x71e65941E04da2A88F4C0716F5cde8Af8317d94d", + "switchboard": "0xEf3589Fb5CE7a5BfB01BF4F1e35a198BA7F6dF4E" + }, + "OPTIMISTIC": { + "capacitor": "0xB40C51F025D330219811A502B6ADEdaaC9d757F7", + "decapacitor": "0xCb97B4BD183413d34406fE29277D7AAfFFDd9040", + "switchboard": "0x06638c0799638d64c9AfbB132f94c451A35C7c09" + } + } + } + }, "80008": { "SignatureVerifier": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", "Hasher": "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json index e6713060..423dc9a3 100644 --- a/deployments/prod_verification.json +++ b/deployments/prod_verification.json @@ -4266,6 +4266,26 @@ ["0x5fD7D0d6b91CC4787Bcb86ca47e0Bd4ea0346d34"] ] ], + "63157": [ + [ + "0x22891c72dE565d884Dfd762B8df7C4632888a93A", + "SocketSimulator", + "contracts/mocks/fee-updater/SocketSimulator.sol", + [ + 63157, + 63157, + "0xFe9DCb3dAba382f46F2Ce69ddEb3b5Df86d96f04", + "0x941f0ef5258604Fe10C76AE3858984CE0452b5f2", + "IMLI" + ] + ], + [ + "0x5C4186D343EeF952c9ED886E45F8243edf0A503F", + "CapacitorFactory", + "contracts/CapacitorFactory.sol", + ["0x44A44837894B5eDC2Bde64567FC62599b3b88F4C", 10] + ] + ], "80001": [ [ "0x1F0F1FC746fcd4d59b6dBDDFf67a88cde70dAeE5", diff --git a/hardhat.config.ts b/hardhat.config.ts index 47196863..4f9cf2f4 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -118,6 +118,7 @@ if (isProduction) { [HardhatChainName.AVALANCHE]: getChainConfig(ChainSlug.AVALANCHE), [HardhatChainName.MANTA_PACIFIC]: getChainConfig(ChainSlug.MANTA_PACIFIC), [HardhatChainName.OPBNB]: getChainConfig(ChainSlug.OPBNB), + [HardhatChainName.GEIST]: getChainConfig(ChainSlug.GEIST), }; } @@ -169,6 +170,7 @@ const config: HardhatUserConfig = { avalanche: process.env.SNOWTRACE_API_KEY || "", manta_pacific: process.env.MANTA_PACIFIC_API_KEY || "none", opbnb: process.env.OPBNB_API_KEY || "none", + geist: process.env.GEIST_API_KEY || "none", }, customChains: [ { @@ -323,6 +325,14 @@ const config: HardhatUserConfig = { browserURL: "https://opbnb.bscscan.com/", }, }, + { + network: "geist", + chainId: ChainId.GEIST, + urls: { + apiURL: "https://geist-mainnet.explorer.alchemy.com/api", + browserURL: "https://geist-mainnet.explorer.alchemy.com/", + }, + }, ], }, networks: { diff --git a/package.json b/package.json index f303e231..a16dc412 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@socket.tech/dl-core", "license": "UNLICENSED", - "version": "2.31.0", + "version": "2.32.0", "description": "Smart contracts for socket data layer.", "main": "./dist/src/index.js", "types": "./dist/src/index.d.ts", diff --git a/scripts/deploy/deploy.ts b/scripts/deploy/deploy.ts index 2acec3a6..06ec762f 100644 --- a/scripts/deploy/deploy.ts +++ b/scripts/deploy/deploy.ts @@ -33,18 +33,26 @@ const main = async () => { value: chain, })); - const configResponse = await prompts([ + const chainsResponse = await prompts([ { name: "chains", type: "multiselect", + message: "Select chains to connect", + choices, + }, + { + name: "siblings", + type: "multiselect", message: "Select sibling chains to connect", choices, }, ]); - const chains = [...configResponse.chains]; + const chains = chainsResponse.chains; + const siblings = chainsResponse.siblings; + const allChains = [...chains, ...siblings]; let addresses: DeploymentAddresses = await deployForChains( - chains, + allChains, executionManagerVersion ); @@ -52,13 +60,20 @@ const main = async () => { console.log("No siblings selected!"); return; } - await configureRoles(addresses, chains, true, executionManagerVersion); + await configureRoles( + addresses, + chains, + siblings, + true, + executionManagerVersion + ); addresses = await configureSwitchboards( addresses, chains, + siblings, executionManagerVersion ); - await connectPlugs(addresses, chains); + await connectPlugs(addresses, chains, siblings); } catch (error) { console.log("Error:", error); } diff --git a/scripts/deploy/scripts/configureRoles.ts b/scripts/deploy/scripts/configureRoles.ts index dc4f1d06..4c8719b9 100644 --- a/scripts/deploy/scripts/configureRoles.ts +++ b/scripts/deploy/scripts/configureRoles.ts @@ -24,6 +24,7 @@ const newRoleStatus = true; export const configureRoles = async ( addresses: DeploymentAddresses, chains: ChainSlug[], + siblings: ChainSlug[], sendTransaction: boolean, executionManagerVersion: CORE_CONTRACTS ) => { @@ -60,7 +61,7 @@ export const configureRoles = async ( ], contractName: executionManagerVersion, filterChains: chains, - filterSiblingChains: chains, + filterSiblingChains: siblings, sendTransaction, newRoleStatus, }, @@ -90,7 +91,7 @@ export const configureRoles = async ( ], contractName: CORE_CONTRACTS.TransmitManager, filterChains: chains, - filterSiblingChains: chains, + filterSiblingChains: siblings, sendTransaction, newRoleStatus, }, @@ -111,7 +112,7 @@ export const configureRoles = async ( ], contractName: CORE_CONTRACTS.Socket, filterChains: chains, - filterSiblingChains: chains, + filterSiblingChains: siblings, sendTransaction, newRoleStatus, }, @@ -152,7 +153,7 @@ export const configureRoles = async ( contractName: CORE_CONTRACTS.FastSwitchboard, filterChains: chains, - filterSiblingChains: chains, + filterSiblingChains: siblings, sendTransaction, newRoleStatus, }, @@ -191,7 +192,7 @@ export const configureRoles = async ( ], contractName: CORE_CONTRACTS.OptimisticSwitchboard, filterChains: chains, - filterSiblingChains: chains, + filterSiblingChains: siblings, sendTransaction, newRoleStatus, }, @@ -227,7 +228,7 @@ export const configureRoles = async ( ], contractName: CORE_CONTRACTS.NativeSwitchboard, filterChains: chains, - filterSiblingChains: chains, + filterSiblingChains: siblings, sendTransaction, newRoleStatus, }, diff --git a/scripts/deploy/scripts/configureSwitchboards.ts b/scripts/deploy/scripts/configureSwitchboards.ts index 8eafaf10..99accc5d 100644 --- a/scripts/deploy/scripts/configureSwitchboards.ts +++ b/scripts/deploy/scripts/configureSwitchboards.ts @@ -25,6 +25,7 @@ import { export const configureSwitchboards = async ( addresses: DeploymentAddresses, chains: ChainSlug[], + siblings: ChainSlug[], executionManagerVersion: CORE_CONTRACTS ) => { try { @@ -42,17 +43,17 @@ export const configureSwitchboards = async ( let addr: ChainSocketAddresses = addresses[chain]!; - const list = isTestnet(chain) ? TestnetIds : MainnetIds; - const siblingSlugs: ChainSlug[] = list.filter( - (chainSlug) => chainSlug !== chain && chains.includes(chainSlug) - ); + // const list = isTestnet(chain) ? TestnetIds : MainnetIds; + // const siblingSlugs: ChainSlug[] = list.filter( + // (chainSlug) => chainSlug !== chain && chains.includes(chainSlug) + // ); await configureExecutionManager( executionManagerVersion, addr[executionManagerVersion]!, addr[CORE_CONTRACTS.SocketBatcher], chain, - siblingSlugs, + siblings, socketSigner ); @@ -60,7 +61,7 @@ export const configureSwitchboards = async ( const integrations = addr["integrations"] ?? {}; const integrationList = Object.keys(integrations).filter((chain) => - chains.includes(parseInt(chain) as ChainSlug) + siblings.includes(parseInt(chain) as ChainSlug) ); console.log(`Configuring for ${chain}`); @@ -91,7 +92,7 @@ export const configureSwitchboards = async ( addr = await registerSwitchboards( chain, - siblingSlugs, + siblings, CORE_CONTRACTS.FastSwitchboard, IntegrationTypes.fast, addr, @@ -101,7 +102,7 @@ export const configureSwitchboards = async ( addr = await registerSwitchboards( chain, - siblingSlugs, + siblings, CORE_CONTRACTS.OptimisticSwitchboard, IntegrationTypes.optimistic, addr, diff --git a/scripts/deploy/scripts/connect.ts b/scripts/deploy/scripts/connect.ts index 56313799..20bff40d 100644 --- a/scripts/deploy/scripts/connect.ts +++ b/scripts/deploy/scripts/connect.ts @@ -18,7 +18,8 @@ import { overrides } from "../config/config"; export const connectPlugs = async ( addresses: DeploymentAddresses, - chains: ChainSlug[] + chains: ChainSlug[], + siblings: ChainSlug[] ) => { try { await Promise.all( @@ -34,15 +35,15 @@ export const connectPlugs = async ( const addr: ChainSocketAddresses = addresses[chain]!; if (!addr["integrations"]) return; - const list = isTestnet(chain) ? TestnetIds : MainnetIds; - const siblingSlugs: ChainSlug[] = list.filter( - (chainSlug) => - chainSlug !== chain && - addresses?.[chainSlug]?.["Counter"] && - chains.includes(chainSlug) - ); + // const list = isTestnet(chain) ? TestnetIds : MainnetIds; + // const siblingSlugs: ChainSlug[] = list.filter( + // (chainSlug) => + // chainSlug !== chain && + // addresses?.[chainSlug]?.["Counter"] && + // chains.includes(chainSlug) + // ); - const siblingIntegrationtype: IntegrationTypes[] = siblingSlugs.map( + const siblingIntegrationtype: IntegrationTypes[] = siblings.map( (chainSlug) => { return getDefaultIntegrationType(chain, chainSlug); } @@ -58,8 +59,8 @@ export const connectPlugs = async ( await getInstance("Socket", addr["Socket"]) ).connect(socketSigner); - for (let index = 0; index < siblingSlugs.length; index++) { - const sibling = siblingSlugs[index]; + for (let index = 0; index < siblings.length; index++) { + const sibling = siblings[index]; const siblingCounter = addresses?.[sibling]?.["Counter"]; let switchboard; try { diff --git a/scripts/rpcConfig/constants/batcherSupportedChainSlug.ts b/scripts/rpcConfig/constants/batcherSupportedChainSlug.ts index e5e5093b..832d4ca7 100644 --- a/scripts/rpcConfig/constants/batcherSupportedChainSlug.ts +++ b/scripts/rpcConfig/constants/batcherSupportedChainSlug.ts @@ -42,4 +42,5 @@ export const batcherSupportedChainSlugs = [ ChainSlug.XLAYER, ChainSlug.MANTA_PACIFIC, ChainSlug.OPBNB, + ChainSlug.GEIST, ]; diff --git a/scripts/rpcConfig/constants/explorers.ts b/scripts/rpcConfig/constants/explorers.ts index 23f207da..c82ce7b0 100644 --- a/scripts/rpcConfig/constants/explorers.ts +++ b/scripts/rpcConfig/constants/explorers.ts @@ -21,4 +21,5 @@ export const explorers = { [ChainSlug.XLAYER]: "https://www.okx.com/web3/explorer/xlayer", [ChainSlug.MANTA_PACIFIC]: "https://pacific-explorer.manta.network/", [ChainSlug.OPBNB]: "https://opbnb.bscscan.com/", + [ChainSlug.GEIST]: "https://geist-mainnet.explorer.alchemy.com/", }; diff --git a/scripts/rpcConfig/constants/icons.ts b/scripts/rpcConfig/constants/icons.ts index 9690489d..cee51994 100644 --- a/scripts/rpcConfig/constants/icons.ts +++ b/scripts/rpcConfig/constants/icons.ts @@ -19,4 +19,5 @@ export const icons = { [ChainSlug.XLAYER]: "", [ChainSlug.MANTA_PACIFIC]: "", [ChainSlug.OPBNB]: "", + [ChainSlug.GEIST]: "", }; diff --git a/scripts/rpcConfig/constants/rpc.ts b/scripts/rpcConfig/constants/rpc.ts index 0473dae0..f79bd239 100644 --- a/scripts/rpcConfig/constants/rpc.ts +++ b/scripts/rpcConfig/constants/rpc.ts @@ -54,4 +54,5 @@ export const rpcs = { [ChainSlug.XLAYER]: checkEnvValue("XLAYER_RPC"), [ChainSlug.MANTA_PACIFIC]: checkEnvValue("MANTA_PACIFIC_RPC"), [ChainSlug.OPBNB]: checkEnvValue("OPBNB_RPC"), + [ChainSlug.GEIST]: checkEnvValue("GEIST_RPC"), }; diff --git a/scripts/rpcConfig/constants/version.ts b/scripts/rpcConfig/constants/version.ts index ba27ffcd..5bc12c4b 100644 --- a/scripts/rpcConfig/constants/version.ts +++ b/scripts/rpcConfig/constants/version.ts @@ -2,5 +2,5 @@ import { DeploymentMode } from "../../../src"; export const version = { [DeploymentMode.DEV]: "1.0.5", - [DeploymentMode.PROD]: "1.0.61", + [DeploymentMode.PROD]: "1.0.65", }; diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index d6c8eded..8d31d32e 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -62,8 +62,6 @@ const getOldEMVersionChainSlugs = (): ChainSlug[] => { if (!chainAddress.ExecutionManagerDF) chains.push(parseInt(chain) as ChainSlug); }); - - console.log(chains); } catch (error) { return [] as ChainSlug[]; } diff --git a/src/enums/arbChains.ts b/src/enums/arbChains.ts index a88dffd5..5a7a9e81 100644 --- a/src/enums/arbChains.ts +++ b/src/enums/arbChains.ts @@ -7,4 +7,5 @@ export const arbChains = [ ChainSlug.PARALLEL, ChainSlug.REYA_CRONOS, ChainSlug.REYA, + ChainSlug.GEIST, ]; diff --git a/src/enums/chainId.ts b/src/enums/chainId.ts index 959e196c..178fb381 100644 --- a/src/enums/chainId.ts +++ b/src/enums/chainId.ts @@ -50,4 +50,5 @@ export enum ChainId { XLAYER = 196, MANTA_PACIFIC = 169, OPBNB = 204, + GEIST = 63157, } diff --git a/src/enums/chainSlug.ts b/src/enums/chainSlug.ts index db01d18f..3c523c8c 100644 --- a/src/enums/chainSlug.ts +++ b/src/enums/chainSlug.ts @@ -52,4 +52,5 @@ export enum ChainSlug { XLAYER = ChainId.XLAYER, MANTA_PACIFIC = ChainId.MANTA_PACIFIC, OPBNB = ChainId.OPBNB, + GEIST = ChainId.GEIST, } diff --git a/src/enums/chainSlugToHardhatChainName.ts b/src/enums/chainSlugToHardhatChainName.ts index 07b4847e..a7c69003 100644 --- a/src/enums/chainSlugToHardhatChainName.ts +++ b/src/enums/chainSlugToHardhatChainName.ts @@ -53,4 +53,5 @@ export const chainSlugToHardhatChainName = { [ChainSlug.XLAYER]: [HardhatChainName.XLAYER], [ChainSlug.MANTA_PACIFIC]: [HardhatChainName.MANTA_PACIFIC], [ChainSlug.OPBNB]: [HardhatChainName.OPBNB], + [ChainSlug.GEIST]: [HardhatChainName.GEIST], }; diff --git a/src/enums/chainSlugToId.ts b/src/enums/chainSlugToId.ts index d09c56a9..01af63c6 100644 --- a/src/enums/chainSlugToId.ts +++ b/src/enums/chainSlugToId.ts @@ -53,4 +53,5 @@ export const ChainSlugToId = { [ChainSlug.XLAYER]: ChainId.XLAYER, [ChainSlug.MANTA_PACIFIC]: ChainId.MANTA_PACIFIC, [ChainSlug.OPBNB]: ChainId.OPBNB, + [ChainSlug.GEIST]: ChainId.GEIST, }; diff --git a/src/enums/chainSlugToKey.ts b/src/enums/chainSlugToKey.ts index b86aa3b3..346e4ea3 100644 --- a/src/enums/chainSlugToKey.ts +++ b/src/enums/chainSlugToKey.ts @@ -53,4 +53,5 @@ export const ChainSlugToKey = { [ChainSlug.XLAYER]: HardhatChainName.XLAYER, [ChainSlug.MANTA_PACIFIC]: HardhatChainName.MANTA_PACIFIC, [ChainSlug.OPBNB]: HardhatChainName.OPBNB, + [ChainSlug.GEIST]: HardhatChainName.GEIST, }; diff --git a/src/enums/currency.ts b/src/enums/currency.ts index b46ef354..57afb022 100644 --- a/src/enums/currency.ts +++ b/src/enums/currency.ts @@ -16,4 +16,5 @@ export const Currency = { [ChainSlug.AVALANCHE]: NativeTokens["avalanche-2"], [ChainSlug.XLAYER]: NativeTokens["okb"], [ChainSlug.OPBNB]: NativeTokens["binancecoin"], + [ChainSlug.GEIST]: NativeTokens["aavegotchi"], }; diff --git a/src/enums/hardhatChainName.ts b/src/enums/hardhatChainName.ts index fd5a3af7..eb9ef825 100644 --- a/src/enums/hardhatChainName.ts +++ b/src/enums/hardhatChainName.ts @@ -50,4 +50,5 @@ export enum HardhatChainName { XLAYER = "xlayer", MANTA_PACIFIC = "manta_pacific", OPBNB = "opbnb", + GEIST = "geist", } diff --git a/src/enums/hardhatChainNameToSlug.ts b/src/enums/hardhatChainNameToSlug.ts index f7d48d25..3e83b0fa 100644 --- a/src/enums/hardhatChainNameToSlug.ts +++ b/src/enums/hardhatChainNameToSlug.ts @@ -53,4 +53,5 @@ export const hardhatChainNameToSlug = { [HardhatChainName.XLAYER]: ChainSlug.XLAYER, [HardhatChainName.MANTA_PACIFIC]: ChainSlug.MANTA_PACIFIC, [HardhatChainName.OPBNB]: ChainSlug.OPBNB, + [HardhatChainName.GEIST]: ChainSlug.GEIST, }; diff --git a/src/enums/mainnetIds.ts b/src/enums/mainnetIds.ts index 5c5c1103..eaaeced7 100644 --- a/src/enums/mainnetIds.ts +++ b/src/enums/mainnetIds.ts @@ -28,4 +28,5 @@ export const MainnetIds: ChainSlug[] = [ ChainSlug.XLAYER, ChainSlug.MANTA_PACIFIC, ChainSlug.OPBNB, + ChainSlug.GEIST, ]; diff --git a/src/enums/native-tokens.ts b/src/enums/native-tokens.ts index c059d89a..1e70d1bf 100644 --- a/src/enums/native-tokens.ts +++ b/src/enums/native-tokens.ts @@ -11,4 +11,5 @@ export enum NativeTokens { "dai" = "dai", "avalanche-2" = "avalanche-2", "okb" = "okb", + "aavegotchi" = "aavegotchi", }