Skip to main content

ISablierV2MerkleLockupFactory

Git Source

Deploys MerkleLockup campaigns with CREATE2.

Functions

isPercentagesSum100

Verifies if the sum of percentages in tranches equals 100% , i.e. 1e18.

Reverts if the sum of percentages overflows.

function isPercentagesSum100(MerkleLT.TrancheWithPercentage[] calldata tranches) external pure returns (bool result);

Parameters

NameTypeDescription
tranchesMerkleLT.TrancheWithPercentage[]The tranches with their respective unlock percentages.

Returns

NameTypeDescription
resultboolTrue if the sum of percentages equals 100%, otherwise false.

createMerkleLL

Creates a new MerkleLockup campaign with a LockupLinear distribution.

Emits a CreateMerkleLL event.

function createMerkleLL(
MerkleLockup.ConstructorParams memory baseParams,
ISablierV2LockupLinear lockupLinear,
LockupLinear.Durations memory streamDurations,
uint256 aggregateAmount,
uint256 recipientCount
)
external
returns (ISablierV2MerkleLL merkleLL);

Parameters

NameTypeDescription
baseParamsMerkleLockup.ConstructorParamsStruct encapsulating the SablierV2MerkleLockup parameters, which are documented in {DataTypes}.
lockupLinearISablierV2LockupLinearThe address of the SablierV2LockupLinear contract.
streamDurationsLockupLinear.DurationsThe durations for each stream.
aggregateAmountuint256The total amount of ERC-20 assets to be distributed to all recipients.
recipientCountuint256The total number of recipients who are eligible to claim.

Returns

NameTypeDescription
merkleLLISablierV2MerkleLLThe address of the newly created MerkleLockup contract.

createMerkleLT

Creates a new MerkleLockup campaign with a LockupTranched distribution.

Emits a CreateMerkleLT event.

function createMerkleLT(
MerkleLockup.ConstructorParams memory baseParams,
ISablierV2LockupTranched lockupTranched,
MerkleLT.TrancheWithPercentage[] memory tranchesWithPercentages,
uint256 aggregateAmount,
uint256 recipientCount
)
external
returns (ISablierV2MerkleLT merkleLT);

Parameters

NameTypeDescription
baseParamsMerkleLockup.ConstructorParamsStruct encapsulating the SablierV2MerkleLockup parameters, which are documented in {DataTypes}.
lockupTranchedISablierV2LockupTranchedThe address of the SablierV2LockupTranched contract.
tranchesWithPercentagesMerkleLT.TrancheWithPercentage[]The tranches with their respective unlock percentages.
aggregateAmountuint256The total amount of ERC-20 assets to be distributed to all recipients.
recipientCountuint256The total number of recipients who are eligible to claim.

Returns

NameTypeDescription
merkleLTISablierV2MerkleLTThe address of the newly created MerkleLockup contract.

Events

CreateMerkleLL

Emitted when a SablierV2MerkleLL campaign is created.

event CreateMerkleLL(
ISablierV2MerkleLL indexed merkleLL,
MerkleLockup.ConstructorParams baseParams,
ISablierV2LockupLinear lockupLinear,
LockupLinear.Durations streamDurations,
uint256 aggregateAmount,
uint256 recipientCount
);

CreateMerkleLT

Emitted when a SablierV2MerkleLT campaign is created.

event CreateMerkleLT(
ISablierV2MerkleLT indexed merkleLT,
MerkleLockup.ConstructorParams baseParams,
ISablierV2LockupTranched lockupTranched,
MerkleLT.TrancheWithPercentage[] tranchesWithPercentages,
uint256 totalDuration,
uint256 aggregateAmount,
uint256 recipientCount
);