Closed sherlock-admin2 closed 9 months ago
bareli
medium
we are not verifying the _unsafeSubtract implementation as : uint256 currentEntryIndex = currentEntryIndexArray[_unsafeSubtract(count, 1)];
uint256 currentEntryIndex = currentEntryIndexArray[_unsafeSubtract(count, 1)]; here count can be 0. then we will get an issue.
https://github.com/sherlock-audit/2024-01-looksrare/blob/main/contracts-yolo/contracts/YoloV2.sol#L1286
Manual Review
verify count is greater than 0.
Invalid, count will always be at least 1 or greater than 1, given there must at least be 2 participants per game.
bareli
medium
_unsafeSubtract can led to error
Summary
we are not verifying the _unsafeSubtract implementation as : uint256 currentEntryIndex = currentEntryIndexArray[_unsafeSubtract(count, 1)];
Vulnerability Detail
uint256 currentEntryIndex = currentEntryIndexArray[_unsafeSubtract(count, 1)]; here count can be 0. then we will get an issue.
Impact
Code Snippet
https://github.com/sherlock-audit/2024-01-looksrare/blob/main/contracts-yolo/contracts/YoloV2.sol#L1286
Tool used
Manual Review
Recommendation
verify count is greater than 0.