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

Add clearer messaging around the risks of overwriting _getNonce #70

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions script/universal/MultisigBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ abstract contract MultisigBase is Simulator {

// Virtual method which can be overwritten
// Default logic here is vestigial for backwards compatibility
// IMPORTANT: this method is used in the sign, simulate, AND execution contexts
// If you override it, ensure that the behavior is correct for all contexts
// As an example, if you are pre-signing a message that needs safe.nonce+1 (before safe.nonce is executed),
// you should explicitly set the nonce value with an env var.
// Overwriting this method with safe.nonce + 1 will cause issues upon execution because the transaction
// hash will differ from the one signed.
function _getNonce(IGnosisSafe safe) internal view virtual returns (uint256 nonce) {
nonce = safe.nonce();
console.log("Safe current nonce:", nonce);
Expand Down