Beginner FriendlyFoundryDeFiOracle
100 EXP
View results
Submission Details
Severity: low
Valid

Missing Event Emissions on Key Contract Actions

Vulnerability Details

The ThunderLoan protocol lacks event emissions for several critical functions, which could limit transparency and make it difficult to track and verify contract interactions on-chain. Events are particularly important for off-chain services such as user interfaces and backend systems that rely on transaction logs to monitor contract activity.

The absence of event emissions for key actions such as updating the flash loan fee, setting allowed tokens, and repaying loans can hinder auditability and reduce the ability to respond to potential issues in real time.

Impact

  1. Reduced Transparency: Without events, it becomes challenging for users and external applications to track when certain actions have taken place, which is a key aspect of smart contract transparency.

  2. Inefficient Monitoring: Services that monitor the state of the contract must resort to less efficient methods than listening for events, potentially leading to increased costs and slower response times.

  3. Limited Historical Data: Lack of events means that historical data is harder to reconstruct without parsing the entire blockchain history, which is resource-intensive.

Recommendations

  1. Add Missing Events: Implement event emissions for all key functions, such as updateFlashLoanFee, repay and __Oracle_init. This will enhance the transparency and auditability of the contract.

  2. Follow Event-Naming Conventions: Ensure that the names of new events clearly describe the action that has occurred, and that the parameters provide sufficient detail about the action's effects.

  3. Audit and Test Event Emissions: Thoroughly test the new event emissions to ensure they are fired correctly in all scenarios. Consider adding automated tests that verify the correct events are emitted for each action.

  4. Update Documentation: Update the contract documentation to include information about the new events and the circumstances under which they are emitted.

  5. Inform Stakeholders: Communicate changes to users and any services that utilize the contract events for monitoring or other purposes.

By addressing these recommendations, ThunderLoan will enhance its on-chain transparency and provide better tools for monitoring contract activity, which is beneficial for users and external services alike.

Updates

Lead Judging Commences

0xnevi Lead Judge about 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

missing event emission updateFlashLoanFee

Support

FAQs

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