diff --git a/.changeset/busy-chicken-win.md b/.changeset/busy-chicken-win.md new file mode 100644 index 000000000..40e47a1bc --- /dev/null +++ b/.changeset/busy-chicken-win.md @@ -0,0 +1,5 @@ +--- +"@exactly/protocol": patch +--- + +🐛 market: fix double-count in max supply check diff --git a/.gas-snapshot b/.gas-snapshot index 909b1ea74..3237eca19 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -97,8 +97,8 @@ DebtPreviewerTest:testPreviewSameAssetInvalidLeverageShouldCapRatio() (gas: 1229 DebtRollerTest:test_receiveFlashLoan_reverts_whenUnauthorizedFlashLoaner() (gas: 39801) DebtRollerTest:test_rollFixed_reverts_whenInvalidOperation() (gas: 51027) DebtRollerTest:test_rollFixed_reverts_whenNotMarket() (gas: 49047) -DebtRollerTest:test_rollFixed_rolls() (gas: 1100854) -DebtRollerTest:test_rollFixed_rolls_partial() (gas: 1140051) +DebtRollerTest:test_rollFixed_rolls() (gas: 1100779) +DebtRollerTest:test_rollFixed_rolls_partial() (gas: 1139976) EXATest:test_burn_burnsAndEmitsCrosschainBurn() (gas: 149890) EXATest:test_burn_reverts_whenCallerLacksBridgeRole() (gas: 69255) EXATest:test_crosschainBurn_burnsAndEmitsCrosschainBurn() (gas: 149888) @@ -174,11 +174,11 @@ FlashLoanAdapterTest:test_setWToken_reverts_whenNotAdmin() (gas: 66649) FlashLoanAdapterTest:test_setWToken_sets_whenAdmin() (gas: 82048) InstallmentsRouterTest:testAmountsLength() (gas: 36806) InstallmentsRouterTest:testBorrowETHToAnotherReceiver() (gas: 801220) -InstallmentsRouterTest:testBorrowETHWithPermit() (gas: 1239179) +InstallmentsRouterTest:testBorrowETHWithPermit() (gas: 1239104) InstallmentsRouterTest:testBorrowRouter() (gas: 691277) InstallmentsRouterTest:testBorrowToAnotherReceiver() (gas: 715159) InstallmentsRouterTest:testBorrowUnwrappedETH() (gas: 768423) -InstallmentsRouterTest:testBorrowWithPermit() (gas: 1375087) +InstallmentsRouterTest:testBorrowWithPermit() (gas: 1375012) InstallmentsRouterTest:testFakeMarket() (gas: 47946) InstallmentsRouterTest:testInsufficientMaxRepay() (gas: 676442) InstallmentsRouterTest:testMaxRepay() (gas: 676436) @@ -194,161 +194,162 @@ IntegrationPreviewerTest:test_fixedRepayPosition_beforeMaturity() (gas: 579991) IntegrationPreviewerTest:test_fixedRepayPosition_maxUint() (gas: 79468) IntegrationPreviewerTest:test_fixedRepayPosition_saturatedFallback() (gas: 63069) IntegrationPreviewerTest:test_healthFactor() (gas: 463879) -IntegrationPreviewerTest:test_previewDeposit_(uint256) (runs: 256, μ: 1590621, ~: 1594531) -IntegrationPreviewerTest:test_previewHealthFactor() (gas: 5805369) -IntegrationPreviewerTest:test_previewWithdraw_(uint256) (runs: 256, μ: 1650006, ~: 1654116) +IntegrationPreviewerTest:test_previewDeposit_(uint256) (runs: 256, μ: 1590393, ~: 1594456) +IntegrationPreviewerTest:test_previewHealthFactor() (gas: 5805294) +IntegrationPreviewerTest:test_previewWithdraw_(uint256) (runs: 256, μ: 1649847, ~: 1654116) InterestRateModelTest:testFixedBorrowRate() (gas: 2088868) InterestRateModelTest:testFixedRateRevertAlreadyMatured() (gas: 2083135) InterestRateModelTest:testFixedRateRevertUtilizationExceeded() (gas: 2097203) InterestRateModelTest:testFloatingBorrowRate() (gas: 2082456) InterestRateModelTest:testFuzzFixedRateGrowth(uint256,uint256,uint256,uint256) (runs: 256, μ: 2109079, ~: 2105195) InterestRateModelTest:testFuzzFixedRateTimeSensitivity(uint256,uint256,uint256) (runs: 256, μ: 2117002, ~: 2117161) -InterestRateModelTest:testFuzzReferenceLegacyRateFixed(uint32,uint256,uint256[2],uint256[2],uint256,uint256,uint256) (runs: 256, μ: 12911661, ~: 13132845) +InterestRateModelTest:testFuzzReferenceLegacyRateFixed(uint32,uint256,uint256[2],uint256[2],uint256,uint256,uint256) (runs: 256, μ: 12909428, ~: 13130610) InterestRateModelTest:testFuzzReferenceRateFixed(uint256,uint256,uint256,uint256,uint256,uint256,(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,int256,uint256,uint256)) (runs: 256, μ: 2384608, ~: 2386846) InterestRateModelTest:testFuzzReferenceRateFloating(uint256,uint256,(uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 256, μ: 2324354, ~: 2324970) InterestRateModelTest:testMinTimeToMaturity() (gas: 2107232) InterestRateModelTest:testRevertMaxUtilizationLowerThanWad() (gas: 268402) -MarketTest:testAccountLiquidityAdjustedDebt() (gas: 654335) -MarketTest:testAccountsFixedConsolidated() (gas: 2084838) -MarketTest:testAccountsFixedConsolidatedWhenClearBadDebt() (gas: 2147315) -MarketTest:testAccountsFixedConsolidatedWhenSenderNotOwner() (gas: 973482) -MarketTest:testAccountsFixedConsolidatedWithPartialRepayAndWithdraw() (gas: 1478629) -MarketTest:testAccrueEarningsBeforeLiquidation() (gas: 1572667) -MarketTest:testAnotherUserRedeemWhenOwnerHasShortfall() (gas: 909013) -MarketTest:testAnotherUserWithdrawWhenOwnerHasShortfall() (gas: 855191) -MarketTest:testBorrowAfterFreezing() (gas: 493283) -MarketTest:testBorrowAtMaturity() (gas: 545852) -MarketTest:testBorrowAtMaturityAfterFreezing() (gas: 619397) -MarketTest:testBorrowAtMaturityUpdatesFloatingDebtAndFloatingAssets() (gas: 888663) +MarketTest:testAccountLiquidityAdjustedDebt() (gas: 654260) +MarketTest:testAccountsFixedConsolidated() (gas: 2084688) +MarketTest:testAccountsFixedConsolidatedWhenClearBadDebt() (gas: 2147165) +MarketTest:testAccountsFixedConsolidatedWhenSenderNotOwner() (gas: 973309) +MarketTest:testAccountsFixedConsolidatedWithPartialRepayAndWithdraw() (gas: 1478554) +MarketTest:testAccrueEarningsBeforeLiquidation() (gas: 1572539) +MarketTest:testAnotherUserRedeemWhenOwnerHasShortfall() (gas: 908863) +MarketTest:testAnotherUserWithdrawWhenOwnerHasShortfall() (gas: 855063) +MarketTest:testBorrowAfterFreezing() (gas: 493230) +MarketTest:testBorrowAtMaturity() (gas: 545799) +MarketTest:testBorrowAtMaturityAfterFreezing() (gas: 619322) +MarketTest:testBorrowAtMaturityUpdatesFloatingDebtAndFloatingAssets() (gas: 888535) MarketTest:testBorrowAtMaturityWhenFrozen() (gas: 93430) MarketTest:testBorrowAtMaturityWithZeroAssets() (gas: 40235) -MarketTest:testBorrowDisagreement() (gas: 297367) -MarketTest:testBorrowFromFreeLunchShouldNotRevertWithFloatingFullUtilization() (gas: 1387487) -MarketTest:testBorrowWhenFrozen() (gas: 92956) -MarketTest:testBorrowWithZeroAssets() (gas: 39654) -MarketTest:testCappedLiquidation() (gas: 1354623) -MarketTest:testChargeTreasuryToEarlyWithdraws() (gas: 1453763) -MarketTest:testChargeTreasuryToFixedBorrows() (gas: 1814144) -MarketTest:testClearBadDebtAvoidingFixedBorrowsIfAccumulatorLower() (gas: 2456569) -MarketTest:testClearBadDebtBeforeMaturity() (gas: 2497898) +MarketTest:testBorrowDisagreement() (gas: 297292) +MarketTest:testBorrowFromFreeLunchShouldNotRevertWithFloatingFullUtilization() (gas: 1387293) +MarketTest:testBorrowWhenFrozen() (gas: 92933) +MarketTest:testBorrowWithZeroAssets() (gas: 39676) +MarketTest:testCappedLiquidation() (gas: 1354473) +MarketTest:testChargeTreasuryToEarlyWithdraws() (gas: 1453688) +MarketTest:testChargeTreasuryToFixedBorrows() (gas: 1813994) +MarketTest:testClearBadDebtAvoidingFixedBorrowsIfAccumulatorLower() (gas: 2456419) +MarketTest:testClearBadDebtBeforeMaturity() (gas: 2497629) MarketTest:testClearBadDebtCalledByAccount() (gas: 34965) -MarketTest:testClearBadDebtEmptiesUnassignedEarnings() (gas: 2808516) -MarketTest:testClearBadDebtExactlyRepaysFixedBorrowWithAccumulatorAmount() (gas: 2197484) -MarketTest:testClearBadDebtPartiallyRepaysEachFixedBorrow() (gas: 2150267) -MarketTest:testClearBadDebtPartiallyRepaysFloatingDebt() (gas: 2523328) -MarketTest:testClearBadDebtShouldAccrueAccumulatedEarningsBeforeSpreadingLosses() (gas: 2335748) -MarketTest:testClearBadDebtWithEmptyAccumulatorShouldNotRevert() (gas: 1129049) -MarketTest:testClearMaturity() (gas: 1853499) -MarketTest:testCollectTreasuryFreeLunchToEarlyWithdraws() (gas: 2081072) -MarketTest:testCollectTreasuryFreeLunchToEarlyWithdrawsWithZeroFees() (gas: 650071) -MarketTest:testCollectTreasuryFreeLunchToFixedBorrows() (gas: 2087502) -MarketTest:testCollectTreasuryFreeLunchToFixedBorrowsWithZeroFees() (gas: 864310) -MarketTest:testCrossMaturityLiquidation() (gas: 2877810) -MarketTest:testDepositAfterFreezing() (gas: 258096) -MarketTest:testDepositAtMaturity() (gas: 238025) -MarketTest:testDepositAtMaturityAfterFreezing() (gas: 311812) -MarketTest:testDepositAtMaturityWhenFrozen() (gas: 92960) +MarketTest:testClearBadDebtEmptiesUnassignedEarnings() (gas: 2808291) +MarketTest:testClearBadDebtExactlyRepaysFixedBorrowWithAccumulatorAmount() (gas: 2197334) +MarketTest:testClearBadDebtPartiallyRepaysEachFixedBorrow() (gas: 2150073) +MarketTest:testClearBadDebtPartiallyRepaysFloatingDebt() (gas: 2523178) +MarketTest:testClearBadDebtShouldAccrueAccumulatedEarningsBeforeSpreadingLosses() (gas: 2335598) +MarketTest:testClearBadDebtWithEmptyAccumulatorShouldNotRevert() (gas: 1128899) +MarketTest:testClearMaturity() (gas: 1853424) +MarketTest:testCollectTreasuryFreeLunchToEarlyWithdraws() (gas: 2081019) +MarketTest:testCollectTreasuryFreeLunchToEarlyWithdrawsWithZeroFees() (gas: 649933) +MarketTest:testCollectTreasuryFreeLunchToFixedBorrows() (gas: 2087449) +MarketTest:testCollectTreasuryFreeLunchToFixedBorrowsWithZeroFees() (gas: 864257) +MarketTest:testCrossMaturityLiquidation() (gas: 2877660) +MarketTest:testDepositAfterFreezing() (gas: 258021) +MarketTest:testDepositAtMaturity() (gas: 237982) +MarketTest:testDepositAtMaturityAfterFreezing() (gas: 311834) +MarketTest:testDepositAtMaturityWhenFrozen() (gas: 92917) MarketTest:testDepositAtMaturityWithZeroAssets() (gas: 39804) MarketTest:testDepositDisagreement() (gas: 73930) -MarketTest:testDepositShouldUpdateFlexibleBorrowVariables() (gas: 799381) -MarketTest:testDepositToSmartPool() (gas: 183924) +MarketTest:testDepositShouldUpdateFlexibleBorrowVariables() (gas: 799178) +MarketTest:testDepositToSmartPool() (gas: 183805) MarketTest:testDepositWhenFrozen() (gas: 176182) -MarketTest:testDistributeMultipleAccumulatedEarnings() (gas: 1736997) -MarketTest:testDistributionOfLossesShouldReduceFromFloatingBackupBorrowedAccordingly() (gas: 6804967) -MarketTest:testEarlyRepayLiquidationUnassignedEarnings() (gas: 2588041) -MarketTest:testEarlyRepaymentWithExcessiveAmountOfFees() (gas: 3549365) -MarketTest:testEarlyWithdrawFromFreeLunchShouldNotRevertWithFloatingFullUtilization() (gas: 1092307) +MarketTest:testDistributeMultipleAccumulatedEarnings() (gas: 1736794) +MarketTest:testDistributionOfLossesShouldReduceFromFloatingBackupBorrowedAccordingly() (gas: 6804742) +MarketTest:testEarlyRepayLiquidationUnassignedEarnings() (gas: 2587913) +MarketTest:testEarlyRepaymentWithExcessiveAmountOfFees() (gas: 3549215) +MarketTest:testEarlyWithdrawFromFreeLunchShouldNotRevertWithFloatingFullUtilization() (gas: 1092157) MarketTest:testEmergencyAdminRole() (gas: 373284) -MarketTest:testEmitFrozen() (gas: 90632) -MarketTest:testFixedBorrowFailingWhenFlexibleBorrowAccruesDebt() (gas: 1585458) -MarketTest:testFixedBorrowRateToMaturity() (gas: 608954) -MarketTest:testFixedOperationsUpdateFloatingDebt() (gas: 994170) -MarketTest:testFlexibleBorrow() (gas: 461018) -MarketTest:testFlexibleBorrowAccountingDebt() (gas: 755069) -MarketTest:testFlexibleBorrowChargingDebtToTreasury() (gas: 847949) -MarketTest:testFlexibleBorrowExceedingReserve() (gas: 882480) -MarketTest:testFlexibleBorrowExceedingReserveIncludingFixedBorrow() (gas: 1315881) -MarketTest:testFlexibleBorrowExceedingReserveWithNewDebt() (gas: 1005367) -MarketTest:testFlexibleBorrowFromAnotherUserSubtractsAllowance() (gas: 480194) -MarketTest:testFlexibleBorrowFromAnotherUserWithAllowance() (gas: 460773) -MarketTest:testFlexibleBorrowFromAnotherUserWithoutAllowance() (gas: 254455) -MarketTest:testFrontRunSmartPoolEarningsDistributionWithBigPenaltyRepayment() (gas: 1681344) -MarketTest:testFullPause() (gas: 6091640) +MarketTest:testEmitFrozen() (gas: 90654) +MarketTest:testFixedBorrowFailingWhenFlexibleBorrowAccruesDebt() (gas: 1585308) +MarketTest:testFixedBorrowRateToMaturity() (gas: 608879) +MarketTest:testFixedOperationsUpdateFloatingDebt() (gas: 994095) +MarketTest:testFlexibleBorrow() (gas: 460901) +MarketTest:testFlexibleBorrowAccountingDebt() (gas: 754994) +MarketTest:testFlexibleBorrowChargingDebtToTreasury() (gas: 847810) +MarketTest:testFlexibleBorrowExceedingReserve() (gas: 882330) +MarketTest:testFlexibleBorrowExceedingReserveIncludingFixedBorrow() (gas: 1315731) +MarketTest:testFlexibleBorrowExceedingReserveWithNewDebt() (gas: 1005217) +MarketTest:testFlexibleBorrowFromAnotherUserSubtractsAllowance() (gas: 480119) +MarketTest:testFlexibleBorrowFromAnotherUserWithAllowance() (gas: 460698) +MarketTest:testFlexibleBorrowFromAnotherUserWithoutAllowance() (gas: 254380) +MarketTest:testFrontRunSmartPoolEarningsDistributionWithBigPenaltyRepayment() (gas: 1681141) +MarketTest:testFullPause() (gas: 6091490) MarketTest:testInitiallyUnfrozen() (gas: 15498) -MarketTest:testInsufficientProtocolLiquidity() (gas: 1990764) -MarketTest:testLiquidateAndChargeIncentiveForLenders() (gas: 2554518) -MarketTest:testLiquidateAndDistributeLosses() (gas: 3522201) -MarketTest:testLiquidateAndSeizeExactAmountWithDustAsCollateral() (gas: 3077406) -MarketTest:testLiquidateAndSeizeFromEmptyCollateral() (gas: 1092010) -MarketTest:testLiquidateAndSubtractLossesFromAccumulator() (gas: 4260450) -MarketTest:testLiquidateFlexibleAndFixedBorrowPositionsInSingleCall() (gas: 2792836) -MarketTest:testLiquidateFlexibleBorrow() (gas: 2771825) -MarketTest:testLiquidateFlexibleBorrowChargeLendersAssetsToLiquidator() (gas: 1201683) -MarketTest:testLiquidateFlexibleBorrowConsideringDebtOverTime() (gas: 1277456) -MarketTest:testLiquidateLeavingDustAsCollateral() (gas: 4001162) -MarketTest:testLiquidateTransferRepayAssetsBeforeSeize() (gas: 1222226) -MarketTest:testLiquidateUpdateFloatingDebt() (gas: 1981194) -MarketTest:testLiquidateWhenFrozen() (gas: 1236974) -MarketTest:testLiquidateWithTwoUnitsAsMaxAssets() (gas: 1810095) -MarketTest:testLiquidateWithZeroAsMaxAssets() (gas: 1091938) -MarketTest:testLiquidationClearingDebtOfAllAccountMarkets() (gas: 3419879) -MarketTest:testLiquidationResultingInZeroCollateralAndZeroDebt() (gas: 2193917) -MarketTest:testMaturityInsufficientProtocolLiquidity() (gas: 1569501) -MarketTest:testMultipleBorrowsForMultipleAssets() (gas: 2483954631) -MarketTest:testMultipleDepositsToSmartPool() (gas: 930641) -MarketTest:testMultipleFixedBorrowsRepays() (gas: 1468953) -MarketTest:testMultipleLiquidationSameUser() (gas: 3597935) -MarketTest:testNotEnteredMarketShouldNotBeSeized() (gas: 11372318) -MarketTest:testOnlyAdminCanFreezeUnfreeze() (gas: 228242) -MarketTest:testOperationsShouldUpdateFloatingAssetsAverage() (gas: 1649089) -MarketTest:testOperationsWithBtcWbtcRate() (gas: 11075335) -MarketTest:testOperationsWithStEthAsset() (gas: 10964717) -MarketTest:testPausable() (gas: 183062) +MarketTest:testInsufficientProtocolLiquidity() (gas: 1990516) +MarketTest:testLiquidateAndChargeIncentiveForLenders() (gas: 2554368) +MarketTest:testLiquidateAndDistributeLosses() (gas: 3522051) +MarketTest:testLiquidateAndSeizeExactAmountWithDustAsCollateral() (gas: 3077301) +MarketTest:testLiquidateAndSeizeFromEmptyCollateral() (gas: 1091860) +MarketTest:testLiquidateAndSubtractLossesFromAccumulator() (gas: 4260300) +MarketTest:testLiquidateFlexibleAndFixedBorrowPositionsInSingleCall() (gas: 2792642) +MarketTest:testLiquidateFlexibleBorrow() (gas: 2771697) +MarketTest:testLiquidateFlexibleBorrowChargeLendersAssetsToLiquidator() (gas: 1201555) +MarketTest:testLiquidateFlexibleBorrowConsideringDebtOverTime() (gas: 1277306) +MarketTest:testLiquidateLeavingDustAsCollateral() (gas: 4000989) +MarketTest:testLiquidateTransferRepayAssetsBeforeSeize() (gas: 1222151) +MarketTest:testLiquidateUpdateFloatingDebt() (gas: 1981044) +MarketTest:testLiquidateWhenFrozen() (gas: 1236824) +MarketTest:testLiquidateWithTwoUnitsAsMaxAssets() (gas: 1809967) +MarketTest:testLiquidateWithZeroAsMaxAssets() (gas: 1091788) +MarketTest:testLiquidationClearingDebtOfAllAccountMarkets() (gas: 3419654) +MarketTest:testLiquidationResultingInZeroCollateralAndZeroDebt() (gas: 2193789) +MarketTest:testMaturityInsufficientProtocolLiquidity() (gas: 1569373) +MarketTest:testMultipleBorrowsForMultipleAssets() (gas: 2483945638) +MarketTest:testMultipleDepositsToSmartPool() (gas: 930093) +MarketTest:testMultipleFixedBorrowsRepays() (gas: 1468900) +MarketTest:testMultipleLiquidationSameUser() (gas: 3597785) +MarketTest:testNotEnteredMarketShouldNotBeSeized() (gas: 11369955) +MarketTest:testOnlyAdminCanFreezeUnfreeze() (gas: 228264) +MarketTest:testOperationsShouldUpdateFloatingAssetsAverage() (gas: 1648939) +MarketTest:testOperationsWithBtcWbtcRate() (gas: 11073100) +MarketTest:testOperationsWithStEthAsset() (gas: 10962439) +MarketTest:testPausable() (gas: 183084) MarketTest:testPauserRole() (gas: 88344) -MarketTest:testPreviewOperationsWithSmartPoolCorrectlyAccountingEarnings() (gas: 2265165) -MarketTest:testRepayAtMaturity() (gas: 639073) -MarketTest:testRepayDisagreement() (gas: 640423) -MarketTest:testRepayFlexibleBorrow() (gas: 1251214) -MarketTest:testRepayWhenFrozen() (gas: 537282) -MarketTest:testRoundingDownAssetsToValidateShortfallWhenTransferring() (gas: 9587078) -MarketTest:testRoundingDownAssetsToValidateShortfallWhenTransferringFrom() (gas: 9642490) -MarketTest:testRoundingDownAssetsWhenTransferingFromAnAccountWithoutShortfall() (gas: 1096112) -MarketTest:testRoundingDownAssetsWhenTransferingWithAnAccountWithoutShortfall() (gas: 1038155) -MarketTest:testRoundingUpAllowanceWhenBorrowingAtMaturity() (gas: 902063) -MarketTest:testRoundingUpAllowanceWhenWithdrawingAtMaturity() (gas: 885105) -MarketTest:testSetDampSpeedFactorShouldUpdateFloatingAssetsAverage() (gas: 410961) -MarketTest:testSetEarningsAccumulatorSmoothFactorShouldDistributeEarnings() (gas: 905654) -MarketTest:testSetInterestRateModelShouldUpdateFloatingDebt() (gas: 2853671) -MarketTest:testSetInterestRateModelWithAddressZeroShouldNotUpdateFloatingDebt() (gas: 2642682) -MarketTest:testShareValueNotDecreasingAfterDeposit() (gas: 797059) -MarketTest:testShareValueNotDecreasingWhenMintingToTreasury() (gas: 846242) -MarketTest:testSingleFloatingBorrow() (gas: 419475) -MarketTest:testSingleFloatingRepay() (gas: 486680) -MarketTest:testSmartPoolEarningsDistribution() (gas: 1235163) -MarketTest:testSmartPoolSharesDoNotAccountUnassignedEarningsFromMoreThanOneIntervalPastMaturities() (gas: 680325) -MarketTest:testSumDebtPlusEffectsShouldntRoundUpWhenWithdrawing() (gas: 1068946) -MarketTest:testTotalAssetsProjectingBackupEarningsCorrectly() (gas: 594214) -MarketTest:testTotalAssetsProjectingFloatingDebtCorrectly() (gas: 844359) -MarketTest:testUpdateAccumulatedEarningsFactorToZero() (gas: 1789542) -MarketTest:testUpdateFloatingAssetsAverageWhenDepositingAndBorrowingContinuously() (gas: 421907) -MarketTest:testUpdateFloatingAssetsAverageWhenDepositingRightBeforeBorrow() (gas: 741260) -MarketTest:testUpdateFloatingAssetsAverageWhenDepositingRightBeforeEarlyWithdraw() (gas: 695245) -MarketTest:testUpdateFloatingAssetsAverageWhenDepositingSomeSecondsBeforeBorrow() (gas: 1059342) -MarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingRightBeforeBorrow() (gas: 757985) -MarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingRightBeforeEarlyWithdraw() (gas: 711948) -MarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingSomeSecondsBeforeBorrow() (gas: 539311) -MarketTest:testUpdateFloatingAssetsAverageWithDampSpeedDown() (gas: 444294) -MarketTest:testUpdateFloatingAssetsAverageWithDampSpeedUp() (gas: 318394) -MarketTest:testUpdateFloatingDebtBeforeSettingTreasury() (gas: 115197) -MarketTest:testWithdrawAtMaturity() (gas: 342219) -MarketTest:testWithdrawFromSmartPool() (gas: 289996) -MarketTest:testWithdrawShouldUpdateFlexibleBorrowVariables() (gas: 941865) -MarketTest:testWithdrawWhenFrozen() (gas: 327797) -MarketTest:test_deposit_deposits_whenTotalSupplyLowerThanMaxSupply() (gas: 224770) -MarketTest:test_deposit_reverts_whenTotalSupplyHigherThanMaxSupply() (gas: 160870) +MarketTest:testPreviewOperationsWithSmartPoolCorrectlyAccountingEarnings() (gas: 2264812) +MarketTest:testRepayAtMaturity() (gas: 638954) +MarketTest:testRepayDisagreement() (gas: 640370) +MarketTest:testRepayFlexibleBorrow() (gas: 1251041) +MarketTest:testRepayWhenFrozen() (gas: 537207) +MarketTest:testRoundingDownAssetsToValidateShortfallWhenTransferring() (gas: 9584811) +MarketTest:testRoundingDownAssetsToValidateShortfallWhenTransferringFrom() (gas: 9640246) +MarketTest:testRoundingDownAssetsWhenTransferingFromAnAccountWithoutShortfall() (gas: 1095887) +MarketTest:testRoundingDownAssetsWhenTransferingWithAnAccountWithoutShortfall() (gas: 1037930) +MarketTest:testRoundingUpAllowanceWhenBorrowingAtMaturity() (gas: 902010) +MarketTest:testRoundingUpAllowanceWhenWithdrawingAtMaturity() (gas: 885030) +MarketTest:testSetDampSpeedFactorShouldUpdateFloatingAssetsAverage() (gas: 410811) +MarketTest:testSetEarningsAccumulatorSmoothFactorShouldDistributeEarnings() (gas: 905579) +MarketTest:testSetInterestRateModelShouldUpdateFloatingDebt() (gas: 2853596) +MarketTest:testSetInterestRateModelWithAddressZeroShouldNotUpdateFloatingDebt() (gas: 2642607) +MarketTest:testShareValueNotDecreasingAfterDeposit() (gas: 796909) +MarketTest:testShareValueNotDecreasingWhenMintingToTreasury() (gas: 846167) +MarketTest:testSingleFloatingBorrow() (gas: 419400) +MarketTest:testSingleFloatingRepay() (gas: 486605) +MarketTest:testSmartPoolEarningsDistribution() (gas: 1234938) +MarketTest:testSmartPoolSharesDoNotAccountUnassignedEarningsFromMoreThanOneIntervalPastMaturities() (gas: 680272) +MarketTest:testSumDebtPlusEffectsShouldntRoundUpWhenWithdrawing() (gas: 1068743) +MarketTest:testTotalAssetsProjectingBackupEarningsCorrectly() (gas: 594116) +MarketTest:testTotalAssetsProjectingFloatingDebtCorrectly() (gas: 844209) +MarketTest:testUpdateAccumulatedEarningsFactorToZero() (gas: 1789242) +MarketTest:testUpdateFloatingAssetsAverageWhenDepositingAndBorrowingContinuously() (gas: 421757) +MarketTest:testUpdateFloatingAssetsAverageWhenDepositingRightBeforeBorrow() (gas: 741110) +MarketTest:testUpdateFloatingAssetsAverageWhenDepositingRightBeforeEarlyWithdraw() (gas: 695051) +MarketTest:testUpdateFloatingAssetsAverageWhenDepositingSomeSecondsBeforeBorrow() (gas: 1059214) +MarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingRightBeforeBorrow() (gas: 757932) +MarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingRightBeforeEarlyWithdraw() (gas: 711895) +MarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingSomeSecondsBeforeBorrow() (gas: 539236) +MarketTest:testUpdateFloatingAssetsAverageWithDampSpeedDown() (gas: 444219) +MarketTest:testUpdateFloatingAssetsAverageWithDampSpeedUp() (gas: 318341) +MarketTest:testUpdateFloatingDebtBeforeSettingTreasury() (gas: 115219) +MarketTest:testWithdrawAtMaturity() (gas: 342177) +MarketTest:testWithdrawFromSmartPool() (gas: 289943) +MarketTest:testWithdrawShouldUpdateFlexibleBorrowVariables() (gas: 941790) +MarketTest:testWithdrawWhenFrozen() (gas: 327699) +MarketTest:test_deposit_allowsDepositUpToMaxSupply() (gas: 349979) +MarketTest:test_deposit_deposits_whenTotalSupplyLowerThanMaxSupply() (gas: 224695) +MarketTest:test_deposit_reverts_whenTotalSupplyHigherThanMaxSupply() (gas: 160772) MarketTest:test_setMaxSupply_emits_maxSupplySet() (gas: 44325) MarketTest:test_setMaxSupply_reverts_whenNotAdmin() (gas: 65179) -MarketTest:test_setMaxSupply_sets_whenAdmin() (gas: 66379) +MarketTest:test_setMaxSupply_sets_whenAdmin() (gas: 66356) PauserTest:testPauseProtocolFromRando() (gas: 32819) PauserTest:testPauseProtocolWhenMarketsArePaused() (gas: 186975) PauserTest:testPauseProtocolWhenMarketsAreUnpaused() (gas: 147173) @@ -363,62 +364,62 @@ PoolLibTest:testEarningsDistribution() (gas: 32679) PoolLibTest:testFuzzAddRemoveAll(uint8[12]) (runs: 256, μ: 104449, ~: 105534) PoolLibTest:testMaturityRangeLimit() (gas: 7866) PoolLibTest:testMaturityRangeTooWide() (gas: 11656) -PreviewerTest:testAccountsReturningAccurateAmounts() (gas: 1686539) -PreviewerTest:testAccountsReturningUtilizationForDifferentMaturities() (gas: 5278517) -PreviewerTest:testAccountsWithAccountOnlyDeposit() (gas: 1045098) -PreviewerTest:testAccountsWithAccountThatHasBalances() (gas: 2755970) +PreviewerTest:testAccountsReturningAccurateAmounts() (gas: 1686464) +PreviewerTest:testAccountsReturningUtilizationForDifferentMaturities() (gas: 5278442) +PreviewerTest:testAccountsWithAccountOnlyDeposit() (gas: 1045023) +PreviewerTest:testAccountsWithAccountThatHasBalances() (gas: 2755895) PreviewerTest:testAccountsWithEmptyAccount() (gas: 713126) -PreviewerTest:testAccountsWithIntermediateOperationsReturningAccurateAmounts() (gas: 22751171) -PreviewerTest:testActualTimeBeforeStartDistributionRewards() (gas: 8693191) +PreviewerTest:testAccountsWithIntermediateOperationsReturningAccurateAmounts() (gas: 22748786) +PreviewerTest:testActualTimeBeforeStartDistributionRewards() (gas: 8693116) PreviewerTest:testEmptyExactly() (gas: 6258134) PreviewerTest:testExactlyReturningInterestRateModelData() (gas: 737924) -PreviewerTest:testFixedAvailableLiquidityProjectingNewFloatingDebt() (gas: 16818586) -PreviewerTest:testFixedPoolsA() (gas: 24434898) +PreviewerTest:testFixedAvailableLiquidityProjectingNewFloatingDebt() (gas: 16816276) +PreviewerTest:testFixedPoolsA() (gas: 24432513) PreviewerTest:testFixedPoolsChangingMaturityInTime() (gas: 2001786) -PreviewerTest:testFixedPoolsRatesAndUtilizations() (gas: 18753921) -PreviewerTest:testFixedPoolsWithFloatingAssetsAverage() (gas: 22413596) -PreviewerTest:testFlexibleAvailableLiquidity() (gas: 21941951) -PreviewerTest:testFlexibleBorrowSharesAndAssets() (gas: 5159249) -PreviewerTest:testFloatingAvailableLiquidityProjectingNewFloatingDebt() (gas: 15998480) -PreviewerTest:testFloatingRateAndUtilization() (gas: 1236195) -PreviewerTest:testJustUpdatedRewardRatesShouldStillReturnRate() (gas: 7784292) -PreviewerTest:testMaxBorrowAssetsCapacity() (gas: 2892924) -PreviewerTest:testMaxBorrowAssetsCapacityForAccountWithShortfall() (gas: 14264927) -PreviewerTest:testMaxBorrowAssetsCapacityPerMarket() (gas: 16618812) -PreviewerTest:testOraclePriceReturningAccurateValues() (gas: 13042361) -PreviewerTest:testPreviewBorrowAtAllMaturitiesReturningAccurateAmount() (gas: 4752354) -PreviewerTest:testPreviewBorrowAtMaturityReturningAccurateAmount() (gas: 705049) -PreviewerTest:testPreviewBorrowAtMaturityReturningAccurateAmountWithIntermediateOperations() (gas: 2250216) -PreviewerTest:testPreviewBorrowAtMaturityReturningAccurateUtilization() (gas: 717087) -PreviewerTest:testPreviewBorrowAtMaturityWithFiveUnits() (gas: 456782) -PreviewerTest:testPreviewBorrowAtMaturityWithInvalidMaturity() (gas: 262341) +PreviewerTest:testFixedPoolsRatesAndUtilizations() (gas: 18751611) +PreviewerTest:testFixedPoolsWithFloatingAssetsAverage() (gas: 22411286) +PreviewerTest:testFlexibleAvailableLiquidity() (gas: 21939566) +PreviewerTest:testFlexibleBorrowSharesAndAssets() (gas: 5159099) +PreviewerTest:testFloatingAvailableLiquidityProjectingNewFloatingDebt() (gas: 15996170) +PreviewerTest:testFloatingRateAndUtilization() (gas: 1236120) +PreviewerTest:testJustUpdatedRewardRatesShouldStillReturnRate() (gas: 7784217) +PreviewerTest:testMaxBorrowAssetsCapacity() (gas: 2892849) +PreviewerTest:testMaxBorrowAssetsCapacityForAccountWithShortfall() (gas: 14262617) +PreviewerTest:testMaxBorrowAssetsCapacityPerMarket() (gas: 16616352) +PreviewerTest:testOraclePriceReturningAccurateValues() (gas: 13040201) +PreviewerTest:testPreviewBorrowAtAllMaturitiesReturningAccurateAmount() (gas: 4752204) +PreviewerTest:testPreviewBorrowAtMaturityReturningAccurateAmount() (gas: 704974) +PreviewerTest:testPreviewBorrowAtMaturityReturningAccurateAmountWithIntermediateOperations() (gas: 2249991) +PreviewerTest:testPreviewBorrowAtMaturityReturningAccurateUtilization() (gas: 717012) +PreviewerTest:testPreviewBorrowAtMaturityWithFiveUnits() (gas: 456632) +PreviewerTest:testPreviewBorrowAtMaturityWithInvalidMaturity() (gas: 262266) PreviewerTest:testPreviewBorrowAtMaturityWithMaturedMaturity() (gas: 49802) -PreviewerTest:testPreviewBorrowAtMaturityWithOneUnit() (gas: 456804) +PreviewerTest:testPreviewBorrowAtMaturityWithOneUnit() (gas: 456654) PreviewerTest:testPreviewBorrowAtMaturityWithSameTimestamp() (gas: 49742) -PreviewerTest:testPreviewBorrowAtMaturityWithZeroAmount() (gas: 251595) -PreviewerTest:testPreviewDepositAtAllMaturitiesReturningAccurateAmounts() (gas: 2805679) -PreviewerTest:testPreviewDepositAtMaturityReturningAccurateAmount() (gas: 925086) -PreviewerTest:testPreviewDepositAtMaturityReturningAccurateAmountWithIntermediateOperations() (gas: 1745698) +PreviewerTest:testPreviewBorrowAtMaturityWithZeroAmount() (gas: 251520) +PreviewerTest:testPreviewDepositAtAllMaturitiesReturningAccurateAmounts() (gas: 2805604) +PreviewerTest:testPreviewDepositAtMaturityReturningAccurateAmount() (gas: 925011) +PreviewerTest:testPreviewDepositAtMaturityReturningAccurateAmountWithIntermediateOperations() (gas: 1745623) PreviewerTest:testPreviewDepositAtMaturityWithEmptyMaturity() (gas: 48556) PreviewerTest:testPreviewDepositAtMaturityWithEmptyMaturityAndZeroAmount() (gas: 48592) PreviewerTest:testPreviewDepositAtMaturityWithInvalidMaturity() (gas: 48570) PreviewerTest:testPreviewDepositAtMaturityWithMaturedMaturity() (gas: 12418) -PreviewerTest:testPreviewDepositAtMaturityWithOneUnit() (gas: 660704) +PreviewerTest:testPreviewDepositAtMaturityWithOneUnit() (gas: 660629) PreviewerTest:testPreviewDepositAtMaturityWithSameTimestamp() (gas: 51101) -PreviewerTest:testPreviewDepositAtMaturityWithZeroAmount() (gas: 660729) -PreviewerTest:testPreviewRepayAtMaturityLastAccrualIsMaturity() (gas: 1557059) -PreviewerTest:testPreviewRepayAtMaturityReturningAccurateAmount() (gas: 1379777) -PreviewerTest:testPreviewRepayAtMaturityReturningAccurateAmountWithIntermediateOperations() (gas: 1833170) +PreviewerTest:testPreviewDepositAtMaturityWithZeroAmount() (gas: 660654) +PreviewerTest:testPreviewRepayAtMaturityLastAccrualIsMaturity() (gas: 1556909) +PreviewerTest:testPreviewRepayAtMaturityReturningAccurateAmount() (gas: 1379627) +PreviewerTest:testPreviewRepayAtMaturityReturningAccurateAmountWithIntermediateOperations() (gas: 1833020) PreviewerTest:testPreviewRepayAtMaturityWithEmptyMaturity() (gas: 35162) PreviewerTest:testPreviewRepayAtMaturityWithEmptyMaturityAndZeroAmount() (gas: 35170) PreviewerTest:testPreviewRepayAtMaturityWithInvalidMaturity() (gas: 35215) -PreviewerTest:testPreviewRepayAtMaturityWithMaturedMaturity() (gas: 674465) -PreviewerTest:testPreviewRepayAtMaturityWithOneUnit() (gas: 667162) -PreviewerTest:testPreviewRepayAtMaturityWithSameTimestamp() (gas: 664285) -PreviewerTest:testPreviewRepayAtMaturityWithZeroAmount() (gas: 667165) -PreviewerTest:testPreviewValueInFixedOperations() (gas: 2882299) +PreviewerTest:testPreviewRepayAtMaturityWithMaturedMaturity() (gas: 674390) +PreviewerTest:testPreviewRepayAtMaturityWithOneUnit() (gas: 667087) +PreviewerTest:testPreviewRepayAtMaturityWithSameTimestamp() (gas: 664210) +PreviewerTest:testPreviewRepayAtMaturityWithZeroAmount() (gas: 667090) +PreviewerTest:testPreviewValueInFixedOperations() (gas: 2882224) PreviewerTest:testPreviewWithdrawAtMaturityReturningAccurateAmount() (gas: 457863) -PreviewerTest:testPreviewWithdrawAtMaturityReturningAccurateAmountWithIntermediateOperations() (gas: 1717710) +PreviewerTest:testPreviewWithdrawAtMaturityReturningAccurateAmountWithIntermediateOperations() (gas: 1717560) PreviewerTest:testPreviewWithdrawAtMaturityWithEmptyMaturity() (gas: 35184) PreviewerTest:testPreviewWithdrawAtMaturityWithEmptyMaturityAndZeroAmount() (gas: 35182) PreviewerTest:testPreviewWithdrawAtMaturityWithFiveUnits() (gas: 329675) @@ -430,11 +431,11 @@ PreviewerTest:testPreviewWithdrawAtMaturityWithZeroAmount() (gas: 329691) PreviewerTest:testReserveFactor() (gas: 716070) PreviewerTest:testReturnRewardAssetUsdPrice() (gas: 7458678) PreviewerTest:testRewardRatesMaturities() (gas: 7582626) -PreviewerTest:testRewardsRateAfterDistributionEnd() (gas: 8075397) -PreviewerTest:testRewardsRateOnlyWithFixedBorrows() (gas: 7513938) -PreviewerTest:testRewardsRateWithDifferentRewardLengths() (gas: 22765561) -PreviewerTest:testRewardsRateWithMarketWithDifferentDecimals() (gas: 22477840) -PreviewerTest:testRewardsRateX() (gas: 9180234) +PreviewerTest:testRewardsRateAfterDistributionEnd() (gas: 8075247) +PreviewerTest:testRewardsRateOnlyWithFixedBorrows() (gas: 7513863) +PreviewerTest:testRewardsRateWithDifferentRewardLengths() (gas: 22763251) +PreviewerTest:testRewardsRateWithMarketWithDifferentDecimals() (gas: 22475605) +PreviewerTest:testRewardsRateX() (gas: 9180159) PriceFeedDoubleTest:testPriceFeedDoubleReturningAccurateDecimals() (gas: 617669) PriceFeedDoubleTest:testPriceFeedDoubleReturningPrice() (gas: 76193) PriceFeedDoubleTest:testPriceFeedDoubleWithActualOnChainValues() (gas: 85326) @@ -455,81 +456,81 @@ RatePreviewerTest:testPreviewRate() (gas: 1215583) RatePreviewerTest:testPreviewRateAfterFloatingDepositAndBorrow() (gas: 1411833) RatePreviewerTest:testSnapshot() (gas: 1654022) RatePreviewerTest:testSnapshotWithSignificantElapsedTime() (gas: 1724086) -RewardsControllerTest:testAccountKeeperClaimOnBehalfOf() (gas: 1443201) -RewardsControllerTest:testAccrueRewardsForWholeDistributionPeriod() (gas: 1150962) -RewardsControllerTest:testAccrueRewardsWithBadDebtClearingOfFixedBorrow() (gas: 3594688) -RewardsControllerTest:testAccrueRewardsWithFixedWithdraw() (gas: 1368445) -RewardsControllerTest:testAccrueRewardsWithRepayOfBorrowBalance() (gas: 1608611) -RewardsControllerTest:testAccrueRewardsWithRepayOfFixedBorrowBalance() (gas: 1877865) -RewardsControllerTest:testAccrueRewardsWithSeizeOfAllDepositShares() (gas: 2045516) -RewardsControllerTest:testAfterDistributionPeriodEnd() (gas: 1574487) -RewardsControllerTest:testAllClaimableOnlyWithUSDCOps() (gas: 1019309) -RewardsControllerTest:testAllClaimableUSDCWithAnotherAccountInPool() (gas: 4805231) -RewardsControllerTest:testAllClaimableUSDCWithDeposit() (gas: 4352581) -RewardsControllerTest:testAllClaimableUSDCWithFixedDeposit() (gas: 3333131) -RewardsControllerTest:testAllClaimableUSDCWithFloatingBorrow() (gas: 3338235) -RewardsControllerTest:testAllClaimableUSDCWithFloatingRefund() (gas: 2708262) -RewardsControllerTest:testAllClaimableUSDCWithFloatingRepay() (gas: 2740901) -RewardsControllerTest:testAllClaimableUSDCWithMint() (gas: 3066802) -RewardsControllerTest:testAllClaimableUSDCWithRedeem() (gas: 2709969) -RewardsControllerTest:testAllClaimableUSDCWithTransfer() (gas: 4697759) -RewardsControllerTest:testAllClaimableUSDCWithTransferFrom() (gas: 4348044) -RewardsControllerTest:testAllClaimableUSDCWithWithdraw() (gas: 2754536) -RewardsControllerTest:testAllClaimableWETH() (gas: 2937688) -RewardsControllerTest:testAllClaimableWithMaturedFixedPool() (gas: 1726347) -RewardsControllerTest:testAllClaimableWithMultipleMarketOps() (gas: 2660090) -RewardsControllerTest:testAllClaimableWithTimeElapsedZero() (gas: 1878247) -RewardsControllerTest:testAllRewards() (gas: 229783) -RewardsControllerTest:testClaim() (gas: 1365612) -RewardsControllerTest:testClaimAll() (gas: 2839389) -RewardsControllerTest:testClaimFixedDepositRewards() (gas: 1502041) -RewardsControllerTest:testClaimMarketWithoutRewards() (gas: 1386822) -RewardsControllerTest:testClaimWithAllClaimableArgs() (gas: 3086038) -RewardsControllerTest:testClaimWithNotEnabledRewardAsset() (gas: 1521076) -RewardsControllerTest:testConfigSettingNewStartWithOnGoingDistributionShouldNotUpdate() (gas: 450946) -RewardsControllerTest:testConfigWithDistributionNotYetStartedShouldNotFail() (gas: 599108) +RewardsControllerTest:testAccountKeeperClaimOnBehalfOf() (gas: 1443126) +RewardsControllerTest:testAccrueRewardsForWholeDistributionPeriod() (gas: 1150887) +RewardsControllerTest:testAccrueRewardsWithBadDebtClearingOfFixedBorrow() (gas: 3594463) +RewardsControllerTest:testAccrueRewardsWithFixedWithdraw() (gas: 1368370) +RewardsControllerTest:testAccrueRewardsWithRepayOfBorrowBalance() (gas: 1608461) +RewardsControllerTest:testAccrueRewardsWithRepayOfFixedBorrowBalance() (gas: 1877715) +RewardsControllerTest:testAccrueRewardsWithSeizeOfAllDepositShares() (gas: 2045291) +RewardsControllerTest:testAfterDistributionPeriodEnd() (gas: 1574412) +RewardsControllerTest:testAllClaimableOnlyWithUSDCOps() (gas: 1019234) +RewardsControllerTest:testAllClaimableUSDCWithAnotherAccountInPool() (gas: 4805081) +RewardsControllerTest:testAllClaimableUSDCWithDeposit() (gas: 4352506) +RewardsControllerTest:testAllClaimableUSDCWithFixedDeposit() (gas: 3333056) +RewardsControllerTest:testAllClaimableUSDCWithFloatingBorrow() (gas: 3338085) +RewardsControllerTest:testAllClaimableUSDCWithFloatingRefund() (gas: 2708112) +RewardsControllerTest:testAllClaimableUSDCWithFloatingRepay() (gas: 2740751) +RewardsControllerTest:testAllClaimableUSDCWithMint() (gas: 3066727) +RewardsControllerTest:testAllClaimableUSDCWithRedeem() (gas: 2709819) +RewardsControllerTest:testAllClaimableUSDCWithTransfer() (gas: 4697609) +RewardsControllerTest:testAllClaimableUSDCWithTransferFrom() (gas: 4347894) +RewardsControllerTest:testAllClaimableUSDCWithWithdraw() (gas: 2754386) +RewardsControllerTest:testAllClaimableWETH() (gas: 2937613) +RewardsControllerTest:testAllClaimableWithMaturedFixedPool() (gas: 1726272) +RewardsControllerTest:testAllClaimableWithMultipleMarketOps() (gas: 2659940) +RewardsControllerTest:testAllClaimableWithTimeElapsedZero() (gas: 1878097) +RewardsControllerTest:testAllRewards() (gas: 229708) +RewardsControllerTest:testClaim() (gas: 1365537) +RewardsControllerTest:testClaimAll() (gas: 2839239) +RewardsControllerTest:testClaimFixedDepositRewards() (gas: 1501966) +RewardsControllerTest:testClaimMarketWithoutRewards() (gas: 1386672) +RewardsControllerTest:testClaimWithAllClaimableArgs() (gas: 3085888) +RewardsControllerTest:testClaimWithNotEnabledRewardAsset() (gas: 1521001) +RewardsControllerTest:testConfigSettingNewStartWithOnGoingDistributionShouldNotUpdate() (gas: 450871) +RewardsControllerTest:testConfigWithDistributionNotYetStartedShouldNotFail() (gas: 599033) RewardsControllerTest:testConfigWithTransitionFactorHigherOrEqThanCap() (gas: 111158) RewardsControllerTest:testConfigWithZeroDepositAllocationWeightFactorShouldRevert() (gas: 75666) -RewardsControllerTest:testDifferentDistributionTimeForDifferentRewards() (gas: 2404258) -RewardsControllerTest:testEmitAccrue() (gas: 1428378) -RewardsControllerTest:testEmitClaimRewards() (gas: 1134235) +RewardsControllerTest:testDifferentDistributionTimeForDifferentRewards() (gas: 2404108) +RewardsControllerTest:testEmitAccrue() (gas: 1428228) +RewardsControllerTest:testEmitClaimRewards() (gas: 1134160) RewardsControllerTest:testEmitConfigUpdate() (gas: 439022) -RewardsControllerTest:testEmitIndexUpdate() (gas: 1513001) -RewardsControllerTest:testLastUndistributed() (gas: 2017824) -RewardsControllerTest:testLastUpdateAfterDistributionPeriodEnd() (gas: 1608651) +RewardsControllerTest:testEmitIndexUpdate() (gas: 1512926) +RewardsControllerTest:testLastUndistributed() (gas: 2017749) +RewardsControllerTest:testLastUpdateAfterDistributionPeriodEnd() (gas: 1608576) RewardsControllerTest:testNotKeeperClaimOnBehalfOf() (gas: 184609) -RewardsControllerTest:testOperationAfterDistributionEnded() (gas: 722627) -RewardsControllerTest:testOperationsBeforeDistributionStart() (gas: 1696557) -RewardsControllerTest:testPermitClaim() (gas: 1403220) -RewardsControllerTest:testSetDistributionConfigWithDifferentDecimals() (gas: 14898698) +RewardsControllerTest:testOperationAfterDistributionEnded() (gas: 722552) +RewardsControllerTest:testOperationsBeforeDistributionStart() (gas: 1696407) +RewardsControllerTest:testPermitClaim() (gas: 1403145) +RewardsControllerTest:testSetDistributionConfigWithDifferentDecimals() (gas: 14896313) RewardsControllerTest:testSetDistributionOperationShouldUpdateIndex() (gas: 144923) -RewardsControllerTest:testSetDistributionWithOnGoingMarketOperations() (gas: 1377950) -RewardsControllerTest:testSetHigherTotalDistribution() (gas: 1637459) +RewardsControllerTest:testSetDistributionWithOnGoingMarketOperations() (gas: 1377875) +RewardsControllerTest:testSetHigherTotalDistribution() (gas: 1637384) RewardsControllerTest:testSetKeeperOnlyAdminRole() (gas: 117586) -RewardsControllerTest:testSetLowerAndEqualDistributionPeriodThanCurrentTimestampShouldRevert() (gas: 1240503) -RewardsControllerTest:testSetLowerAndEqualTotalDistributionThanReleasedShouldRevert() (gas: 1233571) -RewardsControllerTest:testSetLowerDistributionPeriod() (gas: 1990770) -RewardsControllerTest:testSetLowerDistributionPeriodAndLowerTotalDistribution() (gas: 1993583) -RewardsControllerTest:testSetLowerTotalDistribution() (gas: 1637482) -RewardsControllerTest:testSetNewDistributionPeriod() (gas: 2343182) -RewardsControllerTest:testSetNewDistributionPeriodAfterDistributionEnds() (gas: 1327186) -RewardsControllerTest:testSetNewTargetDebt() (gas: 1507548) -RewardsControllerTest:testSetNewTargetDebtAfterDistributionEnds() (gas: 1546019) -RewardsControllerTest:testSetNewTargetDebtWithClaimOnlyAtEnd() (gas: 1290576) -RewardsControllerTest:testSetNewTreasuryFeeShouldImpactAllocation() (gas: 776099) -RewardsControllerTest:testSetTargetDebtMultipleTimes() (gas: 2290955) -RewardsControllerTest:testSetTargetDebtMultipleTimesAfterEnd() (gas: 2249709) -RewardsControllerTest:testSetTotalDistributionMultipleTimes() (gas: 1756965) -RewardsControllerTest:testTriggerHandleBorrowHookBeforeUpdatingFloatingDebt() (gas: 2170459) -RewardsControllerTest:testUpdateConfig() (gas: 1449877) -RewardsControllerTest:testUpdateIndexesWithUtilizationEqualToOne() (gas: 1206579) -RewardsControllerTest:testUpdateIndexesWithUtilizationHigherThanOne() (gas: 1301162) -RewardsControllerTest:testUpdateWithTotalDebtZeroShouldUpdateLastUndistributed() (gas: 753138) -RewardsControllerTest:testUtilizationEqualZero() (gas: 923092) -RewardsControllerTest:testWithTwelveFixedPools() (gas: 6259440) +RewardsControllerTest:testSetLowerAndEqualDistributionPeriodThanCurrentTimestampShouldRevert() (gas: 1240428) +RewardsControllerTest:testSetLowerAndEqualTotalDistributionThanReleasedShouldRevert() (gas: 1233496) +RewardsControllerTest:testSetLowerDistributionPeriod() (gas: 1990695) +RewardsControllerTest:testSetLowerDistributionPeriodAndLowerTotalDistribution() (gas: 1993508) +RewardsControllerTest:testSetLowerTotalDistribution() (gas: 1637407) +RewardsControllerTest:testSetNewDistributionPeriod() (gas: 2343107) +RewardsControllerTest:testSetNewDistributionPeriodAfterDistributionEnds() (gas: 1327111) +RewardsControllerTest:testSetNewTargetDebt() (gas: 1507473) +RewardsControllerTest:testSetNewTargetDebtAfterDistributionEnds() (gas: 1545944) +RewardsControllerTest:testSetNewTargetDebtWithClaimOnlyAtEnd() (gas: 1290501) +RewardsControllerTest:testSetNewTreasuryFeeShouldImpactAllocation() (gas: 776024) +RewardsControllerTest:testSetTargetDebtMultipleTimes() (gas: 2290880) +RewardsControllerTest:testSetTargetDebtMultipleTimesAfterEnd() (gas: 2249634) +RewardsControllerTest:testSetTotalDistributionMultipleTimes() (gas: 1756890) +RewardsControllerTest:testTriggerHandleBorrowHookBeforeUpdatingFloatingDebt() (gas: 2170234) +RewardsControllerTest:testUpdateConfig() (gas: 1449802) +RewardsControllerTest:testUpdateIndexesWithUtilizationEqualToOne() (gas: 1206429) +RewardsControllerTest:testUpdateIndexesWithUtilizationHigherThanOne() (gas: 1301012) +RewardsControllerTest:testUpdateWithTotalDebtZeroShouldUpdateLastUndistributed() (gas: 752988) +RewardsControllerTest:testUtilizationEqualZero() (gas: 922942) +RewardsControllerTest:testWithTwelveFixedPools() (gas: 6259365) RewardsControllerTest:testWithdrawAllRewardBalance() (gas: 91314) RewardsControllerTest:testWithdrawOnlyAdminRole() (gas: 121375) -RewardsControllerTest:testWithdrawUndistributed() (gas: 1704200) +RewardsControllerTest:testWithdrawUndistributed() (gas: 1704125) RewardsControllerTest:testWithdrawUndistributedOnlyAdminRole() (gas: 180933) RewardsControllerTest:testWithdrawUndistributedOnlyEndedDistribution() (gas: 155130) StakedEXATest:invariantAvgIndexUpOnly() (runs: 10, calls: 5000, reverts: 0) @@ -647,201 +648,202 @@ VerifiedAuditorTest:test_setFirewall_reverts_whenNotAdmin() (gas: 771425) VerifiedAuditorTest:test_setFirewall_sets_whenAdmin() (gas: 50939) VerifiedAuditorTest:test_unlock_reverts_withInvalidOperation_whenAccountIsNotAllowed() (gas: 100837) VerifiedAuditorTest:test_unlock_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 181052) -VerifiedMarketTest:testAccountLiquidityAdjustedDebt() (gas: 689822) -VerifiedMarketTest:testAccountsFixedConsolidated() (gas: 2283515) -VerifiedMarketTest:testAccountsFixedConsolidatedWhenClearBadDebt() (gas: 2116865) -VerifiedMarketTest:testAccountsFixedConsolidatedWhenSenderNotOwner() (gas: 1059236) -VerifiedMarketTest:testAccountsFixedConsolidatedWithPartialRepayAndWithdraw() (gas: 1616682) -VerifiedMarketTest:testAccrueEarningsBeforeLiquidation() (gas: 1647757) -VerifiedMarketTest:testAnotherUserRedeemWhenOwnerHasShortfall() (gas: 980206) -VerifiedMarketTest:testAnotherUserWithdrawWhenOwnerHasShortfall() (gas: 926360) -VerifiedMarketTest:testBorrowAfterFreezing() (gas: 528908) -VerifiedMarketTest:testBorrowAtMaturity() (gas: 581405) -VerifiedMarketTest:testBorrowAtMaturityAfterFreezing() (gas: 654928) -VerifiedMarketTest:testBorrowAtMaturityUpdatesFloatingDebtAndFloatingAssets() (gas: 908611) +VerifiedMarketTest:testAccountLiquidityAdjustedDebt() (gas: 689747) +VerifiedMarketTest:testAccountsFixedConsolidated() (gas: 2283365) +VerifiedMarketTest:testAccountsFixedConsolidatedWhenClearBadDebt() (gas: 2116715) +VerifiedMarketTest:testAccountsFixedConsolidatedWhenSenderNotOwner() (gas: 1059108) +VerifiedMarketTest:testAccountsFixedConsolidatedWithPartialRepayAndWithdraw() (gas: 1616607) +VerifiedMarketTest:testAccrueEarningsBeforeLiquidation() (gas: 1647563) +VerifiedMarketTest:testAnotherUserRedeemWhenOwnerHasShortfall() (gas: 980056) +VerifiedMarketTest:testAnotherUserWithdrawWhenOwnerHasShortfall() (gas: 926232) +VerifiedMarketTest:testBorrowAfterFreezing() (gas: 528855) +VerifiedMarketTest:testBorrowAtMaturity() (gas: 581264) +VerifiedMarketTest:testBorrowAtMaturityAfterFreezing() (gas: 654853) +VerifiedMarketTest:testBorrowAtMaturityUpdatesFloatingDebtAndFloatingAssets() (gas: 908483) VerifiedMarketTest:testBorrowAtMaturityWhenFrozen() (gas: 93517) VerifiedMarketTest:testBorrowAtMaturityWithZeroAssets() (gas: 40291) -VerifiedMarketTest:testBorrowDisagreement() (gas: 320426) -VerifiedMarketTest:testBorrowFromFreeLunchShouldNotRevertWithFloatingFullUtilization() (gas: 1406895) -VerifiedMarketTest:testBorrowWhenFrozen() (gas: 93021) -VerifiedMarketTest:testBorrowWithZeroAssets() (gas: 39763) -VerifiedMarketTest:testCappedLiquidation() (gas: 1348356) -VerifiedMarketTest:testChargeTreasuryToEarlyWithdraws() (gas: 1567894) -VerifiedMarketTest:testChargeTreasuryToFixedBorrows() (gas: 1899244) -VerifiedMarketTest:testClearBadDebtAvoidingFixedBorrowsIfAccumulatorLower() (gas: 2397952) -VerifiedMarketTest:testClearBadDebtBeforeMaturity() (gas: 2490804) +VerifiedMarketTest:testBorrowDisagreement() (gas: 320351) +VerifiedMarketTest:testBorrowFromFreeLunchShouldNotRevertWithFloatingFullUtilization() (gas: 1406767) +VerifiedMarketTest:testBorrowWhenFrozen() (gas: 93043) +VerifiedMarketTest:testBorrowWithZeroAssets() (gas: 39700) +VerifiedMarketTest:testCappedLiquidation() (gas: 1348206) +VerifiedMarketTest:testChargeTreasuryToEarlyWithdraws() (gas: 1567819) +VerifiedMarketTest:testChargeTreasuryToFixedBorrows() (gas: 1899094) +VerifiedMarketTest:testClearBadDebtAvoidingFixedBorrowsIfAccumulatorLower() (gas: 2397802) +VerifiedMarketTest:testClearBadDebtBeforeMaturity() (gas: 2490534) VerifiedMarketTest:testClearBadDebtCalledByAccount() (gas: 34934) -VerifiedMarketTest:testClearBadDebtEmptiesUnassignedEarnings() (gas: 2729549) -VerifiedMarketTest:testClearBadDebtExactlyRepaysFixedBorrowWithAccumulatorAmount() (gas: 2188286) -VerifiedMarketTest:testClearBadDebtPartiallyRepaysEachFixedBorrow() (gas: 2119835) -VerifiedMarketTest:testClearBadDebtPartiallyRepaysFloatingDebt() (gas: 2464588) -VerifiedMarketTest:testClearBadDebtShouldAccrueAccumulatedEarningsBeforeSpreadingLosses() (gas: 2449761) -VerifiedMarketTest:testClearBadDebtWithEmptyAccumulatorShouldNotRevert() (gas: 1115148) -VerifiedMarketTest:testClearMaturity() (gas: 1968921) -VerifiedMarketTest:testCollectTreasuryFreeLunchToEarlyWithdraws() (gas: 2234798) -VerifiedMarketTest:testCollectTreasuryFreeLunchToEarlyWithdrawsWithZeroFees() (gas: 714837) -VerifiedMarketTest:testCollectTreasuryFreeLunchToFixedBorrows() (gas: 2216517) -VerifiedMarketTest:testCollectTreasuryFreeLunchToFixedBorrowsWithZeroFees() (gas: 922954) -VerifiedMarketTest:testCrossMaturityLiquidation() (gas: 2800041) -VerifiedMarketTest:testDepositAfterFreezing() (gas: 281253) -VerifiedMarketTest:testDepositAtMaturity() (gas: 261116) -VerifiedMarketTest:testDepositAtMaturityAfterFreezing() (gas: 335013) -VerifiedMarketTest:testDepositAtMaturityWhenFrozen() (gas: 116189) +VerifiedMarketTest:testClearBadDebtEmptiesUnassignedEarnings() (gas: 2729324) +VerifiedMarketTest:testClearBadDebtExactlyRepaysFixedBorrowWithAccumulatorAmount() (gas: 2188136) +VerifiedMarketTest:testClearBadDebtPartiallyRepaysEachFixedBorrow() (gas: 2119707) +VerifiedMarketTest:testClearBadDebtPartiallyRepaysFloatingDebt() (gas: 2464438) +VerifiedMarketTest:testClearBadDebtShouldAccrueAccumulatedEarningsBeforeSpreadingLosses() (gas: 2449611) +VerifiedMarketTest:testClearBadDebtWithEmptyAccumulatorShouldNotRevert() (gas: 1114998) +VerifiedMarketTest:testClearMaturity() (gas: 1968868) +VerifiedMarketTest:testCollectTreasuryFreeLunchToEarlyWithdraws() (gas: 2234745) +VerifiedMarketTest:testCollectTreasuryFreeLunchToEarlyWithdrawsWithZeroFees() (gas: 714784) +VerifiedMarketTest:testCollectTreasuryFreeLunchToFixedBorrows() (gas: 2216397) +VerifiedMarketTest:testCollectTreasuryFreeLunchToFixedBorrowsWithZeroFees() (gas: 922901) +VerifiedMarketTest:testCrossMaturityLiquidation() (gas: 2799891) +VerifiedMarketTest:testDepositAfterFreezing() (gas: 281178) +VerifiedMarketTest:testDepositAtMaturity() (gas: 261138) +VerifiedMarketTest:testDepositAtMaturityAfterFreezing() (gas: 335035) +VerifiedMarketTest:testDepositAtMaturityWhenFrozen() (gas: 116211) VerifiedMarketTest:testDepositAtMaturityWithZeroAssets() (gas: 63077) VerifiedMarketTest:testDepositDisagreement() (gas: 97017) -VerifiedMarketTest:testDepositShouldUpdateFlexibleBorrowVariables() (gas: 881233) -VerifiedMarketTest:testDepositToSmartPool() (gas: 207037) +VerifiedMarketTest:testDepositShouldUpdateFlexibleBorrowVariables() (gas: 880943) +VerifiedMarketTest:testDepositToSmartPool() (gas: 206984) VerifiedMarketTest:testDepositWhenFrozen() (gas: 199362) -VerifiedMarketTest:testDistributeMultipleAccumulatedEarnings() (gas: 1859951) -VerifiedMarketTest:testDistributionOfLossesShouldReduceFromFloatingBackupBorrowedAccordingly() (gas: 6782542) -VerifiedMarketTest:testEarlyRepayLiquidationUnassignedEarnings() (gas: 2710956) -VerifiedMarketTest:testEarlyRepaymentWithExcessiveAmountOfFees() (gas: 3559727) -VerifiedMarketTest:testEarlyWithdrawFromFreeLunchShouldNotRevertWithFloatingFullUtilization() (gas: 1153986) +VerifiedMarketTest:testDistributeMultipleAccumulatedEarnings() (gas: 1859748) +VerifiedMarketTest:testDistributionOfLossesShouldReduceFromFloatingBackupBorrowedAccordingly() (gas: 6782317) +VerifiedMarketTest:testEarlyRepayLiquidationUnassignedEarnings() (gas: 2710828) +VerifiedMarketTest:testEarlyRepaymentWithExcessiveAmountOfFees() (gas: 3559577) +VerifiedMarketTest:testEarlyWithdrawFromFreeLunchShouldNotRevertWithFloatingFullUtilization() (gas: 1153836) VerifiedMarketTest:testEmergencyAdminRole() (gas: 373392) -VerifiedMarketTest:testEmitFrozen() (gas: 90717) -VerifiedMarketTest:testFixedBorrowFailingWhenFlexibleBorrowAccruesDebt() (gas: 1717825) -VerifiedMarketTest:testFixedBorrowRateToMaturity() (gas: 641973) -VerifiedMarketTest:testFixedOperationsUpdateFloatingDebt() (gas: 1088776) -VerifiedMarketTest:testFlexibleBorrow() (gas: 496515) -VerifiedMarketTest:testFlexibleBorrowAccountingDebt() (gas: 832836) -VerifiedMarketTest:testFlexibleBorrowChargingDebtToTreasury() (gas: 895675) -VerifiedMarketTest:testFlexibleBorrowExceedingReserve() (gas: 926020) -VerifiedMarketTest:testFlexibleBorrowExceedingReserveIncludingFixedBorrow() (gas: 1335668) -VerifiedMarketTest:testFlexibleBorrowExceedingReserveWithNewDebt() (gas: 1004280) -VerifiedMarketTest:testFlexibleBorrowFromAnotherUserSubtractsAllowance() (gas: 515757) -VerifiedMarketTest:testFlexibleBorrowFromAnotherUserWithAllowance() (gas: 496334) -VerifiedMarketTest:testFlexibleBorrowFromAnotherUserWithoutAllowance() (gas: 277656) -VerifiedMarketTest:testFrontRunSmartPoolEarningsDistributionWithBigPenaltyRepayment() (gas: 1805643) -VerifiedMarketTest:testFullPause() (gas: 6350249) +VerifiedMarketTest:testEmitFrozen() (gas: 90739) +VerifiedMarketTest:testFixedBorrowFailingWhenFlexibleBorrowAccruesDebt() (gas: 1717675) +VerifiedMarketTest:testFixedBorrowRateToMaturity() (gas: 641898) +VerifiedMarketTest:testFixedOperationsUpdateFloatingDebt() (gas: 1088701) +VerifiedMarketTest:testFlexibleBorrow() (gas: 496462) +VerifiedMarketTest:testFlexibleBorrowAccountingDebt() (gas: 832761) +VerifiedMarketTest:testFlexibleBorrowChargingDebtToTreasury() (gas: 895622) +VerifiedMarketTest:testFlexibleBorrowExceedingReserve() (gas: 925870) +VerifiedMarketTest:testFlexibleBorrowExceedingReserveIncludingFixedBorrow() (gas: 1335518) +VerifiedMarketTest:testFlexibleBorrowExceedingReserveWithNewDebt() (gas: 1004130) +VerifiedMarketTest:testFlexibleBorrowFromAnotherUserSubtractsAllowance() (gas: 515682) +VerifiedMarketTest:testFlexibleBorrowFromAnotherUserWithAllowance() (gas: 496259) +VerifiedMarketTest:testFlexibleBorrowFromAnotherUserWithoutAllowance() (gas: 277581) +VerifiedMarketTest:testFrontRunSmartPoolEarningsDistributionWithBigPenaltyRepayment() (gas: 1805440) +VerifiedMarketTest:testFullPause() (gas: 6350099) VerifiedMarketTest:testInitiallyUnfrozen() (gas: 15542) -VerifiedMarketTest:testInsufficientProtocolLiquidity() (gas: 1935372) -VerifiedMarketTest:testLiquidateAndChargeIncentiveForLenders() (gas: 2476482) -VerifiedMarketTest:testLiquidateAndDistributeLosses() (gas: 3459038) -VerifiedMarketTest:testLiquidateAndSeizeExactAmountWithDustAsCollateral() (gas: 2946877) -VerifiedMarketTest:testLiquidateAndSeizeFromEmptyCollateral() (gas: 1097626) -VerifiedMarketTest:testLiquidateAndSubtractLossesFromAccumulator() (gas: 4230950) -VerifiedMarketTest:testLiquidateFlexibleAndFixedBorrowPositionsInSingleCall() (gas: 2663336) -VerifiedMarketTest:testLiquidateFlexibleBorrow() (gas: 2690912) -VerifiedMarketTest:testLiquidateFlexibleBorrowChargeLendersAssetsToLiquidator() (gas: 1190799) -VerifiedMarketTest:testLiquidateFlexibleBorrowConsideringDebtOverTime() (gas: 1266647) -VerifiedMarketTest:testLiquidateLeavingDustAsCollateral() (gas: 3787372) -VerifiedMarketTest:testLiquidateTransferRepayAssetsBeforeSeize() (gas: 1274336) -VerifiedMarketTest:testLiquidateUpdateFloatingDebt() (gas: 1922869) -VerifiedMarketTest:testLiquidateWhenFrozen() (gas: 1223623) -VerifiedMarketTest:testLiquidateWithTwoUnitsAsMaxAssets() (gas: 1739367) -VerifiedMarketTest:testLiquidateWithZeroAsMaxAssets() (gas: 1097599) -VerifiedMarketTest:testLiquidationClearingDebtOfAllAccountMarkets() (gas: 3349718) -VerifiedMarketTest:testLiquidationResultingInZeroCollateralAndZeroDebt() (gas: 2215969) -VerifiedMarketTest:testMaturityInsufficientProtocolLiquidity() (gas: 1656401) -VerifiedMarketTest:testMultipleBorrowsForMultipleAssets() (gas: 2495120536) -VerifiedMarketTest:testMultipleDepositsToSmartPool() (gas: 1092608) -VerifiedMarketTest:testMultipleFixedBorrowsRepays() (gas: 1584334) -VerifiedMarketTest:testMultipleLiquidationSameUser() (gas: 3456681) -VerifiedMarketTest:testNotEnteredMarketShouldNotBeSeized() (gas: 11344963) -VerifiedMarketTest:testOnlyAdminCanFreezeUnfreeze() (gas: 228419) -VerifiedMarketTest:testOperationsShouldUpdateFloatingAssetsAverage() (gas: 1792979) -VerifiedMarketTest:testOperationsWithBtcWbtcRate() (gas: 11100428) -VerifiedMarketTest:testOperationsWithStEthAsset() (gas: 10989745) -VerifiedMarketTest:testPausable() (gas: 183149) +VerifiedMarketTest:testInsufficientProtocolLiquidity() (gas: 1935169) +VerifiedMarketTest:testLiquidateAndChargeIncentiveForLenders() (gas: 2476332) +VerifiedMarketTest:testLiquidateAndDistributeLosses() (gas: 3458888) +VerifiedMarketTest:testLiquidateAndSeizeExactAmountWithDustAsCollateral() (gas: 2946749) +VerifiedMarketTest:testLiquidateAndSeizeFromEmptyCollateral() (gas: 1097476) +VerifiedMarketTest:testLiquidateAndSubtractLossesFromAccumulator() (gas: 4230800) +VerifiedMarketTest:testLiquidateFlexibleAndFixedBorrowPositionsInSingleCall() (gas: 2663141) +VerifiedMarketTest:testLiquidateFlexibleBorrow() (gas: 2690784) +VerifiedMarketTest:testLiquidateFlexibleBorrowChargeLendersAssetsToLiquidator() (gas: 1190671) +VerifiedMarketTest:testLiquidateFlexibleBorrowConsideringDebtOverTime() (gas: 1266497) +VerifiedMarketTest:testLiquidateLeavingDustAsCollateral() (gas: 3787244) +VerifiedMarketTest:testLiquidateTransferRepayAssetsBeforeSeize() (gas: 1274261) +VerifiedMarketTest:testLiquidateUpdateFloatingDebt() (gas: 1922719) +VerifiedMarketTest:testLiquidateWhenFrozen() (gas: 1223473) +VerifiedMarketTest:testLiquidateWithTwoUnitsAsMaxAssets() (gas: 1739239) +VerifiedMarketTest:testLiquidateWithZeroAsMaxAssets() (gas: 1097449) +VerifiedMarketTest:testLiquidationClearingDebtOfAllAccountMarkets() (gas: 3349493) +VerifiedMarketTest:testLiquidationResultingInZeroCollateralAndZeroDebt() (gas: 2215841) +VerifiedMarketTest:testMaturityInsufficientProtocolLiquidity() (gas: 1656273) +VerifiedMarketTest:testMultipleBorrowsForMultipleAssets() (gas: 2495111543) +VerifiedMarketTest:testMultipleDepositsToSmartPool() (gas: 1092039) +VerifiedMarketTest:testMultipleFixedBorrowsRepays() (gas: 1584214) +VerifiedMarketTest:testMultipleLiquidationSameUser() (gas: 3456531) +VerifiedMarketTest:testNotEnteredMarketShouldNotBeSeized() (gas: 11342600) +VerifiedMarketTest:testOnlyAdminCanFreezeUnfreeze() (gas: 228441) +VerifiedMarketTest:testOperationsShouldUpdateFloatingAssetsAverage() (gas: 1792829) +VerifiedMarketTest:testOperationsWithBtcWbtcRate() (gas: 11098193) +VerifiedMarketTest:testOperationsWithStEthAsset() (gas: 10987532) +VerifiedMarketTest:testPausable() (gas: 183171) VerifiedMarketTest:testPauserRole() (gas: 88366) -VerifiedMarketTest:testPreviewOperationsWithSmartPoolCorrectlyAccountingEarnings() (gas: 2447451) -VerifiedMarketTest:testRepayAtMaturity() (gas: 687286) -VerifiedMarketTest:testRepayDisagreement() (gas: 697050) -VerifiedMarketTest:testRepayFlexibleBorrow() (gas: 1389695) -VerifiedMarketTest:testRepayWhenFrozen() (gas: 594004) -VerifiedMarketTest:testRoundingDownAssetsToValidateShortfallWhenTransferring() (gas: 9612071) -VerifiedMarketTest:testRoundingDownAssetsToValidateShortfallWhenTransferringFrom() (gas: 9667549) -VerifiedMarketTest:testRoundingDownAssetsWhenTransferingFromAnAccountWithoutShortfall() (gas: 1196603) -VerifiedMarketTest:testRoundingDownAssetsWhenTransferingWithAnAccountWithoutShortfall() (gas: 1138609) -VerifiedMarketTest:testRoundingUpAllowanceWhenBorrowingAtMaturity() (gas: 949799) -VerifiedMarketTest:testRoundingUpAllowanceWhenWithdrawingAtMaturity() (gas: 962216) -VerifiedMarketTest:testSetDampSpeedFactorShouldUpdateFloatingAssetsAverage() (gas: 457143) -VerifiedMarketTest:testSetEarningsAccumulatorSmoothFactorShouldDistributeEarnings() (gas: 964294) -VerifiedMarketTest:testSetInterestRateModelShouldUpdateFloatingDebt() (gas: 2889164) -VerifiedMarketTest:testSetInterestRateModelWithAddressZeroShouldNotUpdateFloatingDebt() (gas: 2678041) -VerifiedMarketTest:testShareValueNotDecreasingAfterDeposit() (gas: 855470) -VerifiedMarketTest:testShareValueNotDecreasingWhenMintingToTreasury() (gas: 893989) -VerifiedMarketTest:testSingleFloatingBorrow() (gas: 455037) -VerifiedMarketTest:testSingleFloatingRepay() (gas: 543324) -VerifiedMarketTest:testSmartPoolEarningsDistribution() (gas: 1316984) -VerifiedMarketTest:testSmartPoolSharesDoNotAccountUnassignedEarningsFromMoreThanOneIntervalPastMaturities() (gas: 716012) -VerifiedMarketTest:testSumDebtPlusEffectsShouldntRoundUpWhenWithdrawing() (gas: 1169424) -VerifiedMarketTest:testTotalAssetsProjectingBackupEarningsCorrectly() (gas: 629722) -VerifiedMarketTest:testTotalAssetsProjectingFloatingDebtCorrectly() (gas: 902744) -VerifiedMarketTest:testUpdateAccumulatedEarningsFactorToZero() (gas: 1917698) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenDepositingAndBorrowingContinuously() (gas: 468177) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenDepositingRightBeforeBorrow() (gas: 799958) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenDepositingRightBeforeEarlyWithdraw() (gas: 783157) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenDepositingSomeSecondsBeforeBorrow() (gas: 1130404) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingRightBeforeBorrow() (gas: 803900) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingRightBeforeEarlyWithdraw() (gas: 787140) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingSomeSecondsBeforeBorrow() (gas: 572841) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWithDampSpeedDown() (gas: 477835) -VerifiedMarketTest:testUpdateFloatingAssetsAverageWithDampSpeedUp() (gas: 341683) -VerifiedMarketTest:testUpdateFloatingDebtBeforeSettingTreasury() (gas: 115196) -VerifiedMarketTest:testWithdrawAtMaturity() (gas: 383828) -VerifiedMarketTest:testWithdrawFromSmartPool() (gas: 323483) -VerifiedMarketTest:testWithdrawShouldUpdateFlexibleBorrowVariables() (gas: 998070) -VerifiedMarketTest:testWithdrawWhenFrozen() (gas: 361305) -VerifiedMarketTest:test_borrowAtMaturity_borrows_whenBorrowerIsAllowed() (gas: 563292) -VerifiedMarketTest:test_borrowAtMaturity_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 519694) -VerifiedMarketTest:test_borrow_borrows_whenBorrowerIsAllowed() (gas: 437186) -VerifiedMarketTest:test_borrow_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 387716) +VerifiedMarketTest:testPreviewOperationsWithSmartPoolCorrectlyAccountingEarnings() (gas: 2447098) +VerifiedMarketTest:testRepayAtMaturity() (gas: 687233) +VerifiedMarketTest:testRepayDisagreement() (gas: 696997) +VerifiedMarketTest:testRepayFlexibleBorrow() (gas: 1389567) +VerifiedMarketTest:testRepayWhenFrozen() (gas: 593929) +VerifiedMarketTest:testRoundingDownAssetsToValidateShortfallWhenTransferring() (gas: 9609849) +VerifiedMarketTest:testRoundingDownAssetsToValidateShortfallWhenTransferringFrom() (gas: 9665305) +VerifiedMarketTest:testRoundingDownAssetsWhenTransferingFromAnAccountWithoutShortfall() (gas: 1196378) +VerifiedMarketTest:testRoundingDownAssetsWhenTransferingWithAnAccountWithoutShortfall() (gas: 1138384) +VerifiedMarketTest:testRoundingUpAllowanceWhenBorrowingAtMaturity() (gas: 949746) +VerifiedMarketTest:testRoundingUpAllowanceWhenWithdrawingAtMaturity() (gas: 962141) +VerifiedMarketTest:testSetDampSpeedFactorShouldUpdateFloatingAssetsAverage() (gas: 456993) +VerifiedMarketTest:testSetEarningsAccumulatorSmoothFactorShouldDistributeEarnings() (gas: 964219) +VerifiedMarketTest:testSetInterestRateModelShouldUpdateFloatingDebt() (gas: 2889089) +VerifiedMarketTest:testSetInterestRateModelWithAddressZeroShouldNotUpdateFloatingDebt() (gas: 2677966) +VerifiedMarketTest:testShareValueNotDecreasingAfterDeposit() (gas: 855320) +VerifiedMarketTest:testShareValueNotDecreasingWhenMintingToTreasury() (gas: 893914) +VerifiedMarketTest:testSingleFloatingBorrow() (gas: 454962) +VerifiedMarketTest:testSingleFloatingRepay() (gas: 543249) +VerifiedMarketTest:testSmartPoolEarningsDistribution() (gas: 1316759) +VerifiedMarketTest:testSmartPoolSharesDoNotAccountUnassignedEarningsFromMoreThanOneIntervalPastMaturities() (gas: 715892) +VerifiedMarketTest:testSumDebtPlusEffectsShouldntRoundUpWhenWithdrawing() (gas: 1169221) +VerifiedMarketTest:testTotalAssetsProjectingBackupEarningsCorrectly() (gas: 629669) +VerifiedMarketTest:testTotalAssetsProjectingFloatingDebtCorrectly() (gas: 902594) +VerifiedMarketTest:testUpdateAccumulatedEarningsFactorToZero() (gas: 1917398) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenDepositingAndBorrowingContinuously() (gas: 468027) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenDepositingRightBeforeBorrow() (gas: 799808) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenDepositingRightBeforeEarlyWithdraw() (gas: 782962) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenDepositingSomeSecondsBeforeBorrow() (gas: 1130209) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingRightBeforeBorrow() (gas: 803847) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingRightBeforeEarlyWithdraw() (gas: 787001) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWhenWithdrawingSomeSecondsBeforeBorrow() (gas: 572766) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWithDampSpeedDown() (gas: 477760) +VerifiedMarketTest:testUpdateFloatingAssetsAverageWithDampSpeedUp() (gas: 341543) +VerifiedMarketTest:testUpdateFloatingDebtBeforeSettingTreasury() (gas: 115218) +VerifiedMarketTest:testWithdrawAtMaturity() (gas: 383850) +VerifiedMarketTest:testWithdrawFromSmartPool() (gas: 323363) +VerifiedMarketTest:testWithdrawShouldUpdateFlexibleBorrowVariables() (gas: 997995) +VerifiedMarketTest:testWithdrawWhenFrozen() (gas: 361252) +VerifiedMarketTest:test_borrowAtMaturity_borrows_whenBorrowerIsAllowed() (gas: 563239) +VerifiedMarketTest:test_borrowAtMaturity_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 519554) +VerifiedMarketTest:test_borrow_borrows_whenBorrowerIsAllowed() (gas: 437133) +VerifiedMarketTest:test_borrow_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 387641) VerifiedMarketTest:test_depositAtMaturity_deposits_whenSenderAndReceiverAreAllowed() (gas: 487677) VerifiedMarketTest:test_depositAtMaturity_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 92609) VerifiedMarketTest:test_depositAtMaturity_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 88627) -VerifiedMarketTest:test_deposit_deposits_whenSenderAndReceiverAreAllowed() (gas: 471560) -VerifiedMarketTest:test_deposit_deposits_whenTotalSupplyLowerThanMaxSupply() (gas: 247886) +VerifiedMarketTest:test_deposit_allowsDepositUpToMaxSupply() (gas: 396186) +VerifiedMarketTest:test_deposit_deposits_whenSenderAndReceiverAreAllowed() (gas: 471344) +VerifiedMarketTest:test_deposit_deposits_whenTotalSupplyLowerThanMaxSupply() (gas: 247811) VerifiedMarketTest:test_deposit_revert_withNotAllowed_whenBothSenderAndReceiverAreNotAllowed() (gas: 173676) -VerifiedMarketTest:test_deposit_reverts_whenTotalSupplyHigherThanMaxSupply() (gas: 183919) -VerifiedMarketTest:test_deposit_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 92258) +VerifiedMarketTest:test_deposit_reverts_whenTotalSupplyHigherThanMaxSupply() (gas: 183866) +VerifiedMarketTest:test_deposit_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 92280) VerifiedMarketTest:test_deposit_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 173895) -VerifiedMarketTest:test_liquidateAllowedAccount_liquidates_withIncentives() (gas: 1444951) -VerifiedMarketTest:test_liquidateNotAllowedAccount_liquidates_withoutIncentives() (gas: 1401321) -VerifiedMarketTest:test_liquidateNotAllowedAccount_underwater_liquidates_withoutIncentives() (gas: 1401307) -VerifiedMarketTest:test_liquidate_reverts_withNotAllowed_whenLiquidatorIsNotAllowed() (gas: 1060909) -VerifiedMarketTest:test_lock_emits_locked() (gas: 433990) -VerifiedMarketTest:test_lock_emits_seize() (gas: 434515) +VerifiedMarketTest:test_liquidateAllowedAccount_liquidates_withIncentives() (gas: 1444801) +VerifiedMarketTest:test_liquidateNotAllowedAccount_liquidates_withoutIncentives() (gas: 1401171) +VerifiedMarketTest:test_liquidateNotAllowedAccount_underwater_liquidates_withoutIncentives() (gas: 1401157) +VerifiedMarketTest:test_liquidate_reverts_withNotAllowed_whenLiquidatorIsNotAllowed() (gas: 1060759) +VerifiedMarketTest:test_lock_emits_locked() (gas: 433915) +VerifiedMarketTest:test_lock_emits_seize() (gas: 434440) VerifiedMarketTest:test_lock_locks_whenAccountHasFixedDeposits() (gas: 575744) -VerifiedMarketTest:test_lock_locks_whenAccountHasNoDebt() (gas: 556552) -VerifiedMarketTest:test_lock_reverts_withNotAuditor_whenNotCalledByAuditor() (gas: 35027) -VerifiedMarketTest:test_lock_reverts_withRemainingDebt_whenAccountHasDebt() (gas: 596637) -VerifiedMarketTest:test_mint_mints_whenSenderAndReceiverAreAllowed() (gas: 395338) +VerifiedMarketTest:test_lock_locks_whenAccountHasNoDebt() (gas: 556499) +VerifiedMarketTest:test_lock_reverts_withNotAuditor_whenNotCalledByAuditor() (gas: 34982) +VerifiedMarketTest:test_lock_reverts_withRemainingDebt_whenAccountHasDebt() (gas: 596562) +VerifiedMarketTest:test_mint_mints_whenSenderAndReceiverAreAllowed() (gas: 395143) VerifiedMarketTest:test_mint_revert_withNotAllowed_whenBothSenderAndReceiverAreNotAllowed() (gas: 173698) -VerifiedMarketTest:test_mint_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 92236) +VerifiedMarketTest:test_mint_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 92191) VerifiedMarketTest:test_mint_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 173828) -VerifiedMarketTest:test_redeem_redeems_whenSenderIsAllowed() (gas: 361134) -VerifiedMarketTest:test_redeem_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 323005) -VerifiedMarketTest:test_refund_refunds_whenBorrowerAndRefunderAreAllowed() (gas: 600175) -VerifiedMarketTest:test_refund_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 537846) -VerifiedMarketTest:test_refund_reverts_withNotAllowed_whenBothBorrowerAndRefunderAreNotAllowed() (gas: 560590) -VerifiedMarketTest:test_refund_reverts_withNotAllowed_whenRefunderIsNotAllowed() (gas: 533408) -VerifiedMarketTest:test_repayAtMaturity_repays_whenBorrowerAndRepayerAreAllowed() (gas: 769640) -VerifiedMarketTest:test_repayAtMaturity_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 664926) -VerifiedMarketTest:test_repayAtMaturity_reverts_withNotAllowed_whenBothBorrowerAndRepayerAreNotAllowed() (gas: 728529) -VerifiedMarketTest:test_repayAtMaturity_reverts_withNotAllowed_whenRepayerIsNotAllowed() (gas: 701162) -VerifiedMarketTest:test_repay_repays_whenBorrowerAndRepayerAreAllowed() (gas: 574283) -VerifiedMarketTest:test_repay_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 537838) -VerifiedMarketTest:test_repay_reverts_withNotAllowed_whenBothBorrowerAndRepayerAreNotAllowed() (gas: 520769) -VerifiedMarketTest:test_repay_reverts_withNotAllowed_whenRepayerIsNotAllowed() (gas: 574078) +VerifiedMarketTest:test_redeem_redeems_whenSenderIsAllowed() (gas: 361059) +VerifiedMarketTest:test_redeem_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 322930) +VerifiedMarketTest:test_refund_refunds_whenBorrowerAndRefunderAreAllowed() (gas: 600100) +VerifiedMarketTest:test_refund_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 537771) +VerifiedMarketTest:test_refund_reverts_withNotAllowed_whenBothBorrowerAndRefunderAreNotAllowed() (gas: 560515) +VerifiedMarketTest:test_refund_reverts_withNotAllowed_whenRefunderIsNotAllowed() (gas: 533333) +VerifiedMarketTest:test_repayAtMaturity_repays_whenBorrowerAndRepayerAreAllowed() (gas: 769565) +VerifiedMarketTest:test_repayAtMaturity_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 664851) +VerifiedMarketTest:test_repayAtMaturity_reverts_withNotAllowed_whenBothBorrowerAndRepayerAreNotAllowed() (gas: 728476) +VerifiedMarketTest:test_repayAtMaturity_reverts_withNotAllowed_whenRepayerIsNotAllowed() (gas: 701087) +VerifiedMarketTest:test_repay_repays_whenBorrowerAndRepayerAreAllowed() (gas: 574142) +VerifiedMarketTest:test_repay_reverts_withNotAllowed_whenBorrowerIsNotAllowed() (gas: 537763) +VerifiedMarketTest:test_repay_reverts_withNotAllowed_whenBothBorrowerAndRepayerAreNotAllowed() (gas: 520694) +VerifiedMarketTest:test_repay_reverts_withNotAllowed_whenRepayerIsNotAllowed() (gas: 573958) VerifiedMarketTest:test_setMaxSupply_emits_maxSupplySet() (gas: 44327) VerifiedMarketTest:test_setMaxSupply_reverts_whenNotAdmin() (gas: 65094) -VerifiedMarketTest:test_setMaxSupply_sets_whenAdmin() (gas: 66293) -VerifiedMarketTest:test_transferFrom_reverts_withNotAllowed_whenBothSenderAndReceiverAreNotAllowed() (gas: 310121) -VerifiedMarketTest:test_transferFrom_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 282733) -VerifiedMarketTest:test_transferFrom_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 333377) -VerifiedMarketTest:test_transferFrom_transfers_whenSenderAndReceiverAreAllowed() (gas: 447302) -VerifiedMarketTest:test_transfer_reverts_withNotAllowed_whenBothSenderAndReceiverAreNotAllowed() (gas: 309644) -VerifiedMarketTest:test_transfer_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 282235) -VerifiedMarketTest:test_transfer_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 332984) -VerifiedMarketTest:test_transfer_transfers_whenSenderAndReceiverAreAllowed() (gas: 396447) -VerifiedMarketTest:test_unlock_afterOperating_unlocks() (gas: 1964888) -VerifiedMarketTest:test_unlock_emits_unlocked() (gas: 662791) +VerifiedMarketTest:test_setMaxSupply_sets_whenAdmin() (gas: 66315) +VerifiedMarketTest:test_transferFrom_reverts_withNotAllowed_whenBothSenderAndReceiverAreNotAllowed() (gas: 310068) +VerifiedMarketTest:test_transferFrom_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 282658) +VerifiedMarketTest:test_transferFrom_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 333302) +VerifiedMarketTest:test_transferFrom_transfers_whenSenderAndReceiverAreAllowed() (gas: 447227) +VerifiedMarketTest:test_transfer_reverts_withNotAllowed_whenBothSenderAndReceiverAreNotAllowed() (gas: 309569) +VerifiedMarketTest:test_transfer_reverts_withNotAllowed_whenReceiverIsNotAllowed() (gas: 282182) +VerifiedMarketTest:test_transfer_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 332909) +VerifiedMarketTest:test_transfer_transfers_whenSenderAndReceiverAreAllowed() (gas: 396372) +VerifiedMarketTest:test_unlock_afterOperating_unlocks() (gas: 1964663) +VerifiedMarketTest:test_unlock_emits_unlocked() (gas: 662641) VerifiedMarketTest:test_unlock_reverts_withNotAuditor_whenNotCalledByAuditor() (gas: 35009) -VerifiedMarketTest:test_unlock_unlocks_whenAccountIsAllowedBack() (gas: 859179) -VerifiedMarketTest:test_unlock_updatesFloatingAssets() (gas: 693870) +VerifiedMarketTest:test_unlock_unlocks_whenAccountIsAllowedBack() (gas: 858967) +VerifiedMarketTest:test_unlock_updatesFloatingAssets() (gas: 693742) VerifiedMarketTest:test_withdrawAtMaturity_reverts_withNotAllowed_whenOwnerIsNotAllowed() (gas: 364077) VerifiedMarketTest:test_withdrawAtMaturity_withdraws_whenOwnerIsAllowed() (gas: 407904) -VerifiedMarketTest:test_withdraw_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 284983) -VerifiedMarketTest:test_withdraw_withdraws_whenSenderIsAllowed() (gas: 367638) +VerifiedMarketTest:test_withdraw_reverts_withNotAllowed_whenSenderIsNotAllowed() (gas: 284908) +VerifiedMarketTest:test_withdraw_withdraws_whenSenderIsAllowed() (gas: 367585) VotePreviewerTest:testExternalVotes() (gas: 428373) \ No newline at end of file diff --git a/contracts/Market.sol b/contracts/Market.sol index 520863698..59baeaf91 100644 --- a/contracts/Market.sol +++ b/contracts/Market.sol @@ -706,8 +706,8 @@ contract Market is MarketBase { /// @notice Hook to update the floating pool average, floating pool balance and distribute earnings from accumulator. /// @param assets amount of assets to be deposited to the floating pool. - function afterDeposit(uint256 assets, uint256 shares) internal override whenNotPaused whenNotFrozen { - if (shares + totalSupply > maxSupply) revert MaxSupplyExceeded(); + function afterDeposit(uint256 assets, uint256) internal override whenNotPaused whenNotFrozen { + if (totalSupply > maxSupply) revert MaxSupplyExceeded(); updateFloatingAssetsAverage(); uint256 treasuryFee = updateFloatingDebt(); diff --git a/test/Market.t.sol b/test/Market.t.sol index 701d9397d..6917db2ce 100644 --- a/test/Market.t.sol +++ b/test/Market.t.sol @@ -3253,6 +3253,13 @@ contract MarketTest is Test { market.deposit(2 ether, address(this)); } + function test_deposit_allowsDepositUpToMaxSupply() external { + market.setMaxSupply(10 ether); + market.deposit(5 ether, address(this)); + market.deposit(5 ether, address(this)); + assertEq(market.totalSupply(), 10 ether); + } + event MarketUpdate( uint256 timestamp, uint256 floatingDepositShares,