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/use modular account libs #166

Merged
merged 6 commits into from
May 13, 2024
Merged

Conversation

Zer0dot
Copy link
Contributor

@Zer0dot Zer0dot commented May 10, 2024

Motivation

This PR adds the modular-account-libs node dependency to the project, and shifts common imports to instead import from the newly added dependency, removing redundant files in the process.

This is part of an effort to consolidate dependencies into a shared source, reducing fragmentation across the modular account ecosystem.

Solution

Removes files and tests for libraries that are now imported from the dependency. These files were diff'd, and are functionally identical to the files already present in modular-account-libs, apart from the FunctionReferenceLib which had slightly more functionality included in the modular-account version.

This functionality was extracted to a new, simple library FunctionReferenceHelpers, but I wouldn't be averse to moving them over to another file if needed. (They're only used once, so we could consider inlining them as well)

TODO

  • Group imports by source (optional, makes import blocks more readable, i.e. Put all modular-account-libs imports in a sequence.)

  • Move the LLSLRepro.t.sol file to the modular-account-libs repo (optional, but it's the only file which imports tests, and is limited in scope to files contained in the modular-account-libs repo)

@Zer0dot Zer0dot marked this pull request as ready for review May 10, 2024 18:30
@Zer0dot Zer0dot requested a review from a team May 10, 2024 18:30
Copy link
Contributor

@adamegyed adamegyed left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for handling some of the more tedious parts of migration.

Long-term, I think we should also migrate our other git submodule dependencies (forge-std, light-account, the OZ contracts) over to NPM packages as well, but we can tackle that in a later PR.

@Zer0dot Zer0dot merged commit c81e712 into develop May 13, 2024
3 checks passed
@Zer0dot Zer0dot deleted the refactor/use-modular-account-libs branch May 13, 2024 10:40
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