Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Misuse of ERC1155: Creating Non-Fungible Tokens for Identical Items

Root + Impact

Description

The current memorabilia implementation unnecessarily creates unique tokenIds for each item within a collection by encoding both collectionId and itemId, making each NFT
non-fungible. This contradicts the uniform pricing model where all items in a collection cost the same amount of BEAT tokens.

Since all memorabilia within a collection are identical (same price, same metadata URI pattern), the design should leverage ERC1155's semi-fungible nature by using the
collectionId directly as the tokenId. This would make all items in a collection share the same tokenId, simplifying the implementation and allowing users to own multiple
fungible copies.

The current approach adds complexity without benefit - tracking "edition numbers" and encoding/decoding tokenIds when a simple _mint(user, collectionId, 1, "") would
achieve the same goal more efficiently while maintaining the collection-based pricing structure.

Recommended Mitigation

function redeemMemorabilia(uint256 collectionId) external {
- _mint(msg.sender, tokenId, 1, "");
+ _mint(msg.sender, collectionId, 1, "");

With this change, the smart contract can be simplified further and remove some storage variables and logic.

  1. Uses collectionId as the tokenId directly

  2. Reuses the existing passSupply mapping for tracking minted amounts

  3. Removes unnecessary encoding/decoding logic

  4. Makes all items in a collection fungible (same tokenId)

  5. Simplifies the URI to be collection-based rather than item-based

Updates

Lead Judging Commences

inallhonesty Lead Judge 27 days ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.