Open brunomenezes opened 5 months ago
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. For devnet it won't work. That's ok.
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.
AFAIK WhatsABI can fetch from etherscan and sourceify automatically. For devnet it won't work. That's ok.
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 autoload()
it will use both even though the EtherScan loader needs an API key, so it will actually rely only on sourcify in that case. I don't see it as a problem for now, but I think defining them for EtherScan sake is better so the baseUrl can also be changed based on chain-id Etherscan endpoints
π 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
)