20,000 USDC
View results
Submission Details
Severity: gas
Valid

Absence of Event Logs in `Staking.sol` Reduces Contract Transparency and Auditability

Summary

The Staking.sol smart contract does not emit any events. Events in Solidity provide a way for smart contracts to log specific activities or changes in state that occur during contract execution. These logs are essential for off-chain services to track the contract's operations.

Vulnerability Details

In the Staking.sol contract, users can deposit, withdraw, and claim rewards. However, none of these functions emit events to log these actions. Without events, it becomes difficult for external entities (like front-end applications, oracles, or analytics services) to track these state changes. This lack of transparency makes auditing contract activity much more challenging.

Impact

The absence of events in the contract reduces the contract's transparency and auditability. It makes it difficult for off-chain services to track the contract's operations and for users to verify their transactions. This lack of transparency could potentially undermine user trust in the platform.

Tools Used

  • Manual code review

Recommendations

It's recommended to emit events in the deposit, withdraw, and claim functions to log these state changes. Emitting events provides an easier way to track these actions, increases the contract's transparency, and improves the auditability of the contract.

Support

FAQs

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

Give us feedback!