The getUserDeposits function breaks after 255 deposits due to uint8 overflow.
if the user ever makes more than 255 deposits the function `getUserDeposits` will be unusable for him forever because in no part of the code is the userDeposits[user] decreased or deleted (not even in withdraw), so for a frequent user or for a bot/agent or even for another smart contract that makes deposits on behalf of its users this function will be reverted every single time after a certain period (even a day for bots/agents).
https://github.com/CodeHawks-Contests/2025-02-gamma/blob/main/contracts/PerpetualVault.sol#L643-L652
getUserDeposits function will be unusable given some time. Also if other contracts base their own logic by calling this function and they reach 255 deposits it will break their whole logic too.
manual
simply update the for(uint8) to for(uint256).
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.