Skip to main content

SablierV2MerkleLL

Git Source

Inherits: ISablierV2MerkleLL, SablierV2MerkleLockup

See the documentation in ISablierV2MerkleLL.

State Variables

LOCKUP_LINEAR

The address of the SablierV2LockupLinear contract.

ISablierV2LockupLinear public immutable override LOCKUP_LINEAR;

streamDurations

The total streaming duration of each stream.

LockupLinear.Durations public override streamDurations;

Functions

constructor

Constructs the contract by initializing the immutable state variables, and max approving the Sablier contract.

constructor(
MerkleLockup.ConstructorParams memory baseParams,
ISablierV2LockupLinear lockupLinear,
LockupLinear.Durations memory streamDurations_
)
SablierV2MerkleLockup(baseParams);

claim

Makes the claim by creating a LockupLinear stream to the recipient. A stream NFT is minted to the recipient.

Emits a {Claim} event. Requirements:

  • The campaign must not have expired.
  • The stream must not have been claimed already.
  • The Merkle proof must be valid.
function claim(
uint256 index,
address recipient,
uint128 amount,
bytes32[] calldata merkleProof
)
external
override
returns (uint256 streamId);

Parameters

NameTypeDescription
indexuint256The index of the recipient in the Merkle tree.
recipientaddressThe address of the stream holder.
amountuint128The amount of ERC-20 assets to be distributed via the claimed stream.
merkleProofbytes32[]The proof of inclusion in the Merkle tree.

Returns

NameTypeDescription
streamIduint256The id of the newly created stream.