Skip to content

Commit 2e9b18e

Browse files
authored
lint fix foundry 1.4.3 (#114)
1 parent 277e6a6 commit 2e9b18e

3 files changed

Lines changed: 23 additions & 11 deletions

File tree

.github/workflows/pre-commit.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
with:
1515
submodules: recursive
1616
- name: Install Foundry
17-
uses: foundry-rs/foundry-toolchain@v1
17+
uses: foundry-rs/foundry-toolchain@50d5a8956f2e319df19e6b57539d7e2acb9f8c1e # v1.5.0
18+
with:
19+
version: v1.4.3
1820
- name: Install pre-commit
1921
run: pip install pre-commit
2022
- name: Run pre-commit

src/briefcase/protocols/v3-periphery/libraries/PositionValue.sol

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,19 @@ library PositionValue {
117117
feeParams.tickUpper
118118
);
119119

120-
amount0 = FullMath.mulDiv(
121-
poolFeeGrowthInside0LastX128 - feeParams.positionFeeGrowthInside0LastX128,
122-
feeParams.liquidity,
123-
FixedPoint128.Q128
124-
) + feeParams.tokensOwed0;
120+
amount0 =
121+
FullMath.mulDiv(
122+
poolFeeGrowthInside0LastX128 - feeParams.positionFeeGrowthInside0LastX128,
123+
feeParams.liquidity,
124+
FixedPoint128.Q128
125+
) + feeParams.tokensOwed0;
125126

126-
amount1 = FullMath.mulDiv(
127-
poolFeeGrowthInside1LastX128 - feeParams.positionFeeGrowthInside1LastX128,
128-
feeParams.liquidity,
129-
FixedPoint128.Q128
130-
) + feeParams.tokensOwed1;
127+
amount1 =
128+
FullMath.mulDiv(
129+
poolFeeGrowthInside1LastX128 - feeParams.positionFeeGrowthInside1LastX128,
130+
feeParams.liquidity,
131+
FixedPoint128.Q128
132+
) + feeParams.tokensOwed1;
131133
}
132134

133135
function _getFeeGrowthInside(IUniswapV3Pool pool, int24 tickLower, int24 tickUpper)

src/briefcase/protocols/v4-periphery/interfaces/IV4Router.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ interface IV4Router is IImmutableState {
1313
error V4TooLittleReceived(uint256 minAmountOutReceived, uint256 amountReceived);
1414
/// @notice Emitted when an exactOutput is asked for more than its maxAmountIn
1515
error V4TooMuchRequested(uint256 maxAmountInRequested, uint256 amountRequested);
16+
/// @notice Emitted when an exactInput swap does not receive its relative minAmountOut per hop (max price)
17+
error V4TooLittleReceivedPerHop(uint256 hopIndex, uint256 maxPrice, uint256 price);
18+
/// @notice Emitted when an exactOutput is asked for more than its relative maxAmountIn per hop (max price)
19+
error V4TooMuchRequestedPerHop(uint256 hopIndex, uint256 maxPrice, uint256 price);
20+
/// @notice Emitted when the length of the maxHopSlippage array is not zero and not equal to the path length
21+
error InvalidHopSlippageLength();
1622

1723
/// @notice Parameters for a single-hop exact-input swap
1824
struct ExactInputSingleParams {
@@ -27,6 +33,7 @@ interface IV4Router is IImmutableState {
2733
struct ExactInputParams {
2834
Currency currencyIn;
2935
PathKey[] path;
36+
uint256[] maxHopSlippage;
3037
uint128 amountIn;
3138
uint128 amountOutMinimum;
3239
}
@@ -44,6 +51,7 @@ interface IV4Router is IImmutableState {
4451
struct ExactOutputParams {
4552
Currency currencyOut;
4653
PathKey[] path;
54+
uint256[] maxHopSlippage;
4755
uint128 amountOut;
4856
uint128 amountInMaximum;
4957
}

0 commit comments

Comments
 (0)