From 720cc45409ef3122c30e9d35089dc0e7ecfc04b1 Mon Sep 17 00:00:00 2001 From: andreivladbrg Date: Sun, 21 Jan 2024 22:16:35 +0200 Subject: [PATCH] refactor: rename create functions --- script/Init.s.sol | 4 +- src/SablierV2LockupDynamic.sol | 14 +-- src/SablierV2LockupLinear.sol | 17 ++-- src/interfaces/ISablierV2LockupDynamic.sol | 8 +- src/interfaces/ISablierV2LockupLinear.sol | 6 +- src/libraries/Helpers.sol | 8 +- src/types/DataTypes.sol | 14 +-- test/fork/LockupDynamic.t.sol | 4 +- test/fork/LockupLinear.t.sol | 4 +- .../createWithDurations.t.sol} | 19 ++-- .../createWithDurations.tree} | 2 +- .../createWithTimestamps.t.sol} | 28 +++--- .../createWithTimestamps.tree} | 2 +- .../createWithDurations.t.sol | 2 +- .../createWithTimestamps.t.sol} | 25 ++--- .../createWithTimestamps.tree} | 2 +- ...Deltas.t.sol => createWithDurations.t.sol} | 16 ++-- ...tones.t.sol => createWithTimestamps.t.sol} | 22 ++--- .../lockup-dynamic/streamedAmountOf.t.sol | 12 +-- .../fuzz/lockup-dynamic/withdraw.t.sol | 4 +- .../lockup-dynamic/withdrawableAmountOf.t.sol | 8 +- ...Range.t.sol => createWithTimestamps.t.sol} | 18 ++-- .../fuzz/lockup-linear/streamedAmountOf.t.sol | 8 +- .../lockup-linear/withdrawableAmountOf.t.sol | 8 +- .../shared/lockup-dynamic/LockupDynamic.t.sol | 92 +++++++++---------- ...Deltas.t.sol => createWithDurations.t.sol} | 2 +- ...tones.t.sol => createWithTimestamps.t.sol} | 2 +- .../shared/lockup-linear/LockupLinear.t.sol | 54 +++++------ ...Range.t.sol => createWithTimestamps.t.sol} | 2 +- .../handlers/LockupDynamicCreateHandler.sol | 16 ++-- .../handlers/LockupLinearCreateHandler.sol | 8 +- test/utils/Defaults.sol | 14 +-- 32 files changed, 227 insertions(+), 218 deletions(-) rename test/integration/concrete/lockup-dynamic/{create-with-deltas/createWithDeltas.t.sol => create-with-durations/createWithDurations.t.sol} (92%) rename test/integration/concrete/lockup-dynamic/{create-with-deltas/createWithDeltas.tree => create-with-durations/createWithDurations.tree} (97%) rename test/integration/concrete/lockup-dynamic/{create-with-milestones/createWithMilestones.t.sol => create-with-timestamps/createWithTimestamps.t.sol} (93%) rename test/integration/concrete/lockup-dynamic/{create-with-milestones/createWithMilestones.tree => create-with-timestamps/createWithTimestamps.tree} (99%) rename test/integration/concrete/lockup-linear/{create-with-range/createWithRange.t.sol => create-with-timestamps/createWithTimestamps.t.sol} (90%) rename test/integration/concrete/lockup-linear/{create-with-range/createWithRange.tree => create-with-timestamps/createWithTimestamps.tree} (99%) rename test/integration/fuzz/lockup-dynamic/{createWithDeltas.t.sol => createWithDurations.t.sol} (91%) rename test/integration/fuzz/lockup-dynamic/{createWithMilestones.t.sol => createWithTimestamps.t.sol} (95%) rename test/integration/fuzz/lockup-linear/{createWithRange.t.sol => createWithTimestamps.t.sol} (94%) rename test/integration/shared/lockup-dynamic/{createWithDeltas.t.sol => createWithDurations.t.sol} (85%) rename test/integration/shared/lockup-dynamic/{createWithMilestones.t.sol => createWithTimestamps.t.sol} (94%) rename test/integration/shared/lockup-linear/{createWithRange.t.sol => createWithTimestamps.t.sol} (89%) diff --git a/script/Init.s.sol b/script/Init.s.sol index 4186ac3e0..3979c9bee 100644 --- a/script/Init.s.sol +++ b/script/Init.s.sol @@ -81,8 +81,8 @@ contract Init is BaseScript { LockupDynamic.SegmentWithDelta[] memory segments = new LockupDynamic.SegmentWithDelta[](2); segments[0] = LockupDynamic.SegmentWithDelta({ amount: 2500e18, exponent: ud2x18(3.14e18), delta: 1 hours }); segments[1] = LockupDynamic.SegmentWithDelta({ amount: 7500e18, exponent: ud2x18(0.5e18), delta: 1 weeks }); - lockupDynamic.createWithDeltas( - LockupDynamic.CreateWithDeltas({ + lockupDynamic.createWithDurations( + LockupDynamic.CreateWithDurations({ sender: sender, recipient: recipient, totalAmount: 10_000e18, diff --git a/src/SablierV2LockupDynamic.sol b/src/SablierV2LockupDynamic.sol index 03fc8c8d5..060b5aa9c 100644 --- a/src/SablierV2LockupDynamic.sol +++ b/src/SablierV2LockupDynamic.sol @@ -267,7 +267,7 @@ contract SablierV2LockupDynamic is //////////////////////////////////////////////////////////////////////////*/ /// @inheritdoc ISablierV2LockupDynamic - function createWithDeltas(LockupDynamic.CreateWithDeltas calldata params) + function createWithDurations(LockupDynamic.CreateWithDurations calldata params) external override noDelegateCall @@ -277,8 +277,8 @@ contract SablierV2LockupDynamic is LockupDynamic.Segment[] memory segments = Helpers.checkDeltasAndCalculateMilestones(params.segments); // Checks, Effects and Interactions: create the stream. - streamId = _createWithMilestones( - LockupDynamic.CreateWithMilestones({ + streamId = _createWithTimestamps( + LockupDynamic.CreateWithTimestamps({ sender: params.sender, recipient: params.recipient, totalAmount: params.totalAmount, @@ -293,14 +293,14 @@ contract SablierV2LockupDynamic is } /// @inheritdoc ISablierV2LockupDynamic - function createWithMilestones(LockupDynamic.CreateWithMilestones calldata params) + function createWithTimestamps(LockupDynamic.CreateWithTimestamps calldata params) external override noDelegateCall returns (uint256 streamId) { // Checks, Effects and Interactions: create the stream. - streamId = _createWithMilestones(params); + streamId = _createWithTimestamps(params); } /*////////////////////////////////////////////////////////////////////////// @@ -537,7 +537,7 @@ contract SablierV2LockupDynamic is } /// @dev See the documentation for the user-facing functions that call this internal function. - function _createWithMilestones(LockupDynamic.CreateWithMilestones memory params) + function _createWithTimestamps(LockupDynamic.CreateWithTimestamps memory params) internal returns (uint256 streamId) { @@ -550,7 +550,7 @@ contract SablierV2LockupDynamic is Helpers.checkAndCalculateFees(params.totalAmount, protocolFee, params.broker.fee, MAX_FEE); // Checks: validate the user-provided parameters. - Helpers.checkCreateWithMilestones(createAmounts.deposit, params.segments, MAX_SEGMENT_COUNT, params.startTime); + Helpers.checkCreateWithTimestamps(createAmounts.deposit, params.segments, MAX_SEGMENT_COUNT, params.startTime); // Load the stream id in a variable. streamId = nextStreamId; diff --git a/src/SablierV2LockupLinear.sol b/src/SablierV2LockupLinear.sol index 56fe191c9..a1eb4f98f 100644 --- a/src/SablierV2LockupLinear.sol +++ b/src/SablierV2LockupLinear.sol @@ -261,15 +261,15 @@ contract SablierV2LockupLinear is range.start = uint40(block.timestamp); // Calculate the cliff time and the end time. It is safe to use unchecked arithmetic because - // {_createWithRange} will nonetheless check that the end time is greater than the cliff time, + // {_createWithTimestamps} will nonetheless check that the end time is greater than the cliff time, // and also that the cliff time is greater than or equal to the start time. unchecked { range.cliff = range.start + params.durations.cliff; range.end = range.start + params.durations.total; } // Checks, Effects and Interactions: create the stream. - streamId = _createWithRange( - LockupLinear.CreateWithRange({ + streamId = _createWithTimestamps( + LockupLinear.CreateWithTimestamps({ sender: params.sender, recipient: params.recipient, totalAmount: params.totalAmount, @@ -283,14 +283,14 @@ contract SablierV2LockupLinear is } /// @inheritdoc ISablierV2LockupLinear - function createWithRange(LockupLinear.CreateWithRange calldata params) + function createWithTimestamps(LockupLinear.CreateWithTimestamps calldata params) external override noDelegateCall returns (uint256 streamId) { // Checks, Effects and Interactions: create the stream. - streamId = _createWithRange(params); + streamId = _createWithTimestamps(params); } /*////////////////////////////////////////////////////////////////////////// @@ -452,7 +452,10 @@ contract SablierV2LockupLinear is } /// @dev See the documentation for the user-facing functions that call this internal function. - function _createWithRange(LockupLinear.CreateWithRange memory params) internal returns (uint256 streamId) { + function _createWithTimestamps(LockupLinear.CreateWithTimestamps memory params) + internal + returns (uint256 streamId) + { // Safe Interactions: query the protocol fee. This is safe because it's a known Sablier contract that does // not call other unknown contracts. UD60x18 protocolFee = comptroller.protocolFees(params.asset); @@ -462,7 +465,7 @@ contract SablierV2LockupLinear is Helpers.checkAndCalculateFees(params.totalAmount, protocolFee, params.broker.fee, MAX_FEE); // Checks: validate the user-provided parameters. - Helpers.checkCreateWithRange(createAmounts.deposit, params.range); + Helpers.checkCreateWithTimestamps(createAmounts.deposit, params.range); // Load the stream id. streamId = nextStreamId; diff --git a/src/interfaces/ISablierV2LockupDynamic.sol b/src/interfaces/ISablierV2LockupDynamic.sol index e60cb3fee..bf030bd99 100644 --- a/src/interfaces/ISablierV2LockupDynamic.sol +++ b/src/interfaces/ISablierV2LockupDynamic.sol @@ -98,11 +98,13 @@ interface ISablierV2LockupDynamic is ISablierV2Lockup { /// @dev Emits a {Transfer} and {CreateLockupDynamicStream} event. /// /// Requirements: - /// - All requirements in {createWithMilestones} must be met for the calculated parameters. + /// - All requirements in {createWithTimestamps} must be met for the calculated parameters. /// /// @param params Struct encapsulating the function parameters, which are documented in {DataTypes}. /// @return streamId The id of the newly created stream. - function createWithDeltas(LockupDynamic.CreateWithDeltas calldata params) external returns (uint256 streamId); + function createWithDurations(LockupDynamic.CreateWithDurations calldata params) + external + returns (uint256 streamId); /// @notice Creates a stream with the provided segment milestones, implying the end time from the last milestone. /// The stream is funded by `msg.sender` and is wrapped in an ERC-721 NFT. @@ -127,7 +129,7 @@ interface ISablierV2LockupDynamic is ISablierV2Lockup { /// /// @param params Struct encapsulating the function parameters, which are documented in {DataTypes}. /// @return streamId The id of the newly created stream. - function createWithMilestones(LockupDynamic.CreateWithMilestones calldata params) + function createWithTimestamps(LockupDynamic.CreateWithTimestamps calldata params) external returns (uint256 streamId); } diff --git a/src/interfaces/ISablierV2LockupLinear.sol b/src/interfaces/ISablierV2LockupLinear.sol index 95ecd1f16..a8f066896 100644 --- a/src/interfaces/ISablierV2LockupLinear.sol +++ b/src/interfaces/ISablierV2LockupLinear.sol @@ -92,7 +92,7 @@ interface ISablierV2LockupLinear is ISablierV2Lockup { /// @dev Emits a {Transfer} and {CreateLockupLinearStream} event. /// /// Requirements: - /// - All requirements in {createWithRange} must be met for the calculated parameters. + /// - All requirements in {createWithTimestamps} must be met for the calculated parameters. /// /// @param params Struct encapsulating the function parameters, which are documented in {DataTypes}. /// @return streamId The id of the newly created stream. @@ -120,5 +120,7 @@ interface ISablierV2LockupLinear is ISablierV2Lockup { /// /// @param params Struct encapsulating the function parameters, which are documented in {DataTypes}. /// @return streamId The id of the newly created stream. - function createWithRange(LockupLinear.CreateWithRange calldata params) external returns (uint256 streamId); + function createWithTimestamps(LockupLinear.CreateWithTimestamps calldata params) + external + returns (uint256 streamId); } diff --git a/src/libraries/Helpers.sol b/src/libraries/Helpers.sol index cfc9e2d54..319cc28b9 100644 --- a/src/libraries/Helpers.sol +++ b/src/libraries/Helpers.sol @@ -55,8 +55,8 @@ library Helpers { amounts.deposit = totalAmount - amounts.protocolFee - amounts.brokerFee; } - /// @dev Checks the parameters of the {SablierV2LockupDynamic-_createWithMilestones} function. - function checkCreateWithMilestones( + /// @dev Checks the parameters of the {SablierV2LockupDynamic-_createWithTimestamps} function. + function checkCreateWithTimestamps( uint128 depositAmount, LockupDynamic.Segment[] memory segments, uint256 maxSegmentCount, @@ -85,8 +85,8 @@ library Helpers { _checkSegments(segments, depositAmount, startTime); } - /// @dev Checks the parameters of the {SablierV2LockupLinear-_createWithRange} function. - function checkCreateWithRange(uint128 depositAmount, LockupLinear.Range memory range) internal view { + /// @dev Checks the parameters of the {SablierV2LockupLinear-_createWithTimestamps} function. + function checkCreateWithTimestamps(uint128 depositAmount, LockupLinear.Range memory range) internal view { // Checks: the deposit amount is not zero. if (depositAmount == 0) { revert Errors.SablierV2Lockup_DepositAmountZero(); diff --git a/src/types/DataTypes.sol b/src/types/DataTypes.sol index ce6366ed5..1a9337a04 100644 --- a/src/types/DataTypes.sol +++ b/src/types/DataTypes.sol @@ -70,7 +70,7 @@ library Lockup { /// @notice Namespace for the structs used in {SablierV2LockupDynamic}. library LockupDynamic { - /// @notice Struct encapsulating the parameters for the {SablierV2LockupDynamic.createWithDeltas} function. + /// @notice Struct encapsulating the parameters for the {SablierV2LockupDynamic.createWithDurations} function. /// @param sender The address streaming the assets, with the ability to cancel the stream. It doesn't have to be the /// same as `msg.sender`. /// @param recipient The address receiving the assets. @@ -83,7 +83,7 @@ library LockupDynamic { /// starting from `block.timestamp` and adding each delta to the previous milestone. /// @param broker Struct 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. - struct CreateWithDeltas { + struct CreateWithDurations { address sender; address recipient; uint128 totalAmount; @@ -94,7 +94,7 @@ library LockupDynamic { Broker broker; } - /// @notice Struct encapsulating the parameters for the {SablierV2LockupDynamic.createWithMilestones} + /// @notice Struct encapsulating the parameters for the {SablierV2LockupDynamic.createWithTimestamps} /// function. /// @param sender The address streaming the assets, with the ability to cancel the stream. It doesn't have to be the /// same as `msg.sender`. @@ -108,7 +108,7 @@ library LockupDynamic { /// @param segments Segments used to compose the custom streaming curve. /// @param broker Struct 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. - struct CreateWithMilestones { + struct CreateWithTimestamps { address sender; address recipient; uint128 totalAmount; @@ -139,7 +139,7 @@ library LockupDynamic { uint40 milestone; } - /// @notice Segment struct used at runtime in {SablierV2LockupDynamic.createWithDeltas}. + /// @notice Segment struct used at runtime in {SablierV2LockupDynamic.createWithDurations}. /// @param amount The amount of assets to be streamed in this segment, denoted in units of the asset's decimals. /// @param exponent The exponent of this segment, denoted as a fixed-point number. /// @param delta The time difference in seconds between this segment and the previous one. @@ -207,7 +207,7 @@ library LockupLinear { Broker broker; } - /// @notice Struct encapsulating the parameters for the {SablierV2LockupLinear.createWithRange} function. + /// @notice Struct encapsulating the parameters for the {SablierV2LockupLinear.createWithTimestamps} function. /// @param sender The address streaming the assets, with the ability to cancel the stream. It doesn't have to be the /// same as `msg.sender`. /// @param recipient The address receiving the assets. @@ -220,7 +220,7 @@ library LockupLinear { /// timestamps. /// @param broker Struct 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. - struct CreateWithRange { + struct CreateWithTimestamps { address sender; address recipient; uint128 totalAmount; diff --git a/test/fork/LockupDynamic.t.sol b/test/fork/LockupDynamic.t.sol index ea1f40f5a..4e7b0c2de 100644 --- a/test/fork/LockupDynamic.t.sol +++ b/test/fork/LockupDynamic.t.sol @@ -177,8 +177,8 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { }); // Create the stream. - lockupDynamic.createWithMilestones( - LockupDynamic.CreateWithMilestones({ + lockupDynamic.createWithTimestamps( + LockupDynamic.CreateWithTimestamps({ sender: params.sender, recipient: params.recipient, totalAmount: vars.totalAmount, diff --git a/test/fork/LockupLinear.t.sol b/test/fork/LockupLinear.t.sol index 7207590fd..d390e49d0 100644 --- a/test/fork/LockupLinear.t.sol +++ b/test/fork/LockupLinear.t.sol @@ -179,8 +179,8 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { }); // Create the stream. - lockupLinear.createWithRange( - LockupLinear.CreateWithRange({ + lockupLinear.createWithTimestamps( + LockupLinear.CreateWithTimestamps({ sender: params.sender, recipient: params.recipient, totalAmount: params.totalAmount, diff --git a/test/integration/concrete/lockup-dynamic/create-with-deltas/createWithDeltas.t.sol b/test/integration/concrete/lockup-dynamic/create-with-durations/createWithDurations.t.sol similarity index 92% rename from test/integration/concrete/lockup-dynamic/create-with-deltas/createWithDeltas.t.sol rename to test/integration/concrete/lockup-dynamic/create-with-durations/createWithDurations.t.sol index 4affdbb97..aeac29e30 100644 --- a/test/integration/concrete/lockup-dynamic/create-with-deltas/createWithDeltas.t.sol +++ b/test/integration/concrete/lockup-dynamic/create-with-durations/createWithDurations.t.sol @@ -7,26 +7,27 @@ import { ISablierV2LockupDynamic } from "src/interfaces/ISablierV2LockupDynamic. import { Errors } from "src/libraries/Errors.sol"; import { Lockup, LockupDynamic } from "src/types/DataTypes.sol"; -import { CreateWithDeltas_Integration_Shared_Test } from "../../../shared/lockup-dynamic/createWithDeltas.t.sol"; +import { CreateWithDurations_Integration_Shared_Test } from "../../../shared/lockup-dynamic/createWithDurations.t.sol"; import { LockupDynamic_Integration_Concrete_Test } from "../LockupDynamic.t.sol"; -contract CreateWithDeltas_LockupDynamic_Integration_Concrete_Test is +contract CreateWithDurations_LockupDynamic_Integration_Concrete_Test is LockupDynamic_Integration_Concrete_Test, - CreateWithDeltas_Integration_Shared_Test + CreateWithDurations_Integration_Shared_Test { function setUp() public virtual - override(LockupDynamic_Integration_Concrete_Test, CreateWithDeltas_Integration_Shared_Test) + override(LockupDynamic_Integration_Concrete_Test, CreateWithDurations_Integration_Shared_Test) { LockupDynamic_Integration_Concrete_Test.setUp(); - CreateWithDeltas_Integration_Shared_Test.setUp(); + CreateWithDurations_Integration_Shared_Test.setUp(); streamId = lockupDynamic.nextStreamId(); } /// @dev it should revert. function test_RevertWhen_DelegateCalled() external { - bytes memory callData = abi.encodeCall(ISablierV2LockupDynamic.createWithDeltas, defaults.createWithDeltas()); + bytes memory callData = + abi.encodeCall(ISablierV2LockupDynamic.createWithDurations, defaults.createWithDurationsLD()); (bool success, bytes memory returnData) = address(lockupDynamic).delegatecall(callData); expectRevertDueToDelegateCall(success, returnData); } @@ -44,7 +45,7 @@ contract CreateWithDeltas_LockupDynamic_Integration_Concrete_Test is whenLoopCalculationsDoNotOverflowBlockGasLimit { uint40 startTime = getBlockTimestamp(); - LockupDynamic.SegmentWithDelta[] memory segments = defaults.createWithDeltas().segments; + LockupDynamic.SegmentWithDelta[] memory segments = defaults.createWithDurationsLD().segments; segments[1].delta = 0; uint256 index = 1; vm.expectRevert( @@ -66,7 +67,7 @@ contract CreateWithDeltas_LockupDynamic_Integration_Concrete_Test is { unchecked { uint40 startTime = getBlockTimestamp(); - LockupDynamic.SegmentWithDelta[] memory segments = defaults.createWithDeltas().segments; + LockupDynamic.SegmentWithDelta[] memory segments = defaults.createWithDurationsLD().segments; segments[0].delta = MAX_UINT40; vm.expectRevert( abi.encodeWithSelector( @@ -111,7 +112,7 @@ contract CreateWithDeltas_LockupDynamic_Integration_Concrete_Test is } } - function test_CreateWithDeltas() + function test_CreateWithDurations() external whenNotDelegateCalled whenLoopCalculationsDoNotOverflowBlockGasLimit diff --git a/test/integration/concrete/lockup-dynamic/create-with-deltas/createWithDeltas.tree b/test/integration/concrete/lockup-dynamic/create-with-durations/createWithDurations.tree similarity index 97% rename from test/integration/concrete/lockup-dynamic/create-with-deltas/createWithDeltas.tree rename to test/integration/concrete/lockup-dynamic/create-with-durations/createWithDurations.tree index 3824747f3..e3a5c988a 100644 --- a/test/integration/concrete/lockup-dynamic/create-with-deltas/createWithDeltas.tree +++ b/test/integration/concrete/lockup-dynamic/create-with-durations/createWithDurations.tree @@ -1,4 +1,4 @@ -createWithDeltas.t.sol +createWithDurations.t.sol ├── when delegate called │ └── it should revert └── when not delegate called diff --git a/test/integration/concrete/lockup-dynamic/create-with-milestones/createWithMilestones.t.sol b/test/integration/concrete/lockup-dynamic/create-with-timestamps/createWithTimestamps.t.sol similarity index 93% rename from test/integration/concrete/lockup-dynamic/create-with-milestones/createWithMilestones.t.sol rename to test/integration/concrete/lockup-dynamic/create-with-timestamps/createWithTimestamps.t.sol index 5a7b028b6..b39b7251a 100644 --- a/test/integration/concrete/lockup-dynamic/create-with-milestones/createWithMilestones.t.sol +++ b/test/integration/concrete/lockup-dynamic/create-with-timestamps/createWithTimestamps.t.sol @@ -9,25 +9,25 @@ import { ISablierV2LockupDynamic } from "src/interfaces/ISablierV2LockupDynamic. import { Errors } from "src/libraries/Errors.sol"; import { Broker, Lockup, LockupDynamic } from "src/types/DataTypes.sol"; -import { CreateWithMilestones_Integration_Shared_Test } from "../../../shared/lockup-dynamic/createWithMilestones.t.sol"; +import { CreateWithTimestamps_Integration_Shared_Test } from "../../../shared/lockup-dynamic/createWithTimestamps.t.sol"; import { LockupDynamic_Integration_Concrete_Test } from "../LockupDynamic.t.sol"; -contract CreateWithMilestones_LockupDynamic_Integration_Concrete_Test is +contract CreateWithTimestamps_LockupDynamic_Integration_Concrete_Test is LockupDynamic_Integration_Concrete_Test, - CreateWithMilestones_Integration_Shared_Test + CreateWithTimestamps_Integration_Shared_Test { function setUp() public virtual - override(LockupDynamic_Integration_Concrete_Test, CreateWithMilestones_Integration_Shared_Test) + override(LockupDynamic_Integration_Concrete_Test, CreateWithTimestamps_Integration_Shared_Test) { LockupDynamic_Integration_Concrete_Test.setUp(); - CreateWithMilestones_Integration_Shared_Test.setUp(); + CreateWithTimestamps_Integration_Shared_Test.setUp(); } function test_RevertWhen_DelegateCalled() external { bytes memory callData = - abi.encodeCall(ISablierV2LockupDynamic.createWithMilestones, defaults.createWithMilestones()); + abi.encodeCall(ISablierV2LockupDynamic.createWithTimestamps, defaults.createWithTimestampsLD()); (bool success, bytes memory returnData) = address(lockupDynamic).delegatecall(callData); expectRevertDueToDelegateCall(success, returnData); } @@ -208,7 +208,7 @@ contract CreateWithMilestones_LockupDynamic_Integration_Concrete_Test is uint128 depositAmount = defaultDepositAmount + 100; // Prepare the params. - LockupDynamic.CreateWithMilestones memory params = defaults.createWithMilestones(); + LockupDynamic.CreateWithTimestamps memory params = defaults.createWithTimestampsLD(); params.broker = Broker({ account: address(0), fee: brokerFee }); params.totalAmount = depositAmount; @@ -222,7 +222,7 @@ contract CreateWithMilestones_LockupDynamic_Integration_Concrete_Test is ); // Create the stream. - lockupDynamic.createWithMilestones(params); + lockupDynamic.createWithTimestamps(params); } function test_RevertGiven_ProtocolFeeTooHigh() @@ -299,7 +299,7 @@ contract CreateWithMilestones_LockupDynamic_Integration_Concrete_Test is createDefaultStreamWithAsset(IERC20(nonContract)); } - function test_CreateWithMilestones_AssetMissingReturnValue() + function test_CreateWithTimestamps_AssetMissingReturnValue() external whenNotDelegateCalled whenRecipientNonZeroAddress @@ -315,10 +315,10 @@ contract CreateWithMilestones_LockupDynamic_Integration_Concrete_Test is whenBrokerFeeNotTooHigh whenAssetContract { - testCreateWithMilestones(address(usdt)); + testCreateWithTimestamps(address(usdt)); } - function test_CreateWithMilestones() + function test_CreateWithTimestamps() external whenNotDelegateCalled whenRecipientNonZeroAddress @@ -335,11 +335,11 @@ contract CreateWithMilestones_LockupDynamic_Integration_Concrete_Test is whenAssetContract whenAssetERC20 { - testCreateWithMilestones(address(dai)); + testCreateWithTimestamps(address(dai)); } - /// @dev Shared logic between {test_CreateWithMilestones_AssetMissingReturnValue} and {test_CreateWithMilestones}. - function testCreateWithMilestones(address asset) internal { + /// @dev Shared logic between {test_CreateWithTimestamps_AssetMissingReturnValue} and {test_CreateWithTimestamps}. + function testCreateWithTimestamps(address asset) internal { // Make the Sender the stream's funder. address funder = users.sender; diff --git a/test/integration/concrete/lockup-dynamic/create-with-milestones/createWithMilestones.tree b/test/integration/concrete/lockup-dynamic/create-with-timestamps/createWithTimestamps.tree similarity index 99% rename from test/integration/concrete/lockup-dynamic/create-with-milestones/createWithMilestones.tree rename to test/integration/concrete/lockup-dynamic/create-with-timestamps/createWithTimestamps.tree index c90aecfc5..6debf4ca6 100644 --- a/test/integration/concrete/lockup-dynamic/create-with-milestones/createWithMilestones.tree +++ b/test/integration/concrete/lockup-dynamic/create-with-timestamps/createWithTimestamps.tree @@ -1,4 +1,4 @@ -createWithMilestones.t.sol +createWithTimestamps.t.sol ├── when delegate called │ └── it should revert └── when not delegate called diff --git a/test/integration/concrete/lockup-linear/create-with-durations/createWithDurations.t.sol b/test/integration/concrete/lockup-linear/create-with-durations/createWithDurations.t.sol index f01eb9415..835b7af64 100644 --- a/test/integration/concrete/lockup-linear/create-with-durations/createWithDurations.t.sol +++ b/test/integration/concrete/lockup-linear/create-with-durations/createWithDurations.t.sol @@ -23,7 +23,7 @@ contract CreateWithDurations_LockupLinear_Integration_Concrete_Test is function test_RevertWhen_DelegateCalled() external { bytes memory callData = - abi.encodeCall(ISablierV2LockupLinear.createWithDurations, defaults.createWithDurations()); + abi.encodeCall(ISablierV2LockupLinear.createWithDurations, defaults.createWithDurationsLL()); (bool success, bytes memory returnData) = address(lockupLinear).delegatecall(callData); expectRevertDueToDelegateCall(success, returnData); } diff --git a/test/integration/concrete/lockup-linear/create-with-range/createWithRange.t.sol b/test/integration/concrete/lockup-linear/create-with-timestamps/createWithTimestamps.t.sol similarity index 90% rename from test/integration/concrete/lockup-linear/create-with-range/createWithRange.t.sol rename to test/integration/concrete/lockup-linear/create-with-timestamps/createWithTimestamps.t.sol index 14c5f4018..1cc002290 100644 --- a/test/integration/concrete/lockup-linear/create-with-range/createWithRange.t.sol +++ b/test/integration/concrete/lockup-linear/create-with-timestamps/createWithTimestamps.t.sol @@ -8,24 +8,25 @@ import { ISablierV2LockupLinear } from "src/interfaces/ISablierV2LockupLinear.so import { Errors } from "src/libraries/Errors.sol"; import { Broker, Lockup, LockupLinear } from "src/types/DataTypes.sol"; -import { CreateWithRange_Integration_Shared_Test } from "../../../shared/lockup-linear/createWithRange.t.sol"; +import { CreateWithTimestamps_Integration_Shared_Test } from "../../../shared/lockup-linear/createWithTimestamps.t.sol"; import { LockupLinear_Integration_Concrete_Test } from "../LockupLinear.t.sol"; -contract CreateWithRange_LockupLinear_Integration_Concrete_Test is +contract CreateWithTimestamps_LockupLinear_Integration_Concrete_Test is LockupLinear_Integration_Concrete_Test, - CreateWithRange_Integration_Shared_Test + CreateWithTimestamps_Integration_Shared_Test { function setUp() public virtual - override(LockupLinear_Integration_Concrete_Test, CreateWithRange_Integration_Shared_Test) + override(LockupLinear_Integration_Concrete_Test, CreateWithTimestamps_Integration_Shared_Test) { LockupLinear_Integration_Concrete_Test.setUp(); - CreateWithRange_Integration_Shared_Test.setUp(); + CreateWithTimestamps_Integration_Shared_Test.setUp(); } function test_RevertWhen_DelegateCalled() external { - bytes memory callData = abi.encodeCall(ISablierV2LockupLinear.createWithRange, defaults.createWithRange()); + bytes memory callData = + abi.encodeCall(ISablierV2LockupLinear.createWithTimestamps, defaults.createWithTimestampsLL()); (bool success, bytes memory returnData) = address(lockupLinear).delegatecall(callData); expectRevertDueToDelegateCall(success, returnData); } @@ -146,7 +147,7 @@ contract CreateWithRange_LockupLinear_Integration_Concrete_Test is createDefaultStreamWithAsset(IERC20(nonContract)); } - function test_CreateWithRange_AssetMissingReturnValue() + function test_CreateWithTimestamps_AssetMissingReturnValue() external whenNotDelegateCalled whenRecipientNonZeroAddress @@ -158,10 +159,10 @@ contract CreateWithRange_LockupLinear_Integration_Concrete_Test is whenBrokerFeeNotTooHigh whenAssetContract { - testCreateWithRange(address(usdt)); + testCreateWithTimestamps(address(usdt)); } - function test_CreateWithRange() + function test_CreateWithTimestamps() external whenNotDelegateCalled whenDepositAmountNotZero @@ -173,11 +174,11 @@ contract CreateWithRange_LockupLinear_Integration_Concrete_Test is whenAssetContract whenAssetERC20 { - testCreateWithRange(address(dai)); + testCreateWithTimestamps(address(dai)); } - /// @dev Shared logic between {test_CreateWithRange_AssetMissingReturnValue} and {test_CreateWithRange}. - function testCreateWithRange(address asset) internal { + /// @dev Shared logic between {test_CreateWithTimestamps_AssetMissingReturnValue} and {test_CreateWithTimestamps}. + function testCreateWithTimestamps(address asset) internal { // Make the Sender the stream's funder. address funder = users.sender; diff --git a/test/integration/concrete/lockup-linear/create-with-range/createWithRange.tree b/test/integration/concrete/lockup-linear/create-with-timestamps/createWithTimestamps.tree similarity index 99% rename from test/integration/concrete/lockup-linear/create-with-range/createWithRange.tree rename to test/integration/concrete/lockup-linear/create-with-timestamps/createWithTimestamps.tree index 6d810042a..407705603 100644 --- a/test/integration/concrete/lockup-linear/create-with-range/createWithRange.tree +++ b/test/integration/concrete/lockup-linear/create-with-timestamps/createWithTimestamps.tree @@ -1,4 +1,4 @@ -createWithRange.t.sol +createWithTimestamps.t.sol ├── when delegate called │ └── it should revert └── when not delegate called diff --git a/test/integration/fuzz/lockup-dynamic/createWithDeltas.t.sol b/test/integration/fuzz/lockup-dynamic/createWithDurations.t.sol similarity index 91% rename from test/integration/fuzz/lockup-dynamic/createWithDeltas.t.sol rename to test/integration/fuzz/lockup-dynamic/createWithDurations.t.sol index 87a61d646..81d7ca19c 100644 --- a/test/integration/fuzz/lockup-dynamic/createWithDeltas.t.sol +++ b/test/integration/fuzz/lockup-dynamic/createWithDurations.t.sol @@ -3,20 +3,20 @@ pragma solidity >=0.8.22 <0.9.0; import { Lockup, LockupDynamic } from "src/types/DataTypes.sol"; -import { CreateWithDeltas_Integration_Shared_Test } from "../../shared/lockup-dynamic/createWithDeltas.t.sol"; +import { CreateWithDurations_Integration_Shared_Test } from "../../shared/lockup-dynamic/createWithDurations.t.sol"; import { LockupDynamic_Integration_Fuzz_Test } from "./LockupDynamic.t.sol"; -contract CreateWithDeltas_LockupDynamic_Integration_Fuzz_Test is +contract CreateWithDurations_LockupDynamic_Integration_Fuzz_Test is LockupDynamic_Integration_Fuzz_Test, - CreateWithDeltas_Integration_Shared_Test + CreateWithDurations_Integration_Shared_Test { function setUp() public virtual - override(LockupDynamic_Integration_Fuzz_Test, CreateWithDeltas_Integration_Shared_Test) + override(LockupDynamic_Integration_Fuzz_Test, CreateWithDurations_Integration_Shared_Test) { LockupDynamic_Integration_Fuzz_Test.setUp(); - CreateWithDeltas_Integration_Shared_Test.setUp(); + CreateWithDurations_Integration_Shared_Test.setUp(); } struct Vars { @@ -37,7 +37,7 @@ contract CreateWithDeltas_LockupDynamic_Integration_Fuzz_Test is uint128 totalAmount; } - function testFuzz_CreateWithDeltas(LockupDynamic.SegmentWithDelta[] memory segments) + function testFuzz_CreateWithDurations(LockupDynamic.SegmentWithDelta[] memory segments) external whenNotDelegateCalled whenLoopCalculationsDoNotOverflowBlockGasLimit @@ -98,11 +98,11 @@ contract CreateWithDeltas_LockupDynamic_Integration_Fuzz_Test is }); // Create the stream. - LockupDynamic.CreateWithDeltas memory params = defaults.createWithDeltas(); + LockupDynamic.CreateWithDurations memory params = defaults.createWithDurationsLD(); params.segments = segments; params.totalAmount = vars.totalAmount; params.transferable = true; - lockupDynamic.createWithDeltas(params); + lockupDynamic.createWithDurations(params); // Check if the stream is settled. It is possible for a Lockup Dynamic stream to settle at the time of creation // because some segment amounts can be zero. diff --git a/test/integration/fuzz/lockup-dynamic/createWithMilestones.t.sol b/test/integration/fuzz/lockup-dynamic/createWithTimestamps.t.sol similarity index 95% rename from test/integration/fuzz/lockup-dynamic/createWithMilestones.t.sol rename to test/integration/fuzz/lockup-dynamic/createWithTimestamps.t.sol index 6db69943c..0bf50c093 100644 --- a/test/integration/fuzz/lockup-dynamic/createWithMilestones.t.sol +++ b/test/integration/fuzz/lockup-dynamic/createWithTimestamps.t.sol @@ -7,20 +7,20 @@ import { stdError } from "forge-std/src/StdError.sol"; import { Errors } from "src/libraries/Errors.sol"; import { Broker, Lockup, LockupDynamic } from "src/types/DataTypes.sol"; -import { CreateWithMilestones_Integration_Shared_Test } from "../../shared/lockup-dynamic/createWithMilestones.t.sol"; +import { CreateWithTimestamps_Integration_Shared_Test } from "../../shared/lockup-dynamic/createWithTimestamps.t.sol"; import { LockupDynamic_Integration_Fuzz_Test } from "./LockupDynamic.t.sol"; -contract CreateWithMilestones_LockupDynamic_Integration_Fuzz_Test is +contract CreateWithTimestamps_LockupDynamic_Integration_Fuzz_Test is LockupDynamic_Integration_Fuzz_Test, - CreateWithMilestones_Integration_Shared_Test + CreateWithTimestamps_Integration_Shared_Test { function setUp() public virtual - override(LockupDynamic_Integration_Fuzz_Test, CreateWithMilestones_Integration_Shared_Test) + override(LockupDynamic_Integration_Fuzz_Test, CreateWithTimestamps_Integration_Shared_Test) { LockupDynamic_Integration_Fuzz_Test.setUp(); - CreateWithMilestones_Integration_Shared_Test.setUp(); + CreateWithTimestamps_Integration_Shared_Test.setUp(); } function testFuzz_RevertWhen_SegmentCountTooHigh(uint256 segmentCount) @@ -111,7 +111,7 @@ contract CreateWithMilestones_LockupDynamic_Integration_Fuzz_Test is uint128 depositAmount = defaultDepositAmount + depositDiff; // Prepare the params. - LockupDynamic.CreateWithMilestones memory params = defaults.createWithMilestones(); + LockupDynamic.CreateWithTimestamps memory params = defaults.createWithTimestampsLD(); params.broker = Broker({ account: address(0), fee: brokerFee }); params.totalAmount = depositAmount; @@ -125,7 +125,7 @@ contract CreateWithMilestones_LockupDynamic_Integration_Fuzz_Test is ); // Create the stream. - lockupDynamic.createWithMilestones(params); + lockupDynamic.createWithTimestamps(params); } function testFuzz_RevertWhen_ProtocolFeeTooHigh(UD60x18 protocolFee) @@ -201,9 +201,9 @@ contract CreateWithMilestones_LockupDynamic_Integration_Fuzz_Test is /// - Start time equal and not equal to the first segment milestone /// - Multiple values for the broker fee, including zero /// - Multiple values for the protocol fee, including zero - function testFuzz_CreateWithMilestones( + function testFuzz_CreateWithTimestamps( address funder, - LockupDynamic.CreateWithMilestones memory params, + LockupDynamic.CreateWithTimestamps memory params, UD60x18 protocolFee ) external @@ -285,8 +285,8 @@ contract CreateWithMilestones_LockupDynamic_Integration_Fuzz_Test is }); // Create the stream. - lockupDynamic.createWithMilestones( - LockupDynamic.CreateWithMilestones({ + lockupDynamic.createWithTimestamps( + LockupDynamic.CreateWithTimestamps({ sender: params.sender, recipient: params.recipient, totalAmount: vars.totalAmount, diff --git a/test/integration/fuzz/lockup-dynamic/streamedAmountOf.t.sol b/test/integration/fuzz/lockup-dynamic/streamedAmountOf.t.sol index 66f2dcca7..567b8f587 100644 --- a/test/integration/fuzz/lockup-dynamic/streamedAmountOf.t.sol +++ b/test/integration/fuzz/lockup-dynamic/streamedAmountOf.t.sol @@ -53,11 +53,11 @@ contract StreamedAmountOf_LockupDynamic_Integration_Fuzz_Test is deal({ token: address(dai), to: users.sender, give: segment.amount }); // Create the stream with the fuzzed segment. - LockupDynamic.CreateWithMilestones memory params = defaults.createWithMilestones(); + LockupDynamic.CreateWithTimestamps memory params = defaults.createWithTimestampsLD(); params.broker = Broker({ account: address(0), fee: ZERO }); params.segments = segments; params.totalAmount = segment.amount; - uint256 streamId = lockupDynamic.createWithMilestones(params); + uint256 streamId = lockupDynamic.createWithTimestamps(params); // Simulate the passage of time. uint40 currentTime = defaults.START_TIME() + timeJump; @@ -118,11 +118,11 @@ contract StreamedAmountOf_LockupDynamic_Integration_Fuzz_Test is deal({ token: address(dai), to: users.sender, give: totalAmount }); // Create the stream with the fuzzed segments. - LockupDynamic.CreateWithMilestones memory params = defaults.createWithMilestones(); + LockupDynamic.CreateWithTimestamps memory params = defaults.createWithTimestampsLD(); params.broker = Broker({ account: address(0), fee: ZERO }); params.segments = segments; params.totalAmount = totalAmount; - uint256 streamId = lockupDynamic.createWithMilestones(params); + uint256 streamId = lockupDynamic.createWithTimestamps(params); // Simulate the passage of time. uint40 currentTime = defaults.START_TIME() + timeJump; @@ -170,11 +170,11 @@ contract StreamedAmountOf_LockupDynamic_Integration_Fuzz_Test is deal({ token: address(dai), to: users.sender, give: totalAmount }); // Create the stream with the fuzzed segments. - LockupDynamic.CreateWithMilestones memory params = defaults.createWithMilestones(); + LockupDynamic.CreateWithTimestamps memory params = defaults.createWithTimestampsLD(); params.broker = Broker({ account: address(0), fee: ZERO }); params.segments = segments; params.totalAmount = totalAmount; - uint256 streamId = lockupDynamic.createWithMilestones(params); + uint256 streamId = lockupDynamic.createWithTimestamps(params); // Warp to the future for the first time. vm.warp({ timestamp: defaults.START_TIME() + timeWarp0 }); diff --git a/test/integration/fuzz/lockup-dynamic/withdraw.t.sol b/test/integration/fuzz/lockup-dynamic/withdraw.t.sol index c73d880f5..379e3bc08 100644 --- a/test/integration/fuzz/lockup-dynamic/withdraw.t.sol +++ b/test/integration/fuzz/lockup-dynamic/withdraw.t.sol @@ -73,11 +73,11 @@ contract Withdraw_LockupDynamic_Integration_Fuzz_Test is changePrank({ msgSender: users.sender }); // Create the stream with the fuzzed segments. - LockupDynamic.CreateWithMilestones memory createParams = defaults.createWithMilestones(); + LockupDynamic.CreateWithTimestamps memory createParams = defaults.createWithTimestampsLD(); createParams.totalAmount = vars.totalAmount; createParams.segments = params.segments; - vars.streamId = lockupDynamic.createWithMilestones(createParams); + vars.streamId = lockupDynamic.createWithTimestamps(createParams); // Simulate the passage of time. vm.warp({ timestamp: defaults.START_TIME() + params.timeJump }); diff --git a/test/integration/fuzz/lockup-dynamic/withdrawableAmountOf.t.sol b/test/integration/fuzz/lockup-dynamic/withdrawableAmountOf.t.sol index e44e47485..e604db5df 100644 --- a/test/integration/fuzz/lockup-dynamic/withdrawableAmountOf.t.sol +++ b/test/integration/fuzz/lockup-dynamic/withdrawableAmountOf.t.sol @@ -42,10 +42,10 @@ contract WithdrawableAmountOf_LockupDynamic_Integration_Fuzz_Test is // Create the stream with a custom total amount. The broker fee is disabled so that it doesn't interfere with // the calculations. - LockupDynamic.CreateWithMilestones memory params = defaults.createWithMilestones(); + LockupDynamic.CreateWithTimestamps memory params = defaults.createWithTimestampsLD(); params.broker = Broker({ account: address(0), fee: ZERO }); params.totalAmount = defaults.DEPOSIT_AMOUNT(); - uint256 streamId = lockupDynamic.createWithMilestones(params); + uint256 streamId = lockupDynamic.createWithTimestamps(params); // Simulate the passage of time. uint40 currentTime = defaults.START_TIME() + timeJump; @@ -92,10 +92,10 @@ contract WithdrawableAmountOf_LockupDynamic_Integration_Fuzz_Test is // Create the stream with a custom total amount. The broker fee is disabled so that it doesn't interfere with // the calculations. - LockupDynamic.CreateWithMilestones memory params = defaults.createWithMilestones(); + LockupDynamic.CreateWithTimestamps memory params = defaults.createWithTimestampsLD(); params.broker = Broker({ account: address(0), fee: ZERO }); params.totalAmount = defaults.DEPOSIT_AMOUNT(); - uint256 streamId = lockupDynamic.createWithMilestones(params); + uint256 streamId = lockupDynamic.createWithTimestamps(params); // Simulate the passage of time. vm.warp({ timestamp: currentTime }); diff --git a/test/integration/fuzz/lockup-linear/createWithRange.t.sol b/test/integration/fuzz/lockup-linear/createWithTimestamps.t.sol similarity index 94% rename from test/integration/fuzz/lockup-linear/createWithRange.t.sol rename to test/integration/fuzz/lockup-linear/createWithTimestamps.t.sol index e82fb3123..1916ea86f 100644 --- a/test/integration/fuzz/lockup-linear/createWithRange.t.sol +++ b/test/integration/fuzz/lockup-linear/createWithTimestamps.t.sol @@ -6,20 +6,20 @@ import { MAX_UD60x18, UD60x18, ud } from "@prb/math/src/UD60x18.sol"; import { Errors } from "src/libraries/Errors.sol"; import { Broker, Lockup, LockupLinear } from "src/types/DataTypes.sol"; -import { CreateWithRange_Integration_Shared_Test } from "../../shared/lockup-linear/createWithRange.t.sol"; +import { CreateWithTimestamps_Integration_Shared_Test } from "../../shared/lockup-linear/createWithTimestamps.t.sol"; import { LockupLinear_Integration_Fuzz_Test } from "./LockupLinear.t.sol"; -contract CreateWithRange_LockupLinear_Integration_Fuzz_Test is +contract CreateWithTimestamps_LockupLinear_Integration_Fuzz_Test is LockupLinear_Integration_Fuzz_Test, - CreateWithRange_Integration_Shared_Test + CreateWithTimestamps_Integration_Shared_Test { function setUp() public virtual - override(LockupLinear_Integration_Fuzz_Test, CreateWithRange_Integration_Shared_Test) + override(LockupLinear_Integration_Fuzz_Test, CreateWithTimestamps_Integration_Shared_Test) { LockupLinear_Integration_Fuzz_Test.setUp(); - CreateWithRange_Integration_Shared_Test.setUp(); + CreateWithTimestamps_Integration_Shared_Test.setUp(); } function testFuzz_RevertWhen_StartTimeGreaterThanCliffTime(uint40 startTime) @@ -123,9 +123,9 @@ contract CreateWithRange_LockupLinear_Integration_Fuzz_Test is /// - Multiple values for the cliff time and the end time /// - Multiple values for the broker fee, including zero /// - Multiple values for the protocol fee, including zero - function testFuzz_CreateWithRange( + function testFuzz_CreateWithTimestamps( address funder, - LockupLinear.CreateWithRange memory params, + LockupLinear.CreateWithTimestamps memory params, UD60x18 protocolFee ) external @@ -196,8 +196,8 @@ contract CreateWithRange_LockupLinear_Integration_Fuzz_Test is }); // Create the stream. - lockupLinear.createWithRange( - LockupLinear.CreateWithRange({ + lockupLinear.createWithTimestamps( + LockupLinear.CreateWithTimestamps({ sender: params.sender, recipient: params.recipient, totalAmount: params.totalAmount, diff --git a/test/integration/fuzz/lockup-linear/streamedAmountOf.t.sol b/test/integration/fuzz/lockup-linear/streamedAmountOf.t.sol index f738bf2a4..98bbd1656 100644 --- a/test/integration/fuzz/lockup-linear/streamedAmountOf.t.sol +++ b/test/integration/fuzz/lockup-linear/streamedAmountOf.t.sol @@ -67,10 +67,10 @@ contract StreamedAmountOf_LockupLinear_Integration_Fuzz_Test is deal({ token: address(dai), to: users.sender, give: depositAmount }); // Create the stream with the fuzzed deposit amount. - LockupLinear.CreateWithRange memory params = defaults.createWithRange(); + LockupLinear.CreateWithTimestamps memory params = defaults.createWithTimestampsLL(); params.broker = Broker({ account: address(0), fee: ZERO }); params.totalAmount = depositAmount; - uint256 streamId = lockupLinear.createWithRange(params); + uint256 streamId = lockupLinear.createWithTimestamps(params); // Simulate the passage of time. uint40 currentTime = defaults.START_TIME() + timeJump; @@ -101,9 +101,9 @@ contract StreamedAmountOf_LockupLinear_Integration_Fuzz_Test is deal({ token: address(dai), to: users.sender, give: depositAmount }); // Create the stream with the fuzzed deposit amount. - LockupLinear.CreateWithRange memory params = defaults.createWithRange(); + LockupLinear.CreateWithTimestamps memory params = defaults.createWithTimestampsLL(); params.totalAmount = depositAmount; - uint256 streamId = lockupLinear.createWithRange(params); + uint256 streamId = lockupLinear.createWithTimestamps(params); // Warp to the future for the first time. vm.warp({ timestamp: defaults.START_TIME() + timeWarp0 }); diff --git a/test/integration/fuzz/lockup-linear/withdrawableAmountOf.t.sol b/test/integration/fuzz/lockup-linear/withdrawableAmountOf.t.sol index a76aa21e9..d0b93bc64 100644 --- a/test/integration/fuzz/lockup-linear/withdrawableAmountOf.t.sol +++ b/test/integration/fuzz/lockup-linear/withdrawableAmountOf.t.sol @@ -64,10 +64,10 @@ contract WithdrawableAmountOf_LockupLinear_Integration_Fuzz_Test is deal({ token: address(dai), to: users.sender, give: depositAmount }); // Create the stream. The broker fee is disabled so that it doesn't interfere with the calculations. - LockupLinear.CreateWithRange memory params = defaults.createWithRange(); + LockupLinear.CreateWithTimestamps memory params = defaults.createWithTimestampsLL(); params.broker = Broker({ account: address(0), fee: ZERO }); params.totalAmount = depositAmount; - uint256 streamId = lockupLinear.createWithRange(params); + uint256 streamId = lockupLinear.createWithTimestamps(params); // Simulate the passage of time. uint40 currentTime = defaults.START_TIME() + timeJump; @@ -119,10 +119,10 @@ contract WithdrawableAmountOf_LockupLinear_Integration_Fuzz_Test is deal({ token: address(dai), to: users.sender, give: depositAmount }); // Create the stream. The broker fee is disabled so that it doesn't interfere with the calculations. - LockupLinear.CreateWithRange memory params = defaults.createWithRange(); + LockupLinear.CreateWithTimestamps memory params = defaults.createWithTimestampsLL(); params.broker = Broker({ account: address(0), fee: ZERO }); params.totalAmount = depositAmount; - uint256 streamId = lockupLinear.createWithRange(params); + uint256 streamId = lockupLinear.createWithTimestamps(params); // Simulate the passage of time. vm.warp({ timestamp: currentTime }); diff --git a/test/integration/shared/lockup-dynamic/LockupDynamic.t.sol b/test/integration/shared/lockup-dynamic/LockupDynamic.t.sol index 5e1bd327e..046b1af22 100644 --- a/test/integration/shared/lockup-dynamic/LockupDynamic.t.sol +++ b/test/integration/shared/lockup-dynamic/LockupDynamic.t.sol @@ -10,8 +10,8 @@ import { Lockup_Integration_Shared_Test } from "../lockup/Lockup.t.sol"; /// @notice Common testing logic needed across {SablierV2LockupDynamic} integration tests. abstract contract LockupDynamic_Integration_Shared_Test is Lockup_Integration_Shared_Test { struct CreateParams { - LockupDynamic.CreateWithDeltas createWithDeltas; - LockupDynamic.CreateWithMilestones createWithMilestones; + LockupDynamic.CreateWithDurations createWithDurations; + LockupDynamic.CreateWithTimestamps createWithTimestamps; } /// @dev These have to be pre-declared so that `vm.expectRevert` does not expect a revert in `defaults`. @@ -21,54 +21,54 @@ abstract contract LockupDynamic_Integration_Shared_Test is Lockup_Integration_Sh function setUp() public virtual override { Lockup_Integration_Shared_Test.setUp(); - _params.createWithDeltas.sender = users.sender; - _params.createWithDeltas.recipient = users.recipient; - _params.createWithDeltas.totalAmount = defaults.TOTAL_AMOUNT(); - _params.createWithDeltas.asset = dai; - _params.createWithDeltas.cancelable = true; - _params.createWithDeltas.transferable = true; - _params.createWithDeltas.broker = defaults.broker(); - - _params.createWithMilestones.sender = users.sender; - _params.createWithMilestones.recipient = users.recipient; - _params.createWithMilestones.totalAmount = defaults.TOTAL_AMOUNT(); - _params.createWithMilestones.asset = dai; - _params.createWithMilestones.cancelable = true; - _params.createWithMilestones.transferable = true; - _params.createWithMilestones.startTime = defaults.START_TIME(); - _params.createWithMilestones.broker = defaults.broker(); + _params.createWithDurations.sender = users.sender; + _params.createWithDurations.recipient = users.recipient; + _params.createWithDurations.totalAmount = defaults.TOTAL_AMOUNT(); + _params.createWithDurations.asset = dai; + _params.createWithDurations.cancelable = true; + _params.createWithDurations.transferable = true; + _params.createWithDurations.broker = defaults.broker(); + + _params.createWithTimestamps.sender = users.sender; + _params.createWithTimestamps.recipient = users.recipient; + _params.createWithTimestamps.totalAmount = defaults.TOTAL_AMOUNT(); + _params.createWithTimestamps.asset = dai; + _params.createWithTimestamps.cancelable = true; + _params.createWithTimestamps.transferable = true; + _params.createWithTimestamps.startTime = defaults.START_TIME(); + _params.createWithTimestamps.broker = defaults.broker(); // See https://github.com/ethereum/solidity/issues/12783 LockupDynamic.SegmentWithDelta[] memory segmentsWithDeltas = defaults.segmentsWithDeltas(); LockupDynamic.Segment[] memory segments = defaults.segments(); for (uint256 i = 0; i < defaults.SEGMENT_COUNT(); ++i) { - _params.createWithDeltas.segments.push(segmentsWithDeltas[i]); - _params.createWithMilestones.segments.push(segments[i]); + _params.createWithDurations.segments.push(segmentsWithDeltas[i]); + _params.createWithTimestamps.segments.push(segments[i]); } } /// @dev Creates the default stream. function createDefaultStream() internal override returns (uint256 streamId) { - streamId = lockupDynamic.createWithMilestones(_params.createWithMilestones); + streamId = lockupDynamic.createWithTimestamps(_params.createWithTimestamps); } /// @dev Creates the default stream with the provided asset. function createDefaultStreamWithAsset(IERC20 asset) internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.asset = asset; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with the provided broker. function createDefaultStreamWithBroker(Broker memory broker) internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.broker = broker; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with deltas. function createDefaultStreamWithDeltas() internal returns (uint256 streamId) { - streamId = lockupDynamic.createWithDeltas(_params.createWithDeltas); + streamId = lockupDynamic.createWithDurations(_params.createWithDurations); } /// @dev Creates the default stream with the provided deltas. @@ -76,45 +76,45 @@ abstract contract LockupDynamic_Integration_Shared_Test is Lockup_Integration_Sh internal returns (uint256 streamId) { - LockupDynamic.CreateWithDeltas memory params = _params.createWithDeltas; + LockupDynamic.CreateWithDurations memory params = _params.createWithDurations; params.segments = segments; - streamId = lockupDynamic.createWithDeltas(params); + streamId = lockupDynamic.createWithDurations(params); } /// @dev Creates the default stream with the provided end time. function createDefaultStreamWithEndTime(uint40 endTime) internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.segments[1].milestone = endTime; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates a stream that will not be cancelable. function createDefaultStreamNotCancelable() internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.cancelable = false; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with the NFT transfer disabled. function createDefaultStreamNotTransferable() internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.transferable = false; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with the provided range. function createDefaultStreamWithRange(LockupDynamic.Range memory range) internal returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.startTime = range.start; params.segments[1].milestone = range.end; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with the provided recipient. function createDefaultStreamWithRecipient(address recipient) internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.recipient = recipient; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with the provided segments. @@ -122,29 +122,29 @@ abstract contract LockupDynamic_Integration_Shared_Test is Lockup_Integration_Sh internal returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.segments = segments; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with the provided sender. function createDefaultStreamWithSender(address sender) internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.sender = sender; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with the provided start time.. function createDefaultStreamWithStartTime(uint40 startTime) internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.startTime = startTime; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } /// @dev Creates the default stream with the provided total amount. function createDefaultStreamWithTotalAmount(uint128 totalAmount) internal override returns (uint256 streamId) { - LockupDynamic.CreateWithMilestones memory params = _params.createWithMilestones; + LockupDynamic.CreateWithTimestamps memory params = _params.createWithTimestamps; params.totalAmount = totalAmount; - streamId = lockupDynamic.createWithMilestones(params); + streamId = lockupDynamic.createWithTimestamps(params); } } diff --git a/test/integration/shared/lockup-dynamic/createWithDeltas.t.sol b/test/integration/shared/lockup-dynamic/createWithDurations.t.sol similarity index 85% rename from test/integration/shared/lockup-dynamic/createWithDeltas.t.sol rename to test/integration/shared/lockup-dynamic/createWithDurations.t.sol index 66ae9dcd4..b9687b7a1 100644 --- a/test/integration/shared/lockup-dynamic/createWithDeltas.t.sol +++ b/test/integration/shared/lockup-dynamic/createWithDurations.t.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.22 <0.9.0; import { LockupDynamic_Integration_Shared_Test } from "./LockupDynamic.t.sol"; -contract CreateWithDeltas_Integration_Shared_Test is LockupDynamic_Integration_Shared_Test { +contract CreateWithDurations_Integration_Shared_Test is LockupDynamic_Integration_Shared_Test { uint256 internal streamId; function setUp() public virtual override { diff --git a/test/integration/shared/lockup-dynamic/createWithMilestones.t.sol b/test/integration/shared/lockup-dynamic/createWithTimestamps.t.sol similarity index 94% rename from test/integration/shared/lockup-dynamic/createWithMilestones.t.sol rename to test/integration/shared/lockup-dynamic/createWithTimestamps.t.sol index 34c08fa11..3027fdb8e 100644 --- a/test/integration/shared/lockup-dynamic/createWithMilestones.t.sol +++ b/test/integration/shared/lockup-dynamic/createWithTimestamps.t.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.22 <0.9.0; import { LockupDynamic_Integration_Shared_Test } from "./LockupDynamic.t.sol"; -contract CreateWithMilestones_Integration_Shared_Test is LockupDynamic_Integration_Shared_Test { +contract CreateWithTimestamps_Integration_Shared_Test is LockupDynamic_Integration_Shared_Test { uint256 internal streamId; function setUp() public virtual override { diff --git a/test/integration/shared/lockup-linear/LockupLinear.t.sol b/test/integration/shared/lockup-linear/LockupLinear.t.sol index 2d90706fd..87315c0fa 100644 --- a/test/integration/shared/lockup-linear/LockupLinear.t.sol +++ b/test/integration/shared/lockup-linear/LockupLinear.t.sol @@ -11,7 +11,7 @@ import { Lockup_Integration_Shared_Test } from "../lockup/Lockup.t.sol"; abstract contract LockupLinear_Integration_Shared_Test is Lockup_Integration_Shared_Test { struct Params { LockupLinear.CreateWithDurations createWithDurations; - LockupLinear.CreateWithRange createWithRange; + LockupLinear.CreateWithTimestamps createWithTimestamps; } /// @dev These have to be pre-declared so that `vm.expectRevert` does not expect a revert in `defaults`. @@ -20,27 +20,27 @@ abstract contract LockupLinear_Integration_Shared_Test is Lockup_Integration_Sha function setUp() public virtual override { Lockup_Integration_Shared_Test.setUp(); - _params.createWithDurations = defaults.createWithDurations(); - _params.createWithRange = defaults.createWithRange(); + _params.createWithDurations = defaults.createWithDurationsLL(); + _params.createWithTimestamps = defaults.createWithTimestampsLL(); } /// @dev Creates the default stream. function createDefaultStream() internal override returns (uint256 streamId) { - streamId = lockupLinear.createWithRange(_params.createWithRange); + streamId = lockupLinear.createWithTimestamps(_params.createWithTimestamps); } /// @dev Creates the default stream with the provided address. function createDefaultStreamWithAsset(IERC20 asset) internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.asset = asset; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } /// @dev Creates the default stream with the provided broker. function createDefaultStreamWithBroker(Broker memory broker) internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.broker = broker; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } /// @dev Creates the default stream with durations. @@ -60,60 +60,60 @@ abstract contract LockupLinear_Integration_Shared_Test is Lockup_Integration_Sha /// @dev Creates the default stream that is not cancelable. function createDefaultStreamNotCancelable() internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.cancelable = false; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } /// @dev Creates the default stream with the NFT transfer disabled. function createDefaultStreamNotTransferable() internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.transferable = false; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } /// @dev Creates the default stream with the provided end time. function createDefaultStreamWithEndTime(uint40 endTime) internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.range.end = endTime; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } - /// @dev Creates the default stream with the provided createWithRange. - function createDefaultStreamWithRange(LockupLinear.Range memory createWithRange) + /// @dev Creates the default stream with the provided createWithTimestamps. + function createDefaultStreamWithRange(LockupLinear.Range memory createWithTimestamps) internal returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; - params.range = createWithRange; - streamId = lockupLinear.createWithRange(params); + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; + params.range = createWithTimestamps; + streamId = lockupLinear.createWithTimestamps(params); } /// @dev Creates the default stream with the provided recipient. function createDefaultStreamWithRecipient(address recipient) internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.recipient = recipient; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } /// @dev Creates the default stream with the provided sender. function createDefaultStreamWithSender(address sender) internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.sender = sender; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } /// @dev Creates the default stream with the provided start time. function createDefaultStreamWithStartTime(uint40 startTime) internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.range.start = startTime; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } /// @dev Creates the default stream with the provided total amount. function createDefaultStreamWithTotalAmount(uint128 totalAmount) internal override returns (uint256 streamId) { - LockupLinear.CreateWithRange memory params = _params.createWithRange; + LockupLinear.CreateWithTimestamps memory params = _params.createWithTimestamps; params.totalAmount = totalAmount; - streamId = lockupLinear.createWithRange(params); + streamId = lockupLinear.createWithTimestamps(params); } } diff --git a/test/integration/shared/lockup-linear/createWithRange.t.sol b/test/integration/shared/lockup-linear/createWithTimestamps.t.sol similarity index 89% rename from test/integration/shared/lockup-linear/createWithRange.t.sol rename to test/integration/shared/lockup-linear/createWithTimestamps.t.sol index 2e7c59223..df2734c6d 100644 --- a/test/integration/shared/lockup-linear/createWithRange.t.sol +++ b/test/integration/shared/lockup-linear/createWithTimestamps.t.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.22 <0.9.0; import { LockupLinear_Integration_Shared_Test } from "./LockupLinear.t.sol"; -abstract contract CreateWithRange_Integration_Shared_Test is LockupLinear_Integration_Shared_Test { +abstract contract CreateWithTimestamps_Integration_Shared_Test is LockupLinear_Integration_Shared_Test { uint256 internal streamId; function setUp() public virtual override { diff --git a/test/invariant/handlers/LockupDynamicCreateHandler.sol b/test/invariant/handlers/LockupDynamicCreateHandler.sol index b101c2873..67af327ed 100644 --- a/test/invariant/handlers/LockupDynamicCreateHandler.sol +++ b/test/invariant/handlers/LockupDynamicCreateHandler.sol @@ -45,12 +45,12 @@ contract LockupDynamicCreateHandler is BaseHandler { HANDLER FUNCTIONS //////////////////////////////////////////////////////////////////////////*/ - function createWithDeltas( + function createWithDurations( uint256 timeJumpSeed, - LockupDynamic.CreateWithDeltas memory params + LockupDynamic.CreateWithDurations memory params ) public - instrument("createWithDeltas") + instrument("createWithDurations") adjustTimestamp(timeJumpSeed) checkUsers(params.sender, params.recipient, params.broker.account) useNewSender(params.sender) @@ -87,18 +87,18 @@ contract LockupDynamicCreateHandler is BaseHandler { // Create the stream. params.asset = asset; - uint256 streamId = lockupDynamic.createWithDeltas(params); + uint256 streamId = lockupDynamic.createWithDurations(params); // Store the stream id. lockupStore.pushStreamId(streamId, params.sender, params.recipient); } - function createWithMilestones( + function createWithTimestamps( uint256 timeJumpSeed, - LockupDynamic.CreateWithMilestones memory params + LockupDynamic.CreateWithTimestamps memory params ) public - instrument("createWithMilestones") + instrument("createWithTimestamps") adjustTimestamp(timeJumpSeed) checkUsers(params.sender, params.recipient, params.broker.account) useNewSender(params.sender) @@ -135,7 +135,7 @@ contract LockupDynamicCreateHandler is BaseHandler { // Create the stream. params.asset = asset; - uint256 streamId = lockupDynamic.createWithMilestones(params); + uint256 streamId = lockupDynamic.createWithTimestamps(params); // Store the stream id. lockupStore.pushStreamId(streamId, params.sender, params.recipient); diff --git a/test/invariant/handlers/LockupLinearCreateHandler.sol b/test/invariant/handlers/LockupLinearCreateHandler.sol index af048de0a..1635c3f03 100644 --- a/test/invariant/handlers/LockupLinearCreateHandler.sol +++ b/test/invariant/handlers/LockupLinearCreateHandler.sol @@ -77,12 +77,12 @@ contract LockupLinearCreateHandler is BaseHandler { lockupStore.pushStreamId(streamId, params.sender, params.recipient); } - function createWithRange( + function createWithTimestamps( uint256 timeJumpSeed, - LockupLinear.CreateWithRange memory params + LockupLinear.CreateWithTimestamps memory params ) public - instrument("createWithRange") + instrument("createWithTimestamps") adjustTimestamp(timeJumpSeed) checkUsers(params.sender, params.recipient, params.broker.account) useNewSender(params.sender) @@ -114,7 +114,7 @@ contract LockupLinearCreateHandler is BaseHandler { // Create the stream. params.asset = asset; - uint256 streamId = lockupLinear.createWithRange(params); + uint256 streamId = lockupLinear.createWithTimestamps(params); // Store the stream id. lockupStore.pushStreamId(streamId, params.sender, params.recipient); diff --git a/test/utils/Defaults.sol b/test/utils/Defaults.sol index 244bfbff0..73af3e950 100644 --- a/test/utils/Defaults.sol +++ b/test/utils/Defaults.sol @@ -181,8 +181,8 @@ contract Defaults is Constants { PARAMS //////////////////////////////////////////////////////////////////////////*/ - function createWithDeltas() public view returns (LockupDynamic.CreateWithDeltas memory) { - return LockupDynamic.CreateWithDeltas({ + function createWithDurationsLD() public view returns (LockupDynamic.CreateWithDurations memory) { + return LockupDynamic.CreateWithDurations({ sender: users.sender, recipient: users.recipient, totalAmount: TOTAL_AMOUNT, @@ -194,7 +194,7 @@ contract Defaults is Constants { }); } - function createWithDurations() public view returns (LockupLinear.CreateWithDurations memory) { + function createWithDurationsLL() public view returns (LockupLinear.CreateWithDurations memory) { return LockupLinear.CreateWithDurations({ sender: users.sender, recipient: users.recipient, @@ -207,8 +207,8 @@ contract Defaults is Constants { }); } - function createWithMilestones() public view returns (LockupDynamic.CreateWithMilestones memory) { - return LockupDynamic.CreateWithMilestones({ + function createWithTimestampsLD() public view returns (LockupDynamic.CreateWithTimestamps memory) { + return LockupDynamic.CreateWithTimestamps({ sender: users.sender, recipient: users.recipient, totalAmount: TOTAL_AMOUNT, @@ -221,8 +221,8 @@ contract Defaults is Constants { }); } - function createWithRange() public view returns (LockupLinear.CreateWithRange memory) { - return LockupLinear.CreateWithRange({ + function createWithTimestampsLL() public view returns (LockupLinear.CreateWithTimestamps memory) { + return LockupLinear.CreateWithTimestamps({ sender: users.sender, recipient: users.recipient, totalAmount: TOTAL_AMOUNT,