Open code423n4 opened 12 months ago
asselstine marked the issue as sponsor confirmed
Considering the rounding issue is of a few wei, I'll downgrade this to low under the assumption that the error is not significant.
Picodes changed the severity to QA (Quality Assurance)
Picodes marked the issue as grade-a
Lines of code
https://github.com/generationsoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/libraries/TierCalculationLib.sol#L26
Vulnerability details
Impact
Detailed description of the impact of this finding. Tiers odds compuations is not accurate
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept. If you will go to wolfram link than equation for tiers can be simplified to this![image](https://i.ibb.co/0jL26pv/Screenshot-from-2023-07-11-20-36-58.png)
So code for ods will become like this
blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/libraries/TierCalculationLib.sol#L26
Here is an example before and after, its not a huge difference. But seems like real tier odds are slightly less than current this means that protocol will give out prize a little bit more than it should. Above is current formula, below for new formula.
Tools Used
Recommended Mitigation Steps
Fix a tier odds
Assessed type
Error