Skip to content

Commit

Permalink
style: apply forge formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Sep 5, 2024
1 parent 780f52e commit 945c414
Show file tree
Hide file tree
Showing 35 changed files with 75 additions and 210 deletions.
4 changes: 1 addition & 3 deletions script/DeployDeterministicProtocol.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import { BaseScript } from "./Base.s.sol";
/// @notice Deploys the Lockup Protocol at deterministic addresses across chains.
contract DeployDeterministicProtocol is BaseScript {
/// @dev Deploy via Forge.
function run(
address initialAdmin
)
function run(address initialAdmin)
public
virtual
broadcast
Expand Down
4 changes: 1 addition & 3 deletions script/DeployProtocol.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import { BaseScript } from "./Base.s.sol";
/// @notice Deploys the Lockup Protocol.
contract DeployProtocol is BaseScript {
/// @dev Deploy via Forge.
function run(
address initialAdmin
)
function run(address initialAdmin)
public
virtual
broadcast
Expand Down
4 changes: 1 addition & 3 deletions script/core/DeployCore.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import { BaseScript } from "../Base.s.sol";

/// @notice Deploys all Core contracts.
contract DeployCore is BaseScript {
function run(
address initialAdmin
)
function run(address initialAdmin)
public
virtual
broadcast
Expand Down
4 changes: 1 addition & 3 deletions script/core/DeployDeterministicCore.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import { BaseScript } from "../Base.s.sol";
/// @notice Deploys all 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: 5 additions & 15 deletions src/core/SablierLockupDynamic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ contract SablierLockupDynamic is
//////////////////////////////////////////////////////////////////////////*/

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/// @inheritdoc ISablierLockup
function withdrawableAmountOf(
uint256 streamId
)
function withdrawableAmountOf(uint256 streamId)
external
view
override
Expand Down
8 changes: 2 additions & 6 deletions src/core/interfaces/ISablierLockupDynamic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ interface ISablierLockupDynamic is ISablierLockup {
///
/// @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 @@ -109,9 +107,7 @@ interface ISablierLockupDynamic is ISablierLockup {
///
/// @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: 2 additions & 6 deletions src/core/interfaces/ISablierLockupLinear.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ interface ISablierLockupLinear is ISablierLockup {
///
/// @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 @@ -104,9 +102,7 @@ interface ISablierLockupLinear is ISablierLockup {
///
/// @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: 2 additions & 6 deletions src/core/interfaces/ISablierLockupTranched.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ interface ISablierLockupTranched is ISablierLockup {
///
/// @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 @@ -109,9 +107,7 @@ interface ISablierLockupTranched is ISablierLockup {
///
/// @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: 2 additions & 6 deletions src/core/libraries/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ 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 @@ -49,9 +47,7 @@ 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
4 changes: 1 addition & 3 deletions src/periphery/SablierMerkleFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ contract SablierMerkleFactory is ISablierMerkleFactory {
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierMerkleFactory
function isPercentagesSum100(
MerkleLT.TrancheWithPercentage[] calldata tranches
)
function isPercentagesSum100(MerkleLT.TrancheWithPercentage[] calldata tranches)
external
pure
override
Expand Down
4 changes: 1 addition & 3 deletions src/periphery/SablierMerkleLT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ contract SablierMerkleLT is

/// @dev Calculates the start time, and the tranches based on the claim amount and the unlock percentages for each
/// tranche.
function _calculateStartTimeAndTranches(
uint128 claimAmount
)
function _calculateStartTimeAndTranches(uint128 claimAmount)
internal
view
returns (uint40 startTime, LockupTranched.Tranche[] memory tranches)
Expand Down
4 changes: 1 addition & 3 deletions src/periphery/interfaces/ISablierMerkleFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ interface ISablierMerkleFactory {
/// @dev Reverts if the sum of percentages overflows.
/// @param tranches The tranches with their respective unlock percentages.
/// @return result True if the sum of percentages equals 100%, otherwise false.
function isPercentagesSum100(
MerkleLT.TrancheWithPercentage[] calldata tranches
)
function isPercentagesSum100(MerkleLT.TrancheWithPercentage[] calldata tranches)
external
pure
returns (bool result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ contract CreateWithDurations_LockupDynamic_Integration_Fuzz_Test is
uint128 totalAmount;
}

function testFuzz_CreateWithDurations(
LockupDynamic.SegmentWithDuration[] memory segments
)
function testFuzz_CreateWithDurations(LockupDynamic.SegmentWithDuration[] memory segments)
external
whenNoDelegateCall
whenSegmentCountNotExceedMaxValue
Expand Down
Loading

0 comments on commit 945c414

Please sign in to comment.