From 711950246fdb6090abc60f82eeb02ec6e6db3ba1 Mon Sep 17 00:00:00 2001 From: Miguel de Elias Date: Thu, 23 Nov 2023 18:02:34 -0300 Subject: [PATCH] fix: added arbitrum sepolia to get retryable tickets --- src/mappings/helpers/bridge.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/mappings/helpers/bridge.ts b/src/mappings/helpers/bridge.ts index c195f2a8..b9714814 100644 --- a/src/mappings/helpers/bridge.ts +++ b/src/mappings/helpers/bridge.ts @@ -4,6 +4,7 @@ import { ethereum, crypto, ByteArray, + log, } from "@graphprotocol/graph-ts"; import { DepositInitiated } from "../../types/L1GraphTokenGateway/L1GraphTokenGateway"; import { bigIntToBytes, padZeros } from "./byte"; @@ -50,9 +51,18 @@ export function getRetryableTicketId( let fields: ByteArray[] = []; // Get the L2 chain id based on the L1 network - // 0x066EED = 421613 (Arbitrum Goerli) - // 0xA4B1 = 42161 (Arbitrum One) - let l2ChainIdHex = addresses.network === "mainnet" ? "0xA4B1" : "0x066EED"; + let l2ChainIdHex = ""; + if (addresses.network === "mainnet") { + l2ChainIdHex = "0xA4B1"; // 0xA4B1 = 42161 (Arbitrum One) + } else if (addresses.network === "goerli") { + l2ChainIdHex = "0x066EED"; // 0x066EED = 421613 (Arbitrum Goerli) + } else if (addresses.network === "sepolia") { + l2ChainIdHex = "0x066EEE"; // 0x066EEE = 421614 (Arbitrum Sepolia) + } else { + log.critical('Unsupported network: {}', [addresses.network]); + return null; + } + let l2ChainId = Bytes.fromHexString(l2ChainIdHex); fields.push(l2ChainId);