Flow

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

`isPaused()` returns an incorrect state when the stream is voided.

Description

isPaused() is used to determine if a stream is paused or not. The problem is that to prevent edge cases, the void() function sets _streams[streamId].ratePerSecond to 0, which is the condition for a stream to be considered paused.

However, isPaused() does not differentiate between a paused stream and a voided one, leading the function to incorrectly indicate that voided streams are paused.

function _void(uint256 streamId) internal {
...
// Effect: update the snapshot time.
_streams[streamId].snapshotTime = uint40(block.timestamp);
// Effect: set the rate per second to zero.
@> _streams[streamId].ratePerSecond = ud21x18(0);
// Effect: set the stream as voided.
_streams[streamId].isVoided = true;
...
}
@> function isPaused(uint256 streamId) external view override notNull(streamId) returns (bool result) {
@> result = _streams[streamId].ratePerSecond.unwrap() == 0;
}

Risk

Likelyhood: High

  • Every call on isPaused() with a voided stream will return true.

Impact: Low

  • Incorrect state: voided streams are marked as paused instead of reverting.

Recommended Mitigation

- function isPaused(uint256 streamId) external view override notNull(streamId) returns (bool result) {
+ function isPaused(uint256 streamId) external view override notNull(streamId) notVoidedl(streamId) returns (bool result) {
result = _streams[streamId].ratePerSecond.unwrap() == 0;
}
Updates

Lead Judging Commences

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

Appeal created

n0kto Submitter
8 months ago
n0kto Submitter
8 months ago
inallhonesty Lead Judge
8 months ago
inallhonesty Lead Judge 8 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.