Skip to content

refactor: rename token burn and mint functions for consistency and cl…#288

Merged
maxnorm merged 2 commits intoPerfect-Abstractions:mainfrom
aapsi:fix/redundant-token-prefix
Mar 7, 2026
Merged

refactor: rename token burn and mint functions for consistency and cl…#288
maxnorm merged 2 commits intoPerfect-Abstractions:mainfrom
aapsi:fix/redundant-token-prefix

Conversation

@aapsi
Copy link
Contributor

@aapsi aapsi commented Mar 7, 2026

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, setApprovalForAll and the ERC721
Enumerable 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 — renamed mintERC20mint
  • ERC20/Burn/ERC20BurnMod.sol — renamed burnERC20burn, added @dev notice
    clarifying no approval check
  • ERC20/Burn/ERC20BurnFacet.sol — renamed burnERC20burn, burnERC20From
    burnFrom, updated exportSelectors
  • ERC721/Mint/ERC721MintMod.sol — renamed mintERC721mint
  • ERC721/Burn/ERC721BurnMod.sol — renamed burnERC721burn, added @dev notice
    clarifying no approval check
  • ERC721/Burn/ERC721BurnFacet.sol — renamed burnERC721burn, burnERC721s
    burnBatch, updated exportSelectors
  • ERC721/Enumerable/Burn/ERC721EnumerableBurnMod.sol — added @dev notice clarifying
    no approval check (name was already correct)
  • test/harnesses/token/ERC20/ERC20BurnModHarness.sol — updated to reflect renamed
    function (test files are exempt from style rules per STYLE.md)
  • test/harnesses/token/ERC20/ERC20MintModHarness.sol — updated to reflect renamed
    function (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 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.

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

  • Documentation updated - If applicable, update relevant documentation

Additional Notes

Naming consistency verified against:

  • ERC721Enumerable Mint/Burn Mods already in the repo which use mint and burn
  • All other ERC20/ERC721 Mods (approve, transfer, transferFrom) which use no prefix
  • OpenZeppelin ERC20Burnable (burn, burnFrom) and ERC721Burnable (burn) per
    copilot-instructions.md Section 10 which requires mirroring OZ naming where it
    affects interoperability

@netlify
Copy link

netlify bot commented Mar 7, 2026

👷 Deploy request for compose-diamonds pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6dff1bd

@aapsi
Copy link
Contributor Author

aapsi commented Mar 7, 2026

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!

@maxnorm
Copy link
Collaborator

maxnorm commented Mar 7, 2026

Good catch! Let's make it uniform across the codebase and ensure compatibility with other libraries

@maxnorm maxnorm marked this pull request as ready for review March 7, 2026 19:07
@maxnorm maxnorm merged commit 947c1f9 into Perfect-Abstractions:main Mar 7, 2026
1 of 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