Skip to main content

LockupTranched

Git Source

Namespace for the structs used in SablierV2LockupTranched.

Structs

CreateWithDurations

Struct encapsulating the parameters of the {SablierV2LockupTranched.createWithDurations} function.

struct CreateWithDurations {
address sender;
address recipient;
uint128 totalAmount;
IERC20 asset;
bool cancelable;
bool transferable;
TrancheWithDuration[] tranches;
Broker broker;
}

Properties

NameTypeDescription
senderaddressThe address distributing the assets, with the ability to cancel the stream. It doesn't have to be the same as msg.sender.
recipientaddressThe address receiving the assets.
totalAmountuint128The total amount of ERC-20 assets to be distributed, including the stream deposit and any broker fee, both denoted in units of the asset's decimals.
assetIERC20The contract address of the ERC-20 asset to be distributed.
cancelableboolIndicates if the stream is cancelable.
transferableboolIndicates if the stream NFT is transferable.
tranchesTrancheWithDuration[]Tranches with durations used to compose the tranched distribution function. Timestamps are calculated by starting from block.timestamp and adding each duration to the previous timestamp.
brokerBrokerStruct containing (i) the address of the broker assisting in creating the stream, and (ii) the percentage fee paid to the broker from totalAmount, denoted as a fixed-point number. Both can be set to zero.

CreateWithTimestamps

Struct encapsulating the parameters of the {SablierV2LockupTranched.createWithTimestamps} function.

struct CreateWithTimestamps {
address sender;
address recipient;
uint128 totalAmount;
IERC20 asset;
bool cancelable;
bool transferable;
uint40 startTime;
Tranche[] tranches;
Broker broker;
}

Properties

NameTypeDescription
senderaddressThe address distributing the assets, with the ability to cancel the stream. It doesn't have to be the same as msg.sender.
recipientaddressThe address receiving the assets.
totalAmountuint128The total amount of ERC-20 assets to be distributed, including the stream deposit and any broker fee, both denoted in units of the asset's decimals.
assetIERC20The contract address of the ERC-20 asset to be distributed.
cancelableboolIndicates if the stream is cancelable.
transferableboolIndicates if the stream NFT is transferable.
startTimeuint40The Unix timestamp indicating the stream's start.
tranchesTranche[]Tranches used to compose the tranched distribution function.
brokerBrokerStruct containing (i) the address of the broker assisting in creating the stream, and (ii) the percentage fee paid to the broker from totalAmount, denoted as a fixed-point number. Both can be set to zero.

StreamLT

Struct encapsulating the full details of a stream.

Extends Lockup.Stream by including the recipient and the tranches.

struct StreamLT {
address sender;
address recipient;
uint40 startTime;
uint40 endTime;
bool isCancelable;
bool wasCanceled;
IERC20 asset;
bool isDepleted;
bool isStream;
bool isTransferable;
Lockup.Amounts amounts;
Tranche[] tranches;
}

Timestamps

Struct encapsulating the LockupTranched timestamps.

struct Timestamps {
uint40 start;
uint40 end;
}

Properties

NameTypeDescription
startuint40The Unix timestamp indicating the stream's start.
enduint40The Unix timestamp indicating the stream's end.

Tranche

Tranche struct used in the Lockup Tranched stream.

struct Tranche {
uint128 amount;
uint40 timestamp;
}

Properties

NameTypeDescription
amountuint128The amount of assets to be unlocked in the tranche, denoted in units of the asset's decimals.
timestampuint40The Unix timestamp indicating the tranche's end.

TrancheWithDuration

Tranche struct used at runtime in {SablierV2LockupTranched.createWithDurations}.

struct TrancheWithDuration {
uint128 amount;
uint40 duration;
}

Properties

NameTypeDescription
amountuint128The amount of assets to be unlocked in the tranche, denoted in units of the asset's decimals.
durationuint40The time difference in seconds between the tranche and the previous one.