Skip to content

Conversation

zguesmi
Copy link
Member

@zguesmi zguesmi commented Jul 22, 2025

Steps:

  • Migrate src files (minimal changes)
  • Modify receive and fallback behavior in Diamond.sol
  • Rename all 1538 to 2535
  • Rename Module to Facet in contracts names
  • Update all facets to use namespaces app storage.
  • Remove ENSIntegration modules/functions
  • Update docs (soldoc, diagrams, ...)

All tests are ✔️ except the ones for receive and fallback, which will be fixed in the next PR

image

@zguesmi zguesmi changed the title Migrate contracts to Diamond pattern Migrate contracts to Diamond pattern - Part1 Jul 23, 2025
@zguesmi zguesmi marked this pull request as ready for review July 23, 2025 15:37
@zguesmi zguesmi self-assigned this Jul 23, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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": {

Copy link
Contributor

@Le-Caignec Le-Caignec left a comment

Choose a reason for hiding this comment

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

LGTM

@zguesmi
Copy link
Member Author

zguesmi commented Jul 24, 2025

Merging even though CI is failing.
(1) This is an intermediate branch and (2) it will be fixed in the next PR.

@zguesmi zguesmi merged commit fe356a3 into feature/diamond Jul 24, 2025
1 check failed
@zguesmi zguesmi deleted the feature/diamond-migration-src branch July 24, 2025 11:07
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.

3 participants