Skip to content

Commit

Permalink
Fix adresses format (#190)
Browse files Browse the repository at this point in the history
* Fix from and to addresses format

* Update tests

* Fix interpreters

* Add changesets
  • Loading branch information
anastasiarods authored Dec 23, 2024
1 parent 6aef832 commit dc5643e
Show file tree
Hide file tree
Showing 38 changed files with 78 additions and 83 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-toys-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@3loop/transaction-decoder': patch
---

Update from and to adresses to the Hex format
5 changes: 5 additions & 0 deletions .changeset/pink-ravens-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@3loop/transaction-interpreter': patch
---

Small fixes in 0x and erc 721 interpreters
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
A library to transform any EVM transaction into a human-readable format. It consists of 2 parts:

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

> ⚠️ The Transaction Interpreter is still under development and breaking changes are expected.
Expand Down
4 changes: 2 additions & 2 deletions packages/transaction-decoder/src/transaction-decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ export const decodeTransaction = ({
const decodedTx: DecodedTransaction = {
txHash: transaction.hash,
txType: nativeTransfer ? TxType.TRANSFER : TxType.CONTRACT_INTERACTION,
fromAddress: receipt.from,
toAddress: receipt.to,
fromAddress: getAddress(receipt.from),
toAddress: receipt.to ? getAddress(receipt.to) : null,
contractName: contractMeta?.contractName ?? null,
contractType: contractMeta?.type ?? 'OTHER',
methodCall: {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"contractType": "ERC721",
"effectiveGasPrice": "28687531",
"errors": null,
"fromAddress": "0x997162a6beb886655d3e355b190fe0c8f0c37f0e",
"fromAddress": "0x997162a6BEB886655d3e355B190fe0C8f0c37F0e",
"gasPaid": "0.00000134085519894",
"gasUsed": "46740",
"interactedAddresses": [
Expand Down Expand Up @@ -81,7 +81,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1692818220,
"toAddress": "0xc3e4214dd442136079df06bb2529bae276d37564",
"toAddress": "0xC3E4214dd442136079dF06bb2529Bae276d37564",
"traceCalls": [],
"transfers": [],
"txHash": "0x0235fc6d0c91f40bcbe627069be612464027913b2e95b23dcf2e647f330a22b4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "12123195085",
"errors": null,
"fromAddress": "0xea3c9d1d357c02b5bd0d98ffb8b5d06f0de3ceac",
"fromAddress": "0xEA3C9D1D357C02B5Bd0d98ffB8b5D06f0De3Ceac",
"gasPaid": "0.00112064390726723",
"gasUsed": "92438",
"interactedAddresses": [
Expand Down Expand Up @@ -137,7 +137,7 @@
"nativeValueSent": "10000000000000000",
"reverted": false,
"timestamp": 1713094379,
"toAddress": "0xd152f549545093347a162dce210e7293f1452150",
"toAddress": "0xD152f549545093347A162Dce210e7293f1452150",
"traceCalls": [],
"transfers": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "13720245625",
"errors": null,
"fromAddress": "0xde02fffb824720e25674a604baf2277f21c66a0f",
"fromAddress": "0xde02FFFb824720E25674a604BaF2277f21c66a0F",
"gasPaid": "0.002586856270874375",
"gasUsed": "188543",
"interactedAddresses": [
Expand Down Expand Up @@ -303,7 +303,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1712476739,
"toAddress": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
"toAddress": "0xb2ecfE4E4D61f8790bbb9DE2D1259B9e2410CEA5",
"traceCalls": [
{
"from": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "14882560478",
"errors": null,
"fromAddress": "0xaef176ef3501a72608411d8f15f570bc3c36d7fa",
"fromAddress": "0xaeF176EF3501a72608411d8F15f570bc3C36D7fa",
"gasPaid": "0.002982822301242672",
"gasUsed": "200424",
"interactedAddresses": [
Expand Down Expand Up @@ -203,7 +203,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1728390371,
"toAddress": "0x40a2accbd92bca938b02010e17a5b8929b49130d",
"toAddress": "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D",
"traceCalls": [],
"transfers": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "13241256548",
"errors": null,
"fromAddress": "0xbbdd1b3c87c211e482cda98ea14fa8bf50022ca0",
"fromAddress": "0xbbDd1b3C87c211E482CdA98eA14fa8bF50022CA0",
"gasPaid": "0.000696741678299212",
"gasUsed": "52619",
"interactedAddresses": [
Expand Down Expand Up @@ -90,7 +90,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1712476259,
"toAddress": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
"toAddress": "0xb2ecfE4E4D61f8790bbb9DE2D1259B9e2410CEA5",
"traceCalls": [
{
"from": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"contractType": "ERC1155",
"effectiveGasPrice": "1003151084",
"errors": null,
"fromAddress": "0x80f6ec9e30340f2c2fe96493c242b227c85e520d",
"fromAddress": "0x80f6EC9E30340f2c2fE96493c242b227C85e520d",
"gasPaid": "0.000033173203196796",
"gasUsed": "33069",
"interactedAddresses": [
Expand Down Expand Up @@ -98,7 +98,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1691435796,
"toAddress": "0x58c3c2547084cc1c94130d6fd750a3877c7ca5d2",
"toAddress": "0x58c3c2547084CC1C94130D6fd750A3877c7Ca5D2",
"traceCalls": [],
"transfers": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "7233943704",
"errors": null,
"fromAddress": "0xac21ac0aaa1c9c658c8ea29f81f02520a3d82d60",
"fromAddress": "0xaC21aC0AAA1c9C658C8ea29f81F02520a3D82D60",
"gasPaid": "0.000372121298077464",
"gasUsed": "51441",
"interactedAddresses": [
Expand Down Expand Up @@ -142,7 +142,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1730731979,
"toAddress": "0x1f98415757620b543a52e61c46b32eb19261f984",
"toAddress": "0x1F98415757620B543A52E61c46B32eB19261F984",
"traceCalls": [
{
"from": "0x1f98415757620b543a52e61c46b32eb19261f984",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "2984279961",
"errors": null,
"fromAddress": "0xac844837a2b58db4b4def35b243ee14c3e36a96b",
"fromAddress": "0xac844837a2B58db4B4deF35b243ee14c3e36A96b",
"gasPaid": "0.000681382737815364",
"gasUsed": "228324",
"interactedAddresses": [
Expand Down Expand Up @@ -325,7 +325,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1725778547,
"toAddress": "0xca11bde05977b3631167028862be2a173976ca11",
"toAddress": "0xcA11bde05977b3631167028862bE2a173976CA11",
"traceCalls": [
{
"from": "0xca11bde05977b3631167028862be2a173976ca11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"contractType": "ERC721",
"effectiveGasPrice": "2500000021",
"errors": null,
"fromAddress": "0xdc75e8c3ae765d8947adbc6698a2403a6141d439",
"fromAddress": "0xdC75e8c3aE765D8947aDBC6698a2403A6141D439",
"gasPaid": "0.000219745001845858",
"gasUsed": "87898",
"interactedAddresses": [
Expand Down Expand Up @@ -114,7 +114,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1692349644,
"toAddress": "0xc3e4214dd442136079df06bb2529bae276d37564",
"toAddress": "0xC3E4214dd442136079dF06bb2529Bae276d37564",
"traceCalls": [],
"transfers": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"contractType": "ERC721",
"effectiveGasPrice": "1500000028",
"errors": null,
"fromAddress": "0x6951ae195690e95e9f3eafadbe241ac19ef263e4",
"fromAddress": "0x6951AE195690E95E9f3eAfadBe241ac19Ef263E4",
"gasPaid": "0.000127456502379188",
"gasUsed": "84971",
"interactedAddresses": [
Expand Down Expand Up @@ -114,7 +114,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1692347904,
"toAddress": "0xc3e4214dd442136079df06bb2529bae276d37564",
"toAddress": "0xC3E4214dd442136079dF06bb2529Bae276d37564",
"traceCalls": [],
"transfers": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"contractType": "ERC1155",
"effectiveGasPrice": "1500000008",
"errors": null,
"fromAddress": "0xbdddd277583dcae0b501046ba86714feea71b03f",
"fromAddress": "0xBdDDd277583DCaE0B501046ba86714FEea71B03F",
"gasPaid": "0.000261153001392816",
"gasUsed": "174102",
"interactedAddresses": [
Expand Down Expand Up @@ -199,7 +199,7 @@
"nativeValueSent": "3000000000000000000",
"reverted": false,
"timestamp": 1693789380,
"toAddress": "0x4bed3ae022fd201ab7185a9bc80cb8bf9819bb80",
"toAddress": "0x4BED3aE022FD201AB7185a9BC80cB8Bf9819bb80",
"traceCalls": [
{
"from": "0x4bed3ae022fd201ab7185a9bc80cb8bf9819bb80",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "1500000012",
"errors": null,
"fromAddress": "0x607e064d6d9dc45d4109b835b915d9c75780103e",
"fromAddress": "0x607E064d6D9DC45D4109b835B915d9c75780103e",
"gasPaid": "0.00027312000218496",
"gasUsed": "182080",
"interactedAddresses": [
Expand Down Expand Up @@ -290,7 +290,7 @@
"nativeValueSent": "1000000000000000000",
"reverted": false,
"timestamp": 1693726392,
"toAddress": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
"toAddress": "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
"traceCalls": [
{
"from": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"contractType": "ERC721",
"effectiveGasPrice": "1500000010",
"errors": null,
"fromAddress": "0x63c640de6f9963a90afdfa64fd44ee97e2169a18",
"fromAddress": "0x63c640dE6f9963A90AFdFa64fD44Ee97e2169a18",
"gasPaid": "0.00043732950291553",
"gasUsed": "291553",
"interactedAddresses": [
Expand Down Expand Up @@ -91,7 +91,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1692818604,
"toAddress": "0xc3e4214dd442136079df06bb2529bae276d37564",
"toAddress": "0xC3E4214dd442136079dF06bb2529Bae276d37564",
"traceCalls": [],
"transfers": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
"contractType": "ERC1155",
"effectiveGasPrice": "1500000008",
"errors": null,
"fromAddress": "0xbdddd277583dcae0b501046ba86714feea71b03f",
"fromAddress": "0xBdDDd277583DCaE0B501046ba86714FEea71B03F",
"gasPaid": "0.00295564501576344",
"gasUsed": "1970430",
"interactedAddresses": [
Expand Down Expand Up @@ -1775,7 +1775,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1693790700,
"toAddress": "0x4bed3ae022fd201ab7185a9bc80cb8bf9819bb80",
"toAddress": "0x4BED3aE022FD201AB7185a9BC80cB8Bf9819bb80",
"traceCalls": [
{
"from": "0x4bed3ae022fd201ab7185a9bc80cb8bf9819bb80",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "13465408617",
"errors": null,
"fromAddress": "0x22b81a596d3a1f727801bac52fc1b6c258765f48",
"fromAddress": "0x22b81A596d3A1f727801bac52FC1B6c258765f48",
"gasPaid": "0.004282336575421425",
"gasUsed": "318025",
"interactedAddresses": [
Expand Down Expand Up @@ -695,7 +695,7 @@
"nativeValueSent": "285000000000000000",
"reverted": false,
"timestamp": 1713106571,
"toAddress": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
"toAddress": "0xb2ecfE4E4D61f8790bbb9DE2D1259B9e2410CEA5",
"traceCalls": [
{
"from": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "136945022825",
"errors": null,
"fromAddress": "0x44f356e8716575f2a713a3d91ae4ed1c7c054a90",
"fromAddress": "0x44f356E8716575f2a713A3D91Ae4ed1c7c054A90",
"gasPaid": "0.01719618651613525",
"gasUsed": "125570",
"interactedAddresses": [
Expand Down Expand Up @@ -221,7 +221,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1688483352,
"toAddress": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
"toAddress": "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
"traceCalls": [
{
"from": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "12228644719",
"errors": null,
"fromAddress": "0x691c975c857182e67ab227e2cb4ffc4daba15654",
"fromAddress": "0x691c975C857182e67Ab227E2cb4fFc4dAba15654",
"gasPaid": "0.0023637970241827",
"gasUsed": "193300",
"interactedAddresses": [
Expand Down Expand Up @@ -572,7 +572,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1728222767,
"toAddress": "0xbd4b515ed602792497364de7c306659297378fae",
"toAddress": "0xBd4b515Ed602792497364De7C306659297378FAe",
"traceCalls": [
{
"from": "0xbd4b515ed602792497364de7c306659297378fae",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"contractType": "ERC1155",
"effectiveGasPrice": "1386",
"errors": null,
"fromAddress": "0x75dd23ba3ba67f9663cbf6f9bdc7ab4923dd91d7",
"fromAddress": "0x75dD23ba3BA67f9663CbF6F9bdc7aB4923dD91D7",
"gasPaid": "0.00000000009225909",
"gasUsed": "66565",
"interactedAddresses": [
Expand Down Expand Up @@ -81,7 +81,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1693791180,
"toAddress": "0x4bed3ae022fd201ab7185a9bc80cb8bf9819bb80",
"toAddress": "0x4BED3aE022FD201AB7185a9BC80cB8Bf9819bb80",
"traceCalls": [
{
"from": "0x4bed3ae022fd201ab7185a9bc80cb8bf9819bb80",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"contractType": "ERC20",
"effectiveGasPrice": "13538434193",
"errors": null,
"fromAddress": "0x79e105407826df488c0e715372fc858b8fcf8ee3",
"fromAddress": "0x79e105407826Df488c0E715372Fc858B8fcf8EE3",
"gasPaid": "0.01105859920186819",
"gasUsed": "816830",
"interactedAddresses": [
Expand Down Expand Up @@ -1604,7 +1604,7 @@
"nativeValueSent": "0",
"reverted": false,
"timestamp": 1712476775,
"toAddress": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
"toAddress": "0xb2ecfE4E4D61f8790bbb9DE2D1259B9e2410CEA5",
"traceCalls": [
{
"from": "0xb2ecfe4e4d61f8790bbb9de2d1259b9e2410cea5",
Expand Down
Loading

0 comments on commit dc5643e

Please sign in to comment.