diff --git a/packages/nextjs/utils/scaffold-eth/decodeTxData.ts b/packages/nextjs/utils/scaffold-eth/decodeTxData.ts index 65c20f789..86eac35e8 100644 --- a/packages/nextjs/utils/scaffold-eth/decodeTxData.ts +++ b/packages/nextjs/utils/scaffold-eth/decodeTxData.ts @@ -18,6 +18,7 @@ const interfaces = chainMetaData export const decodeTransactionData = (tx: TransactionWithFunction) => { if (tx.input.length >= 10 && !tx.input.startsWith("0x60e06040")) { + let foundInterface = false; for (const [, contractAbi] of Object.entries(interfaces)) { try { const { functionName, args } = decodeFunctionData({ @@ -34,12 +35,15 @@ export const decodeTransactionData = (tx: TransactionWithFunction) => { abi: contractAbi as AbiFunction[], name: functionName, })?.inputs.map((input: any) => input.type); - + foundInterface = true; break; - } catch (e) { - console.error(`Parsing failed: ${e}`); + } catch { + // do nothing } } + if (!foundInterface) { + tx.functionName = "⚠️ Unknown"; + } } return tx; };