The encodeTokenId function lacks bounds checks before performing a 128-bit bitwise shift. Since the input parameters are uint256, any collectionId or itemId exceeding 2^128 - 1 will cause high-bit data to overflow and be discarded.This makes the encoding logic non-reversible
Likelihood:Low
Under normal business scenarios, IDs rarely reach 2^128; however, it is inevitably triggered by extreme inputs or large-scale system expansion.
Missing Constraints: Since the contract lacks type restrictions or require checks, this risk is 100% present from a technical standpoint.
Impact:
Data Corruption: Original IDs cannot be correctly recovered, causing functions like uri() to return incorrect data.
Collisions: Different inputs can generate the same tokenId, destroying the uniqueness of the NFT
Add strict bounds checks using require statements in the encodeTokenId function. This ensures that both collectionId and itemId do not exceed the 2^128 - 1 limit, preventing any data loss or ID collisions before the bitwise shift occurs.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.