Consensys / Consensys/abi-decoder

exception when decoding receipt logs of some transaction

Open
#27 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
641
Forks
215
PR merge metrics
No merged PRs in 30d

Description

transaction:0x7834632fb74e671317e87551c5969dcf117efaf00c1f16c4e5d66419715e3b37

when decoding the transaction above, got the exception, most other transactions is ok.

```
const abiDecoder = require('abi-decoder');
abiDecoder.addABI(config.get('ERC20-abi'));
let batch = web3.createBatch();
batch.add(web3.eth.getTransactionReceipt.request('0x7834632fb74e671317e87551c5969dcf117efaf00c1f16c4e5d66419715e3b37', receiveTransactionReceipt));
batch.execute();

function receiveTransactionReceipt(err, receipt) {
const decodedLogs = abiDecoder.decodeLogs(receipt.logs);
console.log(decodedLogs);
}

```

```
TypeError: Cannot read property 'slice' of undefined
at /data/ethereum/wallet_server/node_modules/abi-decoder/index.js:112:40
at Array.map ()
at Object._decodeLogs [as decodeLogs] (/data/ethereum/wallet_server/node_modules/abi-decoder/index.js:111:15)
at Object.receiveTransactionReceipt [as callback] (/data/ethereum/wallet_server/ether_scan/ether-scan-test.js:218:36)
at /data/ethereum/wallet_server/node_modules/web3/lib/web3/batch.js:59:33
at Array.forEach ()
at /data/ethereum/wallet_server/node_modules/web3/lib/web3/batch.js:52:12
at /data/ethereum/wallet_server/node_modules/web3/lib/web3/requestmanager.js:116:9
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with decodeLogs in index.js around lines 111-112 and reproduce the failure using transaction 0x7834632fb74e671317e87551c5969dcf117efaf00c1f16c4e5d66419715e3b37 and its receipt.logs. Trace which log value is undefined before slice is called; done means this receipt no longer throws while decoding and existing transaction decoding continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.