The normal behavior should allow a token ID encoded from (collectionId, itemId) to decode back to the same (collectionId, itemId). The interface exposes both values as uint256.
encodeTokenId() accepts full uint256 values but decodeTokenId() only preserves the lower 128 bits for itemId. When itemId exceeds type(uint128).max, the encoded value spills into the collection portion and decoding returns different values.
Likelihood:
This occurs when callers use encodeTokenId() with an itemId larger than type(uint128).max.
This occurs because the public API accepts uint256 values while the encoding format only safely supports 128-bit components.
Impact:
decodeTokenId(encodeTokenId(collectionId, itemId)) can return a different collection and item than the original inputs.
Integrations relying on these public helpers can misidentify memorabilia tokens.
Make the supported 128-bit bound explicit in the API, or validate inputs before encoding.
Or change the signature to accept uint128 collectionId, uint128 itemId.
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.