Skip to content

Commit

Permalink
style: apply forge formatter (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja authored Aug 14, 2024
1 parent c0aa6a5 commit c48baf0
Show file tree
Hide file tree
Showing 27 changed files with 195 additions and 65 deletions.
4 changes: 3 additions & 1 deletion script/DeployCore.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { BaseScript } from "./Base.s.sol";

/// @notice Deploys all V2 Core contracts.
contract DeployCore is BaseScript {
function run(address initialAdmin)
function run(
address initialAdmin
)
public
virtual
broadcast
Expand Down
4 changes: 3 additions & 1 deletion script/DeployDeterministicCore.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { BaseScript } from "./Base.s.sol";
/// @notice Deploys all V2 Core contracts at deterministic addresses across chains.
/// @dev Reverts if any contract has already been deployed.
contract DeployDeterministicCore is BaseScript {
function run(address initialAdmin)
function run(
address initialAdmin
)
public
virtual
broadcast
Expand Down
20 changes: 15 additions & 5 deletions src/SablierV2LockupDynamic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ contract SablierV2LockupDynamic is
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2LockupDynamic
function getSegments(uint256 streamId)
function getSegments(
uint256 streamId
)
external
view
override
Expand All @@ -88,7 +90,9 @@ contract SablierV2LockupDynamic is
}

/// @inheritdoc ISablierV2LockupDynamic
function getStream(uint256 streamId)
function getStream(
uint256 streamId
)
external
view
override
Expand Down Expand Up @@ -120,7 +124,9 @@ contract SablierV2LockupDynamic is
}

/// @inheritdoc ISablierV2LockupDynamic
function getTimestamps(uint256 streamId)
function getTimestamps(
uint256 streamId
)
external
view
override
Expand All @@ -135,7 +141,9 @@ contract SablierV2LockupDynamic is
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2LockupDynamic
function createWithDurations(LockupDynamic.CreateWithDurations calldata params)
function createWithDurations(
LockupDynamic.CreateWithDurations calldata params
)
external
override
noDelegateCall
Expand All @@ -161,7 +169,9 @@ contract SablierV2LockupDynamic is
}

/// @inheritdoc ISablierV2LockupDynamic
function createWithTimestamps(LockupDynamic.CreateWithTimestamps calldata params)
function createWithTimestamps(
LockupDynamic.CreateWithTimestamps calldata params
)
external
override
noDelegateCall
Expand Down
16 changes: 12 additions & 4 deletions src/SablierV2LockupLinear.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ contract SablierV2LockupLinear is
}

/// @inheritdoc ISablierV2LockupLinear
function getStream(uint256 streamId)
function getStream(
uint256 streamId
)
external
view
override
Expand Down Expand Up @@ -105,7 +107,9 @@ contract SablierV2LockupLinear is
}

/// @inheritdoc ISablierV2LockupLinear
function getTimestamps(uint256 streamId)
function getTimestamps(
uint256 streamId
)
external
view
override
Expand All @@ -124,7 +128,9 @@ contract SablierV2LockupLinear is
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2LockupLinear
function createWithDurations(LockupLinear.CreateWithDurations calldata params)
function createWithDurations(
LockupLinear.CreateWithDurations calldata params
)
external
override
noDelegateCall
Expand Down Expand Up @@ -160,7 +166,9 @@ contract SablierV2LockupLinear is
}

/// @inheritdoc ISablierV2LockupLinear
function createWithTimestamps(LockupLinear.CreateWithTimestamps calldata params)
function createWithTimestamps(
LockupLinear.CreateWithTimestamps calldata params
)
external
override
noDelegateCall
Expand Down
20 changes: 15 additions & 5 deletions src/SablierV2LockupTranched.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ contract SablierV2LockupTranched is
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2LockupTranched
function getStream(uint256 streamId)
function getStream(
uint256 streamId
)
external
view
override
Expand Down Expand Up @@ -104,7 +106,9 @@ contract SablierV2LockupTranched is
}

/// @inheritdoc ISablierV2LockupTranched
function getTimestamps(uint256 streamId)
function getTimestamps(
uint256 streamId
)
external
view
override
Expand All @@ -115,7 +119,9 @@ contract SablierV2LockupTranched is
}

