Skip to content

Commit dc5643e

Browse files
Fix adresses format (#190)
* Fix from and to addresses format * Update tests * Fix interpreters * Add changesets
1 parent 6aef832 commit dc5643e

File tree

38 files changed

+78
-83
lines changed

38 files changed

+78
-83
lines changed

.changeset/hot-toys-judge.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+
Update from and to adresses to the Hex format

.changeset/pink-ravens-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@3loop/transaction-interpreter': patch
3+
---
4+
5+
Small fixes in 0x and erc 721 interpreters

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
A library to transform any EVM transaction into a human-readable format. It consists of 2 parts:
88

99
- [Transaction decoder](https://github.com/3loop/loop-decoder/tree/main/packages/transaction-decoder)
10-
- [Transaction interpreter](https://github.com/3loop/loop-decoder/tree/main/packages/transaction-interpreter)
10+
- [Transaction interpreter](https://github.com/3loop/loop-decoder/tree/main/packages/transaction-interpreter) (experimental)
1111

1212
> ⚠️ The Transaction Interpreter is still under development and breaking changes are expected.
1313

packages/transaction-decoder/src/transaction-decoder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ export const decodeTransaction = ({
166166
const decodedTx: DecodedTransaction = {
167167
txHash: transaction.hash,
168168
txType: nativeTransfer ? TxType.TRANSFER : TxType.CONTRACT_INTERACTION,
169-
fromAddress: receipt.from,
170-
toAddress: receipt.to,
169+
fromAddress: getAddress(receipt.from),
170+
toAddress: receipt.to ? getAddress(receipt.to) : null,
171171
contractName: contractMeta?.contractName ?? null,
172172
contractType: contractMeta?.type ?? 'OTHER',
173173
methodCall: {

packages/transaction-decoder/test/snapshots/calldata/0x867ee0665a0e37bb52e5c2211b122ee952c358ee1d509c45b1157c2b3be8313c.snapshot

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/transaction-decoder/test/snapshots/decoder/0x0235fc6d0c91f40bcbe627069be612464027913b2e95b23dcf2e647f330a22b4.snapshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"contractType": "ERC721",
3434
"effectiveGasPrice": "28687531",
3535
"errors": null,
36-
"fromAddress": "0x997162a6beb886655d3e355b190fe0c8f0c37f0e",
36+
"fromAddress": "0x997162a6BEB886655d3e355B190fe0C8f0c37F0e",
3737
"gasPaid": "0.00000134085519894",
3838
"gasUsed": "46740",
3939
"interactedAddresses": [
@@ -81,7 +81,7 @@
8181
"nativeValueSent": "0",
8282
"reverted": false,
8383
"timestamp": 1692818220,
84-
"toAddress": "0xc3e4214dd442136079df06bb2529bae276d37564",
84+
"toAddress": "0xC3E4214dd442136079dF06bb2529Bae276d37564",
8585
"traceCalls": [],
8686
"transfers": [],
8787
"txHash": "0x0235fc6d0c91f40bcbe627069be612464027913b2e95b23dcf2e647f330a22b4",

packages/transaction-decoder/test/snapshots/decoder/0x026fdb8b0017ef0e468e6d1627357adb9a8c4b6205ac0049bad80c253c76750c.snapshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"contractType": "ERC20",
4444
"effectiveGasPrice": "12123195085",
4545
"errors": null,
46-
"fromAddress": "0xea3c9d1d357c02b5bd0d98ffb8b5d06f0de3ceac",
46+
"fromAddress": "0xEA3C9D1D357C02B5Bd0d98ffB8b5D06f0De3Ceac",
4747
"gasPaid": "0.00112064390726723",
4848
"gasUsed": "92438",
4949
"interactedAddresses": [
@@ -137,7 +137,7 @@
137137
"nativeValueSent": "10000000000000000",
138138
"reverted": false,
139139
"timestamp": 1713094379,
140-
"toAddress": "0xd152f549545093347a162dce210e7293f1452150",
140+
"toAddress": "0xD152f549545093347A162Dce210e7293f1452150",
141141
"traceCalls": [],
142142
"transfers": [
143143
{

packages/transaction-decoder/test/snapshots/decoder/0x02a4dda78f1452772d87aa080d65ed7c34785b9d0f4c20aa6c91c51a63ee1fa4.snapshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"contractType": "ERC20",
6262
"effectiveGasPrice": "13720245625",
6363
"errors": null,
64-
"fromAddress": "0xde02fffb824720e25674a604baf2277f21c66a0f",
64+
"fromAddress": "0xde02FFFb824720E25674a604BaF2277f21c66a0F",
6565
"gasPaid": "0.002586856270874375",
6666
"gasUsed": "188543",
6767
"interactedAddresses": [
@@ -303,7 +303,7 @@
303303
"nativeValueSent": "0",
304304
"reverted": false,
305305
"timestamp": 1712476739,
306-
"toAddress": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
306+
"toAddress": "0xb2ecfE4E4D61f8790bbb9DE2D1259B9e2410CEA5",
307307
"traceCalls": [
308308
{
309309
"from": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",

packages/transaction-decoder/test/snapshots/decoder/0x074e27d856aae900c2a16f8577baa4194a1c23daf54efe80faff4bb612e410ba.snapshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"contractType": "ERC20",
5353
"effectiveGasPrice": "14882560478",
5454
"errors": null,
55-
"fromAddress": "0xaef176ef3501a72608411d8f15f570bc3c36d7fa",
55+
"fromAddress": "0xaeF176EF3501a72608411d8F15f570bc3C36D7fa",
5656
"gasPaid": "0.002982822301242672",
5757
"gasUsed": "200424",
5858
"interactedAddresses": [
@@ -203,7 +203,7 @@
203203
"nativeValueSent": "0",
204204
"reverted": false,
205205
"timestamp": 1728390371,
206-
"toAddress": "0x40a2accbd92bca938b02010e17a5b8929b49130d",
206+
"toAddress": "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D",
207207
"traceCalls": [],
208208
"transfers": [
209209
{

packages/transaction-decoder/test/snapshots/decoder/0x0f5cb8565e543d866a0477865575c20919e09c37c14588cf1878c91a47c6e37e.snapshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"contractType": "ERC20",
2626
"effectiveGasPrice": "13241256548",
2727
"errors": null,
28-
"fromAddress": "0xbbdd1b3c87c211e482cda98ea14fa8bf50022ca0",
28+
"fromAddress": "0xbbDd1b3C87c211E482CdA98eA14fa8bF50022CA0",
2929
"gasPaid": "0.000696741678299212",
3030
"gasUsed": "52619",
3131
"interactedAddresses": [
@@ -90,7 +90,7 @@
9090
"nativeValueSent": "0",
9191
"reverted": false,
9292
"timestamp": 1712476259,
93-
"toAddress": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
93+
"toAddress": "0xb2ecfE4E4D61f8790bbb9DE2D1259B9e2410CEA5",
9494
"traceCalls": [
9595
{
9696
"from": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",

0 commit comments

Comments
 (0)