Skip to content

Conversation

@lumoswiz
Copy link
Collaborator

@lumoswiz lumoswiz commented Jan 5, 2026

Summary

Recent changes to the ERC-20 facets (splitting up of transfer/metadata) broke test harness imports, this PR fixes them.

In future PRs that approach the test refactor, we will be using harnesses sparingly in favour of storage util libs. I sought to make minimal changes here to get existing tests to compile.

Changes Made

  • Created new harnesses for split ERC-20 facets:
    • ERC20MetadataFacetHarness - minimal harness with initialize() only
    • ERC20TransferFacetHarness - harness with mint() helper
    • Updated ERC20BurnFacetHarness to use ERC20TransferStorage
    • Removed obsolete references to deleted ERC20Facet
    • Updated existing tests to work with new harness structure
    • Fixed script imports by removing ERC20Facet

Checklist

Before submitting this PR, please ensure:

  • Code follows the Solidity feature ban - No inheritance, constructors, modifiers, public/private variables, external library functions, using for directives, or selfdestruct

  • Code follows Design Principles - Readable, uses diamond storage, favors composition over inheritance

  • Code matches the codebase style - Consistent formatting, documentation, and patterns (e.g. ERC20Facet.sol)

  • Code is formatted with forge fmt

  • Existing tests pass - Run tests to be sure existing tests pass.

  • New tests are optional - If you don't provide tests for new functionality or changes then please create a new issue so this can be assigned to someone.

  • All tests pass - Run forge test and ensure everything works

  • Documentation updated - If applicable, update relevant documentation

@netlify
Copy link

netlify bot commented Jan 5, 2026

👷 Deploy request for compose-diamonds pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 5022cee

@mudgen
Copy link
Contributor

mudgen commented Jan 5, 2026

@lumoswiz Great to see this. Once you feel your code is ready, please merge it. I trust you.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Coverage Report

Coverage

Metric Coverage Details
Lines 71% 1121/1583 lines
Functions 83% 283/342 functions
Branches 51% 114/225 branches

Last updated: Mon, 05 Jan 2026 18:13:17 GMT for commit 5022cee

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Gas Report

No gas usage changes detected between main and test/fix-erc20-harnesses.

All functions maintain the same gas costs. ✅

Last updated: Mon, 05 Jan 2026 18:13:25 GMT for commit 5022cee

@lumoswiz lumoswiz marked this pull request as ready for review January 5, 2026 18:14
@lumoswiz lumoswiz merged commit cf659c2 into Perfect-Abstractions:main Jan 5, 2026
5 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.

2 participants