fix: gas tests with interest accrual (vs dev)#1190
Conversation
🌈 Test ResultsNo files changed, compilation skipped
Ran 9 tests for tests/unit/libraries/KeyValueList.t.sol:KeyValueListTest
[PASS] test_add_unique() (gas: 354262)
[PASS] test_fuzz_add(uint256,uint256) (runs: 5, μ: 231230, ~: 232296)
[PASS] test_fuzz_add_unique(uint256,uint256) (runs: 5, μ: 257237, ~: 254508)
Logs:
Bound result 56
[PASS] test_fuzz_get(uint256[]) (runs: 5, μ: 479712, ~: 487162)
[PASS] test_fuzz_get_uninitialized(uint256[]) (runs: 5, μ: 360458, ~: 412672)
[PASS] test_fuzz_get_uninitialized_sorted(uint256[]) (runs: 5, μ: 161896, ~: 132993)
[PASS] test_fuzz_sortByKey(uint256[]) (runs: 5, μ: 556780, ~: 569669)
[PASS] test_fuzz_sortByKey_length(uint256) (runs: 5, μ: 191773, ~: 135128)
Logs:
Bound result 31
[PASS] test_fuzz_sortByKey_with_collision(uint256[]) (runs: 5, μ: 628050, ~: 641909)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 173.14ms (172.00ms CPU time)
Ran 20 tests for tests/unit/AaveOracle.t.sol:AaveOracleTest
[PASS] test_DECIMALS() (gas: 8326)
[PASS] test_constructor() (gas: 18428)
[PASS] test_description() (gas: 12039)
[PASS] test_fuzz_constructor(uint8) (runs: 5, μ: 20214, ~: 20214)
Logs:
Bound result 16
[PASS] test_getReservePrice() (gas: 48776)
[PASS] test_getReservePrice_revertsWith_InvalidPrice() (gas: 48047)
[PASS] test_getReservePrice_revertsWith_InvalidSource() (gas: 10898)
[PASS] test_getReservePrices() (gas: 80715)
[PASS] test_getReservePrices_revertsWith_InvalidSource() (gas: 50930)
[PASS] test_getReserveSource() (gas: 48946)
[PASS] test_setReserveSource() (gas: 45988)
[PASS] test_setReserveSource_revertsWith_InvalidPrice() (gas: 102779)
[PASS] test_setReserveSource_revertsWith_InvalidSource() (gas: 17228)
[PASS] test_setReserveSource_revertsWith_InvalidSourceDecimals() (gas: 17065)
[PASS] test_setReserveSource_revertsWith_OnlySpoke() (gas: 13021)
[PASS] test_setReserveSource_revertsWith_OracleMismatch() (gas: 5010072)
[PASS] test_setSpoke() (gas: 5037974)
[PASS] test_setSpoke_revertsWith_InvalidAddress() (gas: 10870)
[PASS] test_setSpoke_revertsWith_OnlyDeployer(address) (runs: 5, μ: 13397, ~: 13397)
[PASS] test_setSpoke_revertsWith_SpokeAlreadySet() (gas: 15080)
Suite result: ok. 20 passed; 0 failed; 0 skipped; finished in 192.14ms (166.67ms CPU time)
Ran 6 tests for tests/unit/Hub/Hub.PayFee.t.sol:HubPayFeeTest
[PASS] test_payFee_fuzz(uint256,uint256) (runs: 5, μ: 703389, ~: 704052)
Logs:
Bound result 72003609882796634652662230263
Bound result 0
Bound result 6701823741808856409993735250
[PASS] test_payFee_fuzz_with_interest(uint256,uint256,uint256) (runs: 5, μ: 704656, ~: 704720)
Logs:
Bound result 28440373319405028386003002998
Bound result 4896747
Bound result 20234343860279723851399548880
[PASS] test_payFee_revertsWith_InvalidShares() (gas: 20356)
[PASS] test_payFee_revertsWith_SpokeNotActive() (gas: 61390)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded() (gas: 138740)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded_with_interest() (gas: 643431)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 224.01ms (192.01ms CPU time)
Ran 2 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.CollateralToLiquidate.t.sol:LiquidationLogicCollateralToLiquidateTest
[PASS] test_calculateCollateralAmountToLiquidate() (gas: 168084)
[PASS] test_calculateCollateralToLiquidate_fuzz((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 197426, ~: 180250)
Logs:
Bound result 2
Bound result 9
Bound result 5000000000000
Bound result 99000000000000000000000014579
Bound result 8
Bound result 18156
Bound result 14
Bound result 177362148
Bound result 10125
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 112.47ms (88.57ms CPU time)
Ran 17 tests for tests/unit/AccessManagerEnumerable.t.sol:AccessManagerEnumerableTest
[PASS] test_getRoleMembers_fuzz(uint256,uint256) (runs: 5, μ: 1977371, ~: 1977224)
Logs:
Bound result 8
Bound result 10
[PASS] test_getRoleTargetSelectors_fuzz(uint256,uint256) (runs: 5, μ: 1525556, ~: 1525471)
Logs:
Bound result 8
Bound result 10
[PASS] test_grantRole() (gas: 315886)
[PASS] test_grantRole_fuzz(uint64,uint256) (runs: 5, μ: 894811, ~: 919753)
Logs:
Bound result 2
[PASS] test_revokeRole() (gas: 323138)
[PASS] test_setRoleAdmin_fuzz_trackAdminRoles_multipleRoles_multipleAdmins(uint256) (runs: 5, μ: 1695874, ~: 1825652)
Logs:
Bound result 4
[PASS] test_setRoleAdmin_fuzz_trackRolesAndTrackAdminRoles_multipleRoles(uint256) (runs: 5, μ: 1469939, ~: 1469938)
Logs:
Bound result 4
[PASS] test_setRoleAdmin_trackAdminOfRoles() (gas: 606131)
[PASS] test_setRoleAdmin_trackAdminOfRoles_changeAdminRole() (gas: 577217)
[PASS] test_setRoleAdmin_trackAdminRoles() (gas: 602311)
[PASS] test_setRoleAdmin_trackRolesAndTrackAdminRoles() (gas: 378311)
[PASS] test_setRoleGuardian_trackRoles() (gas: 263932)
[PASS] test_setTargetFunctionRole() (gas: 414440)
[PASS] test_setTargetFunctionRole_multipleTargets() (gas: 1103911)
[PASS] test_setTargetFunctionRole_removeTarget() (gas: 894967)
[PASS] test_setTargetFunctionRole_skipAddToAdminRole() (gas: 30940)
[PASS] test_setTargetFunctionRole_withReplace() (gas: 549104)
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 111.11ms (109.97ms CPU time)
Ran 11 tests for tests/unit/Hub/Hub.Reclaim.t.sol:HubReclaimTest
[PASS] test_reclaim() (gas: 652774)
Logs:
Bound result 1000000000000000000000
Bound result 500000000000000000000
Bound result 200000000000000000000
[PASS] test_reclaim_fullAmount() (gas: 635224)
[PASS] test_reclaim_fuzz(uint256,uint256,uint256) (runs: 5, μ: 653736, ~: 653741)
Logs:
Bound result 28440373319405028386003002998
Bound result 20234343860279723851399548880
Bound result 4896747
[PASS] test_reclaim_multipleSweepsAndReclaims() (gas: 743828)
[PASS] test_reclaim_revertsWith_AssetNotListed() (gas: 13093)
[PASS] test_reclaim_revertsWith_InsufficientTransferred() (gas: 456516)
[PASS] test_reclaim_revertsWith_InsufficientTransferred_noSwept() (gas: 102551)
[PASS] test_reclaim_revertsWith_InvalidAmount_zero() (gas: 92721)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController(address) (runs: 5, μ: 93604, ~: 93604)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController_init() (gas: 40516)
[PASS] test_reclaim_revertsWith_underflow_exceedsSwept_afterSweep() (gas: 619868)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 188.44ms (165.78ms CPU time)
Ran 23 tests for tests/unit/AssetInterestRateStrategy.t.sol:AssetInterestRateStrategyTest
[PASS] test_calculateInterestRate_AtKinkPoint() (gas: 24326)
Logs:
Bound result 2000
Bound result 778565440757296803935461404101
[PASS] test_calculateInterestRate_AtMaxUtilization() (gas: 24621)
Logs:
Bound result 10000
Bound result 778565440757296803935461404101
[PASS] test_calculateInterestRate_LeftToKinkPoint(uint256) (runs: 5, μ: 24027, ~: 24179)
Logs:
Bound result 1016
Bound result 652288372909708709858213579545
[PASS] test_calculateInterestRate_RightToKinkPoint(uint256) (runs: 5, μ: 25320, ~: 25349)
Logs:
Bound result 9016
Bound result 652288372909708709858213579545
[PASS] test_calculateInterestRate_ZeroDebtZeroLiquidity() (gas: 18771)
Logs:
Bound result 0
[PASS] test_calculateInterestRate_fuzz_ZeroDebt(uint256) (runs: 5, μ: 18958, ~: 18822)
Logs:
Bound result 1016
[PASS] test_calculateInterestRate_revertsWith_InterestRateDataNotSet() (gas: 11225)
[PASS] test_deploy_revertsWith_InvalidAddress() (gas: 3746)
[PASS] test_getBaseVariableBorrowRate() (gas: 14812)
[PASS] test_getInterestRateData() (gas: 19290)
[PASS] test_getMaxVariableBorrowRate() (gas: 15258)
[PASS] test_getOptimalUsageRatio() (gas: 14705)
[PASS] test_getVariableRateSlope1() (gas: 14791)
[PASS] test_getVariableRateSlope2() (gas: 14746)
[PASS] test_maxBorrowRate() (gas: 8312)
[PASS] test_maxOptimalRatio() (gas: 8312)
[PASS] test_minOptimalRatio() (gas: 8321)
[PASS] test_setInterestRateData() (gas: 68999)
[PASS] test_setInterestRateData_revertsWith_InvalidMaxRate() (gas: 41819)
[PASS] test_setInterestRateData_revertsWith_InvalidOptimalUsageRatio() (gas: 42380)
[PASS] test_setInterestRateData_revertsWith_InvalidRateData() (gas: 35269)
[PASS] test_setInterestRateData_revertsWith_OnlyHub() (gas: 23502)
[PASS] test_setInterestRateData_revertsWith_Slope2MustBeGteSlope1() (gas: 37658)
Suite result: ok. 23 passed; 0 failed; 0 skipped; finished in 224.03ms (207.53ms CPU time)
Ran 3 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.DebtToLiquidate.t.sol:LiquidationLogicDebtToLiquidateTest
[PASS] test_calculateDebtToLiquidate_fuzz((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 39891, ~: 40179)
Logs:
Bound result 27817417914151451884601
Bound result 10794
Bound result 2406
Bound result 1296784785287246118
Bound result 482897447027983936
Bound result 9408548411028617
Bound result 15
Bound result 1000000000000000000000000000000
Bound result 99026661368107885217517341611
Bound result 103485765157
Bound result 106286321362
[PASS] test_calculateDebtToLiquidate_fuzz_AmountAdjustedDueToDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 42696, ~: 43211)
Logs:
Bound result 27817417914151451884601
Bound result 10794
Bound result 2406
Bound result 1296784785287246118
Bound result 482897447027983936
Bound result 9408548411028617
Bound result 15
Bound result 1000000000000000000000000000000
Bound result 99026661368107885217517341611
Bound result 103485765157
Bound result 106286321362
Bound result 9408548411028617
Bound result 2049991
[PASS] test_calculateDebtToLiquidate_fuzz_ImpossibleToAdjustForDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 42222, ~: 42656)
Logs:
Bound result 27817417914151451884601
Bound result 10794
Bound result 2406
Bound result 1296784785287246118
Bound result 482897447027983936
Bound result 9408548411028617
Bound result 15
Bound result 1000000000000000000000000000000
Bound result 99026661368107885217517341611
Bound result 103485765157
Bound result 106286321362
Bound result 5
Bound result 10000000000000000
Bound result 103485765157
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 306.88ms (282.71ms CPU time)
Ran 10 tests for tests/unit/misc/EIP712Hash.t.sol:EIP712HashTest
[PASS] test_constants() (gas: 13531)
[PASS] test_hash_borrow_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5, μ: 6805, ~: 6805)
[PASS] test_hash_positionManagerUpdate_fuzz((address,bool)) (runs: 5, μ: 6193, ~: 6193)
[PASS] test_hash_repay_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5, μ: 6806, ~: 6806)
[PASS] test_hash_setUserPositionManagers_fuzz((address,(address,bool)[],uint256,uint256)) (runs: 5, μ: 322956, ~: 350797)
[PASS] test_hash_setUsingAsCollateral_fuzz((address,uint256,bool,address,uint256,uint256)) (runs: 5, μ: 7305, ~: 7305)
[PASS] test_hash_supply_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5, μ: 6849, ~: 6849)
[PASS] test_hash_updateUserDynamicConfig_fuzz((address,address,uint256,uint256)) (runs: 5, μ: 6450, ~: 6450)
[PASS] test_hash_updateUserRiskPremium_fuzz((address,address,uint256,uint256)) (runs: 5, μ: 6471, ~: 6471)
[PASS] test_hash_withdraw_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5, μ: 6805, ~: 6805)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 91.17ms (90.70ms CPU time)
Ran 7 tests for tests/unit/Spoke/Spoke.AccrueInterest.t.sol:SpokeAccrueInterestTest
[PASS] test_accrueInterest_NoActionTaken() (gas: 132992)
[PASS] test_accrueInterest_NoInterest_NoDebt(uint40) (runs: 5, μ: 631849, ~: 631713)
Logs:
Bound result 9610
[PASS] test_accrueInterest_NoInterest_OnlySupply(uint40) (runs: 5, μ: 250199, ~: 250063)
Logs:
Bound result 9610
[PASS] test_accrueInterest_TenPercentRp(uint256,uint40) (runs: 5, μ: 579577, ~: 579473)
Logs:
Bound result 34641449056492339346837209590
Bound result 13686
[PASS] test_accrueInterest_fuzz_BorrowAmountAndSkipTime(uint256,uint40) (runs: 5, μ: 538824, ~: 538786)
Logs:
Bound result 72003609882796634652662230263
Bound result 13686
[SKIP: pending rft] test_accrueInterest_fuzz_RPBorrowAndSkipTime((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint40) (runs: 0, μ: 0, ~: 0)
[PASS] test_accrueInterest_fuzz_RatesRPBorrowAndSkipTime((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),(uint96,uint96,uint96,uint96),uint40) (runs: 5, μ: 4070336, ~: 4063942)
Logs:
Bound result 309425946788297219012937972879
Bound result 451793245268469845329932546549
Bound result 11647
Bound result 74768436363656985453
Bound result 444860966668015932389501662077
Bound result 844269475657800115044182820366
Bound result 548707868091040472
Bound result 85886370499055179822
Bound result 1
Bound result 14
Bound result 39259
Bound result 834
Bound result 357751
Bound result 444860966668015932389501662077
Bound result 844269475657800115044182820366
Bound result 548707868091040472
Bound result 16068272383032175514
Suite result: ok. 6 passed; 0 failed; 1 skipped; finished in 633.94ms (608.76ms CPU time)
Ran 3 tests for tests/unit/misc/ExtSload.t.sol:ExtSloadTest
[PASS] test_extSload(bytes32) (runs: 5, μ: 9767, ~: 9767)
[PASS] test_extSloads(uint256) (runs: 5, μ: 882714, ~: 641902)
Logs:
Bound result 940
[PASS] test_extSloads(uint256,bytes) (runs: 5, μ: 1071404, ~: 1204453)
Logs:
Bound result 14
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 77.78ms (77.49ms CPU time)
Ran 8 tests for tests/unit/misc/GatewayBase.t.sol:GatewayBaseTest
[PASS] test_constructor() (gas: 17151)
[PASS] test_registerSpoke_fuzz(address) (runs: 5, μ: 41629, ~: 41629)
[PASS] test_registerSpoke_revertsWith_InvalidAddress() (gas: 13119)
[PASS] test_registerSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 13791)
[PASS] test_registerSpoke_unregister() (gas: 36076)
[PASS] test_renouncePositionManagerRole() (gas: 65249)
[PASS] test_renouncePositionManagerRole_revertsWith_InvalidAddress() (gas: 74198)
[PASS] test_renouncePositionManagerRole_revertsWith_OwnableUnauthorizedAccount() (gas: 74417)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 92.18ms (69.42ms CPU time)
Ran 12 tests for tests/unit/Hub/Hub.RefreshPremium.t.sol:HubRefreshPremiumTest
[PASS] test_refreshPremium_emitsEvent() (gas: 254760)
[PASS] test_refreshPremium_fuzz_positiveDeltas(uint256,int256,int256) (runs: 5, μ: 493667, ~: 493549)
Logs:
Bound result 999999999990000000000000000001
Bound result 7996
Bound result 20031
[PASS] test_refreshPremium_fuzz_withAccrual(uint256,uint256,uint256,uint256) (runs: 5, μ: 464675, ~: 474531)
Logs:
Bound result 240336
Bound result 601
Bound result 658565049645239055663504730267
Bound result 305527059267969844621518062160
[PASS] test_refreshPremium_haltedSpokesAllowed() (gas: 121441)
[PASS] test_refreshPremium_maxRiskPremiumThreshold() (gas: 898439)
[PASS] test_refreshPremium_negativeDeltas(uint256) (runs: 5, μ: 458652, ~: 458516)
Logs:
Bound result 9833
[PASS] test_refreshPremium_negativeDeltas_withAccrual(uint256) (runs: 5, μ: 528265, ~: 528129)
Logs:
Bound result 9833
[PASS] test_refreshPremium_revertsWith_InvalidPremiumChange_NonZeroRestoredPremiumRay() (gas: 853847)
[PASS] test_refreshPremium_revertsWith_InvalidPremiumChange_RiskPremiumThresholdExceeded_DecreasingPremium() (gas: 875149)
[PASS] test_refreshPremium_revertsWith_SpokeNotActive() (gas: 58921)
[PASS] test_refreshPremium_riskPremiumThreshold() (gas: 920617)
[PASS] test_refreshPremium_spokePremiumUpdateIsContained() (gas: 707620)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 381.51ms (358.42ms CPU time)
Ran 5 tests for tests/gas/Gateways.Operations.gas.t.sol:NativeTokenGateway_Gas_Tests
[PASS] test_borrowNative() (gas: 922378)
[PASS] test_repayNative() (gas: 994146)
[PASS] test_supplyAndCollateralNative() (gas: 310385)
[PASS] test_supplyNative() (gas: 290118)
[PASS] test_withdrawNative() (gas: 517794)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 60.26ms (4.46ms CPU time)
Ran 8 tests for tests/gas/Gateways.Operations.gas.t.sol:SignatureGateway_Gas_Tests
[PASS] test_borrowWithSig() (gas: 625566)
[PASS] test_repayWithSig() (gas: 860917)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 205811)
[PASS] test_setUsingAsCollateralWithSig() (gas: 217538)
[PASS] test_supplyWithSig() (gas: 417579)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 221461)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 219126)
[PASS] test_withdrawWithSig() (gas: 455778)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 54.17ms (9.05ms CPU time)
Ran 6 tests for tests/unit/Hub/Hub.Access.t.sol:HubAccessTest
[PASS] test_change_authority() (gas: 206690)
[PASS] test_change_role_responsibility() (gas: 121258)
[PASS] test_hub_access_manager_exposure() (gas: 13439)
[PASS] test_hub_admin_access() (gas: 1350388)
[PASS] test_migrate_role_responsibility() (gas: 708988)
[PASS] test_setInterestRateData_access() (gas: 102667)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 27.03ms (3.81ms CPU time)
Ran 7 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.DebtToTargetHealthFactor.t.sol:LiquidationLogicDebtToTargetHealthFactorTest
[PASS] test_calculateDebtToTargetHealthFactor_HealthFactorEqualsTargetHealthFactor((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 23779, ~: 24051)
Logs:
Bound result 7484638388661680898639593928834930651911
Bound result 11343
Bound result 1975
Bound result 1000000000000000001
Bound result 1
Bound result 96968901737418
Bound result 12
[PASS] test_calculateDebtToTargetHealthFactor_NoPrecisionLoss() (gas: 27855)
[PASS] test_calculateDebtToTargetHealthFactor_PrecisionLoss() (gas: 17346)
[PASS] test_calculateDebtToTargetHealthFactor_UnitPrice() (gas: 27855)
[PASS] test_calculateDebtToTargetHealthFactor_fuzz_NoRevert((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 20964, ~: 21177)
Logs:
Bound result 7484638388661680898639593928834930651911
Bound result 11343
Bound result 1975
Bound result 1000000000000000001
Bound result 1
Bound result 96968901737418
Bound result 12
[PASS] test_calculateDebtToTargetHealthFactor_fuzz_revertsWith_DivisionByZero_ZeroAssetPrice((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 23288, ~: 23560)
Logs:
Bound result 7484638388661680898639593928834930651911
Bound result 11343
Bound result 1975
Bound result 1000000000000000001
Bound result 1
Bound result 96968901737418
Bound result 12
[PASS] test_calculateDebtToTargetHealthFactor_revertsWith_ArithmeticError_TargetHealthFactorLessThanHealthFactor((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 23040, ~: 23312)
Logs:
Bound result 7484638388661680898639593928834930651911
Bound result 11343
Bound result 1975
Bound result 1000000000000000001
Bound result 1
Bound result 96968901737418
Bound result 12
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 403.05ms (379.67ms CPU time)
Ran 16 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.EvaluateDeficit.t.sol:LiquidationLogicEvaluateDeficitTest
[PASS] test_evaluateDeficit_CRE_SCCM_DRE_BRCM() (gas: 8928)
[PASS] test_evaluateDeficit_CRE_SCCM_DRE_BRCO() (gas: 8896)
[PASS] test_evaluateDeficit_CRE_SCCM_DRN_BRCM() (gas: 8917)
[PASS] test_evaluateDeficit_CRE_SCCM_DRN_BRCO() (gas: 8884)
[PASS] test_evaluateDeficit_CRE_SCCO_DRE_BRCM() (gas: 8910)
[PASS] test_evaluateDeficit_CRE_SCCO_DRE_BRCO() (gas: 8977)
[PASS] test_evaluateDeficit_CRE_SCCO_DRN_BRCM() (gas: 8942)
[PASS] test_evaluateDeficit_CRE_SCCO_DRN_BRCO() (gas: 8930)
[PASS] test_evaluateDeficit_CRN_SCCM_DRE_BRCM() (gas: 8930)
[PASS] test_evaluateDeficit_CRN_SCCM_DRE_BRCO() (gas: 8919)
[PASS] test_evaluateDeficit_CRN_SCCM_DRN_BRCM() (gas: 8853)
[PASS] test_evaluateDeficit_CRN_SCCM_DRN_BRCO() (gas: 8886)
[PASS] test_evaluateDeficit_CRN_SCCO_DRE_BRCM() (gas: 8863)
[PASS] test_evaluateDeficit_CRN_SCCO_DRE_BRCO() (gas: 8920)
[PASS] test_evaluateDeficit_CRN_SCCO_DRN_BRCM() (gas: 8871)
[PASS] test_evaluateDeficit_CRN_SCCO_DRN_BRCO() (gas: 8949)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 24.67ms (1.08ms CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.ExecuteLiquidation.t.sol:LiquidationLogicExecuteLiquidationTest
[PASS] test_executeLiquidation() (gas: 368581)
[PASS] test_executeLiquidation_revertsWith_InvalidDebtToCover() (gas: 81007)
[PASS] test_executeLiquidation_revertsWith_MustNotLeaveDust_Collateral() (gas: 141309)
[PASS] test_executeLiquidation_revertsWith_MustNotLeaveDust_Debt() (gas: 141861)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 31.91ms (1.60ms CPU time)
Ran 3 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateCollateral.t.sol:LiquidationLogicLiquidateCollateralTest
[PASS] test_liquidateCollateral_fuzz(uint256,uint256,bool) (runs: 5, μ: 210426, ~: 224481)
Logs:
Bound result 56473442242201527199
Bound result 16911371606172480067
[PASS] test_liquidateCollateral_revertsWith_ArithmeticUnderflow() (gas: 28059)
[PASS] test_liquidateCollateral_revertsWith_ArithmeticUnderflow_FeeShares() (gas: 124023)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 113.81ms (89.54ms CPU time)
Ran 15 tests for tests/unit/Hub/Hub.Remove.t.sol:HubRemoveTest
[PASS] test_remove() (gas: 208909)
Logs:
Bound result 2
Bound result 100000000000000000000
[PASS] test_remove_all_with_interest() (gas: 368332)
[PASS] test_remove_fuzz(uint256,uint256) (runs: 5, μ: 207690, ~: 207615)
Logs:
Bound result 3
Bound result 492253093935020786046210146305
[PASS] test_remove_fuzz_all_liquidity_with_interest(uint256,uint256) (runs: 5, μ: 419342, ~: 419766)
Logs:
Bound result 82796634652662230263
Bound result 386146305
[PASS] test_remove_fuzz_multi_spoke(uint256,uint256) (runs: 5, μ: 289074, ~: 289074)
Logs:
Bound result 236494313724771466934857772360
Bound result 88947056689989320366372374425
[PASS] test_remove_fuzz_multi_spoke_with_interest(uint256,uint256,uint256,uint256) (runs: 5, μ: 422350, ~: 423360)
Logs:
Bound result 240336
Bound result 49623954023794104862590597984
Bound result 16492345978402882778078266451
Bound result 555770955
[PASS] test_remove_revertsWith_InsufficientLiquidity() (gas: 158411)
[PASS] test_remove_revertsWith_InsufficientLiquidity_exceeding_added_amount() (gas: 147500)
[PASS] test_remove_revertsWith_InsufficientLiquidity_zero_added() (gas: 21376)
[PASS] test_remove_revertsWith_InvalidAddress() (gas: 16471)
[PASS] test_remove_revertsWith_InvalidAmount() (gas: 18628)
[PASS] test_remove_revertsWith_SpokeHalted() (gas: 61971)
[PASS] test_remove_revertsWith_SpokeNotActive() (gas: 61880)
[PASS] test_remove_revertsWith_underflow_exceeding_added_amount() (gas: 185386)
[PASS] test_remove_revertsWtih_underflow_one_extra_wei() (gas: 364720)
Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 372.11ms (348.93ms CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateDebt.t.sol:LiquidationLogicLiquidateDebtTest
[PASS] test_liquidateDebt_fuzz(uint256) (runs: 5, μ: 222389, ~: 218281)
[PASS] test_liquidateDebt_revertsWith_ArithmeticUnderflow() (gas: 106082)
[PASS] test_liquidateDebt_revertsWith_InsufficientAllowance() (gas: 118587)
[PASS] test_liquidateDebt_revertsWith_InsufficientBalance() (gas: 177134)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 115.32ms (89.84ms CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateUser.t.sol:LiquidationLogicLiquidateUserTest
[PASS] test_liquidateUser() (gas: 369668)
[PASS] test_liquidateUser_revertsWith_InvalidDebtToCover() (gas: 73786)
[PASS] test_liquidateUser_revertsWith_MustNotLeaveDust_Collateral() (gas: 138106)
[PASS] test_liquidateUser_revertsWith_MustNotLeaveDust_Debt() (gas: 142699)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 32.46ms (1.79ms CPU time)
Ran 7 tests for tests/unit/Hub/Hub.ReportDeficit.t.sol:HubReportDeficitTest
[PASS] test_reportDeficit_fuzz_revertsWith_SurplusDrawnDeficitReported(uint256) (runs: 5, μ: 219922, ~: 219786)
Logs:
Bound result 10223
[PASS] test_reportDeficit_fuzz_revertsWith_SurplusPremiumRayDeficitReported(uint256) (runs: 5, μ: 220947, ~: 220811)
Logs:
Bound result 10223
[PASS] test_reportDeficit_fuzz_with_premium(uint256,uint256,uint256,uint256) (runs: 5, μ: 675657, ~: 675640)
Logs:
Bound result 240336
Bound result 555770955
Bound result 178808
Bound result 34853063093323925748250951516542
[PASS] test_reportDeficit_halted() (gas: 265152)
[PASS] test_reportDeficit_revertsWith_InvalidAmount() (gas: 24893)
[PASS] test_reportDeficit_revertsWith_SpokeNotActive(address) (runs: 5, μ: 33865, ~: 33865)
[PASS] test_reportDeficit_with_premium() (gas: 673657)
Logs:
Bound result 10000000000
Bound result 31536000
Bound result 5000000000
Bound result 0
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 323.30ms (297.58ms CPU time)
Ran 19 tests for tests/unit/Hub/Hub.Add.t.sol:HubAddTest
[PASS] test_add_AddCapReachedButNotExceeded_rounding() (gas: 667246)
[PASS] test_add_fuzz_AddCapReachedButNotExceeded(uint40) (runs: 5, μ: 157848, ~: 157848)
Logs:
Bound result 9478
[PASS] test_add_fuzz_multi_asset_multi_spoke(uint256,uint256,uint256) (runs: 5, μ: 332587, ~: 332181)
Logs:
Bound result 2
Bound result 276197703734924979325426575862
Bound result 4896747
[PASS] test_add_fuzz_revertsWith_AddCapExceeded(uint40) (runs: 5, μ: 112393, ~: 112393)
Logs:
Bound result 9478
[PASS] test_add_fuzz_revertsWith_AddCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5, μ: 267360, ~: 267633)
Logs:
Bound result 476358262
Bound result 386270036924979325426576441
Bound result 4896747
[PASS] test_add_fuzz_revertsWith_InvalidShares_due_to_index(uint256,uint256,uint256) (runs: 5, μ: 224121, ~: 224123)
Logs:
Bound result 740130867392857144266204334010
Bound result 3126960748
Bound result 10
[PASS] test_add_fuzz_single_asset(uint256,address,uint256) (runs: 5, μ: 342283, ~: 342387)
Logs:
Bound result 2
Bound result 1466075083157903748843
[PASS] test_add_fuzz_single_spoke_multi_add(uint256,uint256) (runs: 5, μ: 804944, ~: 805253)
Logs:
Bound result 72003609882796634652662230263
Bound result 9230
[PASS] test_add_multi_add_minimal_shares() (gas: 322520)
[PASS] test_add_revertsWith_AmountDowncastOverflow() (gas: 360306)
[PASS] test_add_revertsWith_InsufficientTransferred() (gas: 64504)
[PASS] test_add_revertsWith_InvalidAmount() (gas: 13631)
[PASS] test_add_revertsWith_InvalidShares() (gas: 223458)
[PASS] test_add_revertsWith_SharesDowncastOverflow() (gas: 224358)
[PASS] test_add_revertsWith_SpokeHalted() (gas: 99705)
[PASS] test_add_revertsWith_SpokeNotActive() (gas: 99741)
[PASS] test_add_single_asset() (gas: 330255)
Logs:
Bound result 2
Bound result 100000000000000000000
[PASS] test_add_with_increased_index() (gas: 301312)
[PASS] test_add_with_increased_index_with_premium() (gas: 680739)
Suite result: ok. 19 passed; 0 failed; 0 skipped; finished in 616.02ms (592.06ms CPU time)
Ran 3 tests for tests/unit/Hub/Hub.Rescue.t.sol:HubRescueTest
[PASS] test_cannot_rescue_liquidity_fee_reverts_with_InsufficientTransferred() (gas: 274449)
[PASS] test_rescue_fuzz_with_interest(uint256,uint256) (runs: 5, μ: 514528, ~: 514606)
Logs:
Bound result 214006557
Bound result 2
[PASS] test_rescue_scenario_fuzz(uint256) (runs: 5, μ: 454104, ~: 454011)
Logs:
Bound result 9610
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 184.55ms (160.67ms CPU time)
Ran 8 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationAmounts.t.sol:LiquidationLogicLiquidationAmountsTest
[PASS] test_calculateLiquidationAmounts_EnoughCollateral() (gas: 169813)
[PASS] test_calculateLiquidationAmounts_InsufficientCollateral() (gas: 170541)
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_CollateralDust((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 278776, ~: 278072)
Logs:
Bound result 365448755728163590
Bound result 24
Bound result 69965119113623865
Bound result 11473
Bound result 9
Bound result 476064849280271667429369734467949596086748031206405307828953139284
Bound result 11473
Bound result 5391
Bound result 1049767079792608675
Bound result 69965119113623865
Bound result 3307148893
Bound result 12
Bound result 95588826644
Bound result 80977496854448293501980409439
Bound result 149594988585848
Bound result 302375258070970
Bound result 6491011603397232
Bound result 8
Bound result 9998
Bound result 879212170809003673237450766514
Bound result 4
Bound result 6491011603397232
Bound result 19109732003961
Bound result 115792089237316195423570985008687907853269984665640564039457584007913129639935
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_NoCollateralDust((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 231916, ~: 231760)
Logs:
Bound result 365448755728163590
Bound result 24
Bound result 69965119113623865
Bound result 11473
Bound result 9
Bound result 476064849280271667429369734467949596086748031206405307828953139284
Bound result 11473
Bound result 5391
Bound result 1049767079792608675
Bound result 69965119113623865
Bound result 3307148893
Bound result 12
Bound result 95588826644
Bound result 80977496854448293501980409439
Bound result 149594988585848
Bound result 302375258070970
Bound result 6491011603397232
Bound result 8
Bound result 9998
Bound result 879212170809003673237450766514
Bound result 4
Bound result 879212170809003673237450766514
Bound result 95588826644
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_NoDebtLeft((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 251786, ~: 251425)
Logs:
Bound result 365448755728163590
Bound result 24
Bound result 69965119113623865
Bound result 11473
Bound result 9
Bound result 476064849280271667429369734467949596086748031206405307828953139284
Bound result 11473
Bound result 5391
Bound result 1049767079792608675
Bound result 69965119113623865
Bound result 3307148893
Bound result 12
Bound result 95588826644
Bound result 80977496854448293501980409439
Bound result 149594988585848
Bound result 302375258070970
Bound result 6491011603397232
Bound result 8
Bound result 9998
Bound result 879212170809003673237450766514
Bound result 4
Bound result 476064849280271667429369734467949596086748031206405307828953139284
Bound result 11473
Bound result 5391
Bound result 1049767079792608675
Bound result 69965119113623865
Bound result 3307148893
Bound result 12
Bound result 95588826644
Bound result 80977496854448293501980409439
Bound result 149594988585848
Bound result 302375258070970
Bound result 3307148893
Bound result 14547727928
Bound result 879212170809003673237450766514
Bound result 115792089237316195423570985008687907853269984665640564039457584006578315812069
[PASS] test_calculateLiquidationAmounts_fuzz_InsufficientCollateral((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 238390, ~: 237454)
Logs:
Bound result 951096458009547743
Bound result 2412
Bound result 45
Bound result 13217
Bound result 18
Bound result 494879001284116745852788561806595862296592815911323639013959996872
Bound result 13217
Bound result 4395
Bound result 1406481229805706073
Bound result 45
Bound result 6019478411443837
Bound result 14
Bound result 251970229710981144461863810869
Bound result 75130604611008540399360329147
Bound result 1358713569
Bound result 13947926608
Bound result 3859280546598232
Bound result 12
Bound result 2178
Bound result 79909947322720505262
Bound result 2
Bound result 96620
Bound result 251970229710981144461863810869
[PASS] test_calculateLiquidationAmounts_fuzz_revertsWith_MustNotLeaveDust_Collateral((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 261196, ~: 260374)
Logs:
Bound result 365448755728163590
Bound result 24
Bound result 69965119113623865
Bound result 11473
Bound result 9
Bound result 476064849280271667429369734467949596086748031206405307828953139284
Bound result 11473
Bound result 5391
Bound result 1049767079792608675
Bound result 69965119113623865
Bound result 3307148893
Bound result 12
Bound result 95588826644
Bound result 80977496854448293501980409439
Bound result 149594988585848
Bound result 302375258070970
Bound result 6491011603397232
Bound result 8
Bound result 9998
Bound result 879212170809003673237450766514
Bound result 4
Bound result 6491011603397232
Bound result 19109732003961
Bound result 115792089237316195423570985008687907853269984665640564039457584007913129639935
[PASS] test_calculateLiquidationAmounts_fuzz_revertsWith_MustNotLeaveDust_Debt((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5, μ: 243428, ~: 242537)
Logs:
Bound result 365448755728163590
Bound result 24
Bound result 69965119113623865
Bound result 11473
Bound result 9
Bound result 476064849280271667429369734467949596086748031206405307828953139284
Bound result 11473
Bound result 5391
Bound result 1049767079792608675
Bound result 69965119113623865
Bound result 3307148893
Bound result 12
Bound result 95588826644
Bound result 80977496854448293501980409439
Bound result 149594988585848
Bound result 302375258070970
Bound result 6491011603397232
Bound result 8
Bound result 9998
Bound result 879212170809003673237450766514
Bound result 4
Bound result 476064849280271667429369734467949596086748031206405307828953139284
Bound result 11473
Bound result 5391
Bound result 1049767079792608675
Bound result 69965119113623865
Bound result 3307148893
Bound result 12
Bound result 95588826644
Bound result 80977496854448293501980409439
Bound result 149594988585848
Bound result 302375258070970
Bound result 3307148893
Bound result 14547727928
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 591.17ms (567.62ms CPU time)
Ran 23 tests for tests/unit/Hub/Hub.Restore.t.sol:HubRestoreTest
[PASS] test_restore_full_amount_with_interest() (gas: 363934)
Logs:
Bound result 1000000000000000000000
Bound result 500000000000000000000
Bound result 31536000
[PASS] test_restore_full_amount_with_interest_and_premium() (gas: 673926)
Logs:
Bound result 100000000000000000000
Bound result 50000000000000000000
Bound result 31536000
Bound result 1
[PASS] test_restore_fuzz_full_amount_with_interest(uint256,uint256,uint256) (runs: 5, μ: 365624, ~: 366034)
Logs:
Bound result 319405028386003002998
Bound result 198441614500191239054
Bound result 4896747
[PASS] test_restore_fuzz_full_amount_with_interest_and_premium(uint256,uint256,uint256,uint256) (runs: 5, μ: 660019, ~: 675987)
Logs:
Bound result 240336
Bound result 189664
Bound result 685180691
Bound result 54667
[PASS] test_restore_fuzz_revertsWith_SurplusDrawnRestored_with_interest(uint256,uint256,uint256) (runs: 5, μ: 248067, ~: 248477)
Logs:
Bound result 319405028386003002998
Bound result 198441614500191239054
Bound result 4896747
[PASS] test_restore_fuzz_revertsWith_SurplusDrawnRestored_with_interest_and_premium(uint256,uint256,uint256,uint256) (runs: 5, μ: 638765, ~: 638813)
Logs:
Bound result 240336
Bound result 189664
Bound result 685180691
Bound result 54667
[PASS] test_restore_one_share_delta_increase_revertsWith_InvalidPremiumChange() (gas: 214789)
[PASS] test_restore_partial_drawn() (gas: 325588)
[PASS] test_restore_partial_same_block() (gas: 325714)
[PASS] test_restore_premiumDeltas_twoWeiIncrease_realizedDelta() (gas: 235510)
[PASS] test_restore_revertsWith_InsufficientTransferred() (gas: 255301)
[PASS] test_restore_revertsWith_InvalidAmount_zero() (gas: 58002)
[PASS] test_restore_revertsWith_InvalidPremiumChange_premiumIncrease() (gas: 221754)
[PASS] test_restore_revertsWith_InvalidPremiumChange_premiumSharesIncrease() (gas: 221754)
[PASS] test_restore_revertsWith_SpokeHalted() (gas: 99191)
[PASS] test_restore_revertsWith_SpokeNotActive_whenPaused() (gas: 181319)
[PASS] test_restore_revertsWith_SurplusDrawnRestored() (gas: 364429)
[PASS] test_restore_revertsWith_SurplusDrawnRestored_with_interest() (gas: 246420)
Logs:
Bound result 100000000000000000000
Bound result 50000000000000000000
Bound result 15768000
[PASS] test_restore_revertsWith_SurplusDrawnRestored_with_interest_and_premium() (gas: 636775)
Logs:
Bound result 100000000000000000000
Bound result 50000000000000000000
Bound result 31536000
Bound result 1
[PASS] test_restore_revertsWith_SurplusPremiumRayRestored() (gas: 527044)
[PASS] test_restore_revertsWith_underflow_offsetIncrease() (gas: 230611)
[PASS] test_restore_tooMuchDrawn_revertsWith_SurplusDrawnRestored() (gas: 217195)
[PASS] test_restore_when_asset_caps_reset() (gas: 438513)
Suite result: ok. 23 passed; 0 failed; 0 skipped; finished in 373.14ms (348.06ms CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationBonus.t.sol:LiquidationLogicLiquidationBonusTest
[PASS] test_calculateLiquidationBonus_MinBonusDueToRounding() (gas: 12466)
[PASS] test_calculateLiquidationBonus_PartialBonus() (gas: 12487)
[PASS] test_calculateLiquidationBonus_fuzz_ConstantBonus(uint256,uint256,uint256,uint256) (runs: 5, μ: 20479, ~: 20768)
Logs:
Bound result 240336
Bound result 2682
Bound result 715740573453180691
Bound result 12699
[PASS] test_calculateLiquidationBonus_fuzz_MaxBonus(uint256,uint256,uint256,uint256) (runs: 5, μ: 23413, ~: 23710)
Logs:
Bound result 240336
Bound result 2682
Bound result 715740573453180691
Bound result 12699
Bound result 212406
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 203.21ms (179.83ms CPU time)
Ran 11 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.ValidateLiquidationCall.t.sol:LiquidationLogicValidateLiquidationCallTest
[PASS] test_validateLiquidationCall() (gas: 26036)
[PASS] test_validateLiquidationCall_revertsWith_CannotReceiveShares() (gas: 259738)
[PASS] test_validateLiquidationCall_revertsWith_HealthFactorNotBelowThreshold() (gas: 31769)
[PASS] test_validateLiquidationCall_revertsWith_InvalidDebtToCover() (gas: 26861)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotBorrowed() (gas: 26980)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotEnabledAsCollateral_NotUsingAsCollateral() (gas: 27033)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotEnabledAsCollateral_ZeroCollateralFactor() (gas: 27018)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotSupplied() (gas: 26947)
[PASS] test_validateLiquidationCall_revertsWith_ReservePaused_CollateralPaused() (gas: 31989)
[PASS] test_validateLiquidationCall_revertsWith_ReservePaused_DebtPaused() (gas: 31989)
[PASS] test_validateLiquidationCall_revertsWith_SelfLiquidation() (gas: 33724)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 25.20ms (1.45ms CPU time)
Ran 28 tests for tests/unit/MathUtils.t.sol:MathUtilsTest
[PASS] test_add_edge_cases() (gas: 4679)
[PASS] test_add_negative_operand(uint256,int256) (runs: 5, μ: 9018, ~: 8816)
Logs:
Bound result -347324752816465037774479
[PASS] test_add_positive_operand(uint256,int256) (runs: 5, μ: 3916, ~: 3916)
[PASS] test_calculateLinearInterest() (gas: 4368)
[PASS] test_calculateLinearInterest_add_edge() (gas: 4890)
[PASS] test_calculateLinearInterest_edge_cases() (gas: 16246)
Logs:
Bound result 0
Bound result 1
Bound result 864000000
Bound result 864000000
[PASS] test_calculateLinearInterest_reverts_on_past_timestamp(uint40) (runs: 5, μ: 7790, ~: 8063)
Logs:
Bound result 1072
[PASS] test_constants() (gas: 3110)
[PASS] test_fuzz_calculateLinearInterest(uint96,uint40,uint256) (runs: 5, μ: 8551, ~: 8824)
Logs:
Bound result 4896747
[PASS] test_fuzz_divUp(uint256,uint256) (runs: 5, μ: 3544, ~: 3544)
[PASS] test_fuzz_mulDivDown(uint256,uint256,uint256) (runs: 5, μ: 3476, ~: 3409)
[PASS] test_fuzz_mulDivUp(uint256,uint256,uint256) (runs: 5, μ: 3509, ~: 3367)
[PASS] test_min(uint256,uint256) (runs: 5, μ: 3281, ~: 3282)
[PASS] test_mulDivDown_NoRemainder() (gas: 3223)
[PASS] test_mulDivDown_RevertOnDivByZero() (gas: 3107)
[PASS] test_mulDivDown_RevertOnOverflow() (gas: 3183)
[PASS] test_mulDivDown_WithRemainder() (gas: 3268)
[PASS] test_mulDivDown_ZeroAOrB() (gas: 3721)
[PASS] test_mulDivUp_NoRemainder() (gas: 3249)
[PASS] test_mulDivUp_RevertOnDivByZero() (gas: 3084)
[PASS] test_mulDivUp_RevertOnOverflow() (gas: 3140)
[PASS] test_mulDivUp_WithRemainder() (gas: 3248)
[PASS] test_mulDivUp_ZeroAOrB() (gas: 3792)
[PASS] test_signedSub(uint256,uint256) (runs: 5, μ: 8666, ~: 8530)
Logs:
Bound result 38088019639628816452705211337534894291302262850251721590154004630696097410295
Bound result 11762
[PASS] test_signedSub_revertsWith_SafeCastOverflowedUintToInt(uint256) (runs: 5, μ: 7702, ~: 7702)
Logs:
Bound result 57896044618658097711785492504343953926634992332820282019728792003956564821040
[PASS] test_uncheckedAdd(uint256,uint256) (runs: 5, μ: 3438, ~: 3438)
[PASS] test_uncheckedExp(uint256,uint256) (runs: 5, μ: 13023, ~: 9826)
[PASS] test_uncheckedSub(uint256,uint256) (runs: 5, μ: 3460, ~: 3526)
Suite result: ok. 28 passed; 0 failed; 0 skipped; finished in 920.69ms (908.42ms CPU time)
Ran 5 tests for tests/unit/Spoke/Spoke.AccrueLiquidityFee.EdgeCases.t.sol:SpokeAccrueLiquidityFeeEdgeCasesTest
[PASS] test_accrueLiquidityFee_fuzz_maxLiquidityFee_with_premium(uint256,uint256,uint256,uint256) (runs: 5, μ: 544695, ~: 544756)
Logs:
Bound result 70955
Bound result 685180691
Bound result 1
Bound result 45728715735036875056
[PASS] test_accrueLiquidityFee_fuzz_maxLiquidityFee_with_premium_multiple_users(uint256,uint256,uint256,uint256,uint256) (runs: 5, μ: 802934, ~: 803343)
Logs:
Bound result 67549
Bound result 800062139
Bound result 4
Bound result 89473879703452351689256785169
Bound result 47938669350974575399012617271
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_spoke() (gas: 645198830)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_user() (gas: 263612164)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_with_premium() (gas: 544488)
Logs:
Bound result 5000
Bound result 34560000
Bound result 2
Bound result 500000000000000000000
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 2.85s (2.82s CPU time)
Ran 38 tests for tests/unit/Hub/Hub.Config.t.sol:HubConfigTest
[PASS] test_addAsset_fuzz(address,uint8,address) (runs: 5, μ: 390338, ~: 390384)
Logs:
Bound result 18
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_feeReceiver(address,uint8,address) (runs: 5, μ: 45401, ~: 45674)
Logs:
Bound result 1
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_irStrategy(address,uint8,address) (runs: 5, μ: 45444, ~: 45717)
Logs:
Bound result 1
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_underlying(uint8,address,address) (runs: 5, μ: 36719, ~: 36719)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals(address,uint8,address,address) (runs: 5, μ: 45954, ~: 45986)
Logs:
Bound result 21
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals_tooLow(address,uint8,address,address) (runs: 5, μ: 46005, ~: 46157)
Logs:
Bound result 2
[PASS] test_addAsset_fuzz_reverts_InvalidIrData(address,uint8,address,address) (runs: 5, μ: 47422, ~: 34963)
Logs:
Bound result 2
[PASS] test_addAsset_revertsWith_BlockTimestampDowncastOverflow() (gas: 956634)
[PASS] test_addAsset_revertsWith_DrawnRateDowncastOverflow() (gas: 953770)
[PASS] test_addAsset_reverts_UnderlyingAlreadyListed() (gas: 48980)
[PASS] test_addSpoke_fuzz(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5, μ: 126702, ~: 126726)
Logs:
Bound result 2
[PASS] test_addSpoke_fuzz_revertsWith_AssetNotListed(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5, μ: 35235, ~: 35235)
Logs:
Bound result 14
[PASS] test_addSpoke_fuzz_revertsWith_InvalidAddress_spoke(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5, μ: 33955, ~: 33979)
Logs:
Bound result 2
[PASS] test_addSpoke_revertsWith_SpokeAlreadyListed() (gas: 39773)
[PASS] test_getAssetId() (gas: 73160)
[PASS] test_getAssetId_fuzz_revertsWith_AssetNotListed(address) (runs: 5, μ: 18561, ~: 18561)
[PASS] test_hub_deploy_reverts_on_InvalidConstructorInput() (gas: 828595)
[PASS] test_hub_max_riskPremium() (gas: 8610)
[PASS] test_isUnderlyingListed() (gas: 1178402)
[PASS] test_updateAssetConfig_NewFeeReceiver_noFees() (gas: 719381)
[PASS] test_updateAssetConfig_NewFeeReceiver_revertsWith_SpokeNotActive_noFees() (gas: 618740)
[PASS] test_updateAssetConfig_UseExistingSpokeAndListedAsFeeReceiver_revertsWith_SpokeAlreadyListed() (gas: 70708)
[PASS] test_updateAssetConfig_fuzz(uint256,(address,uint16,address,address)) (runs: 5, μ: 269745, ~: 269609)
Logs:
Bound result 2
Bound result 1805
[PASS] test_updateAssetConfig_fuzz_FromZeroLiquidityFee(uint256,uint16) (runs: 5, μ: 822086, ~: 822117)
Logs:
Bound result 5
Bound result 9216
Bound result 5
Bound result 0
Bound result 5
Bound result 9216
[PASS] test_updateAssetConfig_fuzz_LiquidityFee(uint256,uint16) (runs: 5, μ: 724479, ~: 724510)
Logs:
Bound result 5
Bound result 9216
Bound result 5
Bound result 9216
[PASS] test_updateAssetConfig_fuzz_NewFeeReceiver(uint256) (runs: 5, μ: 823698, ~: 823680)
Logs:
Bound result 0
Bound result 0
Bound result 1000
[PASS] test_updateAssetConfig_fuzz_NewInterestRateStrategy(uint256) (runs: 5, μ: 698298, ~: 698280)
Logs:
Bound result 0
[PASS] test_updateAssetConfig_fuzz_ReuseFeeReceiver_revertsWith_SpokeAlreadyListed(uint256) (runs: 5, μ: 875299, ~: 875281)
Logs:
Bound result 0
Bound result 0
Bound result 0
Bound result 1000
[PASS] test_updateAssetConfig_fuzz_Scenario(uint256) (runs: 5, μ: 700605, ~: 700605)
Logs:
Bound result 0
Bound result 0
Bound result 1000
Bound result 0
Bound result 1000
Bound result 0
Bound result 0
Bound result 0
Bound result 0
Bound result 0
Bound result 0
Bound result 0
Bound result 0
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidInterestRateStrategy(uint256) (runs: 5, μ: 61136, ~: 61136)
Logs:
Bound result 0
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidLiquidityFee(uint256,(address,uint16,address,address)) (runs: 5, μ: 40178, ~: 40042)
Logs:
Bound result 2
Bound result 1805
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidReinvestmentController() (gas: 485646)
[PASS] test_updateAssetConfig_fuzz_revertsWith_calculateInterestRateReverts(uint256,(address,uint16,address,address)) (runs: 5, μ: 199392, ~: 199256)
Logs:
Bound result 3
Bound result 1070
[PASS] test_updateAssetConfig_fuzz_revertsWith_setInterestRateDataReverts(uint256,(address,uint16,address,address)) (runs: 5, μ: 96293, ~: 96293)
Logs:
Bound result 3
Bound result 6818
[PASS] test_updateAssetConfig_oldFeeReceiver_flags() (gas: 880156)
Logs:
Bound result 1
Bound result 500
Bound result 3
Bound result 1000
Bound result 5
Bound result 500
Bound result 3
Bound result 1000
[PASS] test_updateSpokeConfig_fuzz(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5, μ: 59199, ~: 59164)
Logs:
Bound result 2
[PASS] test_updateSpokeConfig_fuzz_revertsWith_SpokeNotListed(uint256,address,(uint40,uint40,uint24,bool,bool)) (runs: 5, μ: 40531, ~: 40592)
Logs:
Bound result 3
[PASS] test_updateSpokeConfig_revertsWith_AssetNotListed() (gas: 29639)
Suite result: ok. 38 passed; 0 failed; 0 skipped; finished in 2.07s (2.04s CPU time)
Ran 7 tests for tests/unit/Spoke/Spoke.AccrueLiquidityFee.t.sol:SpokeAccrueLiquidityFeeTest
[PASS] test_accrueLiquidityFee() (gas: 862061)
[PASS] test_accrueLiquidityFee_NoActionTaken() (gas: 122076)
[PASS] test_accrueLiquidityFee_NoInterest_OnlySupply(uint40) (runs: 5, μ: 245513, ~: 245786)
Logs:
Bound result 10193
[PASS] test_accrueLiquidityFee_exact() (gas: 867969)
[PASS] test_accrueLiquidityFee_fuzz_BorrowAmountAndSkipTime(uint256,uint40) (runs: 5, μ: 922647, ~: 896857)
Logs:
Bound result 72003609882796634652662230263
Bound result 165174155
[PASS] test_accrueLiquidityFee_maxLiquidityFee() (gas: 545723)
[PASS] test_accrueLiquidityFee_setUsingAsCollateral() (gas: 894143)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 226.86ms (203.44ms CPU time)
Ran 40 tests for tests/unit/misc/NativeTokenGateway.t.sol:NativeTokenGatewayTest
[PASS] test_borrowNative() (gas: 664013)
Logs:
Bound result 5000000000000000000
[PASS] test_borrowNative_fuzz(uint256) (runs: 5, μ: 664473, ~: 664746)
Logs:
Bound result 7173026006516105215
[PASS] test_borrowNative_revertsWith_InvalidAmount() (gas: 32360)
[PASS] test_borrowNative_revertsWith_NotNativeWrappedAsset() (gas: 32435)
[PASS] test_borrowNative_revertsWith_ReentrancyGuardReentrantCall_hubDraw() (gas: 282993)
[PASS] test_borrowNative_revertsWith_ReentrancyGuardReentrantCall_spokeBorrow() (gas: 271094)
[PASS] test_borrowNative_revertsWith_SpokeNotRegistered() (gas: 25340)
[PASS] test_constructor() (gas: 12715)
[PASS] test_constructor_revertsWith_InvalidAddress() (gas: 5958)
[PASS] test_fallback_revertsWith_UnsupportedAction() (gas: 17616)
[PASS] test_receive_revertsWith_UnsupportedAction() (gas: 17408)
[PASS] test_repayNative() (gas: 756350)
Logs:
Bound result 5000000000000000000
[PASS] test_repayNative_excessAmount() (gas: 664881)
[PASS] test_repayNative_fuzz(uint256) (runs: 5, μ: 756931, ~: 757081)
Logs:
Bound result 7173026006516105215
[PASS] test_repayNative_fuzz_withInterest(uint256,uint256) (runs: 5, μ: 690022, ~: 670962)
Logs:
Bound result 49225183759147251094
Bound result 13078287
[PASS] test_repayNative_revertsWith_InvalidAmount() (gas: 32441)
[PASS] test_repayNative_revertsWith_NativeAmountMismatch() (gas: 30030)
[PASS] test_repayNative_revertsWith_NotNativeWrappedAsset() (gas: 39209)
[PASS] test_repayNative_revertsWith_ReentrancyGuardReentrantCall_hubRestore() (gas: 326137)
[PASS] test_repayNative_revertsWith_ReentrancyGuardReentrantCall_spokeRepay() (gas: 303215)
[PASS] test_repayNative_revertsWith_SpokeNotRegistered() (gas: 38728)
[PASS] test_supplyAndCollateralNative() (gas: 333348)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyAndCollateralNative_fuzz(uint256) (runs: 5, μ: 333785, ~: 334058)
Logs:
Bound result 842782220917173026006516105215
[PASS] test_supplyNative() (gas: 305086)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyNative_fuzz(uint256) (runs: 5, μ: 305522, ~: 305795)
Logs:
Bound result 842782220917173026006516105215
[PASS] test_supplyNative_revertsWith_InvalidAmount() (gas: 32395)
[PASS] test_supplyNative_revertsWith_NativeAmountMismatch() (gas: 30014)
[PASS] test_supplyNative_revertsWith_NotNativeWrappedAsset() (gas: 39175)
[PASS] test_supplyNative_revertsWith_ReentrancyGuardReentrantCall_hubAdd() (gas: 374132)
[PASS] test_supplyNative_revertsWith_ReentrancyGuardReentrantCall_spokeSupply() (gas: 336089)
[PASS] test_supplyNative_revertsWith_SpokeNotRegistered() (gas: 38740)
[PASS] test_withdrawNative() (gas: 331730)
Logs:
Bound result 100000000000000000000
[PASS] test_withdrawNative_fuzz(uint256) (runs: 5, μ: 332211, ~: 332484)
Logs:
Bound result 842782220917173026006516105215
[PASS] test_withdrawNative_fuzz_allBalance(uint256) (runs: 5, μ: 268063, ~: 268255)
Logs:
Bound result 842782220917173026006516105215
[PASS] test_withdrawNative_fuzz_allBalanceWithInterest(uint256,uint256) (runs: 5, μ: 615156, ~: 614942)
Logs:
Bound result 400985017566938267345569888285
Bound result 161398005380967383844021014975
[PASS] test_withdrawNative_revertsWith_InvalidAmount() (gas: 32457)
[PASS] test_withdrawNative_revertsWith_NotNativeWrappedAsset() (gas: 32490)
[PASS] test_withdrawNative_revertsWith_ReentrancyGuardReentrantCall_hubRemove() (gas: 299966)
[PASS] test_withdrawNative_revertsWith_ReentrancyGuardReentrantCall_spokeWithdraw() (gas: 271156)
[PASS] test_withdrawNative_revertsWith_SpokeNotRegistered() (gas: 25395)
Suite result: ok. 40 passed; 0 failed; 0 skipped; finished in 744.15ms (720.39ms CPU time)
Ran 3 tests for tests/unit/NoncesKeyed.t.sol:NoncesKeyedTest
[PASS] test_useCheckedNonce_monotonic(bytes32) (runs: 5, μ: 12863, ~: 12863)
[PASS] test_useCheckedNonce_revertsWith_InvalidAccountNonce(bytes32) (runs: 5, μ: 113826, ~: 135841)
[PASS] test_useNonce_monotonic(bytes32) (runs: 5, μ: 13531, ~: 13531)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 27.40ms (25.43ms CPU time)
Ran 10 tests for tests/unit/PercentageMath.t.sol:PercentageMathTests
[PASS] test_constants() (gas: 8604)
[PASS] test_fromBpsDown() (gas: 9654)
[PASS] test_percentDiv() (gas: 14993)
[PASS] test_percentDivUp_ge_value(uint256,uint256) (runs: 5, μ: 15200, ~: 15261)
Logs:
Bound result 34
Bound result 4001489475519777892714368177441398361764893722540077576405250493469071667
[PASS] test_percentDivUp_le_value(uint256,uint256) (runs: 5, μ: 15619, ~: 15347)
Logs:
Bound result 90035
Bound result 158043496892361332228536126589354016571387317550164480032517780550211133
[PASS] test_percentDiv_fuzz(uint256,uint256) (runs: 5, μ: 12485, ~: 12760)
[PASS] test_percentMul() (gas: 14932)
[PASS] test_percentMulUp_ge_value(uint256,uint256) (runs: 5, μ: 15602, ~: 15330)
Logs:
Bound result 90035
Bound result 158043496892361332228536126589354016571387317550164480032517780550211133
[PASS] test_percentMulUp_le_value(uint256,uint256) (runs: 5, μ: 15203, ~: 15264)
Logs:
Bound result 34
Bound result 4001489475519777892714368177441398361764893722540077576405250493469071667
[PASS] test_percentMul_fuzz(uint256,uint256) (runs: 5, μ: 11480, ~: 12063)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 51.97ms (51.62ms CPU time)
Ran 5 tests for tests/unit/Spoke/Spoke.Borrow.EdgeCases.t.sol:SpokeBorrowEdgeCasesTest
[PASS] test_borrow_fuzz_rounding_effect(uint256,uint256) (runs: 5, μ: 1043025, ~: 1043162)
Logs:
Bound result 72003609882796634652662230263
Bound result 13760
[PASS] test_borrow_fuzz_rounding_effect_inflated_ex_rate(uint256,uint256,uint256) (runs: 5, μ: 1416221, ~: 1416532)
Logs:
Bound result 43313684148191607974964
Bound result 999999999999999999999997
Bound result 389169995
[PASS] test_borrow_fuzz_rounding_effect_shares(uint256,uint256) (runs: 5, μ: 1085124, ~: 1084988)
Logs:
Bound result 72003609882796634652662230263
Bound result 832477761
[PASS] test_borrow_rounding_effect_multiple_actions() (gas: 1145613)
[PASS] test_borrow_rounding_effect_shares() (gas: 1084250)
Logs:
Bound result 5000000000000000000
Bound result 94608000
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 360.80ms (322.12ms CPU time)
Ran 16 tests for tests/unit/Hub/Hub.Draw.t.sol:HubDrawTest
[PASS] test_draw_DifferentSpokes() (gas: 355531)
[PASS] test_draw_fuzz_IncreasedBorrowRate(uint256,uint256) (runs: 5, μ: 696673, ~: 696543)
Logs:
Bound result 3
Bound result 9918
[PASS] test_draw_fuzz_amounts_same_block(uint256,uint256) (runs: 5, μ: 288995, ~: 288867)
Logs:
Bound result 3
Bound result 9918
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded(uint40) (runs: 5, μ: 82420, ~: 82284)
Logs:
Bound result 8590
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5, μ: 287054, ~: 286782)
Logs:
Bound result 476358262
Bound result 75862
Bound result 4896747
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity(uint256,uint256) (runs: 5, μ: 34588, ~: 34512)
Logs:
Bound result 3
Bound result 9918
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_draw(uint256) (runs: 5, μ: 172628, ~: 172492)
Logs:
Bound result 8590
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_remove(uint256) (runs: 5, μ: 134387, ~: 134293)
Logs:
Bound result 8590
[PASS] test_draw_fuzz_revertsWith_InvalidAddress(uint256) (runs: 5, μ: 16138, ~: 16138)
[PASS] test_draw_revertsWith_DrawCapExceeded_due_to_deficit() (gas: 270488)
[PASS] test_draw_revertsWith_InsufficientLiquidity() (gas: 28289)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_draw() (gas: 169103)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_remove() (gas: 131632)
[PASS] test_draw_revertsWith_InvalidAmount() (gas: 16269)
[PASS] test_draw_revertsWith_SpokeHalted() (gas: 61452)
[PASS] test_draw_revertsWith_SpokeNotActive() (gas: 61391)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 781.05ms (744.92ms CPU time)
Ran 8 tests for tests/unit/Hub/Hub.EliminateDeficit.t.sol:HubEliminateDeficitTest
[PASS] test_eliminateDeficit(uint256) (runs: 5, μ: 663609, ~: 663609)
[PASS] test_eliminateDeficit_fuzz_revertsWith_AccessManagedUnauthorized(address) (runs: 5, μ: 32580, ~: 32580)
[PASS] test_eliminateDeficit_fuzz_revertsWith_ArithmeticUnderflow_CallerSpokeNoFunds(uint256) (runs: 5, μ: 352008, ~: 352008)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountNoDeficit() (gas: 36025)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountWithDeficit() (gas: 348183)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_on_UnregisteredCoveredSpoke() (gas: 36412)
[PASS] test_eliminateDeficit_revertsWith_SpokeNotActive_on_UnregisteredAsset() (gas: 384005)
[PASS] test_eliminateDeficit_revertsWith_callerSpokeNotActive() (gas: 159412)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 282.66ms (252.30ms CPU time)
Ran 6 tests for tests/unit/Hub/Hub.MintFeeShares.t.sol:HubMintFeeSharesTest
[PASS] test_mintFeeShares() (gas: 311928)
[PASS] test_mintFeeShares_noFees() (gas: 367828)
[PASS] test_mintFeeShares_noShares() (gas: 293092)
[PASS] test_mintFeeShares_revertsWith_AccessManagedUnauthorized() (gas: 24139)
[PASS] test_mintFeeShares_revertsWith_AssetNotListed() (gas: 27553)
[PASS] test_mintFeeShares_revertsWith_SpokeNotActive() (gas: 242774)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 27.36ms (3.93ms CPU time)
Ran 9 tests for tests/gas/Hub.Operations.gas.t.sol:HubOperations_Gas_Tests
[PASS] test_add() (gas: 250800)
[PASS] test_deficit() (gas: 1302312)
[PASS] test_draw() (gas: 350873)
[PASS] test_mintFeeShares() (gas: 434125)
[PASS] test_payFee_transferShares() (gas: 897138)
[PASS] test_refreshPremium() (gas: 611359)
[PASS] test_remove() (gas: 313134)
[PASS] test_restore() (gas: 806628)
[PASS] test_restore_with_transfer() (gas: 807293)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 51.11ms (7.47ms CPU time)
Ran 14 tests for tests/gas/Spoke.Operations.gas.t.sol:SpokeOperations_Gas_Tests
[PASS] test_borrow() (gas: 1599148)
[PASS] test_liquidation_full() (gas: 10791359)
[PASS] test_liquidation_partial() (gas: 10790776)
[PASS] test_liquidation_receiveShares_full() (gas: 10756682)
[PASS] test_liquidation_receiveShares_partial() (gas: 10756101)
[PASS] test_liquidation_reportDeficit_full() (gas: 10800290)
[PASS] test_multicall_ops() (gas: 1675526)
[PASS] test_repay() (gas: 867164)
[PASS] test_setUserPositionManagersWithSig() (gas: 311532)
[PASS] test_supply() (gas: 563583)
[PASS] test_updateRiskPremium() (gas: 1275372)
[PASS] test_updateUserDynamicConfig() (gas: 588935)
[PASS] test_usingAsCollateral() (gas: 1386690)
[PASS] test_withdraw() (gas: 1888596)
Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 83.04ms (36.80ms CPU time)
Ran 14 tests for tests/gas/Spoke.Operations.gas.t.sol:SpokeOperations_ZeroRiskPremium_Gas_Tests
[PASS] test_borrow() (gas: 1339442)
[PASS] test_liquidation_full() (gas: 10690853)
[PASS] test_liquidation_partial() (gas: 10690270)
[PASS] test_liquidation_receiveShares_full() (gas: 10656176)
[PASS] test_liquidation_receiveShares_partial() (gas: 10655595)
[PASS] test_liquidation_reportDeficit_full() (gas: 10737211)
[PASS] test_multicall_ops() (gas: 1606383)
[PASS] test_repay() (gas: 791325)
[PASS] test_setUserPositionManagersWithSig() (gas: 315986)
[PASS] test_supply() (gas: 566264)
[PASS] test_updateRiskPremium() (gas: 937420)
[PASS] test_updateUserDynamicConfig() (gas: 593389)
[PASS] test_usingAsCollateral() (gas: 1077625)
[PASS] test_withdraw() (gas: 1587926)
Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 80.17ms (33.31ms CPU time)
Ran 17 tests for tests/unit/Spoke/Spoke.Borrow.HealthFactor.t.sol:SpokeBorrowHealthFactorTest
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_collateral_price_drop(uint256,uint256) (runs: 5, μ: 910506, ~: 910506)
Logs:
Bound result 11539
Bound result 72003609882796634652662230263
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_multiple_colls(uint256,uint256) (runs: 5, μ: 857276, ~: 857432)
Logs:
Bound result 29165
Bound result 24116
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_multiple_colls_with_interest(uint256,uint256,uint256) (runs: 5, μ: 893845, ~: 893644)
Logs:
Bound result 300
Bound result 5720
Bound result 19
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_multiple_debts(uint256,uint256) (runs: 5, μ: 1097552, ~: 1097767)
Logs:
Bound result 7283647803336944687374883
Bound result 99999999999000000000011540
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_multiple_debts_with_interest(uint256,uint256,uint256) (runs: 5, μ: 1137182, ~: 1137592)
Logs:
Bound result 870363970
Bound result 176202468386690180592058594679
Bound result 477101053
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_with_interest(uint256,uint256) (runs: 5, μ: 673073, ~: 672801)
Logs:
Bound result 1157
Bound result 11050
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold() (gas: 640860)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_collateral_price_drop_weth() (gas: 904756)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls() (gas: 851213)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_collateral_price_drop_dai() (gas: 1124858)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_collateral_price_drop_weth() (gas: 1124902)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_with_interest() (gas: 888653)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_debts() (gas: 1090007)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_debts_with_interest() (gas: 1128575)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_with_interest() (gas: 668189)
[PASS] test_fuzz_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_collateral_price_drop_dai(uint256,uint256,uint256) (runs: 5, μ: 1128648, ~: 1128343)
Logs:
Bound result 200000000
Bound result 177362147
Bound result 3333
[PASS] test_fuzz_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_collateral_price_drop_weth(uint256,uint256,uint256) (runs: 5, μ: 1129437, ~: 1129323)
Logs:
Bound result 200000000
Bound result 177362147
Bound result 3333
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 854.08ms (830.40ms CPU time)
Ran 4 tests for tests/unit/Spoke/Spoke.PermitReserve.t.sol:SpokePermitReserveTest
[PASS] test_permitReserve() (gas: 88227)
[PASS] test_permitReserve_forwards_correct_call() (gas: 35554)
[PASS] test_permitReserve_ignores_permit_reverts() (gas: 24390)
[PASS] test_permitReserve_revertsWith_ReserveNotListedIn() (gas: 22927)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 45.24ms (1.09ms CPU time)
Ran 10 tests for tests/unit/Spoke/Spoke.PositionManager.t.sol:SpokePositionManagerTest
[PASS] test_onlyPositionManager_on_borrow() (gas: 538159)
[PASS] test_onlyPositionManager_on_repay() (gas: 563162)
[PASS] test_onlyPositionManager_on_supply() (gas: 291492)
[PASS] test_onlyPositionManager_on_updateUserDynamicConfig() (gas: 1286437)
[PASS] test_onlyPositionManager_on_updateUserRiskPremium() (gas: 1523842)
[PASS] test_onlyPositionManager_on_usingAsCollateral() (gas: 144153)
[PASS] test_onlyPositionManager_on_withdraw() (gas: 320528)
[PASS] test_renouncePositionManagerRole() (gas: 20246)
[PASS] test_renouncePositionManagerRole_noop_from_disabled() (gas: 21860)
[PASS] test_setApprovalForPositionManager(bytes32) (runs: 5, μ: 18089, ~: 18089)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 115.86ms (89.41ms CPU time)
Ran 7 tests for tests/unit/Spoke/Spoke.Repay.EdgeCases.t.sol:SpokeRepayEdgeCaseTest
[PASS] test_fuzz_repay_effect_on_ex_rates(uint256,uint256) (runs: 5, μ: 700706, ~: 700658)
Logs:
Bound result 61535656045728715735036875056
Bound result 685180691
Bound result 136475009112242956586343982035
[PASS] test_rep...*[Comment body truncated]* |
♻️ Forge Gas Snapshots
🔕 Unchanged
|
Forge Build Sizes🔕 Unchanged
|
There was a problem hiding this comment.
i kinda don't agree w the premise of the pr, it was discussed before as well and the existing tests found a balance to the average user experience
this makes it for the unlikely worst case, ie only the first user in a block will experience this, every other user won't. for debugging & analysis i 100% agree this is the way to go but not sure overall about the goal. wdyt
There was a problem hiding this comment.
wouldn't the average user experience involve an accrue within each action? I think it's less likely that a user would interact at the same block as another, but perhaps not?
There was a problem hiding this comment.
depends on what we deem as the "canonical" user experience. Was discussing with Cheyenne, I feel like the user action with accrual included is that. It's kind of a ceiling vs floor gas cost.
but when we're looking at mintFeeShares, we can't evaluate it properly unless it includes an accrual action. At the moment it's simply not consistent in any way. I don't think it's a balance for avg UX, it's just kind of haphazard imo atm
mintFeeSharesfix to get a more representative view of gas changes associated with accrual actions