Closed sherlock-admin2 closed 5 months ago
Request poc
Likely Invalid per sponsor comments:
- This is intended in deployments that set a
vaultBeneficiary
on the draw manager- The prize pool works on a statistical model to ensure that the probability of over-awarding a prize tier is within reason. There are 2 tools a prize pool deployer can use for this purpose. The first is the reserve, which can be built up to provide backstop liquidity. The second is the
tierUtilizationRatio
which can be set to ensure prizes are calculated using a specific portion of available tier liquidity. By setting the utilization ratio low enough, the deployer can ensure that the chance of a prize being over-awarded is below their desired threshold. The utilization ratio is used when thevaultBeneficiary
is provided so that the reserve does not need to be relied on for prize backstops.- It's up to the prize pool deployer to configure these parameters correctly for any given network environment
PoC requested from @berndartmueller
Requests remaining: 4
Hey @nevillehuang!
Given the sponsor's comments, I have to agree that this is a design decision, and it's up to the prize pool deployer (and draw manager deployer, i.e., likely the same actor) to correctly configure the parameters.
Thus, my submission is invalid and can be closed. Thanks!
berndartmueller
medium
Entire prize pool reserve is used up after a draw is awarded, preventing building up a larger reserve over time
Summary
The
finishDraw
function caps the incentives with themaxRewards
upper bound but donates the entire remaining reserve to the prize pool, which prevents building up a larger reserve over time.Vulnerability Detail
A portion of the vault contributions are captured as reserve, used to fund the incentives to award the draw (request a random number via
DrawManager.startDraw
and submit the random number and award the draw viaDrawManager.finishDraw
). The collected prize pool reserve is kept track of via theTieredLiquidityDistributor._reserve
variable.The eligible rewards (
availableRewards
) for starting and finishing the draw are calculated via the_computeAvailableRewards
function in line333
of thefinishDraw
function.Those rewards are capped by the
maxRewards
upper bound to ensure that not the entire reserve is used.After the draw got rewarded, the remaining reserve (
remainingReserve
) is donated to the prize pool.However, recalling that the rewards are capped by
maxRewards
, donating the remaining reserve causes the reserve to be used up entirely, which prevents building up a larger reserve over time to act as a cushion when there is insufficient tier liquidity.Impact
Whenever a draw is awarded, the entire prize pool reserve is used up (as incentives and donations), which prevents building up a larger reserve over time.
Code Snippet
DrawManager.finishDraw#L354-L369
Tool used
Manual Review
Recommendation
Consider calculating the remaining reserve as the difference between the
availableRewards
(which incorporates themaxRewards
cap) and the rewards actually used as incentives.