/// @inheritdoc ISablierV2LockupTranched
function getTranches(uint256 streamId)
function getTranches(
uint256 streamId
)
external
view
override
Expand All @@ -130,7 +136,9 @@ contract SablierV2LockupTranched is
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2LockupTranched
function createWithDurations(LockupTranched.CreateWithDurations calldata params)
function createWithDurations(
LockupTranched.CreateWithDurations calldata params
)
external
override
noDelegateCall
Expand All @@ -156,7 +164,9 @@ contract SablierV2LockupTranched is
}

/// @inheritdoc ISablierV2LockupTranched
function createWithTimestamps(LockupTranched.CreateWithTimestamps calldata params)
function createWithTimestamps(
LockupTranched.CreateWithTimestamps calldata params
)
external
override
noDelegateCall
Expand Down
24 changes: 18 additions & 6 deletions src/abstracts/SablierV2Lockup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ abstract contract SablierV2Lockup is
}

/// @inheritdoc ISablierV2Lockup
function getDepositedAmount(uint256 streamId)
function getDepositedAmount(
uint256 streamId
)
external
view
override
Expand All @@ -102,7 +104,9 @@ abstract contract SablierV2Lockup is
}

/// @inheritdoc ISablierV2Lockup
function getRefundedAmount(uint256 streamId)
function getRefundedAmount(
uint256 streamId
)
external
view
override
Expand All @@ -123,7 +127,9 @@ abstract contract SablierV2Lockup is
}

/// @inheritdoc ISablierV2Lockup
function getWithdrawnAmount(uint256 streamId)
function getWithdrawnAmount(
uint256 streamId
)
external
view
override
Expand Down Expand Up @@ -173,7 +179,9 @@ abstract contract SablierV2Lockup is
}

/// @inheritdoc ISablierV2Lockup
function refundableAmountOf(uint256 streamId)
function refundableAmountOf(
uint256 streamId
)
external
view
override
Expand All @@ -195,7 +203,9 @@ abstract contract SablierV2Lockup is
}

/// @inheritdoc ISablierV2Lockup
function streamedAmountOf(uint256 streamId)
function streamedAmountOf(
uint256 streamId
)
public
view
override
Expand Down Expand Up @@ -226,7 +236,9 @@ abstract contract SablierV2Lockup is
}

/// @inheritdoc ISablierV2Lockup
function withdrawableAmountOf(uint256 streamId)
function withdrawableAmountOf(
uint256 streamId
)
external
view
override
Expand Down
8 changes: 6 additions & 2 deletions src/interfaces/ISablierV2LockupDynamic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ 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 createWithDurations(LockupDynamic.CreateWithDurations calldata params)
function createWithDurations(
LockupDynamic.CreateWithDurations calldata params
)
external
returns (uint256 streamId);

Expand All @@ -107,7 +109,9 @@ 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 createWithTimestamps(LockupDynamic.CreateWithTimestamps calldata params)
function createWithTimestamps(
LockupDynamic.CreateWithTimestamps calldata params
)
external
returns (uint256 streamId);
}
8 changes: 6 additions & 2 deletions src/interfaces/ISablierV2LockupLinear.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ 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 createWithDurations(LockupLinear.CreateWithDurations calldata params)
function createWithDurations(
LockupLinear.CreateWithDurations calldata params
)
external
returns (uint256 streamId);

