Submitted by 0x52
Minting and redeeming become impossible.
The lines above are taken from JBTiered721DelegateStore#_numberOfReservedTokensOutstandingFor and used to calculate and return the available number of reserve tokens that can be minted. Since the return statement doesnt check that _numberReservedTokensMintable >= _reserveTokensMinted, it will revert under those circumstances. The issue is that there are legitimate circumstances in which this becomes false. If a tier is fully minted then all reserve tokens are mintable. When the tier begins to redeem, _numberReservedTokensMintable will fall under _reserveTokensMinted, permanently breaking minting and redeeming. Minting is broken because all mint functions directly call _numberOfReservedTokensOutstandingFor. Redeeming is broken because the redeem callback (JB721Delegate#redeemParams) calls _totalRedemtionWeight which calls _numberOfReservedTokensOutstandingFor.
Example:
A tier has a reserveRate of 100 (1/100 tokens reserved) and an initialQuantity of 10000. We assume that the tier has been fully minted, that is, _reserveTokensMinted is 100 and remainingQuantity = 0. Now we begin burning the tokens. Lets run through the lines above after 100 tokens have been burned (remainingQuantity = 100):
_numberOfNonReservedMinted = 10000 - 100 - 100 = 9800
_numerator = 9800 * 100 = 980000
_numberReservedTokensMintable = 980000 / 10000 = 98
Since _numberReservedTokensMintable < _reserveTokensMinted the line will underflow and revert.
JBTiered721DelegateStore#_numberOfReservedTokensOutstandingFor will now revert every time it is called. This affects all minting functions as well as totalRedemptionWeight. Since those functions now revert when called, it is impossible to mint or redeem anymore NFTs.
Add a check before returning:
mejango (Juicebox DAO) confirmed 
Trust (warden) commented:
mejango (Juicebox DAO) commented:
Picodes (judge) commented:
