Skip to main content

LockupLinear

Git Source

Namespace for the structs used in SablierV2LockupLinear.

Structs

CreateWithDurations

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

struct CreateWithDurations {
address sender;
address recipient;
uint128 totalAmount;
IERC20 asset;
bool cancelable;
bool transferable;
Durations durations;
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.
durationsDurationsStruct containing (i) cliff period duration and (ii) total stream duration, both in seconds.
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 {SablierV2LockupLinear.createWithTimestamps} function.

struct CreateWithTimestamps {
address sender;
address recipient;
uint128 totalAmount;
IERC20 asset;
bool cancelable;
bool transferable;
Timestamps timestamps;
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.
timestampsTimestampsStruct containing (i) the stream's start time, (ii) cliff time, and (iii) end time, all as Unix timestamps.
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.

Durations

Struct encapsulating the cliff duration and the total duration.

struct Durations {
uint40 cliff;
uint40 total;
}

Properties

NameTypeDescription
cliffuint40The cliff duration in seconds.
totaluint40The total duration in seconds.

StreamLL

Struct encapsulating the full details of a stream.

Extends Lockup.Stream by including the recipient and the cliff time.

struct StreamLL {
address sender;
address recipient;
uint40 startTime;
bool isCancelable;
bool wasCanceled;
IERC20 asset;
uint40 endTime;
bool isDepleted;
bool isStream;
bool isTransferable;
Lockup.Amounts amounts;
uint40 cliffTime;
}

Timestamps

Struct encapsulating the LockupLinear timestamps.

struct Timestamps {
uint40 start;
uint40 cliff;
uint40 end;
}

Properties

NameTypeDescription
startuint40The Unix timestamp for the stream's start.
cliffuint40The Unix timestamp for the cliff period's end. A value of zero means there is no cliff.
enduint40The Unix timestamp for the stream's end.