How to use @truffle/decoder outside truffle project? #5302
Replies: 1 comment 3 replies
-
Hey! Thanks for reaching out about this! Two things:
Apologies about not having good documentation for using @truffle/decoder outside of Truffle contexts... we will certainly have to remedy this soon (and maybe even build handy Hardhat/Foundry shims!), but until then, perhaps this can be a starting point for you. But first, a direct answer: @truffle/decoder needs a Example transaction decoding with @truffle/fetch-and-compileThe following demonstrates how to decode transactions (calldata and events) for verified contracts on public networks. I'll split things up into helper functions + one main Take a look to see what this will give you (approximately): 🖼️ Screenshot of this example decoding a complex transaction.Anyway, I'll start with the entrypoint and then list the helper functions: Entrypoint (
|
Beta Was this translation helpful? Give feedback.
-
I want to decode state variables by using truffle decoder, but am stuck for construction of decoder.
In the documentation, it shows I must use artifacts to import contract artifacts.
"artifacts" seems to be a global value injected by truffle runtime. Is there a way to get artifacts without truffle runtime? Or, where is "artifacts" available besides in migration and testing scripts?
I need help please.
Beta Was this translation helpful? Give feedback.
All reactions