-
Notifications
You must be signed in to change notification settings - Fork 14
Migrate contracts to Diamond pattern - Part1 #222
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the contracts from the ERC1538 proxy pattern to the Diamond pattern (EIP-2535) as the first part of a larger refactoring effort. The key changes replace the custom ERC1538 proxy implementation with a standardized Diamond proxy that provides better modularity and upgradability.
- Replace ERC1538 proxy infrastructure with Diamond pattern using @mudgen/diamond-1 library
- Update proxy deployment and linking logic to use Diamond facets instead of ERC1538 modules
- Refactor storage access patterns and ownership management for Diamond compatibility
Reviewed Changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
File | Description |
---|---|
utils/proxy-tools.ts | Updated proxy linking logic to use Diamond facets and function selectors |
deploy/0_deploy.ts | Replaced ERC1538 proxy deployment with Diamond proxy and facets |
contracts/modules/DelegateBase.sol | Refactored base contract to work with Diamond pattern ownership |
contracts/Store.sol | Updated storage contract to remove ERC1538 dependencies |
test files | Updated proxy references and storage slot indices for Diamond pattern |
package.json | Added Diamond pattern dependency and updated comments |
Comments suppressed due to low confidence (2)
package.json:60
- [nitpick] The field name '__dependenciesComments' uses double underscores which is unconventional for package.json. Consider using a more standard naming convention like 'dependenciesComments' or following npm's conventions.
"__dependenciesComments": {
package.json:85
- [nitpick] The field name '__devDependenciesComments' uses double underscores which is unconventional for package.json. Consider using a more standard naming convention.
"__devDependenciesComments": {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merging even though CI is failing. |
Steps:
receive
andfallback
behavior inDiamond.sol
Module
toFacet
in contracts namesAll tests are ✔️ except the ones for
receive
andfallback
, which will be fixed in the next PR