Comments (7)
Hi @krzkaczor !
22 is actually 34 in hex. Not sure where that 33 is coming from but the number seems correct? in etherscan is also displayed as 22
from abi-decoder.
@denisgranha thanks for the quick response! Yeah sorry, I meant 34 DEC
anyway, the response that I am getting from the lib is totally different.
I pinned point the issue to BN.JS - the version that I have in my project incorrectly parses hex strings starting with 0x
.
Are you able to confirm that it works for you?
I am gonna push the whole repository with repro in a sec.
from abi-decoder.
Its ready here: https://github.com/krzkaczor/abi-decoder-bug-repro
from abi-decoder.
Hi @krzkaczor I was able to reproduce the bug, thank you for the report.
Will fix it soon
from abi-decoder.
My dummy fix would be to use this function to create BN instances rather than doing it directly:
function createBN(number) {
// ensure to remove leading 0x for hex numbers
if (typeof number === 'string' && number.startsWith("0x")) {
number = number.slice(2);
}
return new BN(number);
}
from abi-decoder.
Thanks for quick fix! @denisgranha
Note: there are other calls to BN
constuctor, do you think they are fine?
from abi-decoder.
Turns out that it still doesnt work correctly. My PR fixes it.
Stranger, if you're looking for a fix just use my fork.
from abi-decoder.
Related Issues (20)
- i am getting "Invalid character" error for some transaction hashes
- "Invalid character" error in indexed event
- UnhandledPromiseRejectionWarning: TypeError: _.toLowerCase is not a function HOT 1
- Cannot decode tx data HOT 4
- Can't decode events/logs and can't fetch past events HOT 1
- How to use this library with svelte
- decodeLogs not work for event logs with struct parameter HOT 4
- Decode Transaction Input from ABI without knowing which function
- the abi-decoder.js is missing HOT 4
- Out of memory in decode: HOT 3
- npm install doesn't work
- data out-of-bounds error HOT 1
- Where is located abi-decoder.js ? HOT 1
- _decodeLogs error on parsing hex topics
- decodeLogs don't work with uint256 tokenId HOT 10
- decoding abi HOT 1
- Receiving undefined decode input from transacation HOT 2
- How to decode the contract function name and parameters from a Polygon transaction?
- Get error logs when tried to decode the following Input for Uniswap-v2 function
- Wrong ABI method IDs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abi-decoder.