Skip to content

Ensure Inner Simulation Reverts#947

Merged
nlordell merged 3 commits intomainfrom
fix/fallback-simulation
Apr 29, 2025
Merged

Ensure Inner Simulation Reverts#947
nlordell merged 3 commits intomainfrom
fix/fallback-simulation

Conversation

@nlordell
Copy link
Copy Markdown
Collaborator

This PR makes a small modification the simulate function such that it ensures its inner simulateAndRevert reverts as expected. This is to prevent calls to the CompatibilityFallbackHandler from making unexpected state changes when not called by a Safe.

While using the CompatibilityFallbackHandler for something other than a Safe fallback handler is explictely not supported, it makes sense to ensure the inner call inverts and prevent unintended behaviours.

@nlordell nlordell requested a review from a team as a code owner April 15, 2025 09:29
@nlordell nlordell requested review from akshay-ap, mmv08, remedcu and rmeissner and removed request for a team April 15, 2025 09:29
This PR makes a small modification the `simulate` function such that it
ensures its inner `simulateAndRevert` reverts as expected. This is to
prevent calls to the `CompatibilityFallbackHandler` from making
unexpected state changes when not called by a Safe.

While using the `CompatibilityFallbackHandler` for something other than
a Safe fallback handler is explictely not supported, it makes sense to
ensure the inner call inverts and prevent unintended behaviours.
@nlordell nlordell force-pushed the fix/fallback-simulation branch from 733528e to df76532 Compare April 15, 2025 09:30
*/
bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;

bytes4 internal constant SIMULATE_SELECTOR = bytes4(keccak256("simulate(address,bytes)"));
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was unused.

Comment thread contracts/handler/CompatibilityFallbackHandler.sol
@nlordell nlordell merged commit b115c4c into main Apr 29, 2025
33 checks passed
@nlordell nlordell deleted the fix/fallback-simulation branch April 29, 2025 07:52
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants