Skip to content

feat: add non-transferable token support to ERC1155MaxSupplyMintable & burns no longer reduce total supply of tokens#288

Closed
max-taylor wants to merge 4 commits intodevelopfrom
max/erc1155maxsupplymintable-updates
Closed

feat: add non-transferable token support to ERC1155MaxSupplyMintable & burns no longer reduce total supply of tokens#288
max-taylor wants to merge 4 commits intodevelopfrom
max/erc1155maxsupplymintable-updates

Conversation

@max-taylor
Copy link

@max-taylor max-taylor commented Oct 23, 2025

Description

Enhanced ERC1155MaxSupplyMintable contract to support non-transferable tokens and improved total supply tracking to handle burned tokens correctly.

Objectives

  1. Enable creation of non-transferable (soulbound-like) tokens that can be minted and burned but not transferred between addresses
  2. Fix total supply accounting to ensure burned tokens still count towards the max supply cap, preventing infinite minting through burn/mint cycles
  3. Provide flexible admin controls to manage token transferability on a per-token basis

Changes Made

Contract Updates (src/nfts/ERC1155MaxSupplyMintable.sol):

  • Removed dependency on ERC1155Supply and implemented custom totalSupply tracking that only increments on mints (not decrements on burns)
  • Added nonTransferableTokens mapping to track which token IDs are non-transferable
  • Added setSupplyCapAndNonTransferable() and setNonTransferable() functions for admin control
  • Enhanced _beforeTokenTransfer() hook to block transfers (but allow mints/burns) for non-transferable tokens

Test Coverage (test/unit/nfts/ERC1155MaxSupplyMintable.t.sol):

  • Added 9 new comprehensive tests covering non-transferable token functionality

Breaking Changes

None - This is backward compatible. Tokens are transferable by default unless explicitly marked as non-transferable.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • provided a link to the relevant issue or specification
  • included the necessary unit and integration tests
  • code is adequately commented
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed service design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@openzeppelin-code
Copy link

openzeppelin-code bot commented Oct 23, 2025

feat: add non-transferable token support to ERC1155MaxSupplyMintable & burns no longer reduce total supply of tokens

Generated at commit: 3be4f86e7ccc35c253b7dbe1428b17a04e2648d2

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
2
0
6
40
49
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@max-taylor max-taylor changed the title Max/erc1155maxsupplymintable updates feat: add non-transferable token support to ERC1155MaxSupplyMintable Oct 23, 2025
@max-taylor max-taylor changed the title feat: add non-transferable token support to ERC1155MaxSupplyMintable feat: add non-transferable token support to ERC1155MaxSupplyMintable & burns no longer reduce total supply of tokens Oct 23, 2025
@max-taylor
Copy link
Author

Closing as this PR should exist in the tuxedo-zk repo

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.

1 participant