Raisebox Faucet

First Flight #50
Beginner FriendlySolidity
100 EXP
Submission Details
Impact: medium
Likelihood: medium
Invalid

Improper Use of Global Variable faucetClaimer in Claim Logic

Author Revealed upon completion

Root + Impact

Description

  • The contract stores msg.sender in the global variable faucetClaimer every time a user calls claimFaucetTokens().

  • However, this variable is unnecessarily stored in contract storage, even though it is only used within the current function scope.

function claimFaucetTokens() external faucetActive nonReentrant {
faucetClaimer = msg.sender; // @> This line stores msg.sender globally
...
}
function getClaimer() public view returns (address) {
return faucetClaimer; // @> Leaks last claimer’s address publicly
}

Risk

Likelihood:

  • Privacy risk — last claimer address exposed.

Impact:

  • Slight gas inefficiency (unnecessary storage write).

  • Future logic vulnerability if another function depends on faucetClaimer.

Proof of Concept

function testFaucetClaimerLeak() public {
// Alice claims tokens
vm.prank(alice);
faucet.claimFaucetTokens();
// The contract now stores Alice’s address globally
address lastClaimer = faucet.getClaimer();
assertEq(lastClaimer, alice, "should store alice address");
// Bob claims tokens
vm.prank(bob);
faucet.claimFaucetTokens();
// Anyone can read the last claimer — data leak
address leakedClaimer = faucet.getClaimer();
emit log_address(leakedClaimer);
assertEq(leakedClaimer, bob, "leak of last claimer address");
}

Recommended Mitigation

function claimFaucetTokens() external faucetActive nonReentrant {
+ address claimer = msg.sender;
...
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 2 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.