SablierFactoryMerkleLT
Inherits: ISablierFactoryMerkleLT, SablierFactoryMerkleBase
See the documentation in ISablierFactoryMerkleLT.
Functions
constructor
constructor(address initialComptroller) SablierFactoryMerkleBase(initialComptroller);
Parameters
| Name | Type | Description |
|---|---|---|
initialComptroller | address | The address of the initial comptroller contract. |
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 params
)
external
view
override
returns (address merkleLT);
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
override
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. |
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 calldata params,
uint256 aggregateAmount,
uint256 recipientCount
)
external
override
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. |
_calculateTrancheTotals
Calculate the total duration and total percentage of the tranches.
function _calculateTrancheTotals(MerkleLT.TrancheWithPercentage[] memory tranches)
private
pure
returns (uint256 totalDuration, uint64 totalPercentage);
_checkDeploymentParams
Validate the token and the total percentage.
function _checkDeploymentParams(address token, uint64 totalPercentage) private view;