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

Refactor MultisigBuilder and NestedMultisigBuilder #97

Merged
merged 18 commits into from
Oct 22, 2024

Conversation

mdehoog
Copy link
Contributor

@mdehoog mdehoog commented Oct 18, 2024

These script contracts have diverged pretty significantly from each other and were in need of a consistency refactor and cleanup.

This PR:

  • Fixes support for EIP-1271 signatures (by incrementing the signature offsets by any prepended approveHash signatures)
  • Splits out a bunch of complex functions so we can disable viaIR (yay!)
  • Accept IGnosisSafe instead of address where appropriate
  • Cleanup the _getNonce() inconsistencies between the builders
  • No longer calls postCheck from NestedMultisigBuilder.approve (doesn't make sense because this doesn't run the transaction, so we don't expect the postCheck state to change)
  • Split out state/simulation post checks for each step (sign, approve, run), and give them empty implementations making them optional for subclasses to implement
  • Move the console line about submitting the hash to safe.approveHash to printDataToSign, so it works for both
  • Cleanup the state-override implementation, and share it in both
  • Extract safe signature helper methods to separate library
  • Extract Simulator base class to Simulation library
  • Adds some simple tests (and an emit event for the "data to sign")

Note there are some breaking changes, notably:

  • the Simulation* structs are now in a library, so can just be used by inserting a . (e.g. SimulationPayload becomes Simulation.Payload)
  • the override virtual methods have changed (e.g. _addGenericOverrides and _addMultipleGenericOverrides have been merged into a single _simulationOverrides)
  • the _postCheck virtual method no longer accepts the state accesses and the sim payload (these have been moved to the other _post* methods

See the SetGasLimitBuilder.sol updates as an example.

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Oct 18, 2024

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@mdehoog mdehoog force-pushed the michael/eip-1271-support branch 6 times, most recently from e24e192 to eb56fef Compare October 19, 2024 07:08
@mdehoog mdehoog changed the title Fix support for EIP-1271 Refactor MultisigBuilder and NestedMultisigBuilder Oct 20, 2024
@mds1
Copy link
Contributor

mds1 commented Oct 22, 2024

Really excited for the changes listed here! Also glad to see it looks like tests are starting to be added—lack of test coverage definitely made it hard to verify changes worked properly and didn't break things in the past :)

@cb-heimdall
Copy link
Collaborator

Review Error for jackchuma @ 2024-10-22 16:36:27 UTC
User failed mfa authentication, public email is not set on your github profile. see go/mfa-help

Copy link
Contributor

@stevieraykatz stevieraykatz left a comment

Choose a reason for hiding this comment

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

Looks great @mdehoog . TY for doing this!

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.

5 participants