refactor: rename token burn and mint functions for consistency and cl…#288
Merged
maxnorm merged 2 commits intoPerfect-Abstractions:mainfrom Mar 7, 2026
Merged
Conversation
…arity across modules and facets.
👷 Deploy request for compose-diamonds pending review.Visit the deploys page to approve it
|
Contributor
Author
|
Hey @maxnorm , since you flagged the redundant token prefix on the ERC1155 functions, I took a look at the other token standards to see if the same issue existed — and it does. mintERC20, burnERC20, burnERC20From, mintERC721, burnERC721, and burnERC721s all carry the same prefix, while every other function in the repo (approve, transfer, transferFrom, etc.) and the ERC721Enumerable Mods (mint, burn) already use clean names. I've opened a separate PR (fix/redundant-token-prefix) applying the same rename pattern across ERC20 and ERC721. Let me know what you think! |
Collaborator
|
Good catch! Let's make it uniform across the codebase and ensure compatibility with other libraries |
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.
Summary
Removes the redundant token-standard prefix from mint and burn function names across ERC20
and ERC721 Mods and Facets to align with the naming pattern already established throughout
the repo —
approve,transfer,transferFrom,setApprovalForAlland the ERC721Enumerable Mods (
mint,burn) all use clean names without a token-standard prefix.This change makes ERC20 and ERC721 Mint/Burn consistent with the rest of the codebase.
Changes Made
ERC20/Mint/ERC20MintMod.sol— renamedmintERC20→mintERC20/Burn/ERC20BurnMod.sol— renamedburnERC20→burn, added@devnoticeclarifying no approval check
ERC20/Burn/ERC20BurnFacet.sol— renamedburnERC20→burn,burnERC20From→burnFrom, updatedexportSelectorsERC721/Mint/ERC721MintMod.sol— renamedmintERC721→mintERC721/Burn/ERC721BurnMod.sol— renamedburnERC721→burn, added@devnoticeclarifying no approval check
ERC721/Burn/ERC721BurnFacet.sol— renamedburnERC721→burn,burnERC721s→burnBatch, updatedexportSelectorsERC721/Enumerable/Burn/ERC721EnumerableBurnMod.sol— added@devnotice clarifyingno approval check (name was already correct)
test/harnesses/token/ERC20/ERC20BurnModHarness.sol— updated to reflect renamedfunction (test files are exempt from style rules per
STYLE.md)test/harnesses/token/ERC20/ERC20MintModHarness.sol— updated to reflect renamedfunction (test files are exempt from style rules per
STYLE.md)Checklist
Before submitting this PR, please ensure:
Code follows the Solidity feature ban - No inheritance, constructors, modifiers,
public/private variables, external library functions,
using fordirectives, orselfdestructCode 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 fmtExisting tests pass - Run tests to be sure existing tests pass.
All tests pass - Run
forge testand ensure everything worksDocumentation updated - If applicable, update relevant documentation
Additional Notes
Naming consistency verified against:
ERC721EnumerableMint/Burn Mods already in the repo which usemintandburnapprove,transfer,transferFrom) which use no prefixERC20Burnable(burn,burnFrom) andERC721Burnable(burn) percopilot-instructions.mdSection 10 which requires mirroring OZ naming where itaffects interoperability