Skip to main content

SablierFactoryMerkleExecute

Git Source

Inherits: ISablierFactoryMerkleExecute, SablierFactoryMerkleBase

Title: SablierFactoryMerkleExecute

See the documentation in ISablierFactoryMerkleExecute.

Functions

constructor

constructor(address initialComptroller) SablierFactoryMerkleBase(initialComptroller);

Parameters

NameTypeDescription
initialComptrolleraddressThe address of the initial comptroller contract.

computeMerkleExecute

Computes the deterministic address where SablierMerkleExecute campaign will be deployed.

Reverts if the requirements from {createMerkleExecute} are not met.

function computeMerkleExecute(
address campaignCreator,
MerkleExecute.ConstructorParams calldata campaignParams
)
external
view
override
returns (address merkleExecute);

createMerkleExecute

Creates a new MerkleExecute campaign for claim-and-execute distribution of tokens.

Emits a {CreateMerkleExecute} 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.
  • The create function does not validate if the campaignParams.selector is a function implemented by the target contract. In that case, the claimAndExecute function will revert.
  • If the target contract does not implement the campaignParams.selector but has fallback, the claimAndExecute call may silently succeed. If fallback does not transfer claim tokens, the claim tokens will be left in the campaign contract. These tokens can be clawbacked by the campaign creator. Requirements:
  • campaignParams.token must not be the forbidden native token.
  • campaignParams.target must be a contract.
function createMerkleExecute(
MerkleExecute.ConstructorParams calldata campaignParams,
uint256 aggregateAmount,
uint256 recipientCount
)
external
override
returns (ISablierMerkleExecute merkleExecute);

Parameters

NameTypeDescription
campaignParamsMerkleExecute.ConstructorParamsStruct encapsulating the SablierMerkleExecute 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
merkleExecuteISablierMerkleExecuteThe address of the newly created MerkleExecute campaign.

_checkDeploymentParams

Validates the deployment parameters.

function _checkDeploymentParams(address token, address target) private view;