Consensys / Consensys/abi-decoder
decodeLogs don't work with uint256 tokenId
- Dominant language
- JavaScript
- Stars
- 641
- Forks
- 215
- PR merge metrics
- No merged PRs in 30d
Description
So i was trying to decode some transactions and got this error :
```
(node:17304) UnhandledPromiseRejectionWarning: Error: Invalid character
at assert (C:\Users\XX\Documents\DEV\EtherScan\node_modules\bn.js\lib\bn.js:6:21)
at parseBase (C:\Users\XX\Documents\DEV\EtherScan\node_modules\bn.js\lib\bn.js:274:7)
at BN._parseBase (C:\Users\XX\Documents\DEV\EtherScan\node_modules\bn.js\lib\bn.js:298:14)
at BN.init [as _init] (C:\Users\XX\Documents\DEV\EtherScan\node_modules\bn.js\lib\bn.js:105:14)
at new BN (C:\Users\XX\Documents\DEV\EtherScan\node_modules\bn.js\lib\bn.js:39:12)
at new BNwrapped (C:\Users\XX\Documents\DEV\EtherScan\node_modules\web3-utils\lib\utils.js:480:16)
at C:\Users\XX\Documents\DEV\EtherScan\node_modules\abi-decoder\index.js:190:30
at Array.map ()
at C:\Users\XX\Documents\DEV\EtherScan\node_modules\abi-decoder\index.js:157:21
at Array.map ()
```
after some search the cause was this event :
```json
{
"name": "tokenId",
"type": "uint256",
"value": "0xfe4c845b279619589d6c4c444cc9f5d7a5d1d86aec7cb7083fcd58b57cd9b652"
}
```
i have other tokenId who fail too.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the decodeLogs entry point and reproduce the failure with the reported uint256 tokenId value from the event. Trace the decoding path associated with the BN.js stack trace; done means transactions containing these token IDs decode without the Invalid character error, with a regression test for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100