Sablier

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

Missing a check for streamDurations.total can create the useless SablierV2MerkleLL contract

Summary

The createMerkleLL function lacks checks to ensure that streamDurations.total is not zero.

If streamDurations.total is zero, it becomes impossible to create the stream, as verified by the following checks:
checkCreateLockupLinear

This can lead to the creation of a non-functional SablierV2MerkleLL contract.

Vulnerability Details

https://github.com/Cyfrin/2024-05-Sablier/blob/main/v2-periphery/src/SablierV2MerkleLockupFactory.sol#L36

function createMerkleLL(
MerkleLockup.ConstructorParams memory baseParams,
ISablierV2LockupLinear lockupLinear,
LockupLinear.Durations memory streamDurations,
uint256 aggregateAmount,
uint256 recipientCount
)
external
returns (ISablierV2MerkleLL merkleLL)
{
// Deploy the MerkleLockup contract with CREATE. // @audit streamDurations validation
merkleLL = new SablierV2MerkleLL(baseParams, lockupLinear, streamDurations);
// Log the creation of the MerkleLockup contract, including some metadata that is not stored on-chain.
emit CreateMerkleLL(merkleLL, baseParams, lockupLinear, streamDurations, aggregateAmount, recipientCount);
}

Impact

This can lead to the creation of a non-functional SablierV2MerkleLL contract.

Tools Used

Manual

Recommendations

It's recommended to add the validation for the streamDurations when creating the SablierV2MerkleLL contract.

function createMerkleLL(
MerkleLockup.ConstructorParams memory baseParams,
ISablierV2LockupLinear lockupLinear,
LockupLinear.Durations memory streamDurations,
uint256 aggregateAmount,
uint256 recipientCount
)
external
returns (ISablierV2MerkleLL merkleLL)
{
// Deploy the MerkleLockup contract with CREATE.
+ require(streamDurations.total > 0);
merkleLL = new SablierV2MerkleLL(baseParams, lockupLinear, streamDurations);
// Log the creation of the MerkleLockup contract, including some metadata that is not stored on-chain.
emit CreateMerkleLL(merkleLL, baseParams, lockupLinear, streamDurations, aggregateAmount, recipientCount);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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