Minimal EIP-2535-style Diamond that supports only adding facets (no replace/remove yet), plus a native-token staking facet that uses a dedicated storage slot.
- Diamond proxy:
src/Diamond.sol - DiamondCut interface:
src/interfaces/IDiamondCut.sol - Add-only diamond logic:
src/libraries/LibDiamond.sol - DiamondCut facet:
src/facets/DiamondCutFacet.sol - Staking storage:
src/libraries/LibStaking.sol - Staking facet:
src/facets/StakingFacet.sol
test/StakingFacetDiamond.t.soldeploys the diamond, addsStakingFacetviadiamondCut(Add), then stakes/withdraws through the diamond address.
forge build
forge test