-
Notifications
You must be signed in to change notification settings - Fork 44
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
Suggestions for #140 #145
Suggestions for #140 #145
Conversation
nategraf
commented
Jun 7, 2024
- rename DeployEstopVerifier and change vm.startBroadcast() and vm.broadcast()
- move common functions to base contract
- simulate scheduled calls to avoid finding out they'll fail later
- add a codeblock language
- add --broadcast flag
- fix simulation, error on unset env var
@intoverflow feel free to press the merge button if these suggestions look good to you. |
/// @notice Simulates a call to check if it will succeed, given the current EVM state. | ||
function simulate(address dest, bytes memory data) internal { | ||
uint256 snapshot = vm.snapshot(); | ||
vm.prank(address(timelockController())); | ||
(bool success,) = dest.call(data); | ||
require(success, "simulation of transaction to schedule failed"); | ||
vm.revertTo(snapshot); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant
This is terrific. I've tested the entire flow against Anvil and it works as advertised. I've also confirmed that every scheduled update gets simulated (using vm.prank()) before being scheduled, and that the |