The RaiseBoxFaucet::mintFaucetTokens function is there for the owner to refill the contract's token balance when it's running low — specifically, it should only allow minting if the balance drops below 1000 tokens (the per-claim amount promised to users). That way, the faucet stays topped up without wasting mints.
But the check uses > 1000 * 10**18, which means if there's exactly 1000 tokens left (enough for one last claim), the owner can still mint more. This goes against the intent: you shouldn't need to refill until it's truly depleted. It's a classic off-by-one bug — a small slip, but it lets the owner pump extra tokens in prematurely, inflating the supply a bit more than needed each time.
The owner must actively call mintFaucetTokens, making accidental or malicious over-minting unlikely in a well-managed setup.
Over-minting can lead to inflation of the faucet token supply, potentially diluting token value and undermining user trust. However, it does not directly affect contract security or user funds.
Here's a test that burns down to a workable balance, simulates claims to hit exactly 1000, then shows the owner minting anyway (when they shouldn't). Comments walk through the flow.
Add the test case to the RaiseBoxFaucet.t.sol file:
Run the above test using the following command:
Logs:
Easy to fix, just replace the > operator with >= operator in the check.
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.