RaiseBoxFaucet::claimFaucetTokens is implementedThe RaiseBoxFaucet contract allows first-time claimants to claim both tokens and Sepolia ETH, which are helpful for new users to test the testnet of their future protocol. To ensure that, the contract has implemented claimFaucetTokens function, which checks if the claimant is a first-time claimant, and if so, sends them both tokens and Sepolia ETH. Moreover, the next claim for tokens can be made only after 3 days.
But, the way the function is implemented, a first-time claimant can miss out on their free Sepolia ETH if the contract is out of Sepolia ETH, or the daily cap for Sepolia ETH is reached. However, the issue is that the claimant will do get their tokens, but won't get their Sepolia ETH for around 3 days.
The user must wait the 3-day cooldown to try again for the sepETH. If the contract also remains out of ETH at the next attempt (worst possible scenario), the user may never receive sepETH — otherwise they simply face delayed receipt. This is clearly not the intended behaviour.
It depends on the contract's Sepolia ETH balance and the daily cap being reached. If the contract is well-funded and the daily cap is high enough, the chances of a first-time claimant missing out on their free Sepolia ETH are reduced.
The user will miss out on their free Sepolia ETH for around 3 days, which wasn't the intended behaviour. However, they will still receive their tokens and ETH too, if they are lucky enough. So the impact is not as severe as losing both tokens and Sepolia ETH.
Add this test case to the existing RaiseBoxFaucet.t.sol file:
Run the above test using the following command:
Logs:
There are two ways to mitigate this issue:
Add a revert in the else block (lines 205-210) to ensure that if a first-time claimant cannot receive their free Sepolia ETH due to the contract being out of Sepolia ETH or the daily cap being reached, the entire transaction reverts, and they do not receive their tokens either. This way, they can try again immediately without waiting for 3 days.
Alternatively, if the protocol doesn't want to restrict the transfer of tokens even if the Sepolia ETH drip fails, then try implementing a separate function for claiming Sepolia ETH, which can be called independently of the token claim function. This way, users can claim their tokens without any restrictions, and they can attempt to claim their Sepolia ETH at any time without waiting for three days.
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.