Skip to main content

LockupDynamic

Git Source

Namespace for the structs used in SablierV2LockupDynamic.

Structs

CreateWithDeltas

Struct encapsulating the parameters for the {SablierV2LockupDynamic.createWithDeltas} function.

struct CreateWithDeltas {
address sender;
bool cancelable;
bool transferable;
address recipient;
uint128 totalAmount;
IERC20 asset;
Broker broker;
SegmentWithDelta[] segments;
}

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.
cancelableboolIndicates if the stream is cancelable.
transferableboolIndicates if the stream NFT is transferable.
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.
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.
segmentsSegmentWithDelta[]Segments with deltas used to compose the custom streaming curve. Milestones are calculated by starting from block.timestamp and adding each delta to the previous milestone.

CreateWithMilestones

Struct encapsulating the parameters for the {SablierV2LockupDynamic.createWithMilestones} function.

struct CreateWithMilestones {
address sender;
uint40 startTime;
bool cancelable;
bool transferable;
address recipient;
uint128 totalAmount;
IERC20 asset;
Broker broker;
Segment[] segments;
}

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.
startTimeuint40The Unix timestamp indicating the stream's start.
cancelableboolIndicates if the stream is cancelable.
transferableboolIndicates if the stream NFT is transferable.
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.
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.
segmentsSegment[]Segments used to compose the custom streaming curve.

Range

Struct encapsulating the time range.

struct Range {
uint40 start;
uint40 end;
}

Properties

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

Segment

Segment struct used in the Lockup Dynamic stream.

struct Segment {
uint128 amount;
UD2x18 exponent;
uint40 milestone;
}

Properties

NameTypeDescription
amountuint128The amount of assets to be streamed in this segment, denoted in units of the asset's decimals.
exponentUD2x18The exponent of this segment, denoted as a fixed-point number.
milestoneuint40The Unix timestamp indicating this segment's end.

SegmentWithDelta

Segment struct used at runtime in {SablierV2LockupDynamic.createWithDeltas}.

struct SegmentWithDelta {
uint128 amount;
UD2x18 exponent;
uint40 delta;
}

Properties

NameTypeDescription
amountuint128The amount of assets to be streamed in this segment, denoted in units of the asset's decimals.
exponentUD2x18The exponent of this segment, denoted as a fixed-point number.
deltauint40The time difference in seconds between this segment and the previous one.

Stream

Lockup Dynamic stream.

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

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

Properties

NameTypeDescription
senderaddressThe address streaming the assets, with the ability to cancel the stream.
startTimeuint40The Unix timestamp indicating the stream's start.
endTimeuint40The Unix timestamp indicating the stream'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.
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.
segmentsSegment[]Segments used to compose the custom streaming curve.