Sablier

Sablier
DeFiFoundry
53,440 USDC
View results
Submission Details
Severity: medium
Invalid

Lack of Stream Status Check in _update Function

Description

The _update function in the SablierV2Lockup smart contract is responsible for updating the ownership of an NFT representing a stream. It checks whether the stream is marked as transferable but does not verify the stream's current status (e.g., if it is settled or depleted).

function _update(
address to,
uint256 streamId,
address auth
)
internal
override
updateMetadata(streamId)
returns (address)
{
address from = _ownerOf(streamId);
if (from != address(0) && to != address(0) && !_streams[streamId].isTransferable) {
revert Errors.SablierV2Lockup_NotTransferable(streamId);
}
return super._update(to, streamId, auth);
}

Impact

The absence of a status check could lead to scenarios where an NFT representing a settled or depleted stream is transferred, potentially causing confusion among users. It may also lead to unnecessary transactions and gas expenditure.

Proof of Concept

a user attempting to transfer an NFT representing a stream that has already been settled or depleted. Without a status check, the transfer may succeed, leading the user to believe the stream is still active or has value, which is not the case. This could result in the recipient of the transfer incorrectly assuming they have acquired an active stream, only to find out it has no remaining value or cannot be interacted with as expected.

Tools Used

Manual review

Recommendations

Enhance the _update function with additional checks to verify the stream's status. This could involve checking if the stream is settled or depleted and preventing the transfer if it does not meet the criteria for an active and valid stream.

function _update(
address to,
uint256 streamId,
address auth
)
internal
override
updateMetadata(streamId)
returns (address)
{
require(_streams[streamId].isStream, "Stream does not exist");
require(!_streams[streamId].isDepleted, "Stream is depleted");
require(!_streams[streamId].wasCanceled, "Stream was canceled");
// Existing transferability check remains here
// ...
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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