Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/include recipient in StreamLD StreamLL StreamLT #850

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions precompiles/Precompiles.sol

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/SablierV2LockupDynamic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ contract SablierV2LockupDynamic is
isTransferable: lockupStream.isTransferable,
isDepleted: lockupStream.isDepleted,
isStream: lockupStream.isStream,
sender: lockupStream.sender,
recipient: _ownerOf(streamId),
segments: _segments[streamId],
sender: lockupStream.sender,
startTime: lockupStream.startTime,
wasCanceled: lockupStream.wasCanceled
});
Expand Down
1 change: 1 addition & 0 deletions src/SablierV2LockupLinear.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ contract SablierV2LockupLinear is
isTransferable: lockupStream.isTransferable,
isDepleted: lockupStream.isDepleted,
isStream: lockupStream.isStream,
recipient: _ownerOf(streamId),
sender: lockupStream.sender,
startTime: lockupStream.startTime,
wasCanceled: lockupStream.wasCanceled
Expand Down
1 change: 1 addition & 0 deletions src/SablierV2LockupTranched.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ contract SablierV2LockupTranched is
isTransferable: lockupStream.isTransferable,
isDepleted: lockupStream.isDepleted,
isStream: lockupStream.isStream,
recipient: _ownerOf(streamId),
sender: lockupStream.sender,
startTime: lockupStream.startTime,
tranches: _tranches[streamId],
Expand Down
9 changes: 6 additions & 3 deletions src/types/DataTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ library LockupDynamic {

/// @notice Struct encapsulating all the data for a specific id, allowing anyone to retrieve all information within
/// one call to the contract.
/// @dev It contains the same data as the `Lockup.Stream` struct, plus the segments.
/// @dev It contains the same data as the `Lockup.Stream` struct, plus the recipient and the segments.
struct StreamLD {
address sender;
address recipient;
uint40 startTime;
uint40 endTime;
bool isCancelable;
Expand Down Expand Up @@ -264,9 +265,10 @@ library LockupLinear {

/// @notice Struct encapsulating all the data for a specific id, allowing anyone to retrieve all information within
/// one call to the contract.
/// @dev It contains the same data as the `Lockup.Stream` struct, plus the cliff value.
/// @dev It contains the same data as the `Lockup.Stream` struct, plus the recipient and the cliff value.
struct StreamLL {
address sender;
address recipient;
uint40 startTime;
bool isCancelable;
bool wasCanceled;
Expand Down Expand Up @@ -342,9 +344,10 @@ library LockupTranched {

/// @notice Struct encapsulating all the data for a specific id, allowing anyone to retrieve all information within
/// one call to the contract.
/// @dev It contains the same data as the `Lockup.Stream` struct, plus the tranches.
/// @dev It contains the same data as the `Lockup.Stream` struct, plus the recipient and the tranches.
struct StreamLT {
address sender;
address recipient;
uint40 startTime;
uint40 endTime;
bool isCancelable;
Expand Down
1 change: 1 addition & 0 deletions test/fork/LockupDynamic.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test {
assertEq(actualStream.isDepleted, false, "isDepleted");
assertEq(actualStream.isTransferable, true, "isTransferable");
assertEq(actualStream.isStream, true, "isStream");
assertEq(actualStream.recipient, params.recipient, "recipient");
assertEq(actualStream.segments, params.segments, "segments");
assertEq(actualStream.sender, params.sender, "sender");
assertEq(actualStream.startTime, params.startTime, "startTime");
Expand Down
1 change: 1 addition & 0 deletions test/fork/LockupLinear.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test {
assertEq(actualStream.isDepleted, false, "isDepleted");
assertEq(actualStream.isTransferable, true, "isTransferable");
assertEq(actualStream.isStream, true, "isStream");
assertEq(actualStream.recipient, params.recipient, "recipient");
assertEq(actualStream.sender, params.sender, "sender");
assertEq(actualStream.startTime, params.range.start, "startTime");
assertEq(actualStream.wasCanceled, false, "wasCanceled");
Expand Down
1 change: 1 addition & 0 deletions test/fork/LockupTranched.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test {
assertEq(actualStream.isDepleted, false, "isDepleted");
assertEq(actualStream.isTransferable, true, "isTransferable");
assertEq(actualStream.isStream, true, "isStream");
assertEq(actualStream.recipient, params.recipient, "recipient");
assertEq(actualStream.tranches, params.tranches, "tranches");
assertEq(actualStream.sender, params.sender, "sender");
assertEq(actualStream.startTime, params.startTime, "startTime");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ contract CreateWithDurations_LockupDynamic_Integration_Fuzz_Test is
assertEq(actualStream.isTransferable, true, "isTransferable");
assertEq(actualStream.isDepleted, false, "isDepleted");
assertEq(actualStream.isStream, true, "isStream");
assertEq(actualStream.recipient, users.recipient, "recipient");
assertEq(actualStream.segments, vars.segmentsWithTimestamps, "segments");
assertEq(actualStream.sender, users.sender, "sender");
assertEq(actualStream.startTime, range.start, "startTime");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ contract CreateWithTimestamps_LockupDynamic_Integration_Fuzz_Test is
assertEq(actualStream.isTransferable, true, "isTransferable");
assertEq(actualStream.isDepleted, false, "isStream");
assertEq(actualStream.isStream, true, "isStream");
assertEq(actualStream.recipient, params.recipient, "recipient");
assertEq(actualStream.sender, params.sender, "sender");
assertEq(actualStream.segments, params.segments, "segments");
assertEq(actualStream.startTime, range.start, "startTime");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ contract CreateWithTimestamps_LockupLinear_Integration_Fuzz_Test is
assertEq(actualStream.isDepleted, false, "isStream");
assertEq(actualStream.isTransferable, true, "isTransferable");
assertEq(actualStream.isStream, true, "isStream");
assertEq(actualStream.recipient, params.recipient, "recipient");
assertEq(actualStream.sender, params.sender, "sender");
assertEq(actualStream.startTime, params.range.start, "startTime");
assertEq(actualStream.wasCanceled, false, "wasCanceled");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ contract CreateWithDurations_LockupTranched_Integration_Fuzz_Test is
assertEq(actualStream.isTransferable, true, "isTransferable");
assertEq(actualStream.isDepleted, false, "isDepleted");
assertEq(actualStream.isStream, true, "isStream");
assertEq(actualStream.recipient, params.recipient, "recipient");
assertEq(actualStream.tranches, vars.tranchesWithTimestamps, "tranches");
assertEq(actualStream.sender, users.sender, "sender");
assertEq(actualStream.startTime, range.start, "startTime");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ contract CreateWithTimestamps_LockupTranched_Integration_Fuzz_Test is
assertEq(actualStream.isTransferable, true, "isTransferable");
assertEq(actualStream.isDepleted, false, "isStream");
assertEq(actualStream.isStream, true, "isStream");
assertEq(actualStream.recipient, params.recipient, "recipient");
assertEq(actualStream.sender, params.sender, "sender");
assertEq(actualStream.tranches, params.tranches, "tranches");
assertEq(actualStream.startTime, range.start, "startTime");
Expand Down
3 changes: 3 additions & 0 deletions test/utils/Assertions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ abstract contract Assertions is PRBTest, PRBMathAssertions {
assertEq(a.isDepleted, b.isDepleted, "isDepleted");
assertEq(a.isTransferable, b.isTransferable, "isTransferable");
assertEq(a.isStream, b.isStream, "isStream");
assertEq(a.recipient, b.recipient, "recipient");
assertEq(a.sender, b.sender, "sender");
assertEq(a.startTime, b.startTime, "startTime");
assertEq(a.wasCanceled, b.wasCanceled, "wasCanceled");
Expand All @@ -64,6 +65,7 @@ abstract contract Assertions is PRBTest, PRBMathAssertions {
assertEq(a.isDepleted, b.isDepleted, "isDepleted");
assertEq(a.isTransferable, b.isTransferable, "isTransferable");
assertEq(a.isStream, b.isStream, "isStream");
assertEq(a.recipient, b.recipient, "recipient");
assertEq(a.segments, b.segments, "segments");
assertEq(a.sender, b.sender, "sender");
assertEq(a.startTime, b.startTime, "startTime");
Expand All @@ -78,6 +80,7 @@ abstract contract Assertions is PRBTest, PRBMathAssertions {
assertEq(a.isDepleted, b.isDepleted, "isDepleted");
assertEq(a.isTransferable, b.isTransferable, "isTransferable");
assertEq(a.isStream, b.isStream, "isStream");
assertEq(a.recipient, b.recipient, "recipient");
assertEq(a.sender, b.sender, "sender");
assertEq(a.startTime, b.startTime, "startTime");
assertEq(a.tranches, b.tranches, "tranches");
Expand Down
3 changes: 3 additions & 0 deletions test/utils/Defaults.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ contract Defaults is Constants {
isDepleted: false,
isStream: true,
isTransferable: true,
recipient: users.recipient,
segments: segments(),
sender: users.sender,
startTime: START_TIME,
Expand All @@ -117,6 +118,7 @@ contract Defaults is Constants {
isTransferable: true,
isDepleted: false,
isStream: true,
recipient: users.recipient,
sender: users.sender,
startTime: START_TIME,
wasCanceled: false
Expand All @@ -136,6 +138,7 @@ contract Defaults is Constants {
isDepleted: false,
isStream: true,
isTransferable: true,
recipient: users.recipient,
sender: users.sender,
startTime: START_TIME,
tranches: tranches(),
Expand Down
Loading