User uninformed of unused tickets after registering for raffle
Registration rounds the ticket count down to whole slots, leaving a remainder unused. The contract does not surface this to the caller, so users do not know their balance still holds unconsumed tickets.
Description
The current implementation of the raffle ticket system in the MonadexV1Raffle contract may result in users having unused tickets due to the rounding that occurs when calculating the number of slots a user can occupy.
The contract divides the user's ticket amount by the range size and then multiplies it back, which can lead to some tickets being unused in the raffle. However, the contract does not explicitly inform users about these unused tickets, which may remain in their balance.
Impact
Users may be unaware that they have unused tickets after participating in a raffle. This could lead to confusion about their actual ticket balance. That also means that users might miss opportunities to use these tickets in future raffles.
Recommendation
- Implement a mechanism to calculate and track unused tickets:
uint256 unusedTickets = _amount % RANGE_SIZE;
- Return the number of unused tickets to the user when they register for a raffle:
function register(uint256 _amount) external notZero(_amount) returns (uint256, uint256) {// ... existing code ...return (ticketsToBurn, unusedTickets);}
- Emit an event that includes information about unused tickets:
emit Registered(msg.sender, ticketsToBurn, unusedTickets);

