ISablierFactoryMerkleLT
Inherits: ISablierFactoryMerkleBase
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
| Name | Type | Description |
|---|---|---|
tranches | MerkleLT.TrancheWithPercentage[] | The tranches with their respective unlock percentages. |
Returns
| Name | Type | Description |
|---|---|---|
result | bool | True 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 memory params
)
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
params.expirationmeans the campaign does not expire. Requirements: params.tokenmust not be the forbidden native token.- The sum of percentages of the tranches must equal 100%.
function createMerkleLT(
MerkleLT.ConstructorParams memory params,
uint256 aggregateAmount,
uint256 recipientCount
)
external
returns (ISablierMerkleLT merkleLT);
Parameters
| Name | Type | Description |
|---|---|---|
params | MerkleLT.ConstructorParams | Struct encapsulating the input parameters, which are documented in {DataTypes}. |
aggregateAmount | uint256 | The total amount of ERC-20 tokens to be distributed to all recipients. |
recipientCount | uint256 | The total number of recipient addresses eligible for the airdrop. |
Returns
| Name | Type | Description |
|---|---|---|
merkleLT | ISablierMerkleLT | The address of the newly created Merkle Lockup contract. |
Events
CreateMerkleLT
Emitted when a SablierMerkleLT campaign is created.
event CreateMerkleLT(
ISablierMerkleLT indexed merkleLT,
MerkleLT.ConstructorParams params,
uint256 aggregateAmount,
uint256 totalDuration,
uint256 recipientCount,
address comptroller,
uint256 minFeeUSD
);