Nearly impossible for any user to register to the raffle
register() in MonadexV1Raffle compares ticketsToBurn against the user balance with the wrong operator and reverts in either branch, blocking every registration and breaking the raffle entirely.
Description
The register() function in the MonadexV1Raffle contract contains a critical logic error that prevents any user from successfully registering for the raffle. The function incorrectly checks the user's balance against the number of tickets to burn, causing it to revert in all scenarios.
- If
ticketsToBurn < balance, the function reverts, preventing registration even when the user has sufficient balance. - If
ticketsToBurn >= balance, the function will likely revert in the_burncall due to insufficient balance.
Impact
This vulnerability completely breaks the core functionality of the raffle system, making it impossible for any user to register. As a result, the entire contract becomes non-functional, effectively creating a denial of service for the raffle feature. If deployed, this critical flaw would likely lead to a significant loss of user trust and damage to the protocol's reputation, as users would be unable to participate in the raffle despite potentially having purchased tickets.
Recommendation
Correct the balance check logic so that the revert only triggers when the user truly cannot cover the ticket burn:
function register(uint256 _amount) external notZero(_amount) returns (uint256) {// ... (previous checks)uint256 balance = balanceOf(msg.sender);uint256 ticketsToBurn = slotsToOccupy * RANGE_SIZE;if (ticketsToBurn > balance) {revert MonadexV1Raffle__NotEnoughBalance(ticketsToBurn, balance);}// ... (rest of the function)}

