Description
The _createTokenURI function generates a token URI based on the donor's address, the date, and the donation amount. However, it does not account for the scenario where multiple donations are made by the same donor within the same block. As a result, donations made in the same block will generate identical token URIs, leading to potential conflicts and incorrect metadata for the tokens. Integrating the tokenCounter into the URI will ensure uniqueness.
Code Snippet
Impact
Token URI Conflicts: If a donor makes multiple donations in the same block, all tokens will have the same URI, which can lead to confusion and incorrect representation of the donations.
Loss of Metadata Integrity: The uniqueness of each token's metadata is compromised, which is critical for tracking and verifying donations.
Recommendation
To ensure that each token URI is unique, integrate the tokenCounter into the URI generation process. This will provide a unique identifier for each token based on the order of minting.
Code Snippet
Modifying the _createTokenURI function to include the tokenCounter will ensure that each token generated, even by the same donor in the same block, has a distinct URI. This change is essential for maintaining the integrity and uniqueness of token metadata.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.