Skip to main content

LockupLinear

Git Source

Namespace for the structs used in SablierV2LockupLinear.

Structs

CreateWithDurations

Struct encapsulating the parameters for 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 streaming 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 paid, including the stream deposit and any potential fees, all denoted in units of the asset's decimals.
assetIERC20The contract address of the ERC-20 asset used for streaming.
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.

CreateWithRange

Struct encapsulating the parameters for the {SablierV2LockupLinear.createWithRange} function.

struct CreateWithRange {
address sender;
address recipient;
uint128 totalAmount;
IERC20 asset;
bool cancelable;
bool transferable;
Range range;
Broker broker;
}

Properties

NameTypeDescription
senderaddressThe address streaming 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 paid, including the stream deposit and any potential fees, all denoted in units of the asset's decimals.
assetIERC20The contract address of the ERC-20 asset used for streaming.
cancelableboolIndicates if the stream is cancelable.
transferableboolIndicates if the stream NFT is transferable.
rangeRangeStruct 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.

Range

Struct encapsulating the time range.

struct Range {
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.
enduint40The Unix timestamp for the stream's end.

Stream

Lockup Linear stream.

The fields are arranged like this to save gas via tight variable packing.

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

Properties

NameTypeDescription
senderaddressThe address streaming the assets, with the ability to cancel the stream.
startTimeuint40The Unix timestamp indicating the stream's start.
cliffTimeuint40The Unix timestamp indicating the cliff period's end.
isCancelableboolBoolean indicating if the stream is cancelable.
wasCanceledboolBoolean indicating if the stream was canceled.
assetIERC20The contract address of the ERC-20 asset used for streaming.
endTimeuint40The Unix timestamp indicating the stream's end.
isDepletedboolBoolean indicating if the stream is depleted.
isStreamboolBoolean indicating if the struct entity exists.
isTransferableboolBoolean indicating if the stream NFT is transferable.
amountsLockup.AmountsStruct containing the deposit, withdrawn, and refunded amounts, all denoted in units of the asset's decimals.