Consensys / Consensys/abi-decoder

decoding receipt.logs undefined

Open
#46 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
641
Forks
215
PR merge metrics
No merged PRs in 30d

Description

Hi, I try to use abidDecoder.decodeLogs(), but not working
the code is :
```javascript
web3.eth.getTransactionReceipt('0x3ceff5f69a3e7440bccc226cc6f860b0bde81d05440c676c8bbf0c0f19585bd4', function(e,receipt){
console.log('receipt', receipt);
console.log('receipt log', receipt.logs);
const decodedLogs = abiDecoder.decodeLogs(receipt.logs);
console.log('decodedLogs',decodedLogs);
})
```

And I got the output `receipt { blockHash: '0xc581cd0cd611d70119e10b5e472c4935a31c1bf035e251552df8357b44721206',
blockNumber: 96803,
contractAddress: null,
cumulativeGasUsed: 75490,
from: '0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98',
gasUsed: 32878,
logs:
[ { address: '0xCAc7000C7dBaa2E33Af15325AF5D435E011C7BdD',
topics: [Array],
data: '0x00000000000000000000000000000000000000000000000022359c267290d800',
blockNumber: 96803,
transactionHash: '0x3ceff5f69a3e7440bccc226cc6f860b0bde81d05440c676c8bbf0c0f19585bd4',
transactionIndex: 2,
blockHash: '0xc581cd0cd611d70119e10b5e472c4935a31c1bf035e251552df8357b44721206',
logIndex: 0,
removed: false,
id: 'log_943b1cf8' } ],
logsBloom: '0x00000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000200000000000000000000080000000000000000000000000040000000000000000000000030000000001000000001000000000000',
root: '0xa3f6d0955c6918bdb800c7b8e2bbc224e7e0c7d0938d82dc819fa1cb7c469bcf',
to: '0xcac7000c7dbaa2e33af15325af5d435e011c7bdd',
transactionHash: '0x3ceff5f69a3e7440bccc226cc6f860b0bde81d05440c676c8bbf0c0f19585bd4',
transactionIndex: 2 }
receipt log [ { address: '0xCAc7000C7dBaa2E33Af15325AF5D435E011C7BdD',
topics:
[ '0x4c13017ee95afc4bbd8a701dd9fbc9733f1f09f5a1b5438b5b9abd48e4c92d78',
'0x4249545452455830300000000000000000000000000000000000000000000000',
'0x000000000000000000000000725f637bf6266b62d8a4b8f9ec4e6e346d34998d' ],
data: '0x00000000000000000000000000000000000000000000000022359c267290d800',
blockNumber: 96803,
transactionHash: '0x3ceff5f69a3e7440bccc226cc6f860b0bde81d05440c676c8bbf0c0f19585bd4',
transactionIndex: 2,
blockHash: '0xc581cd0cd611d70119e10b5e472c4935a31c1bf035e251552df8357b44721206',
logIndex: 0,
removed: false,
id: 'log_943b1cf8' } ]
decodedLogs [ undefined ]`

I got the right transaction receipt but the abiDecoder.decodeMethod() returns undefined. What's the problem? Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.