-
There is no error thrown when requesting ethers to decode this ABI type: a = ethers.AbiCoder.defaultAbiCoder().decode(["address"], "0xb47b2fb10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000964ec5e2e3419c4cc", true)
> Proxy [
Result(1) [
value exceeds width (20 bytes) (operation="toBeHex", fault="overflow", value=81633964087944550421898347516412261609448132923240477519941993112300444188672, code=NUMERIC_FAULT, version=6.15.0)
],
{ get: [Function: get] }
] The variable
How can I use the ABI decoder without deferring these errors? I would like the error to be thrown during the original call to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can call the The main reason for the deferred API is that there is a lot of bad data (from old broken encoders and from some protocols trying to hijack weird parts of the ABI coding), so it is important for most people to still be able to access things "around" the bad chunks. Let me know though if you have any more issues. :) |
Beta Was this translation helpful? Give feedback.
You can call the
.toArray(true)
method on the Proxy object. It will recursively convert theResult
object into an Array of its values, and if it encounters any error will throw that first error during conversion.The main reason for the deferred API is that there is a lot of bad data (from old broken encoders and from some protocols trying to hijack weird parts of the ABI coding), so it is important for most people to still be able to access things "around" the bad chunks.
Let me know though if you have any more issues. :)