Skip to content
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

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Conversation

nategraf
Copy link
Contributor

@nategraf 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

@nategraf
Copy link
Contributor Author

nategraf commented Jun 7, 2024

@intoverflow feel free to press the merge button if these suggestions look good to you.

Comment on lines +98 to +105
/// @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);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant

@intoverflow
Copy link
Member

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 --broadcast flag works as intended. Very nicely done

@intoverflow intoverflow merged commit 47e96de into tcarstens/deploy Jun 11, 2024
@intoverflow intoverflow deleted the victor/deploy-suggestions branch June 11, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants