Decode constructor call data #3714
Unanswered
sebastiantf
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You cannot parse the constructor arguments from a transactions calldata, because the initcode has been prepended to it, and without know the length of that data, you would not know where to begin decoding. There are heuristics, based on solidity metadata, but that is outside the scope of ethers, since different versions of solidity uses slightly different formats and not all contracts are compiled from solidity, so there is no gerneralized way to solve that. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Feature
I was looking for an API that lets you decode the constructor args, provided the construction txn hash, or the txn calldata.
This could either be separate function on Contract / Interface, or made doable using
decodeFunctionData()
Apologies if I may have missed something that already allows to do this
Code Example
Beta Was this translation helpful? Give feedback.
All reactions