The token id is composed of the given tier id _tierId and the number of the token _tokenNumber in the tier. The tier id is limited to 16 bits, which means that there can theoretically only exist 65,535 tiers (this is very unlikely as this would have more serious consequences on other parts of the system and will cause a serious denial of service caused by unbounded loops. Still, theoretically, its possible and there is no check in place).
If more than 65,535 tiers exist, the 16 bits reserved for the tier id will be surpassed and overwritten by _tokenNumber. This will lead to token id collisions with other tiers with a lower tier id.
JBTiered721DelegateStore._generateTokenId
Consider reverting if the _tierId is > 16 bits.
drgorillamd (Juicebox DAO) commented:
For this contest, 34 reports were submitted by wardens detailing gas optimizations. The report highlighted below by Jeiwan received the top score from the judge.
The following wardens also submitted reports: brgltd,
0xSmartContract,
JC,
zishansami,
lukris02,
berndartmueller,
bharg4v,
CodingNameKiki,
Aymen0909,
sakman,
0x4non,
Shinchan,
ReyAdmirado,
JrNet,
Saintcode_,
Awesome,
__141345__,
DimSon,
emrekocak,
0x5rings,
cryptostellar5,
Diana,
carlitox477,
mcwildy,
RaymondFam,
LeoS,
ch0bu,
Bnke0x0,
trustindistrust,
gogo,
martin,
0x1f8b, and
chaduke.