Expand All @@ -102,7 +104,9 @@ 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 createWithTimestamps(LockupLinear.CreateWithTimestamps calldata params)
function createWithTimestamps(
LockupLinear.CreateWithTimestamps calldata params
)
external
returns (uint256 streamId);
}
8 changes: 6 additions & 2 deletions src/interfaces/ISablierV2LockupTranched.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ interface ISablierV2LockupTranched is ISablierV2Lockup {
///
/// @param params Struct encapsulating the function parameters, which are documented in {DataTypes}.
/// @return streamId The ID of the newly created stream.
function createWithDurations(LockupTranched.CreateWithDurations calldata params)
function createWithDurations(
LockupTranched.CreateWithDurations calldata params
)
external
returns (uint256 streamId);

Expand All @@ -107,7 +109,9 @@ interface ISablierV2LockupTranched is ISablierV2Lockup {
///
/// @param params Struct encapsulating the function parameters, which are documented in {DataTypes}.
/// @return streamId The ID of the newly created stream.
function createWithTimestamps(LockupTranched.CreateWithTimestamps calldata params)
function createWithTimestamps(
LockupTranched.CreateWithTimestamps calldata params
)
external
returns (uint256 streamId);
}
8 changes: 6 additions & 2 deletions src/libraries/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ library Helpers {
//////////////////////////////////////////////////////////////////////////*/

/// @dev Calculate the timestamps and return the segments.
function calculateSegmentTimestamps(LockupDynamic.SegmentWithDuration[] memory segments)
function calculateSegmentTimestamps(
LockupDynamic.SegmentWithDuration[] memory segments
)
internal
view
returns (LockupDynamic.Segment[] memory segmentsWithTimestamps)
Expand Down Expand Up @@ -47,7 +49,9 @@ library Helpers {
}

/// @dev Calculate the timestamps and return the tranches.
function calculateTrancheTimestamps(LockupTranched.TrancheWithDuration[] memory tranches)
function calculateTrancheTimestamps(
LockupTranched.TrancheWithDuration[] memory tranches
)
internal
view
returns (LockupTranched.Tranche[] memory tranchesWithTimestamps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ contract CreateWithDurations_LockupDynamic_Integration_Fuzz_Test is
uint128 totalAmount;
}

function testFuzz_CreateWithDurations(LockupDynamic.SegmentWithDuration[] memory segments)
function testFuzz_CreateWithDurations(
LockupDynamic.SegmentWithDuration[] memory segments
)
external
whenNotDelegateCalled
whenSegmentCountNotTooHigh
Expand Down
16 changes: 12 additions & 4 deletions test/integration/fuzz/lockup-dynamic/createWithTimestamps.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ contract CreateWithTimestamps_LockupDynamic_Integration_Fuzz_Test is
CreateWithTimestamps_Integration_Shared_Test.setUp();
}

function testFuzz_RevertWhen_SegmentCountTooHigh(uint256 segmentCount)
function testFuzz_RevertWhen_SegmentCountTooHigh(
uint256 segmentCount
)
external
whenNotDelegateCalled
whenRecipientNonZeroAddress
Expand Down Expand Up @@ -59,7 +61,9 @@ contract CreateWithTimestamps_LockupDynamic_Integration_Fuzz_Test is
createDefaultStreamWithSegments(segments);
}

function testFuzz_RevertWhen_StartTimeNotLessThanFirstSegmentTimestamp(uint40 firstTimestamp)
function testFuzz_RevertWhen_StartTimeNotLessThanFirstSegmentTimestamp(
uint40 firstTimestamp
)
external
whenNotDelegateCalled
whenRecipientNonZeroAddress
Expand Down Expand Up @@ -87,7 +91,9 @@ contract CreateWithTimestamps_LockupDynamic_Integration_Fuzz_Test is
createDefaultStreamWithSegments(segments);
}

function testFuzz_RevertWhen_DepositAmountNotEqualToSegmentAmountsSum(uint128 depositDiff)
function testFuzz_RevertWhen_DepositAmountNotEqualToSegmentAmountsSum(
uint128 depositDiff
)
external
whenNotDelegateCalled
whenRecipientNonZeroAddress
Expand Down Expand Up @@ -126,7 +132,9 @@ contract CreateWithTimestamps_LockupDynamic_Integration_Fuzz_Test is
lockupDynamic.createWithTimestamps(params);
}

function testFuzz_RevertWhen_BrokerFeeTooHigh(Broker memory broker)
function testFuzz_RevertWhen_BrokerFeeTooHigh(
Broker memory broker
)
external
whenNotDelegateCalled
whenRecipientNonZeroAddress
Expand Down
4 changes: 3 additions & 1 deletion test/integration/fuzz/lockup-dynamic/withdraw.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ contract Withdraw_LockupDynamic_Integration_Fuzz_Test is
uint128 withdrawableAmount;
}

function testFuzz_Withdraw_SegmentFuzing(Params memory params)
function testFuzz_Withdraw_SegmentFuzing(
Params memory params
)
external
whenNotDelegateCalled
givenNotNull
Expand Down
Loading

0 comments on commit c48baf0

Please sign in to comment.