-
Notifications
You must be signed in to change notification settings - Fork 26
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
Voucher content decoding #156
Comments
Hey @tuler, am I missing anything from our conversation? For that first version, I don't think we need to include the Loaders for Sourcify and/or EtherScan, maybe later? but we need to check how WhatsAbi would work when the Provider added in the setup is fetching data on a dev-net setup. |
AFAIK WhatsABI can fetch from etherscan and sourceify automatically. One possible enhancement, that can be left for another issue, is to allow the user to input the ABI in a Textarea manually, and let the decoding works. That could be used in the devnet scenario. |
When using the |
📄 Context
Given that a voucher has a destination (Address) and the payload (Encoded arguments), we can recover the ABI of this destination address and use it to try to parse the encoded payload (i.e. the input for the destination) for this type of output.
Ref Rollups Contracts: CartesiDApp#executeVoucher
✔️ Solution
We can leverage two tools here. We could experiment with WhatsAbi to retrieve the ABI from an Address (Check the documentation for more details on usage), and then use Viem to decode the
payload
and display it in the Input-details box.input details
the usual encoded payload.Content.tsx
do what it is doing.Content.tsx
to recognise what it is receiving and apply the correct transformation functions. For that option, everything else should still work as expected.PS: The first option is more sensible in the decoding success section above. Given the number of unrelated changes and checks required by the second option. It can be a separate
refactor
issue if necessary.📈 Subtasks
🎯 Definition of Done
Text
,JSON
)The text was updated successfully, but these errors were encountered: