Request to Extend simulateContract
Functionality to Include Event Emissions
#2464
Unanswered
alessandroaw
asked this question in
Idea / Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I frequently use the
simulateContract
method in Viem for simulating contract executions, which currently provides either a revert reason or the contract's return value upon simulation. This functionality is invaluable; however, it is limited when dealing with write operations that do not return values but instead emit events (which often happened to save gas).Typically, to capture these event emissions, I switch to using the Alchemy Simulation API. While effective, this workaround is not ideal—it requires using Alchemy's RPC and adjusting the API URL for each supported network.
Would it be possible to enhance the
simulateContract
method to include event emissions in the simulation results? This enhancement would not only streamline development workflows but also eliminate the need for external API dependencies.Relevant documentation can be found here:
simulateContract
documentationsimulateExecution
referenceLooking forward to your thoughts on this potential improvement.
Thank you for considering this enhancement.
Beta Was this translation helpful? Give feedback.
All reactions