Submitted by ladboy233, also found by brgltd
https://github.com/jbx-protocol/juice-nft-rewards/blob/f9893b1497098241dd3a664956d8016ff0d0efd0/contracts/JBTiered721Delegate.sol#L240
https://github.com/jbx-protocol/juice-nft-rewards/blob/f9893b1497098241dd3a664956d8016ff0d0efd0/contracts/JBTiered721DelegateStore.sol#L628
https://github.com/jbx-protocol/juice-nft-rewards/blob/f9893b1497098241dd3a664956d8016ff0d0efd0/contracts/JBTiered721DelegateStore.sol#L689
The tier setting parameter are unsafely downcasted from uint256 to uint80 / uint48 / uint16
the tier is setted by owner is crucial because the parameter affect how nft is minted.
the callstack is
JBTiered721Delegate.sol#initialize -> Store#recordAddTiers
what does the struct JB721TierParams look like? all parameter in JB721TierParams is uint256 type
however in side the function
all uint256 parameter are downcasted.
uint256 contributionFloor is downcasted to uint80,
uint256 lockedUntil is downcasted to uint48
uint256 initialQuantity and initialQuantity are downcasted to uint40
uint256 votingUnits and uint256 reservedRate are downcasted to uint16
this means the original setting is greatly truncated.
For example, the owner wants to set the initial supply to a number larger than uint40, but the supply is truncated to type(uint40).max
The owner wants to set the contribution floor price above uint80,but the contribution floor price is truncated to type(uint80).max, the user may underpay the price and get the NFT price at a discount.
We can add POC
https://github.com/jbx-protocol/juice-nft-rewards/blob/f9893b1497098241dd3a664956d8016ff0d0efd0/contracts/forge-test/NFTReward_Unit.t.sol#L1689
note, our initial contribution floor price setting is
then we run our test
the result is
clearly the floor price is unsafed downcasted and truncated.
Foundry, Manual Review
We recommend the project either change the data type in the struct
or safely downcast the number to make sure the number is not shortened unexpectedly.
https://docs.openzeppelin.com/contracts/3.x/api/utils#SafeCast
drgorillamd (Juicebox DAO) commented: 
Picodes (judge) commented:
