From 4b3aa138bea721ae9c3cb89e7f4d6d25f9d04b38 Mon Sep 17 00:00:00 2001 From: Oighty Date: Tue, 2 Jul 2024 17:15:37 -0400 Subject: [PATCH] chore: linter --- .../test/FixedPriceBatch-BaseDTL/TestData.s.sol | 4 ++-- script/ops/test/FixedPriceBatch/TestData.s.sol | 2 +- script/ops/test/TestData.s.sol | 2 +- src/modules/auctions/batch/FPB.sol | 2 +- test/AtomicAuctionHouse/AuctionHouseTest.sol | 8 ++++---- test/AtomicAuctionHouse/cancelAuction.t.sol | 2 +- test/AtomicAuctionHouse/purchase.t.sol | 4 ++-- test/BatchAuctionHouse/AuctionHouseTest.sol | 8 ++++---- test/BatchAuctionHouse/auction.t.sol | 2 +- test/BatchAuctionHouse/bid.t.sol | 2 +- .../liquidity/UniswapV2DTL/onSettle.t.sol | 7 ++++--- .../liquidity/UniswapV3DTL/onSettle.t.sol | 13 +++++++------ test/modules/Auction/auction.t.sol | 4 ++-- test/modules/Auction/cancel.t.sol | 4 ++-- test/modules/auctions/FPS/auction.t.sol | 15 +++++++++------ 15 files changed, 42 insertions(+), 37 deletions(-) diff --git a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol index d1279a43..80eddd9d 100644 --- a/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch-BaseDTL/TestData.s.sol @@ -61,7 +61,7 @@ contract TestData is Script, WithEnvironment { routingParams.callbackData = abi.encode( BaseDirectToLiquidity.OnCreateParams({ - proceedsUtilisationPercent: 50_00, // 50% + proceedsUtilisationPercent: 5000, // 50% vestingStart: 0, vestingExpiry: 0, recipient: msg.sender, @@ -80,7 +80,7 @@ contract TestData is Script, WithEnvironment { IFixedPriceBatch.AuctionDataParams memory auctionDataParams; auctionDataParams.price = 2e18; // 2 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_00); // 10% + auctionDataParams.minFillPercent = uint24(1000); // 10% bytes memory implParams = abi.encode(auctionDataParams); uint48 duration = 86_400; // 1 day diff --git a/script/ops/test/FixedPriceBatch/TestData.s.sol b/script/ops/test/FixedPriceBatch/TestData.s.sol index abd57ddb..70834a6c 100644 --- a/script/ops/test/FixedPriceBatch/TestData.s.sol +++ b/script/ops/test/FixedPriceBatch/TestData.s.sol @@ -68,7 +68,7 @@ contract TestData is Script, WithEnvironment { IFixedPriceBatch.AuctionDataParams memory auctionDataParams; auctionDataParams.price = 1e18; // 1 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_00); // 10% + auctionDataParams.minFillPercent = uint24(1000); // 10% bytes memory implParams = abi.encode(auctionDataParams); uint48 duration = 86_400; // 1 day diff --git a/script/ops/test/TestData.s.sol b/script/ops/test/TestData.s.sol index 7e3da732..c2a80bfc 100644 --- a/script/ops/test/TestData.s.sol +++ b/script/ops/test/TestData.s.sol @@ -68,7 +68,7 @@ contract TestData is Script { EncryptedMarginalPrice.AuctionDataParams memory auctionDataParams; auctionDataParams.minPrice = 2e18; // 2 quote tokens per base token - auctionDataParams.minFillPercent = uint24(10_00); // 10% + auctionDataParams.minFillPercent = uint24(1000); // 10% auctionDataParams.minBidSize = 2e17; // 0.2 quote tokens auctionDataParams.publicKey = publicKey; bytes memory implParams = abi.encode(auctionDataParams); diff --git a/src/modules/auctions/batch/FPB.sol b/src/modules/auctions/batch/FPB.sol index 8b3b9e0c..e65f1f2a 100644 --- a/src/modules/auctions/batch/FPB.sol +++ b/src/modules/auctions/batch/FPB.sol @@ -57,7 +57,7 @@ contract FixedPriceBatch is BatchAuctionModule, IFixedPriceBatch { /// This function reverts if: /// - The parameters cannot be decoded into the correct format /// - The price is zero - /// - The minimum fill percentage is greater than + /// - The minimum fill percentage is greater than /// /// @param params_ ABI-encoded data of type `AuctionDataParams` function _auction(uint96 lotId_, Lot memory lot_, bytes memory params_) internal override { diff --git a/test/AtomicAuctionHouse/AuctionHouseTest.sol b/test/AtomicAuctionHouse/AuctionHouseTest.sol index 2a0fd7dc..89d38fe4 100644 --- a/test/AtomicAuctionHouse/AuctionHouseTest.sol +++ b/test/AtomicAuctionHouse/AuctionHouseTest.sol @@ -61,13 +61,13 @@ abstract contract AtomicAuctionHouseTest is Test, Permit2User, WithSalts { address internal _bidder; uint256 internal _bidderKey; - uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 1_00; + uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 100; uint24 internal constant _CURATOR_FEE_PERCENT = 90; uint24 internal _curatorFeePercentActual; - uint24 internal constant _PROTOCOL_FEE_PERCENT = 1_00; - uint24 internal constant _REFERRER_FEE_PERCENT = 1_05; - uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 10_00; + uint24 internal constant _PROTOCOL_FEE_PERCENT = 100; + uint24 internal constant _REFERRER_FEE_PERCENT = 105; + uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 1000; uint24 internal _referrerFeePercentActual; uint24 internal _protocolFeePercentActual; diff --git a/test/AtomicAuctionHouse/cancelAuction.t.sol b/test/AtomicAuctionHouse/cancelAuction.t.sol index f404ead6..a14a3477 100644 --- a/test/AtomicAuctionHouse/cancelAuction.t.sol +++ b/test/AtomicAuctionHouse/cancelAuction.t.sol @@ -10,7 +10,7 @@ import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.s contract AtomicCancelAuctionTest is AtomicAuctionHouseTest { uint256 internal constant _PURCHASE_AMOUNT = 2e18; uint256 internal constant _PURCHASE_AMOUNT_OUT = 1e18; - uint32 internal constant _PAYOUT_MULTIPLIER = 50_00; // 50% + uint32 internal constant _PAYOUT_MULTIPLIER = 5000; // 50% bytes internal _purchaseAuctionData = abi.encode(""); diff --git a/test/AtomicAuctionHouse/purchase.t.sol b/test/AtomicAuctionHouse/purchase.t.sol index dde26bb5..085aceaa 100644 --- a/test/AtomicAuctionHouse/purchase.t.sol +++ b/test/AtomicAuctionHouse/purchase.t.sol @@ -11,7 +11,7 @@ import {AtomicAuctionHouseTest} from "test/AtomicAuctionHouse/AuctionHouseTest.s contract AtomicPurchaseTest is AtomicAuctionHouseTest { uint256 internal constant _AMOUNT_IN = 2e18; - uint256 internal constant _PAYOUT_MULTIPLIER = 50_00; // 50% + uint256 internal constant _PAYOUT_MULTIPLIER = 5000; // 50% address internal constant _SENDER = address(0x26); @@ -314,7 +314,7 @@ contract AtomicPurchaseTest is AtomicAuctionHouseTest { givenUserHasQuoteTokenBalance(_AMOUNT_IN) givenUserHasQuoteTokenAllowance(_AMOUNT_IN) givenFeesAreCalculated(_AMOUNT_IN) - whenPayoutMultiplierIsSet(90_00) + whenPayoutMultiplierIsSet(9000) givenSellerHasBaseTokenBalance(_amountOut) givenSellerHasBaseTokenAllowance(_amountOut) { diff --git a/test/BatchAuctionHouse/AuctionHouseTest.sol b/test/BatchAuctionHouse/AuctionHouseTest.sol index f9fa754a..f0eeee7a 100644 --- a/test/BatchAuctionHouse/AuctionHouseTest.sol +++ b/test/BatchAuctionHouse/AuctionHouseTest.sol @@ -60,13 +60,13 @@ abstract contract BatchAuctionHouseTest is Test, Permit2User, WithSalts { address internal _bidder; uint256 internal _bidderKey; - uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 1_00; + uint24 internal constant _CURATOR_MAX_FEE_PERCENT = 100; uint24 internal constant _CURATOR_FEE_PERCENT = 90; uint24 internal _curatorFeePercentActual; - uint24 internal constant _PROTOCOL_FEE_PERCENT = 1_00; - uint24 internal constant _REFERRER_FEE_PERCENT = 1_05; - uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 10_00; + uint24 internal constant _PROTOCOL_FEE_PERCENT = 100; + uint24 internal constant _REFERRER_FEE_PERCENT = 105; + uint24 internal constant _REFERRER_MAX_FEE_PERCENT = 1000; uint24 internal _referrerFeePercentActual; uint24 internal _protocolFeePercentActual; diff --git a/test/BatchAuctionHouse/auction.t.sol b/test/BatchAuctionHouse/auction.t.sol index ca742219..20b6a75d 100644 --- a/test/BatchAuctionHouse/auction.t.sol +++ b/test/BatchAuctionHouse/auction.t.sol @@ -235,7 +235,7 @@ contract BatchCreateAuctionTest is BatchAuctionHouseTest { whenBatchAuctionModuleIsInstalled givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) - givenMaxReferrerFeeIsSet() + givenMaxReferrerFeeIsSet givenProtocolFeeIsSet givenReferrerFee(_REFERRER_MAX_FEE_PERCENT + 1) { diff --git a/test/BatchAuctionHouse/bid.t.sol b/test/BatchAuctionHouse/bid.t.sol index 7d599525..5a077a19 100644 --- a/test/BatchAuctionHouse/bid.t.sol +++ b/test/BatchAuctionHouse/bid.t.sol @@ -371,7 +371,7 @@ contract BatchBidTest is BatchAuctionHouseTest { givenSellerHasBaseTokenBalance(_LOT_CAPACITY) givenSellerHasBaseTokenAllowance(_LOT_CAPACITY) givenMaxReferrerFeeIsSet - givenReferrerFee(1_00) + givenReferrerFee(100) givenLotIsCreated givenLotHasStarted givenUserHasQuoteTokenBalance(_BID_AMOUNT) diff --git a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol index 17c46b04..60bef165 100644 --- a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol +++ b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol @@ -175,13 +175,14 @@ contract UniswapV2DirectToLiquidityOnSettleTest is UniswapV2DirectToLiquidityTes // Any unspent curator payout is included in the refund // However, curator payouts are linear to the capacity utilised // Calculate the percent utilisation - uint96 capacityUtilisationPercent = - 100e2 - uint96(FixedPointMathLib.mulDivDown(_refund, 100e2, _LOT_CAPACITY + _curatorPayout)); + uint96 capacityUtilisationPercent = 100e2 + - uint96(FixedPointMathLib.mulDivDown(_refund, 100e2, _LOT_CAPACITY + _curatorPayout)); _capacityUtilised = _LOT_CAPACITY * capacityUtilisationPercent / 100e2; // The proceeds utilisation percent scales the quote tokens and base tokens linearly _quoteTokensToDeposit = _proceeds * _dtlCreateParams.proceedsUtilisationPercent / 100e2; - _baseTokensToDeposit = _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; + _baseTokensToDeposit = + _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; _; } diff --git a/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol index d4eefd95..ededd302 100644 --- a/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol +++ b/test/callbacks/liquidity/UniswapV3DTL/onSettle.t.sol @@ -213,13 +213,14 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes // Any unspent curator payout is included in the refund // However, curator payouts are linear to the capacity utilised // Calculate the percent utilisation - uint96 capacityUtilisationPercent = - 100e2 - uint96(FixedPointMathLib.mulDivDown(_refund, 100e2, _LOT_CAPACITY + _curatorPayout)); + uint96 capacityUtilisationPercent = 100e2 + - uint96(FixedPointMathLib.mulDivDown(_refund, 100e2, _LOT_CAPACITY + _curatorPayout)); _capacityUtilised = _LOT_CAPACITY * capacityUtilisationPercent / 100e2; // The proceeds utilisation percent scales the quote tokens and base tokens linearly _quoteTokensToDeposit = _proceeds * _dtlCreateParams.proceedsUtilisationPercent / 100e2; - _baseTokensToDeposit = _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; + _baseTokensToDeposit = + _capacityUtilised * _dtlCreateParams.proceedsUtilisationPercent / 100e2; _sqrtPriceX96 = _calculateSqrtPriceX96(_quoteTokensToDeposit, _baseTokensToDeposit); _; @@ -332,7 +333,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _capacityUtilised) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _capacityUtilised) - givenMaxSlippage(81_00) // 81% + givenMaxSlippage(8100) // 81% { _performCallback(); @@ -457,7 +458,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes setCallbackParameters(_PROCEEDS, _REFUND) givenPoolHasDepositLowerPrice givenPoolIsCreatedAndInitialized(_sqrtPriceX96) - givenMaxSlippage(51_00) // 51% + givenMaxSlippage(5100) // 51% givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) @@ -479,7 +480,7 @@ contract UniswapV3DirectToLiquidityOnSettleTest is UniswapV3DirectToLiquidityTes setCallbackParameters(_PROCEEDS, _REFUND) givenPoolHasDepositHigherPrice givenPoolIsCreatedAndInitialized(_sqrtPriceX96) - givenMaxSlippage(51_00) // 51% + givenMaxSlippage(5100) // 51% givenAddressHasQuoteTokenBalance(_dtlAddress, _proceeds) givenAddressHasBaseTokenBalance(_SELLER, _baseTokensToDeposit) givenAddressHasBaseTokenAllowance(_SELLER, _dtlAddress, _baseTokensToDeposit) diff --git a/test/modules/Auction/auction.t.sol b/test/modules/Auction/auction.t.sol index 74cc2452..6e03e6b3 100644 --- a/test/modules/Auction/auction.t.sol +++ b/test/modules/Auction/auction.t.sol @@ -36,7 +36,7 @@ contract AuctionTest is Test, Permit2User { uint8 internal constant _QUOTE_TOKEN_DECIMALS = 18; uint8 internal constant _BASE_TOKEN_DECIMALS = 18; - uint48 internal constant _REFERRER_FEE = 1_00; + uint48 internal constant _REFERRER_FEE = 100; function setUp() external { // Ensure the block timestamp is a sane value @@ -51,7 +51,7 @@ contract AuctionTest is Test, Permit2User { _auctionHouse.installModule(_mockAuctionModule); - _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 10_00); + _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 1000); _auctionParams = IAuction.AuctionParams({ start: uint48(block.timestamp), diff --git a/test/modules/Auction/cancel.t.sol b/test/modules/Auction/cancel.t.sol index d57f4cfa..6bb3acea 100644 --- a/test/modules/Auction/cancel.t.sol +++ b/test/modules/Auction/cancel.t.sol @@ -34,7 +34,7 @@ contract CancelTest is Test, Permit2User { address internal constant _SELLER = address(0x1); address internal constant _PROTOCOL = address(0x2); uint48 internal constant _DURATION = 1 days; - uint48 internal constant _REFERRER_FEE = 1_00; + uint48 internal constant _REFERRER_FEE = 100; string internal _infoHash = ""; @@ -48,7 +48,7 @@ contract CancelTest is Test, Permit2User { _auctionHouse.installModule(_mockAuctionModule); - _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 10_00); + _auctionHouse.setFee(_mockAuctionModuleKeycode, IFeeManager.FeeType.MaxReferrer, 1000); _auctionParams = IAuction.AuctionParams({ start: uint48(block.timestamp), diff --git a/test/modules/auctions/FPS/auction.t.sol b/test/modules/auctions/FPS/auction.t.sol index daac3782..f9d2ba9e 100644 --- a/test/modules/auctions/FPS/auction.t.sol +++ b/test/modules/auctions/FPS/auction.t.sol @@ -111,8 +111,9 @@ contract FpsCreateAuctionTest is FpsTest { function test_capacityInQuote() public givenCapacityInQuote { // Calculate the expected value - uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); + uint256 expectedMaxPayoutInQuote = Math.mulDivDown( + _scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2 + ); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) ); @@ -139,8 +140,9 @@ contract FpsCreateAuctionTest is FpsTest { givenBaseTokenDecimals(13) { // Calculate the expected value - uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); + uint256 expectedMaxPayoutInQuote = Math.mulDivDown( + _scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2 + ); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) ); @@ -167,8 +169,9 @@ contract FpsCreateAuctionTest is FpsTest { givenBaseTokenDecimals(17) { // Calculate the expected value - uint256 expectedMaxPayoutInQuote = - Math.mulDivDown(_scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2); + uint256 expectedMaxPayoutInQuote = Math.mulDivDown( + _scaleQuoteTokenAmount(_LOT_CAPACITY), _fpaParams.maxPayoutPercent, 100e2 + ); uint256 expectedMaxPayout = Math.mulDivDown( expectedMaxPayoutInQuote, 10 ** _baseTokenDecimals, _scaleQuoteTokenAmount(_PRICE) );