From 6a8de66f3b91f7a10292188f0ff783f90d08aea5 Mon Sep 17 00:00:00 2001 From: bennett Date: Sat, 19 Oct 2024 15:52:18 -0500 Subject: [PATCH] feat: add superseed definitions Signed-off-by: bennett --- package.json | 2 +- src/common/Constants.ts | 33 +++++++++++++++++++++++++++++++++ src/common/ContractAddresses.ts | 23 +++++++++++++++++++++++ yarn.lock | 5 +++++ 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d074695c..452636ed3 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "node": ">=20" }, "dependencies": { - "@across-protocol/constants": "^3.1.16", + "@across-protocol/constants": "^3.1.17", "@across-protocol/contracts": "^3.0.11", "@across-protocol/sdk": "^3.2.7", "@arbitrum/sdk": "^3.1.3", diff --git a/src/common/Constants.ts b/src/common/Constants.ts index 2cb9f579e..b8110af8c 100644 --- a/src/common/Constants.ts +++ b/src/common/Constants.ts @@ -52,6 +52,7 @@ export const DATAWORKER_FAST_LOOKBACK: { [chainId: number]: number } = { [CHAIN_IDs.POLYGON]: 138240, [CHAIN_IDs.REDSTONE]: 172800, // OP stack [CHAIN_IDs.SCROLL]: 115200, // 4 * 24 * 20 * 60, + [CHAIN_IDs.SUPERSEED]: 172800, // OP stack [CHAIN_IDs.WORLD_CHAIN]: 172800, // OP stack [CHAIN_IDs.ZK_SYNC]: 345600, // 4 * 24 * 60 * 60, [CHAIN_IDs.ZORA]: 172800, // OP stack @@ -90,6 +91,7 @@ export const MIN_DEPOSIT_CONFIRMATIONS: { [threshold: number | string]: { [chain [CHAIN_IDs.POLYGON]: 128, // Commonly used finality level for CEX's that accept Polygon deposits [CHAIN_IDs.REDSTONE]: 120, [CHAIN_IDs.SCROLL]: 30, + [CHAIN_IDs.SUPERSEED]: 120, [CHAIN_IDs.WORLD_CHAIN]: 120, [CHAIN_IDs.ZK_SYNC]: 120, [CHAIN_IDs.ZORA]: 120, @@ -106,6 +108,7 @@ export const MIN_DEPOSIT_CONFIRMATIONS: { [threshold: number | string]: { [chain [CHAIN_IDs.POLYGON]: 100, // Probabilistically safe level based on historic Polygon reorgs [CHAIN_IDs.REDSTONE]: 60, [CHAIN_IDs.SCROLL]: 1, + [CHAIN_IDs.SUPERSEED]: 60, [CHAIN_IDs.WORLD_CHAIN]: 60, [CHAIN_IDs.ZK_SYNC]: 0, [CHAIN_IDs.ZORA]: 60, @@ -122,6 +125,7 @@ export const MIN_DEPOSIT_CONFIRMATIONS: { [threshold: number | string]: { [chain [CHAIN_IDs.POLYGON]: 80, [CHAIN_IDs.REDSTONE]: 60, [CHAIN_IDs.SCROLL]: 1, + [CHAIN_IDs.SUPERSEED]: 60, [CHAIN_IDs.WORLD_CHAIN]: 60, [CHAIN_IDs.ZK_SYNC]: 0, [CHAIN_IDs.ZORA]: 60, @@ -148,6 +152,7 @@ export const CHAIN_MAX_BLOCK_LOOKBACK = { [CHAIN_IDs.POLYGON]: 10000, [CHAIN_IDs.REDSTONE]: 10000, [CHAIN_IDs.SCROLL]: 10000, + [CHAIN_IDs.SUPERSEED]: 10000, [CHAIN_IDs.WORLD_CHAIN]: 10000, [CHAIN_IDs.ZK_SYNC]: 10000, [CHAIN_IDs.ZORA]: 10000, @@ -179,6 +184,7 @@ export const BUNDLE_END_BLOCK_BUFFERS = { [CHAIN_IDs.POLYGON]: 128, // 2s/block. Polygon reorgs often so this number is set larger than the largest observed reorg. [CHAIN_IDs.REDSTONE]: 60, // 2s/block [CHAIN_IDs.SCROLL]: 40, // ~3s/block + [CHAIN_IDs.SUPERSEED]: 60, // 2s/block [CHAIN_IDs.WORLD_CHAIN]: 60, // 2s/block [CHAIN_IDs.ZK_SYNC]: 120, // ~1s/block. ZkSync is a centralized sequencer but is relatively unstable so this is kept higher than 0 [CHAIN_IDs.ZORA]: 60, // 2s/block @@ -224,6 +230,7 @@ export const CHAIN_CACHE_FOLLOW_DISTANCE: { [chainId: number]: number } = { [CHAIN_IDs.POLYGON]: 256, [CHAIN_IDs.REDSTONE]: 120, [CHAIN_IDs.SCROLL]: 100, + [CHAIN_IDs.SUPERSEED]: 120, [CHAIN_IDs.WORLD_CHAIN]: 120, [CHAIN_IDs.ZK_SYNC]: 512, [CHAIN_IDs.ZORA]: 120, @@ -254,6 +261,7 @@ export const DEFAULT_NO_TTL_DISTANCE: { [chainId: number]: number } = { [CHAIN_IDs.POLYGON]: 86400, [CHAIN_IDs.REDSTONE]: 86400, [CHAIN_IDs.SCROLL]: 57600, + [CHAIN_IDs.SUPERSEED]: 86400, [CHAIN_IDs.WORLD_CHAIN]: 86400, [CHAIN_IDs.ZK_SYNC]: 172800, [CHAIN_IDs.ZORA]: 86400, @@ -270,6 +278,7 @@ export const DEFAULT_GAS_FEE_SCALERS: { [CHAIN_IDs.MODE]: { maxFeePerGasScaler: 2, maxPriorityFeePerGasScaler: 0.01 }, [CHAIN_IDs.OPTIMISM]: { maxFeePerGasScaler: 2, maxPriorityFeePerGasScaler: 0.01 }, [CHAIN_IDs.REDSTONE]: { maxFeePerGasScaler: 2, maxPriorityFeePerGasScaler: 0.01 }, + [CHAIN_IDs.SUPERSEED]: { maxFeePerGasScaler: 2, maxPriorityFeePerGasScaler: 0.01 }, [CHAIN_IDs.WORLD_CHAIN]: { maxFeePerGasScaler: 2, maxPriorityFeePerGasScaler: 0.01 }, [CHAIN_IDs.ZORA]: { maxFeePerGasScaler: 2, maxPriorityFeePerGasScaler: 0.01 }, }; @@ -294,6 +303,7 @@ export const multicall3Addresses = { [CHAIN_IDs.OPTIMISM]: "0xcA11bde05977b3631167028862bE2a173976CA11", [CHAIN_IDs.POLYGON]: "0xcA11bde05977b3631167028862bE2a173976CA11", [CHAIN_IDs.SCROLL]: "0xcA11bde05977b3631167028862bE2a173976CA11", + [CHAIN_IDs.SUPERSEED]: "0xcA11bde05977b3631167028862bE2a173976CA11", // TBD [CHAIN_IDs.WORLD_CHAIN]: "0xcA11bde05977b3631167028862bE2a173976CA11", [CHAIN_IDs.ZK_SYNC]: "0xF9cda624FBC7e059355ce98a31693d299FACd963", [CHAIN_IDs.ZORA]: "0xcA11bde05977b3631167028862bE2a173976CA11", @@ -322,6 +332,7 @@ export const spokesThatHoldEthAndWeth = [ CHAIN_IDs.OPTIMISM, CHAIN_IDs.REDSTONE, CHAIN_IDs.SCROLL, + CHAIN_IDs.SUPERSEED, CHAIN_IDs.WORLD_CHAIN, CHAIN_IDs.ZK_SYNC, CHAIN_IDs.ZORA, @@ -358,6 +369,7 @@ export const SUPPORTED_TOKENS: { [chainId: number]: string[] } = { [CHAIN_IDs.POLYGON]: ["USDC", "USDT", "WETH", "DAI", "WBTC", "UMA", "BAL", "ACX", "POOL"], [CHAIN_IDs.REDSTONE]: ["WETH"], [CHAIN_IDs.SCROLL]: ["WETH", "USDC", "USDT", "WBTC"], + [CHAIN_IDs.SUPERSEED]: ["WETH", "USDC", "DAI", "USDT", "WBTC"], [CHAIN_IDs.WORLD_CHAIN]: ["WETH", "WBTC", "USDC"], [CHAIN_IDs.ZK_SYNC]: ["USDC", "USDT", "WETH", "WBTC", "DAI"], [CHAIN_IDs.ZORA]: ["USDC", "WETH"], @@ -411,6 +423,7 @@ export const CANONICAL_BRIDGE: { [CHAIN_IDs.POLYGON]: PolygonERC20Bridge, [CHAIN_IDs.REDSTONE]: OpStackDefaultERC20Bridge, [CHAIN_IDs.SCROLL]: ScrollERC20Bridge, + [CHAIN_IDs.SUPERSEED]: OpStackDefaultERC20Bridge, [CHAIN_IDs.WORLD_CHAIN]: OpStackDefaultERC20Bridge, [CHAIN_IDs.ZK_SYNC]: ZKSyncBridge, [CHAIN_IDs.ZORA]: OpStackDefaultERC20Bridge, @@ -465,6 +478,10 @@ export const CUSTOM_BRIDGE: { [CHAIN_IDs.REDSTONE]: { [TOKEN_SYMBOLS_MAP.WETH.addresses[CHAIN_IDs.MAINNET]]: OpStackWethBridge, }, + [CHAIN_IDs.SUPERSEED]: { + [TOKEN_SYMBOLS_MAP.WETH.addresses[CHAIN_IDs.MAINNET]]: OpStackWethBridge, + [TOKEN_SYMBOLS_MAP.USDC.addresses[CHAIN_IDs.MAINNET]]: OpStackUSDCBridge, // TBD + }, [CHAIN_IDs.WORLD_CHAIN]: { [TOKEN_SYMBOLS_MAP.USDC.addresses[CHAIN_IDs.MAINNET]]: OpStackUSDCBridge, [TOKEN_SYMBOLS_MAP.WETH.addresses[CHAIN_IDs.MAINNET]]: OpStackWethBridge, @@ -533,6 +550,7 @@ export const EXPECTED_L1_TO_L2_MESSAGE_TIME = { [CHAIN_IDs.POLYGON]: 60 * 60, [CHAIN_IDs.REDSTONE]: 20 * 60, [CHAIN_IDs.SCROLL]: 60 * 60, + [CHAIN_IDs.SUPERSEED]: 60 * 60, [CHAIN_IDs.WORLD_CHAIN]: 20 * 60, [CHAIN_IDs.ZK_SYNC]: 60 * 60, [CHAIN_IDs.ZORA]: 20 * 60, @@ -588,6 +606,21 @@ export const OPSTACK_CONTRACT_OVERRIDES = { }, l2: DEFAULT_L2_CONTRACT_ADDRESSES, }, + [CHAIN_IDs.SUPERSEED]: { + l1: { + AddressManager: "0x0a1B34aA2047AD1AbEF8aC085b1a7802Ed9dbCF0", + L1CrossDomainMessenger: "0x3a30AEd8fa7717aC2D8454D82c125cF6B875061a", + L1StandardBridge: CONTRACT_ADDRESSES[CHAIN_IDs.MAINNET].ovmStandardBridge_5330.address, + StateCommitmentChain: ZERO_ADDRESS, + CanonicalTransactionChain: ZERO_ADDRESS, + BondManager: ZERO_ADDRESS, + OptimismPortal: "0x2c2150aa5c75A24fB93d4fD2F2a895D618054f07", + L2OutputOracle: "0x693A0F8854F458D282DE3C5b69E8eE5EEE8aA949", + OptimismPortal2: ZERO_ADDRESS, + DisputeGameFactory: ZERO_ADDRESS, + }, + l2: DEFAULT_L2_CONTRACT_ADDRESSES, + }, [CHAIN_IDs.WORLD_CHAIN]: { l1: { AddressManager: "0x5891090d5085679714cb0e62f74950a3c19146a8", diff --git a/src/common/ContractAddresses.ts b/src/common/ContractAddresses.ts index 4433ed226..6734f2dbc 100644 --- a/src/common/ContractAddresses.ts +++ b/src/common/ContractAddresses.ts @@ -81,6 +81,11 @@ export const CONTRACT_ADDRESSES: { address: "0x153A69e4bb6fEDBbAaF463CB982416316c84B2dB", abi: OP_USDC_BRIDGE_ABI, }, + // TBD + opUSDCBridge_5330: { + address: "", + abi: OP_USDC_BRIDGE_ABI, + }, // Since there are multiple ovmStandardBridges on mainnet for different OP Stack chains, we append the chain id of the Op // Stack chain to the name to differentiate. This one is for Optimism. ovmStandardBridge_10: { @@ -99,6 +104,10 @@ export const CONTRACT_ADDRESSES: { address: "0x2658723Bf70c7667De6B25F99fcce13A16D25d08", abi: OVM_L1_STANDARD_BRIDGE_ABI, }, + ovmStandardBridge_5330: { + address: "0x8b0576E39F1233679109F9b40cFcC2a7E0901Ede", + abi: OVM_L1_STANDARD_BRIDGE_ABI, + }, ovmStandardBridge_8453: { address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35", abi: OVM_L1_STANDARD_BRIDGE_ABI, @@ -265,6 +274,20 @@ export const CONTRACT_ADDRESSES: { address: "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000", }, }, + 5330: { + // TBD + opUSDCBridge: { + address: "", + abi: OP_USDC_BRIDGE_ABI, + }, + ovmStandardBridge: { + address: "0x4200000000000000000000000000000000000010", + abi: OVM_L2_STANDARD_BRIDGE_ABI, + }, + eth: { + address: "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000", + }, + }, 8453: { ovmStandardBridge: { address: "0x4200000000000000000000000000000000000010", diff --git a/yarn.lock b/yarn.lock index effb7bb56..bb481e217 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,6 +16,11 @@ resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.16.tgz#c126085d29d4d051fd02a04c833d804d37c3c219" integrity sha512-+U+AecGWnfY4b4sSfKBvsDj/+yXKEqpTXcZgI8GVVmUTkUhs1efA0kN4q3q10yy5TXI5TtagaG7R9yZg1zgKKg== +"@across-protocol/constants@^3.1.17": + version "3.1.17" + resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.17.tgz#1e43c87fbab06df3a1aab8993d7c5f746838e25d" + integrity sha512-mW++45vP04ahogsHFM5nE7ZKV8vmdxSO8gbBeP24VFxijrIYWqhISG67EU9pnAbgAIB58pT+ZmqdXI25iDmctA== + "@across-protocol/contracts@^0.1.4": version "0.1.4" resolved "https://registry.yarnpkg.com/@across-protocol/contracts/-/contracts-0.1.4.tgz#64b3d91e639d2bb120ea94ddef3d160967047fa5"