Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Event Emissions

Summary

Missing event emissions for critical state changes can lead to challenges in tracking and monitoring contract interactions, making it difficult for users and external applications to verify and respond to state changes.

Finding Description

In the SablierFlow.sol contract, several critical operations—such as deposits, withdrawals, and flow updates—do not emit corresponding events. This lack of event logging breaks the transparency and auditability guarantees of the contract, which are essential for user trust and interaction with the smart contract.

When a user interacts with the contract, they expect to see logs of their actions (e.g., when they deposit funds or withdraw funds). Without these logs, users and external systems (like monitoring tools or front-end applications) cannot easily ascertain the state of the contract or any historical actions taken. This absence of events could lead to confusion or misinformation regarding the actual state of the contract, potentially resulting in financial loss or exploitation.

For example, a malicious actor could exploit the absence of events by engaging in unexpected actions without clear visibility, making it difficult for users to react appropriately.

Vulnerability Details

  • Severity: Low

  • Location: Various functions handling critical state changes in SablierFlow.sol

  • Impacted Functions: Deposit, Withdraw, Update Flow

Impact

The impact of missing event emissions is primarily related to transparency and accountability. Users rely on events for monitoring their interactions with the contract. Without events, it becomes challenging for users to verify that their transactions were processed correctly, leading to a potential decrease in trust and confidence in the contract. Moreover, external applications (e.g., dApps) that rely on events for tracking state changes will not function correctly, which may limit the utility of the contract.

Proof of Concept

Here’s an example demonstrating the lack of event emissions in the SablierFlow.sol contract:

function deposit(uint256 amount) external {
// Logic for depositing funds
// Missing event emission here
}
function withdraw(uint256 amount) external {
// Logic for withdrawing funds
// Missing event emission here
}

In the example above, when users deposit or withdraw funds, there are no events emitted to indicate these actions.

Recommendations

To address the issue of missing event emissions, the contract should emit events for each critical action taken by users. Below are proposed events and modified code snippets for the SablierFlow.sol contract:

Suggested Event Declarations

event Deposited(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);

Suggested Code Modifications

Incorporate the events into the relevant functions:

function deposit(uint256 amount) external {
// Logic for depositing funds
emit Deposited(msg.sender, amount); // Emit event upon deposit
}
function withdraw(uint256 amount) external {
// Logic for withdrawing funds
emit Withdrawn(msg.sender, amount); // Emit event upon withdrawal
}

By implementing these changes, the contract will provide necessary transparency and allow users to track their interactions effectively.

File Location

SablierFlow.sol

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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