feat: move custom errors from libraries to interfaces for external accessibility (#57)#84
Conversation
|
@ogazboiz Thanks for doing this work. I do appreciate it. Look at this comment: #57 (comment) It says this:
Please remove any use of interfaces and put all the interfaces into the directory here: |
alright i am doing that |
…e per reviewer feedback
|
I've implemented your feedback. All interface files are now in src/interfaces/ directory and I've removed all interface imports and usage from contracts and libraries. The interfaces are now standalone files for external users only, while all internal code uses local error definitions. @mudgen |
|
@ogazboiz Good job. Merged. |
|
i am really happy to contrbute Hi, I see the contributor shows as "ogazboizz" but that should be "ogazboiz" (my personal account that pushed the code). Could you correct the contributor attribution? The code was developed and pushed from my personal GitHub account. @mudgen can you help me with that? |
|
Yes, sorry about that. Do you mean in the comment I left? Or somewhere else? |
Hi @mudgen! I'm looking at the contributor section and it shows "ogazboizz" as the contributor, but that's not my account. It should show "ogazboiz" (my personal GitHub account that I used to develop and push the code). Could you update the contributor attribution? Thanks for letting me contribute to this awesome project! |
|
@ogazboiz Yes, I see. This is a weird thing that Github used the wrong username. Right now I don't see how to change this. Do you know how to change this? |
|
Hi @mudgen! Thanks for offering to help fix this! My personal email associated with my @ogazboiz account is: ogazboizakpolo@gmail.com I've also created a follow-up PR #86 that addresses the attribution issue. The new PR adds author attribution to all interface files and will show the correct @ogazboiz account since I've fixed my Git configuration. You can either use the email to update the existing commits, or check out PR #86 for the proper attribution going forward. |
|
@ogazboiz
This way your correct account should show up in the contributors section and show what you have done. |
|
alright @mudgen or you can just merge my follow up pr |
No, I won't do that. We are not currently attributing authors like that, and I want the code to remain consistent. If contributors want better attribution or credit then we will figure out a consistent way to do that. |
no problem sir. |
|
It is done. Ready for your new PR. |
i have created a pr #89 |
…rors-to-interfaces feat: move custom errors from libraries to interfaces for external accessibility (Perfect-Abstractions#57)
This PR moves custom errors from internal libraries to public interfaces. External users can now access these errors directly.
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. Updated libraries and facets to import errors from interfaces instead of defining them locally.
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 import interface errors
• Updated all facets to import interface errors
• Fixed import paths for proper compilation
Benefits:
• External users get direct access to custom errors
• UI developers have canonical error definitions
• Follows industry standard of declaring errors in interfaces
• Maintains full backward compatibility
• All tests pass
Technical Details:
Error references now use format
IERC20.ERC20InsufficientBalance(...)instead ofERC20InsufficientBalance(...). All files compile successfully with no breaking changes.