Skip to main content

ISablierFactoryMerkleLT

Git Source

Inherits: ISablierFactoryMerkleBase

Title: ISablierFactoryMerkleLT

A factory that deploys MerkleLT campaign contracts.

See the documentation in ISablierMerkleLT.

Functions​

isPercentagesSum100​

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

This is a helper function for the frontend. It is not used anywhere in the contracts.

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.

computeMerkleLT​

Computes the deterministic address where SablierMerkleLT campaign will be deployed.

Reverts if the requirements from createMerkleLT are not met.

function computeMerkleLT(
address campaignCreator,
MerkleLT.ConstructorParams calldata campaignParams
)
external
view
returns (address merkleLT);

createMerkleLT​

Creates a new Merkle Lockup campaign with a Lockup Tranched distribution.

Emits a CreateMerkleLT event. Notes:

  • The contract is created with CREATE2.
  • The campaign's fee will be set to the min USD fee unless a custom fee is set for msg.sender.
  • A value of zero for campaignParams.expiration means the campaign does not expire. Requirements:
  • campaignParams.token must not be the forbidden native token.
  • The sum of percentages of the tranches must equal 100%.
function createMerkleLT(
MerkleLT.ConstructorParams calldata campaignParams,
uint256 aggregateAmount,
uint256 recipientCount
)
external
returns (ISablierMerkleLT merkleLT);

Parameters

NameTypeDescription
campaignParamsMerkleLT.ConstructorParamsStruct encapsulating the SablierMerkleLT parameters.
aggregateAmountuint256The total amount of ERC-20 tokens to be distributed to all recipients.
recipientCountuint256The total number of recipient addresses eligible for the airdrop.

Returns

NameTypeDescription
merkleLTISablierMerkleLTThe address of the newly created Merkle Lockup contract.

Events​

CreateMerkleLT​

Emitted when a SablierMerkleLT campaign is created.

event CreateMerkleLT(
ISablierMerkleLT indexed merkleLT,
MerkleLT.ConstructorParams campaignParams,
uint256 aggregateAmount,
uint256 totalDuration,
uint256 recipientCount,
address comptroller,
uint256 minFeeUSD
);