diff --git a/.changeset/stale-bottles-rule.md b/.changeset/stale-bottles-rule.md new file mode 100644 index 0000000..7bba377 --- /dev/null +++ b/.changeset/stale-bottles-rule.md @@ -0,0 +1,5 @@ +--- +'@3loop/transaction-decoder': patch +--- + +Do not decode internal calldata param without knowing the address diff --git a/packages/transaction-decoder/src/decoding/calldata-decode.ts b/packages/transaction-decoder/src/decoding/calldata-decode.ts index 4399d62..98700ed 100644 --- a/packages/transaction-decoder/src/decoding/calldata-decode.ts +++ b/packages/transaction-decoder/src/decoding/calldata-decode.ts @@ -52,11 +52,11 @@ const decodeBytesRecursively = ( } } - if (isCallDataNode) { + if (isCallDataNode && address) { const decoded = yield* decodeMethod({ data: node.value as Hex, - chainID: address ? chainID : 0, - contractAddress: address ?? '', + chainID, + contractAddress: address, }).pipe(Effect.orElseSucceed(() => null)) return decoded