Raisebox Faucet

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

Missing Event Emission for Token Burn in `RaiseBoxFaucet::burnFaucetTokens`

Root + Impact

Description

The burnFaucetTokens function currently performs a token transfer from the contract to the owner, followed by a burn, but lacks an event emission that explicitly signals that a faucet burn occurred.
This can disrupt off-chain tracking, auditability, and user experience, as external observers may not easily recognize that a token burn has taken place through this specific function.

function burnFaucetTokens(uint256 amountToBurn) public onlyOwner {
require(amountToBurn <= balanceOf(address(this)), "Faucet Token Balance: Insufficient");
_transfer(address(this), msg.sender, balanceOf(address(this)));
_burn(msg.sender, amountToBurn);
@> // missing event here
}

Risk

Likelihood:

  • If _transfer and _burn emit Transfer events, the lack of a custom event in burnFaucetTokens has minimal impact, as the necessary information is already logged.

  • If _transfer or _burn do not emit events, the likelihood of issues increases, as off-chain applications cannot track the transfer or burn operations.

Impact:

  • Without events, off-chain applications may fail to track token transfers or burns, leading to reduced transparency and potential user confusion.

  • Lack of a clear, custom event makes it difficult for dApps, analytics tools, and indexers to distinguish burns from ordinary transfers.

Proof of Concept:

  • Events serve as a critical mechanism for logging significant state changes on the blockchain, enabling off-chain applications to monitor and reflect these changes accurately.

  • For burn operations, a Transfer event to the zero address is a standard practice in ERC20 contracts, ensuring that token supply reductions are visible and verifiable.

  • A custom TokensBurned event would provide explicit context, making it easier for indexers and analytics platforms to differentiate burn operations from regular transfers, enhancing user trust and system transparency.

Recommended Mitigation

Add a dedicated event such as TokensBurned and emit it within the function to clearly indicate when a faucet burn occurs. This improves traceability and off-chain integration clarity.

+ event TokensBurned(address indexed burner, uint256 amount);
function burnFaucetTokens(uint256 amountToBurn) public onlyOwner {
require(amountToBurn <= balanceOf(address(this)), "Faucet Token Balance: Insufficient");
_transfer(address(this), msg.sender, balanceOf(address(this)));
_burn(msg.sender, amountToBurn);
+ emit TokensBurned(msg.sender, amountToBurn);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 10 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.