Skip to content

feat(erc2535): Diamonds multi-facet proxy with loupe and tests#1

Merged
jose-compu merged 2 commits intomainfrom
feature/erc2535-diamonds
Mar 5, 2026
Merged

feat(erc2535): Diamonds multi-facet proxy with loupe and tests#1
jose-compu merged 2 commits intomainfrom
feature/erc2535-diamonds

Conversation

@jose-compu
Copy link
Copy Markdown
Owner

Description:

Implements EIP-2535 Diamonds: a single proxy contract that delegates to multiple facet contracts via a selector→facet mapping.

  • Interfaces: IDiamond (FacetCut, DiamondCut event), IDiamondCut (diamondCut), IDiamondLoupe (facets, facetFunctionSelectors, facetAddresses, facetAddress).
  • LibDiamond: ERC-7201 namespaced storage, add/replace/remove facets, only-owner checks, init delegatecall. Custom errors for invalid cuts and init revert.
  • Diamond.sol: Proxy with immutable loupe + diamondCut (no storage for those selectors); fallback delegatecall; _rejectImmutableRemoval blocks removal of loupe/cut selectors.
  • Tests: 19 tests (loupe, add/replace/remove, only-owner, duplicate selector, replace selector-not-found, remove immutable revert, constructor with initial facets, receive ETH, diamondCut with init, fuzz for setValue/getValue and add).

ROADMAP and README updated for ERC-2535.

@jose-compu jose-compu self-assigned this Mar 5, 2026
@jose-compu jose-compu merged commit dcdfccc into main Mar 5, 2026
2 checks passed
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.

1 participant