-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(cheatcodes
): add way to access the broadcasted transactions hashes inside of the current forge script
run
#9083
Comments
forge script
forge script
): add ability to access the broadcasted transactions hashes inside of the current forge script
run
Hi @CodeSandwich thanks for your suggestion I think this can be resolved by implementing the cheatcodes outlined in #4732 Marking in favor of that ticket, let me know if this is not accurate |
Hi @zerosnacks, |
I see, would it be solved if there was a cheatcode that would return additional information ( A broadcast log looks like:
From which we could extract the transaction hashes, etc.. If so, I still think we can expand the scope of #4732 to include this request |
Yes, Is there a need for the I don't think that it would be a viable alternative to #4732 though, these reports have limited usability when it comes to getting the deployed contracts. They only work if the script deploys a contract directly, as in |
forge script
): add ability to access the broadcasted transactions hashes inside of the current forge script
runcheatcodes
): add vm.getBroadcast
to access the broadcasted transactions hashes inside of the current forge script
run
Re-opening as it is significantly different from #4732 and possibly requires a different approach. You make a good point regarding indirection. This requires some further exploration in regards to how much context a cheatcode can have in regards to transaction hashes as, to my knowledge, the transactions are collected in order and then executed at the end of the run. |
cheatcodes
): add vm.getBroadcast
to access the broadcasted transactions hashes inside of the current forge script
runcheatcodes
): add way to access the broadcasted transactions hashes inside of the current forge script
run
Also related: #3589, can imagine another version that does not wait for the receipt |
Good catch, I think that this issue may be a duplicate of #3589. I'm not sure if |
Component
Forge
Describe the feature you would like
Currently transactions made with
vm.broadcast
are built, signed and stored in the JSON report byforge script
, but they can't be accessed from the inside of the script itself. It would be great if the list of the hashes of the broadcasted transactions could be somehow obtained.Additional context
Personally I would use it to document the operations made by the script. The current behavior of printing to STDOUT a message including the path to the transactions JSON makes automation rather difficult as it requires parsing the output and running custom tools after the script finishes.
The text was updated successfully, but these errors were encountered: