-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v5 hex data is odd-length #614
Comments
Yes, v5 has it built into the It is not safe to automatically pad; I've had several polls giving a developer the question of things like what do you expect 0x123 to be padded to, and it is about 60/40 split between 0x0123 and 0x1230, which is fair, since the first is how padding would work if the data were a numeric and the latter is how padding would work for a bytes. Anything that enforces the even data length in ethers are places where there should never be odd-length hex strings anyways. How are you getting an odd-length transaction or data? This seems to me there is likely something incredible dangerous is happening, for example, manually computing the data and not padding it, which will almost certainly lead to invalid data... I'm super curious what web3 code leads to this error, because that error should basically never show up... :s |
BN.js output 123 for This mostly happen for values and gasLimit. I agree that it is dangerous to screw up there :) |
Hmmm... Actually, you have convinced me... For I'll make those changes soon. |
This has been published and in the wild for a bit now, but please feel free to re-open if you have any more issues. Thanks! :) |
Hey, when switching from v4 to v5 and also coming from web3 to v5,I keep encounterring issues with "hex data is odd-length"
I guess ethers.js decided to be more strict to avoid issues? Would like to know more the reasoning behind it
But could the entry points like sentTransaction and contract methods be more lenient ? Like it would pad the data automatically ?
The text was updated successfully, but these errors were encountered: