From 5cdb3f209ee2a8c3014b9af1eb7b62e0bee08da7 Mon Sep 17 00:00:00 2001 From: Bayological <6872903+bayological@users.noreply.github.com> Date: Thu, 23 May 2024 10:08:46 +0200 Subject: [PATCH] fix: update to allow decoding with zero params (#148) --- src/lib/contracts/useContractsInfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/contracts/useContractsInfo.ts b/src/lib/contracts/useContractsInfo.ts index da0de93a..6ebe6df3 100644 --- a/src/lib/contracts/useContractsInfo.ts +++ b/src/lib/contracts/useContractsInfo.ts @@ -62,7 +62,7 @@ function decodeCalldata( if (data?.functionName) { // output example: `transfer(0x1234etc, 100)` - return `${data.functionName}(${data.args.length ? data.args.join(", ") : ""})`; + return `${data.functionName}(${data.args?.length ? data.args.join(", ") : ""})`; } else { return call.calldata; }