feat: move custom errors from libraries to interfaces for external accessibility (#57)#89
Merged
mudgen merged 5 commits intoOct 22, 2025
Conversation
Contributor
|
I am sorry, we are not using the |
Contributor
Author
|
I will remove that instead I thought I removed that |
Contributor
|
Thanks! |
Contributor
Author
|
@mudgen i have remove that |
Contributor
|
@ogazboiz I see that your commits show up in the contributors section now. That's great. |
JackieXu
pushed a commit
to JackieXu/Compose
that referenced
this pull request
Nov 6, 2025
…rors-to-interfaces feat: move custom errors from libraries to interfaces for external accessibility (Perfect-Abstractions#57)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves custom errors from internal libraries to public interfaces, making them accessible to external users.
Fixes #57
Problem:
Custom errors were buried in libraries. UI developers had no canonical access to these errors. They had to reimplement errors elsewhere, introducing inconsistencies and making Compose adoption difficult.
Solution:
Created interface files with all custom errors in src/interfaces/ directory. Updated libraries and facets to use local error definitions instead of importing from interfaces.
Changes:
• Created IERC20.sol with all ERC20 custom errors
• Created IERC721.sol with all ERC721 custom errors
• Created IERC721Enumerable.sol with all ERC721Enumerable custom errors
• Created IERC173.sol with all ERC173 custom errors
• Updated all libraries to use local error definitions
• Updated all facets to use local error definitions
• Added proper author attribution to all interface files
Benefits:
• External users get direct access to custom errors via interfaces
• UI developers have canonical error definitions
• Follows industry standard of declaring errors in interfaces
• Maintains full backward compatibility
• All tests pass
Technical Details:
All error references use the original format (e.g., ERC20InsufficientBalance(...)). Interface files are standalone for external users only. All internal code uses local error definitions.
cc: @mudgen