Skip to content

Commit da3a060

Browse files
Do not decode internal data param without address (#174)
1 parent ade1be3 commit da3a060

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/stale-bottles-rule.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@3loop/transaction-decoder': patch
3+
---
4+
5+
Do not decode internal calldata param without knowing the address

packages/transaction-decoder/src/decoding/calldata-decode.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ const decodeBytesRecursively = (
5252
}
5353
}
5454

55-
if (isCallDataNode) {
55+
if (isCallDataNode && address) {
5656
const decoded = yield* decodeMethod({
5757
data: node.value as Hex,
58-
chainID: address ? chainID : 0,
59-
contractAddress: address ?? '',
58+
chainID,
59+
contractAddress: address,
6060
}).pipe(Effect.orElseSucceed(() => null))
6161

6262
return decoded

0 commit comments

Comments
 (0)