docs: Add DynamicConfiguration tech doc#1233
Open
CanonicalJP wants to merge 1 commit intodocs/tech-docsfrom
Open
docs: Add DynamicConfiguration tech doc#1233CanonicalJP wants to merge 1 commit intodocs/tech-docsfrom
CanonicalJP wants to merge 1 commit intodocs/tech-docsfrom
Conversation
Forge Build Sizes🔕 Unchanged
|
♻️ Forge Gas Snapshots🔕 Unchanged
|
🌈 Test ResultsNo files changed, compilation skipped
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateUser.t.sol:LiquidationLogicLiquidateUserTest
[PASS] test_liquidateUser() (gas: 369635)
[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 54.20ms (1.69ms 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: 5000, μ: 19885, ~: 20214)
Logs:
Bound result 1
[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: 5030210)
[PASS] test_setSpoke() (gas: 5058111)
[PASS] test_setSpoke_revertsWith_InvalidAddress() (gas: 10870)
[PASS] test_setSpoke_revertsWith_OnlyDeployer(address) (runs: 5000, μ: 13397, ~: 13397)
[PASS] test_setSpoke_revertsWith_SpokeAlreadySet() (gas: 15080)
Suite result: ok. 20 passed; 0 failed; 0 skipped; finished in 1.46s (1.43s CPU time)
Ran 6 tests for tests/unit/Spoke/Spoke.Getters.t.sol:SpokeGettersTest
[PASS] test_getLiquidationBonus_configured() (gas: 100816)
Logs:
Bound result 2
Bound result 1000000000000000000
Bound result 4000
Bound result 900000000000000000
[PASS] test_getLiquidationBonus_fuzz_configured(uint256,uint256,uint16,uint64) (runs: 5000, μ: 99640, ~: 99990)
Logs:
Bound result 2
Bound result 2154
Bound result 300
Bound result 446744073709551615
[PASS] test_getLiquidationBonus_fuzz_notConfigured(uint256,uint256) (runs: 5000, μ: 77595, ~: 77823)
Logs:
Bound result 4
Bound result 100
[PASS] test_getLiquidationBonus_notConfigured() (gas: 78811)
Logs:
Bound result 2
Bound result 1000000000000000000
[PASS] test_premiumRayGetters() (gas: 1532345)
[PASS] test_protocol_getters() (gas: 288396)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 2.96s (2.93s CPU time)
Ran 4 tests for tests/unit/Spoke/Liquidations/Spoke.LiquidationCall.Dust.t.sol:SpokeLiquidationCallDustTest
[PASS] test_collateralDust_min_debtToTarget() (gas: 17750446)
[PASS] test_debtToCover_exceeds_collateralValue() (gas: 17738563)
[PASS] test_dustColl_allowed() (gas: 17598961)
[PASS] test_dustDebt_allowed() (gas: 17729829)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 51.83ms (21.74ms CPU time)
Ran 13 tests for tests/unit/Spoke/Liquidations/Spoke.LiquidationCall.Scenarios.t.sol:SpokeLiquidationCallScenariosTest
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRefreshPremium() (gas: 25951869)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRemove() (gas: 25823524)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubReportDeficit() (gas: 25934643)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRestore() (gas: 25898930)
[PASS] test_liquidationCall_scenario1() (gas: 3855259)
[PASS] test_liquidationCall_scenario2() (gas: 3863585)
[PASS] test_liquidationCall_scenario3() (gas: 3332566)
[PASS] test_liquidationCall_scenario4() (gas: 27491077)
[PASS] test_liquidationCall_scenario5() (gas: 3470220)
[PASS] test_liquidationCall_scenario6() (gas: 2305391)
[PASS] test_liquidationCall_scenario7() (gas: 3049621)
[PASS] test_scenario_halted_asset() (gas: 26576257)
[PASS] test_scenario_halted_asset_with_deficit() (gas: 26419386)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 162.85ms (132.04ms CPU time)
Ran 20 tests for tests/unit/AccessManagerEnumerable.t.sol:AccessManagerEnumerableTest
[PASS] test_getRoleMembers_fuzz(uint256,uint256) (runs: 5000, μ: 1981604, ~: 1980422)
Logs:
Bound result 9
Bound result 10
[PASS] test_getRoleTargetSelectors_fuzz(uint256,uint256) (runs: 5000, μ: 1528895, ~: 1527977)
Logs:
Bound result 9
Bound result 10
[PASS] test_grantRole() (gas: 315853)
[PASS] test_grantRole_fuzz(uint64,uint256) (runs: 5000, μ: 916249, ~: 919819)
Logs:
Bound result 5
[PASS] test_renounceRole() (gas: 320971)
[PASS] test_renounceRole_shouldNotTrack() (gas: 24510)
[PASS] test_revokeRole() (gas: 323142)
[PASS] test_revokeRole_shouldNotTrack() (gas: 33091)
[PASS] test_setRoleAdmin_fuzz_trackAdminRoles_multipleRoles_multipleAdmins(uint256) (runs: 5000, μ: 2154528, ~: 2256960)
Logs:
Bound result 12
[PASS] test_setRoleAdmin_fuzz_trackRolesAndTrackAdminRoles_multipleRoles(uint256) (runs: 5000, μ: 1968816, ~: 2114243)
Logs:
Bound result 12
[PASS] test_setRoleAdmin_trackAdminOfRoles() (gas: 605988)
[PASS] test_setRoleAdmin_trackAdminOfRoles_changeAdminRole() (gas: 576953)
[PASS] test_setRoleAdmin_trackAdminRoles() (gas: 602234)
[PASS] test_setRoleAdmin_trackRolesAndTrackAdminRoles() (gas: 378157)
[PASS] test_setRoleGuardian_trackRoles() (gas: 263878)
[PASS] test_setTargetFunctionRole() (gas: 414440)
[PASS] test_setTargetFunctionRole_multipleTargets() (gas: 1103888)
[PASS] test_setTargetFunctionRole_removeTarget() (gas: 894968)
[PASS] test_setTargetFunctionRole_skipAddToAdminRole() (gas: 30951)
[PASS] test_setTargetFunctionRole_withReplace() (gas: 548994)
Suite result: ok. 20 passed; 0 failed; 0 skipped; finished in 22.62s (22.61s 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: 5000, μ: 24188, ~: 24330)
Logs:
Bound result 137
Bound result 252173843969976304268974536488
[PASS] test_calculateInterestRate_RightToKinkPoint(uint256) (runs: 5000, μ: 25302, ~: 25351)
Logs:
Bound result 8137
Bound result 252173843969976304268974536488
[PASS] test_calculateInterestRate_ZeroDebtZeroLiquidity() (gas: 18771)
Logs:
Bound result 0
[PASS] test_calculateInterestRate_fuzz_ZeroDebt(uint256) (runs: 5000, μ: 19077, ~: 18822)
Logs:
Bound result 3124043968137
[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 1.19s (1.18s CPU time)
Ran 6 tests for tests/unit/position-manager/libraries/ConfigPermissions.t.sol:ConfigPermissionsTests
[PASS] test_constants() (gas: 12052)
[PASS] test_getConfigPermissionValues(uint8) (runs: 5000, μ: 13682, ~: 13682)
[PASS] test_setCanSetUsingAsCollateral_fuzz(uint8,bool) (runs: 5000, μ: 10623, ~: 10611)
[PASS] test_setCanUpdateUserDynamicConfig_fuzz(uint8,bool) (runs: 5000, μ: 10602, ~: 10590)
[PASS] test_setCanUpdateUserRiskPremium_fuzz(uint8,bool) (runs: 5000, μ: 10612, ~: 10600)
[PASS] test_setFullPermissions_fuzz(bool) (runs: 5000, μ: 13124, ~: 13134)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 1.04s (1.04s CPU time)
Ran 8 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationAmounts.t.sol:LiquidationLogicLiquidationAmountsTest
[PASS] test_calculateLiquidationAmounts_EnoughCollateral() (gas: 166635)
[PASS] test_calculateLiquidationAmounts_InsufficientCollateral() (gas: 167363)
[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: 5000, μ: 285622, ~: 274626)
Logs:
Bound result 3
Bound result 2767
Bound result 443124196721905572
Bound result 14843
Bound result 8
Bound result 18
Bound result 13290
Bound result 5661
Bound result 1999999999999999997
Bound result 443124196721905572
Bound result 9304570613870847
Bound result 9
Bound result 999999999999999999999999999997
Bound result 1000000000000000000000000000
Bound result 28591
Bound result 54527
Bound result 6504484831365108
Bound result 7
Bound result 1109
Bound result 18850239771387979476210927906
Bound result 0
Bound result 6504484831365108
Bound result 26
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: 5000, μ: 240566, ~: 228814)
Logs:
Bound result 3
Bound result 2767
Bound result 443124196721905572
Bound result 14843
Bound result 8
Bound result 18
Bound result 13290
Bound result 5661
Bound result 1999999999999999997
Bound result 443124196721905572
Bound result 9304570613870847
Bound result 9
Bound result 999999999999999999999999999997
Bound result 1000000000000000000000000000
Bound result 28591
Bound result 54527
Bound result 6504484831365108
Bound result 7
Bound result 1109
Bound result 18850239771387979476210927906
Bound result 0
Bound result 18850239771387979476210927906
Bound result 999999999999999999999999999997
[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: 5000, μ: 259683, ~: 247899)
Logs:
Bound result 305647192271866193
Bound result 8596
Bound result 375151818457824964
Bound result 10660
Bound result 18
Bound result 3
Bound result 10650
Bound result 2
Bound result 1320660900608901589
Bound result 375151818457824964
Bound result 2459529247883382
Bound result 14
Bound result 688868459503709026022276783765
Bound result 35620419098526773228444064473
Bound result 30663477167
Bound result 40658186962
Bound result 3642834413111126
Bound result 12
Bound result 6498
Bound result 945630876467233914863016616547
Bound result 0
Bound result 3
Bound result 10650
Bound result 2
Bound result 1320660900608901589
Bound result 375151818457824964
Bound result 2459529247883382
Bound result 14
Bound result 688868459503709026022276783765
Bound result 35620419098526773228444064473
Bound result 30663477167
Bound result 40658186962
Bound result 2459529247883382
Bound result 678767
Bound result 945630876467233914863016616547
Bound result 688868459503709026022276783765
[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: 5000, μ: 245175, ~: 233980)
Logs:
Bound result 12743
Bound result 1568
Bound result 24024024024024025
Bound result 14875
Bound result 9
Bound result 34560000
Bound result 14776
Bound result 1098
Bound result 1999999999999500002
Bound result 24024024024024025
Bound result 7045
Bound result 12
Bound result 16395
Bound result 99000000000000000000000011969
Bound result 259200000
Bound result 800
Bound result 105737
Bound result 10
Bound result 8251
Bound result 600000000000000000000
Bound result 3
Bound result 20643006680
Bound result 999999999999999999978935877969
[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: 5000, μ: 268593, ~: 257087)
Logs:
Bound result 3886412
Bound result 2
Bound result 147
Bound result 12468
Bound result 6
Bound result 28951245481117846533722652
Bound result 12468
Bound result 3739
Bound result 1000109044247905327
Bound result 147
Bound result 1766670143596910
Bound result 14
Bound result 885000589634409638603543244567
Bound result 45625495039344622427514351693
Bound result 1
Bound result 45089934476
Bound result 9035404749081580
Bound result 15
Bound result 274
Bound result 471071379138868438154450132077
Bound result 5
Bound result 9035404749081580
Bound result 3252684925
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: 5000, μ: 251516, ~: 239652)
Logs:
Bound result 305647192271866193
Bound result 8596
Bound result 375151818457824964
Bound result 10660
Bound result 18
Bound result 3
Bound result 10650
Bound result 2
Bound result 1320660900608901589
Bound result 375151818457824964
Bound result 2459529247883382
Bound result 14
Bound result 688868459503709026022276783765
Bound result 35620419098526773228444064473
Bound result 30663477167
Bound result 40658186962
Bound result 3642834413111126
Bound result 12
Bound result 6498
Bound result 945630876467233914863016616547
Bound result 0
Bound result 3
Bound result 10650
Bound result 2
Bound result 1320660900608901589
Bound result 375151818457824964
Bound result 2459529247883382
Bound result 14
Bound result 688868459503709026022276783765
Bound result 35620419098526773228444064473
Bound result 30663477167
Bound result 40658186962
Bound result 2459529247883382
Bound result 678767
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 35.45s (35.42s CPU time)
Ran 35 tests for tests/unit/position-manager/ConfigPositionManager.t.sol:ConfigPositionManagerTest
[PASS] test_multicall() (gas: 84257)
[PASS] test_renounceCanUpdateUserDynamicConfigPermission() (gas: 41118)
[PASS] test_renounceCanUpdateUserDynamicConfigPermission_revertsWith_SpokeNotRegistered() (gas: 17401)
[PASS] test_renounceCanUpdateUserRiskPremiumPermission() (gas: 41172)
[PASS] test_renounceCanUpdateUserRiskPremiumPermission_revertsWith_SpokeNotRegistered() (gas: 17380)
[PASS] test_renounceCanUpdateUsingAsCollateralPermission() (gas: 41172)
[PASS] test_renounceCanUpdateUsingAsCollateralPermission_revertsWith_SpokeNotRegistered() (gas: 17380)
[PASS] test_renounceGlobalPermission() (gas: 42190)
[PASS] test_renounceGlobalPermission_revertsWith_SpokeNotRegistered() (gas: 17401)
[PASS] test_setCanUpdateUserDynamicConfigPermission() (gas: 53889)
[PASS] test_setCanUpdateUserDynamicConfigPermission_remove() (gas: 41184)
[PASS] test_setCanUpdateUserDynamicConfigPermission_revertsWith_SpokeNotRegistered() (gas: 17538)
[PASS] test_setCanUpdateUserRiskPremiumPermission() (gas: 53934)
[PASS] test_setCanUpdateUserRiskPremiumPermission_remove() (gas: 41220)
[PASS] test_setCanUpdateUserRiskPremiumPermission_revertsWith_SpokeNotRegistered() (gas: 17497)
[PASS] test_setCanUpdateUsingAsCollateralPermission() (gas: 53965)
[PASS] test_setCanUpdateUsingAsCollateralPermission_remove() (gas: 41217)
[PASS] test_setCanUpdateUsingAsCollateralPermission_revertsWith_SpokeNotRegistered() (gas: 17497)
[PASS] test_setGlobalPermission() (gas: 55559)
[PASS] test_setGlobalPermission_removeAllPermissions() (gas: 42238)
[PASS] test_setGlobalPermission_removePreviousPermissions() (gas: 46357)
[PASS] test_setGlobalPermission_revertsWith_SpokeNotRegistered() (gas: 17518)
[PASS] test_setGlobalPermission_setThenRemove() (gas: 49896)
[PASS] test_setUsingAsCollateralOnBehalfOf_fuzz_withGlobalPermission(uint256,bool) (runs: 5000, μ: 105661, ~: 110500)
Logs:
Bound result 2
[PASS] test_setUsingAsCollateralOnBehalfOf_fuzz_withPermission(uint256,bool) (runs: 5000, μ: 105653, ~: 110492)
Logs:
Bound result 2
[PASS] test_setUsingAsCollateralOnBehalfOf_revertsWith_CallerNotAllowed() (gas: 22195)
[PASS] test_setUsingAsCollateralOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 17540)
[PASS] test_updateUserDynamicConfigOnBehalfOf_revertsWith_CallerNotAllowed() (gas: 19886)
[PASS] test_updateUserDynamicConfigOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 17445)
[PASS] test_updateUserDynamicConfigOnBehalfOf_withGlobalPermission() (gas: 69691)
[PASS] test_updateUserDynamicConfigOnBehalfOf_withPermission() (gas: 69703)
[PASS] test_updateUserRiskPremiumOnBehalfOf_revertsWith_CallerNotAllowed() (gas: 19842)
[PASS] test_updateUserRiskPremiumOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 17380)
[PASS] test_updateUserRiskPremiumOnBehalfOf_withGlobalPermission() (gas: 801732)
[PASS] test_updateUserRiskPremiumOnBehalfOf_withPermission() (gas: 801766)
Suite result: ok. 35 passed; 0 failed; 0 skipped; finished in 10.03s (10.00s CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationBonus.t.sol:LiquidationLogicLiquidationBonusTest
[PASS] test_calculateLiquidationBonus_MinBonusDueToRounding() (gas: 12488)
[PASS] test_calculateLiquidationBonus_PartialBonus() (gas: 12509)
[PASS] test_calculateLiquidationBonus_fuzz_ConstantBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 20353, ~: 20128)
Logs:
Bound result 4305
Bound result 354
Bound result 7500000000000000
Bound result 14631
[PASS] test_calculateLiquidationBonus_fuzz_MaxBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 23297, ~: 23072)
Logs:
Bound result 4305
Bound result 354
Bound result 7500000000000000
Bound result 14631
Bound result 1090
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 1.19s (1.16s 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 28.53ms (1.61ms CPU time)
Ran 29 tests for tests/unit/MathUtils.t.sol:MathUtilsTest
[PASS] test_add_edge_cases() (gas: 4679)
[PASS] test_add_negative_operand(uint256,int256) (runs: 5000, μ: 9049, ~: 8812)
Logs:
Bound result -57896044618658097711785492504343953926634992332820282013197946218740589849150
[PASS] test_add_positive_operand(uint256,int256) (runs: 5000, μ: 3920, ~: 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: 5000, μ: 7544, ~: 7381)
Logs:
Bound result 9
[PASS] test_constants() (gas: 3133)
[PASS] test_fuzz_calculateLinearInterest(uint96,uint40,uint256) (runs: 5000, μ: 8587, ~: 8824)
Logs:
Bound result 10765498
[PASS] test_fuzz_divUp(uint256,uint256) (runs: 5000, μ: 3540, ~: 3544)
[PASS] test_fuzz_mulDivDown(uint256,uint256,uint256) (runs: 5000, μ: 3514, ~: 3577)
[PASS] test_fuzz_mulDivUp(uint256,uint256,uint256) (runs: 5000, μ: 3593, ~: 3724)
[PASS] test_min(uint256,uint256) (runs: 5000, μ: 3281, ~: 3281)
[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: 3272)
[PASS] test_mulDivUp_RevertOnDivByZero() (gas: 3084)
[PASS] test_mulDivUp_RevertOnOverflow() (gas: 3184)
[PASS] test_mulDivUp_WithRemainder() (gas: 3293)
[PASS] test_mulDivUp_ZeroAOrB() (gas: 3792)
[PASS] test_signedSub(uint256,uint256) (runs: 5000, μ: 8597, ~: 8530)
Logs:
Bound result 68691281934999
Bound result 100
[PASS] test_signedSub_revertsWith_SafeCastOverflowedUintToInt(uint256) (runs: 5000, μ: 7650, ~: 7702)
Logs:
Bound result 57896044618658097711785492504343953926634992332820282019728792007080608788105
[PASS] test_uncheckedAdd(uint256,uint256) (runs: 5000, μ: 3447, ~: 3438)
[PASS] test_uncheckedExp(uint256,uint256) (runs: 5000, μ: 12446, ~: 9768)
[PASS] test_uncheckedSub(uint256,uint256) (runs: 5000, μ: 3443, ~: 3362)
[PASS] test_zeroFloorSub(uint256,uint256) (runs: 5000, μ: 3290, ~: 3326)
Suite result: ok. 29 passed; 0 failed; 0 skipped; finished in 2.77s (2.76s CPU time)
Ran 21 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.InvalidSignature.t.sol:SignatureGatewayInvalidSignatureTest
[PASS] test_borrowWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 154991, ~: 154552)
[PASS] test_borrowWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39084)
[PASS] test_borrowWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37322)
[PASS] test_repayWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 154947, ~: 154508)
[PASS] test_repayWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39017)
[PASS] test_repayWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37344)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 154325, ~: 155416)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39067)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37411)
[PASS] test_supplyWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 155010, ~: 154571)
[PASS] test_supplyWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39084)
[PASS] test_supplyWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37376)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 141405, ~: 140132)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidSignatureDueTo_InvalidSigner() (gas: 25399)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 27083)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 141354, ~: 140081)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidSignatureDueTo_InvalidSigner() (gas: 25333)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 27032)
[PASS] test_withdrawWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 155011, ~: 154572)
[PASS] test_withdrawWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39126)
[PASS] test_withdrawWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37386)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 42.75s (42.72s CPU time)
Ran 7 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.SpokeNotRegistered.t.sol:SignatureGateway_SpokeNotRegistered_Test
[PASS] test_borrowWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13410, ~: 13410)
[PASS] test_repayWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13410, ~: 13410)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_SpokeNotRegistered((address,uint256,bool,address,uint256,uint256)) (runs: 5000, μ: 13401, ~: 13401)
[PASS] test_supplyWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13475, ~: 13475)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_SpokeNotRegistered((address,address,uint256,uint256)) (runs: 5000, μ: 13686, ~: 13686)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_SpokeNotRegistered((address,address,uint256,uint256)) (runs: 5000, μ: 13665, ~: 13665)
[PASS] test_withdrawWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13497, ~: 13497)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 16.23s (16.19s CPU time)
Ran 7 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.Unauthorized.t.sol:SignatureGateway_Unauthorized_PositionManagerActive_Test
[PASS] test_borrowWithSig_revertsWith_Unauthorized() (gas: 80414)
[PASS] test_repayWithSig_revertsWith_Unauthorized() (gas: 113529)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_Unauthorized() (gas: 72985)
[PASS] test_supplyWithSig_revertsWith_Unauthorized() (gas: 140065)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_Unauthorized() (gas: 81380)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_Unauthorized() (gas: 81469)
[PASS] test_withdrawWithSig_revertsWith_Unauthorized() (gas: 79447)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 29.78ms (4.45ms CPU time)
Ran 7 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.Unauthorized.t.sol:SignatureGateway_Unauthorized_PositionManagerNotActive_Test
[PASS] test_borrowWithSig_revertsWith_Unauthorized() (gas: 78206)
[PASS] test_repayWithSig_revertsWith_Unauthorized() (gas: 111321)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_Unauthorized() (gas: 70777)
[PASS] test_supplyWithSig_revertsWith_Unauthorized() (gas: 137857)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_Unauthorized() (gas: 79172)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_Unauthorized() (gas: 79261)
[PASS] test_withdrawWithSig_revertsWith_Unauthorized() (gas: 77239)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 29.45ms (4.25ms CPU time)
Ran 4 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.SetSelfAsUserPositionManagerWithSig.t.sol:SignatureGatewaySetSelfAsUserPositionManagerTest
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 140181)
[PASS] test_setSelfAsUserPositionManagerWithSig_forwards_correct_call() (gas: 32642)
[PASS] test_setSelfAsUserPositionManagerWithSig_ignores_underlying_spoke_reverts() (gas: 29661)
[PASS] test_setSelfAsUserPositionManagerWithSig_revertsWith_SpokeNotRegistered() (gas: 16473)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 25.59ms (1.20ms CPU time)
Ran 14 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.t.sol:SignatureGatewayTest
[PASS] test_borrowWithSig() (gas: 812065)
[PASS] test_multicall() (gas: 628738)
[PASS] test_multicall_atomicity_on_revert() (gas: 523532)
[PASS] test_multicall_no_atomicity_with_trycatch() (gas: 625435)
[PASS] test_renouncePositionManagerRole() (gas: 27532)
[PASS] test_renouncePositionManagerRole_revertsWith_OnlyOwner() (gas: 18068)
[PASS] test_repayWithSig() (gas: 815676)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 330140)
[PASS] test_setUsingAsCollateralWithSig() (gas: 631699)
[PASS] test_supplyWithSig() (gas: 601458)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 340321)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 1029233)
[PASS] test_useNonce_monotonic(bytes32) (runs: 5000, μ: 13323, ~: 13323)
[PASS] test_withdrawWithSig() (gas: 605099)
Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 473.50ms (448.58ms CPU time)
Ran 3 tests for tests/unit/Spoke/Spoke.Access.t.sol:SpokeAccessTest
[PASS] testAccess_change_authority() (gas: 536472)
[PASS] testAccess_hub_functions_callable_by_spokes() (gas: 569372)
[PASS] testAccess_spoke_admin_config_access() (gas: 513798)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 27.14ms (2.98ms CPU time)
Ran 3 tests for tests/unit/misc/ExtSload.t.sol:ExtSloadTest
[PASS] test_extSload(bytes32) (runs: 5000, μ: 9767, ~: 9767)
[PASS] test_extSloads(uint256) (runs: 5000, μ: 947070, ~: 908572)
Logs:
Bound result 812
[PASS] test_extSloads(uint256,bytes) (runs: 5000, μ: 1017504, ~: 977388)
Logs:
Bound result 362
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 60.40s (60.40s CPU time)
Ran 5 tests for tests/gas/Gateways.Operations.gas.t.sol:NativeTokenGateway_Gas_Tests
[PASS] test_borrowNative() (gas: 917958)
[PASS] test_repayNative() (gas: 989361)
[PASS] test_supplyAndCollateralNative() (gas: 305238)
[PASS] test_supplyNative() (gas: 286683)
[PASS] test_withdrawNative() (gas: 508844)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 49.13ms (4.29ms CPU time)
Ran 8 tests for tests/gas/Gateways.Operations.gas.t.sol:SignatureGateway_Gas_Tests
[PASS] test_borrowWithSig() (gas: 745219)
[PASS] test_repayWithSig() (gas: 953423)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 209293)
[PASS] test_setUsingAsCollateralWithSig() (gas: 289353)
[PASS] test_supplyWithSig() (gas: 434276)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 145250)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 143115)
[PASS] test_withdrawWithSig() (gas: 409926)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 53.14ms (8.04ms CPU time)
Ran 41 tests for tests/unit/position-manager/NativeTokenGateway.t.sol:NativeTokenGatewayTest
[PASS] test_borrowNative() (gas: 664107)
Logs:
Bound result 5000000000000000000
[PASS] test_borrowNative_fuzz(uint256) (runs: 5000, μ: 663459, ~: 664840)
Logs:
Bound result 3124043968137
[PASS] test_borrowNative_revertsWith_InvalidAmount() (gas: 32444)
[PASS] test_borrowNative_revertsWith_NotNativeWrappedAsset() (gas: 32519)
[PASS] test_borrowNative_revertsWith_ReentrancyGuardReentrantCall_hubDraw() (gas: 283143)
[PASS] test_borrowNative_revertsWith_ReentrancyGuardReentrantCall_spokeBorrow() (gas: 271222)
[PASS] test_borrowNative_revertsWith_SpokeNotRegistered() (gas: 25378)
[PASS] test_constructor() (gas: 12697)
[PASS] test_constructor_revertsWith_InvalidAddress() (gas: 5958)
[PASS] test_fallback_revertsWith_UnsupportedAction() (gas: 17617)
[PASS] test_multicall_revertsWith_UnsupportedAction() (gas: 11243)
[PASS] test_receive_revertsWith_UnsupportedAction() (gas: 17408)
[PASS] test_repayNative() (gas: 756565)
Logs:
Bound result 5000000000000000000
[PASS] test_repayNative_excessAmount() (gas: 665118)
[PASS] test_repayNative_fuzz(uint256) (runs: 5000, μ: 751830, ~: 757198)
Logs:
Bound result 3124043968137
[PASS] test_repayNative_fuzz_withInterest(uint256,uint256) (runs: 5000, μ: 675886, ~: 671197)
Logs:
Bound result 90000068691281935000
Bound result 25920101
[PASS] test_repayNative_revertsWith_InvalidAmount() (gas: 32481)
[PASS] test_repayNative_revertsWith_NativeAmountMismatch() (gas: 30002)
[PASS] test_repayNative_revertsWith_NotNativeWrappedAsset() (gas: 39249)
[PASS] test_repayNative_revertsWith_ReentrancyGuardReentrantCall_hubRestore() (gas: 326265)
[PASS] test_repayNative_revertsWith_ReentrancyGuardReentrantCall_spokeRepay() (gas: 303321)
[PASS] test_repayNative_revertsWith_SpokeNotRegistered() (gas: 38722)
[PASS] test_supplyAndCollateralNative() (gas: 333552)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyAndCollateralNative_fuzz(uint256) (runs: 5000, μ: 333873, ~: 333580)
Logs:
Bound result 3124043968137
[PASS] test_supplyNative() (gas: 305246)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyNative_fuzz(uint256) (runs: 5000, μ: 305566, ~: 305273)
Logs:
Bound result 3124043968137
[PASS] test_supplyNative_revertsWith_InvalidAmount() (gas: 32457)
[PASS] test_supplyNative_revertsWith_NativeAmountMismatch() (gas: 29986)
[PASS] test_supplyNative_revertsWith_NotNativeWrappedAsset() (gas: 39237)
[PASS] test_supplyNative_revertsWith_ReentrancyGuardReentrantCall_hubAdd() (gas: 374260)
[PASS] test_supplyNative_revertsWith_ReentrancyGuardReentrantCall_spokeSupply() (gas: 336151)
[PASS] test_supplyNative_revertsWith_SpokeNotRegistered() (gas: 38734)
[PASS] test_withdrawNative() (gas: 331946)
Logs:
Bound result 100000000000000000000
[PASS] test_withdrawNative_fuzz(uint256) (runs: 5000, μ: 331367, ~: 331952)
Logs:
Bound result 3124043968137
[PASS] test_withdrawNative_fuzz_allBalance(uint256) (runs: 5000, μ: 268075, ~: 267868)
Logs:
Bound result 3124043968137
[PASS] test_withdrawNative_fuzz_allBalanceWithInterest(uint256,uint256) (runs: 5000, μ: 615054, ~: 614986)
Logs:
Bound result 68691281934999
Bound result 100
[PASS] test_withdrawNative_revertsWith_InvalidAmount() (gas: 32520)
[PASS] test_withdrawNative_revertsWith_NotNativeWrappedAsset() (gas: 32553)
[PASS] test_withdrawNative_revertsWith_ReentrancyGuardReentrantCall_hubRemove() (gas: 300096)
[PASS] test_withdrawNative_revertsWith_ReentrancyGuardReentrantCall_spokeWithdraw() (gas: 271286)
[PASS] test_withdrawNative_revertsWith_SpokeNotRegistered() (gas: 25435)
Suite result: ok. 41 passed; 0 failed; 0 skipped; finished in 68.81s (68.78s CPU time)
Ran 3 tests for tests/unit/NoncesKeyed.t.sol:NoncesKeyedTest
[PASS] test_useCheckedNonce_monotonic(bytes32) (runs: 5000, μ: 12902, ~: 12902)
[PASS] test_useCheckedNonce_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 95279, ~: 94374)
[PASS] test_useNonce_monotonic(bytes32) (runs: 5000, μ: 13570, ~: 13570)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 3.95s (3.95s 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: 5000, μ: 15135, ~: 15261)
Logs:
Bound result 100
Bound result 68691281934999
[PASS] test_percentDivUp_le_value(uint256,uint256) (runs: 5000, μ: 15348, ~: 15347)
Logs:
Bound result 90101
Bound result 68691281934999
[PASS] test_percentDiv_fuzz(uint256,uint256) (runs: 5000, μ: 12599, ~: 12760)
[PASS] test_percentMul() (gas: 14932)
[PASS] test_percentMulUp_ge_value(uint256,uint256) (runs: 5000, μ: 15331, ~: 15330)
Logs:
Bound result 90101
Bound result 68691281934999
[PASS] test_percentMulUp_le_value(uint256,uint256) (runs: 5000, μ: 15138, ~: 15264)
Logs:
Bound result 100
Bound result 68691281934999
[PASS] test_percentMul_fuzz(uint256,uint256) (runs: 5000, μ: 11524, ~: 12063)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 1.50s (1.49s CPU time)
Ran 17 tests for tests/unit/position-manager/PositionManagerBase.t.sol:PositionManagerBaseTest
[PASS] test_constructor() (gas: 17255)
[PASS] test_getReserveUnderlying_fuzz(uint256) (runs: 5000, μ: 36868, ~: 36925)
Logs:
Bound result 2
[PASS] test_getReserveUnderlying_revertsWith_ReserveNotListed() (gas: 25741)
[PASS] test_multicall() (gas: 73366)
[PASS] test_multicall_atomicity_on_revert() (gas: 48261)
[PASS] test_multicall_revertsWith_UnsupportedAction() (gas: 11221)
[PASS] test_permitReserveUnderlying() (gas: 128810)
[PASS] test_permitReserveUnderlying_forwards_correct_call() (gas: 78240)
[PASS] test_permitReserveUnderlying_ignores_permit_reverts() (gas: 67318)
[PASS] test_permitReserveUnderlying_revertsWith_ReserveNotListed() (gas: 58198)
[PASS] test_registerSpoke_fuzz(address) (runs: 5000, μ: 41775, ~: 41775)
[PASS] test_registerSpoke_revertsWith_InvalidAddress() (gas: 13110)
[PASS] test_registerSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 13816)
[PASS] test_registerSpoke_unregister() (gas: 36288)
[PASS] test_renouncePositionManagerRole() (gas: 65288)
[PASS] test_renouncePositionManagerRole_revertsWith_OwnableUnauthorizedAccount() (gas: 74479)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 131426)
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 1.02s (991.87ms CPU time)
Ran 10 tests for tests/unit/position-manager/libraries/PositionManagerEIP712Hash.t.sol:PositionManagerEIP712HashTest
[PASS] test_constants() (gas: 13419)
[PASS] test_hash_borrow_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6712, ~: 6712)
[PASS] test_hash_creditDelegation_fuzz((address,uint256,address,address,uint256,uint256,uint256)) (runs: 5000, μ: 4810, ~: 4810)
[PASS] test_hash_repay_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6690, ~: 6690)
[PASS] test_hash_setUsingAsCollateral_fuzz((address,uint256,bool,address,uint256,uint256)) (runs: 5000, μ: 7171, ~: 7171)
[PASS] test_hash_supply_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6711, ~: 6711)
[PASS] test_hash_updateUserDynamicConfig_fuzz((address,address,uint256,uint256)) (runs: 5000, μ: 6349, ~: 6349)
[PASS] test_hash_updateUserRiskPremium_fuzz((address,address,uint256,uint256)) (runs: 5000, μ: 6370, ~: 6370)
[PASS] test_hash_withdrawPermit_fuzz((address,uint256,address,address,uint256,uint256,uint256)) (runs: 5000, μ: 4832, ~: 4832)
[PASS] test_hash_withdraw_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6689, ~: 6689)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 5.15s (5.15s CPU time)
Ran 11 tests for tests/gas/PositionManagers.Operations.gas.t.sol:ConfigPositionManager_Gas_Tests
[PASS] test_renounceCanUpdateUserDynamicConfigPermission() (gas: 93123)
[PASS] test_renounceCanUpdateUserRiskPremiumPermission() (gas: 93210)
[PASS] test_renounceCanUpdateUsingAsCollateralPermission() (gas: 93212)
[PASS] test_renounceGlobalPermission() (gas: 93061)
[PASS] test_setCanUpdateUserDynamicConfigPermission() (gas: 69162)
[PASS] test_setCanUpdateUserRiskPremiumPermission() (gas: 69185)
[PASS] test_setCanUpdateUsingAsCollateralPermission() (gas: 69208)
[PASS] test_setGlobalPermission() (gas: 69143)
[PASS] test_setUsingAsCollateralOnBehalfOf_fuzz_withGlobalPermission() (gas: 144984)
[PASS] test_updateUserDynamicConfigOnBehalfOf_withGlobalPermission() (gas: 120671)
[PASS] test_updateUserRiskPremiumOnBehalfOf_withGlobalPermission() (gas: 710349)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 47.12ms (2.28ms CPU time)
Ran 2 tests for tests/gas/PositionManagers.Operations.gas.t.sol:GiverPositionManager_Gas_Tests
[PASS] test_repayOnBehalfOf() (gas: 918083)
[PASS] test_supplyOnBehalfOf() (gas: 282870)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 47.16ms (1.74ms CPU time)
Ran 1 test for tests/gas/PositionManagers.Operations.gas.t.sol:PositionManager_Gas_Tests
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 215901)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 44.72ms (704.74µs CPU time)
Ran 8 tests for tests/gas/PositionManagers.Operations.gas.t.sol:TakerPositionManager_Gas_Tests
[PASS] test_approveWithdraw() (gas: 69195)
[PASS] test_approveWithdrawWithSig() (gas: 155438)
[PASS] test_borrowOnBehalfOf() (gas: 762125)
[PASS] test_creditDelegation() (gas: 69162)
[PASS] test_delegateCreditWithSig() (gas: 155432)
[PASS] test_renounceCreditDelegation() (gas: 93655)
[PASS] test_renounceWithdrawAllowance() (gas: 93762)
[PASS] test_withdrawOnBehalfOf() (gas: 584219)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 47.03ms (3.42ms CPU time)
Ran 12 tests for tests/unit/position-manager/GiverPositionManager.t.sol:GiverPositionManagerTest
[PASS] test_multicall() (gas: 334953)
[PASS] test_repayOnBehalfOf() (gas: 638677)
Logs:
Bound result 50000000000000000000
[PASS] test_repayOnBehalfOf_fuzz(uint256) (runs: 5000, μ: 635500, ~: 638972)
Logs:
Bound result 3124043968137
[PASS] test_repayOnBehalfOf_fuzz_withInterest(uint256,uint256) (runs: 5000, μ: 569793, ~: 566114)
Logs:
Bound result 900000068691281935000
Bound result 25920101
[PASS] test_repayOnBehalfOf_maxRepay() (gas: 559930)
[PASS] test_repayOnBehalfOf_maxRepay_revertsWith_InvalidRepayAmount() (gas: 481533)
[PASS] test_repayOnBehalfOf_revertsWith_ReserveNotListed() (gas: 32389)
[PASS] test_repayOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 28767)
[PASS] test_supplyOnBehalfOf() (gas: 296643)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyOnBehalfOf_fuzz(uint256) (runs: 5000, μ: 296905, ~: 296693)
Logs:
Bound result 3124043968137
[PASS] test_supplyOnBehalfOf_revertsWith_ReserveNotListed() (gas: 32405)
[PASS] test_supplyOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 28794)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 28.82s (28.79s CPU time)
Ran 6 tests for tests/unit/Hub/Hub.Access.t.sol:HubAccessTest
[PASS] test_change_authority() (gas: 206679)
[PASS] test_change_role_responsibility() (gas: 121247)
[PASS] test_hub_access_manager_exposure() (gas: 13439)
[PASS] test_hub_admin_access() (gas: 1350377)
[PASS] test_migrate_role_responsibility() (gas: 708944)
[PASS] test_setInterestRateData_access() (gas: 102656)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 28.34ms (3.80ms CPU time)
Ran 19 tests for tests/unit/Hub/Hub.Add.t.sol:HubAddTest
[PASS] test_add_AddCapReachedButNotExceeded_rounding() (gas: 660714)
[PASS] test_add_fuzz_AddCapReachedButNotExceeded(uint40) (runs: 5000, μ: 157880, ~: 157837)
Logs:
Bound result 9
[PASS] test_add_fuzz_multi_asset_multi_spoke(uint256,uint256,uint256) (runs: 5000, μ: 332455, ~: 332622)
Logs:
Bound result 3
Bound result 218470873395738003579119570309
Bound result 446067553769140138733721804
[PASS] test_add_fuzz_revertsWith_AddCapExceeded(uint40) (runs: 5000, μ: 112436, ~: 112393)
Logs:
Bound result 9
[PASS] test_add_fuzz_revertsWith_AddCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 263826, ~: 263690)
Logs:
Bound result 1291
Bound result 1071208440522043736492
Bound result 173721804
[PASS] test_add_fuzz_revertsWith_InvalidShares_due_to_index(uint256,uint256,uint256) (runs: 5000, μ: 220660, ~: 220858)
Logs:
Bound result 812304564170498289808909601494
Bound result 1048131246
Bound result 3
[PASS] test_add_fuzz_single_asset(uint256,address,uint256) (runs: 5000, μ: 342377, ~: 342396)
Logs:
Bound result 4
Bound result 684
[PASS] test_add_fuzz_single_spoke_multi_add(uint256,uint256) (runs: 5000, μ: 785689, ~: 785711)
Logs:
Bound result 68691281934999
Bound result 100
[PASS] test_add_multi_add_minimal_shares() (gas: 316011)
[PASS] test_add_revertsWith_AmountDowncastOverflow() (gas: 357696)
[PASS] test_add_revertsWith_InsufficientTransferred() (gas: 64504)
[PASS] test_add_revertsWith_InvalidAmount() (gas: 13631)
[PASS] test_add_revertsWith_InvalidShares() (gas: 220197)
[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: 330246)
Logs:
Bound result 2
Bound result 100000000000000000000
[PASS] test_add_with_increased_index() (gas: 298042)
[PASS] test_add_with_increased_index_with_premium() (gas: 674207)
Suite result: ok. 19 passed; 0 failed; 0 skipped; finished in 43.84s (43.82s CPU time)
Ran 1 test for tests/unit/Spoke/Spoke.AccrueInterest.Scenario.t.sol:SpokeAccrueInterestScenarioTest
[PASS] test_accrueInterest_fuzz_RPBorrowAndSkipTime_twoActions((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint40) (runs: 5000, μ: 5595115, ~: 5445721)
Logs:
Bound result 416966230219621053938274952927
Bound result 0
Bound result 255831241153786906
Bound result 41191294854201435881
Bound result 124281697546210950467266407747
Bound result 33522909571553656
Bound result 481970306954558904
Bound result 12412
Bound result 6
Bound result 124281697546210950467266407747
Bound result 33522909571553656
Bound result 481970306954558904
Bound result 12412
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 133.53s (133.51s CPU time)
Ran 38 tests for tests/unit/Hub/Hub.Config.t.sol:HubConfigTest
[PASS] test_addAsset_fuzz(address,uint8,address) (runs: 5000, μ: 390345, ~: 390384)
Logs:
Bound result 18
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_feeReceiver(address,uint8,address) (runs: 5000, μ: 45291, ~: 44992)
Logs:
Bound result 7
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_irStrategy(address,uint8,address) (runs: 5000, μ: 45334, ~: 45035)
Logs:
Bound result 7
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_underlying(uint8,address,address) (runs: 5000, μ: 36719, ~: 36719)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals(address,uint8,address,address) (runs: 5000, μ: 45944, ~: 45986)
Logs:
Bound result 239
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals_tooLow(address,uint8,address,address) (runs: 5000, μ: 46023, ~: 46308)
Logs:
Bound result 5
[PASS] test_addAsset_fuzz_reverts_InvalidIrData(address,uint8,address,address) (runs: 5000, μ: 82463575545, ~: 34963)
Logs:
Bound result 11
[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: 5000, μ: 126676, ~: 126726)
Logs:
Bound result 0
[PASS] test_addSpoke_fuzz_revertsWith_AssetNotListed(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 35246, ~: 35235)
Logs:
Bound result 11309625940371505440311598809411618682392820884088750620440737245046459334656
[PASS] test_addSpoke_fuzz_revertsWith_InvalidAddress_spoke(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 33929, ~: 33979)
Logs:
Bound result 0
[PASS] test_addSpoke_revertsWith_SpokeAlreadyListed() (gas: 39773)
[PASS] test_getAssetId() (gas: 73160)
[PASS] test_getAssetId_fuzz_revertsWith_AssetNotListed(address) (runs: 5000, μ: 18561, ~: 18561)
[PASS] test_hub_deploy_reverts_on_InvalidConstructorInput() (gas: 828431)
[PASS] test_hub_max_riskPremium() (gas: 8610)
[PASS] test_isUnderlyingListed() (gas: 1178402)
[PASS] test_updateAssetConfig_NewFeeReceiver_noFees() (gas: 716089)
[PASS] test_updateAssetConfig_NewFeeReceiver_revertsWith_SpokeNotActive_noFees() (gas: 613421)
[PASS] test_updateAssetConfig_UseExistingSpokeAndListedAsFeeReceiver_revertsWith_SpokeAlreadyListed() (gas: 70708)
[PASS] test_updateAssetConfig_fuzz(uint256,(address,uint16,address,address)) (runs: 5000, μ: 269280, ~: 269598)
Logs:
Bound result 3
Bound result 3
[PASS] test_updateAssetConfig_fuzz_FromZeroLiquidityFee(uint256,uint16) (runs: 5000, μ: 818998, ~: 818822)
Logs:
Bound result 3
Bound result 1
Bound result 3
Bound result 0
Bound result 3
Bound result 1
[PASS] test_updateAssetConfig_fuzz_LiquidityFee(uint256,uint16) (runs: 5000, μ: 721402, ~: 721226)
Logs:
Bound result 3
Bound result 1
Bound result 3
Bound result 1
[PASS] test_updateAssetConfig_fuzz_NewFeeReceiver(uint256) (runs: 5000, μ: 820395, ~: 820396)
Logs:
Bound result 3
Bound result 3
Bound result 1000
[PASS] test_updateAssetConfig_fuzz_NewInterestRateStrategy(uint256) (runs: 5000, μ: 698373, ~: 698374)
Logs:
Bound result 3
[PASS] test_updateAssetConfig_fuzz_ReuseFeeReceiver_revertsWith_SpokeAlreadyListed(uint256) (runs: 5000, μ: 871986, ~: 871987)
Logs:
Bound result 3
Bound result 3
Bound result 3
Bound result 1000
[PASS] test_updateAssetConfig_fuzz_Scenario(uint256) (runs: 5000, μ: 700486, ~: 700539)
Logs:
Bound result 3
Bound result 3
Bound result 1000
Bound result 3
Bound result 1000
Bound result 3
Bound result 0
Bound result 3
Bound result 0
Bound result 3
Bound result 0
Bound result 3
Bound result 0
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidInterestRateStrategy(uint256) (runs: 5000, μ: 61083, ~: 61136)
Logs:
Bound result 3
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidLiquidityFee(uint256,(address,uint16,address,address)) (runs: 5000, μ: 40144, ~: 40042)
Logs:
Bound result 3
Bound result 3
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidReinvestmentController() (gas: 469753)
[PASS] test_updateAssetConfig_fuzz_revertsWith_calculateInterestRateReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 198868, ~: 199295)
Logs:
Bound result 0
Bound result 1
[PASS] test_updateAssetConfig_fuzz_revertsWith_setInterestRateDataReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 95919, ~: 96293)
Logs:
Bound result 2
Bound result 4500
[PASS] test_updateAssetConfig_oldFeeReceiver_flags() (gas: 880112)
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: 5000, μ: 59225, ~: 59284)
Logs:
Bound result 0
[PASS] test_updateSpokeConfig_fuzz_revertsWith_SpokeNotListed(uint256,address,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 40525, ~: 40592)
Logs:
Bound result 3
[PASS] test_updateSpokeConfig_revertsWith_AssetNotListed() (gas: 29639)
Suite result: ok. 38 passed; 0 failed; 0 skipped; finished in 93.95s (93.92s CPU time)
Ran 32 tests for tests/unit/libraries/PositionStatusMap.t.sol:PositionStatusMapTest
[PASS] test_borrowCount() (gas: 108134)
[PASS] test_borrowCount(uint256) (runs: 5000, μ: 1924683, ~: 1751623)
Logs:
Bound result 812
[PASS] test_borrowCount_ignoresInvalidBits() (gas: 122795)
[PASS] test_bucketId() (gas: 8922)
[PASS] test_collateralCount() (gas: 108082)
[PASS] test_collateralCount(uint256) (runs: 5000, μ: 1940344, ~: 1767021)
Logs:
Bound result 812
[PASS] test_collateralCount_ignoresInvalidBits() (gas: 122986)
[PASS] test_constants() (gas: 44556)
[PASS] test_fls() (gas: 509035)
[PASS] test_fromBitId(uint256,uint256) (runs: 5000, μ: 14041, ~: 14336)
Logs:
Bound result 151
Bound result 100
[PASS] test_fuzz_setBorrowing(uint256,bool) (runs: 5000, μ: 22255, ~: 32137)
[PASS] test_fuzz_setUseAsCollateral(uint256,bool) (runs: 5000, μ: 22307, ~: 32189)
[PASS] test_getBucketWord(uint256) (runs: 5000, μ: 14179, ~: 14179)
[PASS] test_isUsingAsCollateralOrBorrowing_slot0() (gas: 108352)
[PASS] test_isUsingAsCollateralOrBorrowing_slot1() (gas: 43997)
[PASS] test_isolateBorrowing(uint256) (runs: 5000, μ: 153030, ~: 153030)
[PASS] test_isolateBorrowingUntil(uint256,uint256) (runs: 5000, μ: 144717, ~: 144367)
[PASS] test_isolateCollateral(uint256) (runs: 5000, μ: 152949, ~: 152949)
[PASS] test_isolateCollateralUntil(uint256,uint256) (runs: 5000, μ: 144652, ~: 144302)
[PASS] test_isolateUntil(uint256,uint256) (runs: 5000, μ: 134619, ~: 134612)
[PASS] test_next(uint256) (runs: 5000, μ: 20049, ~: 18925)
Logs:
Bound result 649
[PASS] test_nextBorrowing(uint256) (runs: 5000, μ: 18008, ~: 16874)
Logs:
Bound result 649
[PASS] test_nextBorrowing_continuous() (gas: 61801685)
[PASS] test_nextCollateral(uint256) (runs: 5000, μ: 18174, ~: 16983)
Logs:
Bound result 649
[PASS] test_nextCollateral_continuous() (gas: 62157760)
[PASS] test_next_continuous() (gas: 89136467)
[PASS] test_popCount(bytes32) (runs: 5000, μ: 37881, ~: 38011)
[PASS] test_setBorrowing_slot0() (gas: 43906)
[PASS] test_setBorrowing_slot1() (gas: 43942)
[PASS] test_setUseAsCollateral_slot0() (gas: 44158)
[PASS] test_setUseAsCollateral_slot1() (gas: 44140)
[PASS] test_setters_use_correct_slot(uint256) (runs: 5000, μ: 36549, ~: 41309)
Suite result: ok. 32 passed; 0 failed; 0 skipped; finished in 159.98s (159.97s CPU time)
Ran 5 tests for tests/unit/Rescuable.t.sol:RescuableTest
[PASS] test_constructor() (gas: 12531)
[PASS] test_rescueNative_fuzz(uint256) (runs: 5000, μ: 33307, ~: 33509)
Logs:
Bound result 3124043968137
[PASS] test_rescueNative_revertsWith_OnlyRescueGuardian() (gas: 11089)
[PASS] test_rescueToken_fuzz(uint256) (runs: 5000, μ: 206644, ~: 206781)
Logs:
Bound result 3124043968137
[PASS] test_rescueToken_revertsWith_OnlyRescueGuardian() (gas: 180556)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 3.29s (3.26s CPU time)
Ran 7 tests for tests/unit/ReserveFlags.t.sol:ReserveFlagsTests
[PASS] test_constants() (gas: 12118)
[PASS] test_create_fuzz(bool,bool,bool,bool) (runs: 5000, μ: 14707, ~: 14707)
[PASS] test_setBorrowable_fuzz(uint8) (runs: 5000, μ: 13338, ~: 13338)
[PASS] test_setFrozen_fuzz(uint8) (runs: 5000, μ: 13280, ~: 13280)
[PASS] test_setPaused_fuzz(uint8) (runs: 5000, μ: 13289, ~: 13289)
[PASS] test_setReceiveSharesEnabled_fuzz(uint8) (runs: 5000, μ: 13196, ~: 13196)
[PASS] test_set_flags() (gas: 65513)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 1.32s (1.32s CPU time)
Ran 10 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Constants.t.sol:SignatureGatewayConstantsTest
[PASS] test_DOMAIN_SEPARATOR() (gas: 5628)
[PASS] test_borrow_typeHash() (gas: 9733)
[PASS] test_constructor() (gas: 3749)
[PASS] test_eip712Domain() (gas: 10940)
[PASS] test_repay_typeHash() (gas: 9857)
[PASS] test_setUsingAsCollateral_typeHash() (gas: 9780)
[PASS] test_supply_typeHash() (gas: 9871)
[PASS] test_updateUserDynamicConfig_typeHash() (gas: 9758)
[PASS] test_updateUserRiskPremium_typeHash() (gas: 9779)
[PASS] test_withdraw_typeHash() (gas: 9756)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 26.73ms (2.35ms CPU time)
Ran 5 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.PermitReserve.t.sol:SignatureGatewayPermitReserveTest
[PASS] test_permitReserve() (gas: 101550)
[PASS] test_permitReserve_forwards_correct_call() (gas: 51045)
[PASS] test_permitReserve_ignores_permit_reverts() (gas: 40070)
[PASS] test_permitReserve_revertsWith_ReserveNotListed() (gas: 30985)
[PASS] test_permitReserve_revertsWith_SpokeNotRegistered() (gas: 29349)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 25.94ms (1.47ms CPU time)
Ran 2 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.InsufficientAllowance.t.sol:SignatureGateway_InsufficientAllowance_Test
[PASS] test_repayWithSig_revertsWith_ERC20InsufficientAllowance() (gas: 454119)
[PASS] test_supplyWithSig_revertsWith_ERC20InsufficientAllowance() (gas: 87268)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 28.77ms (3.63ms CPU time)
Ran 16 tests for tests/unit/Hub/Hub.Draw.t.sol:HubDrawTest
[PASS] test_draw_DifferentSpokes() (gas: 352240)
[PASS] test_draw_fuzz_IncreasedBorrowRate(uint256,uint256) (runs: 5000, μ: 693441, ~: 693678)
Logs:
Bound result 3
Bound result 100
[PASS] test_draw_fuzz_amounts_same_block(uint256,uint256) (runs: 5000, μ: 285896, ~: 286025)
Logs:
Bound result 3
Bound result 100
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded(uint40) (runs: 5000, μ: 82327, ~: 82284)
Logs:
Bound result 9
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 283788, ~: 284032)
Logs:
Bound result 1291
Bound result 70309
Bound result 173721804
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity(uint256,uint256) (runs: 5000, μ: 34734, ~: 34512)
Logs:
Bound result 3
Bound result 100
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_draw(uint256) (runs: 5000, μ: 169522, ~: 169225)
Logs:
Bound result 3124043968137
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_remove(uint256) (runs: 5000, μ: 131892, ~: 131682)
Logs:
Bound result 3124043968137
[PASS] test_draw_fuzz_revertsWith_InvalidAddress(uint256) (runs: 5000, μ: 16138, ~: 16138)
[PASS] test_draw_revertsWith_DrawCapExceeded_due_to_deficit() (gas: 267210)
[PASS] test_draw_revertsWith_InsufficientLiquidity() (gas: 28289)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_draw() (gas: 165836)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_remove() (gas: 129018)
[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 22.56s (22.54s CPU time)
Ran 8 tests for tests/unit/Hub/Hub.EliminateDeficit.t.sol:HubEliminateDeficitTest
[PASS] test_eliminateDeficit(uint256) (runs: 5000, μ: 653760, ~: 653760)
[PASS] test_eliminateDeficit_fuzz_revertsWith_AccessManagedUnauthorized(address) (runs: 5000, μ: 32580, ~: 32580)
[PASS] test_eliminateDeficit_fuzz_revertsWith_ArithmeticUnderflow_CallerSpokeNoFunds(uint256) (runs: 5000, μ: 348716, ~: 348716)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountNoDeficit() (gas: 36025)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountWithDeficit() (gas: 344891)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_on_UnregisteredCoveredSpoke() (gas: 36412)
[PASS] test_eliminateDeficit_revertsWith_SpokeNotActive_on_UnregisteredAsset() (gas: 380713)
[PASS] test_eliminateDeficit_revertsWith_callerSpokeNotActive() (gas: 159412)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 16.54s (16.51s CPU time)
Ran 6 tests for tests/unit/Hub/Hub.MintFeeShares.t.sol:HubMintFeeSharesTest
[PASS] test_mintFeeShares() (gas: 308656)
[PASS] test_mintFeeShares_noFees() (gas: 364545)
[PASS] test_mintFeeShares_noShares() (gas: 289788)
[PASS] test_mintFeeShares_revertsWith_AccessManagedUnauthorized() (gas: 24139)
[PASS] test_mintFeeShares_revertsWith_AssetNotListed() (gas: 27553)
[PASS] test_mintFeeShares_revertsWith_SpokeNotActive() (gas: 239515)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 29.61ms (3.81ms CPU time)
Ran 9 tests for tests/gas/Hub.Operations.gas.t.sol:HubOperations_Gas_Tests
[PASS] test_add() (gas: 270108)
[PASS] test_deficit() (gas: 1304823)
[PASS] test_draw() (gas: 418553)
[PASS] test_mintFeeShares() (gas: 499923)
[PASS] test_payFee_transferShares() (gas: 931377)
[PASS] test_refreshPremium() (gas: 634389)
[PASS] test_remove() (gas: 310664)
[PASS] test_restore() (gas: 877812)
[PASS] test_restore_with_transfer() (gas: 878477)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 49.86ms (6.77ms CPU time)
Ran 7 tests for tests/unit/Spoke/Spoke.AccrueLiquidityFee.t.sol:SpokeAccrueLiquidityFeeTest
[PASS] test_accrueLiquidityFee() (gas: 862100)
[PASS] test_accrueLiquidityFee_NoActionTaken() (gas: 122186)
[PASS] test_accrueLiquidityFee_NoInterest_OnlySupply(uint40) (runs: 5000, μ: 245263, ~: 245225)
Logs:
Bound result 9
[PASS] test_accrueLiquidityFee_exact() (gas: 867997)
[PASS] test_accrueLiquidityFee_fuzz_BorrowAmountAndSkipTime(uint256,uint40) (runs: 5000, μ: 942367, ~: 963717)
Logs:
Bound result 68691281934999
Bound result 0
[PASS] test_accrueLiquidityFee_maxLiquidityFee() (gas: 545811)
[PASS] test_accrueLiquidityFee_setUsingAsCollateral() (gas: 894330)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 19.17s (19.14s CPU time)
Ran 7 tests for tests/unit/Spoke/Spoke.AccrueInterest.t.sol:SpokeAccrueInterestTest
[PASS] test_accrueInterest_NoActionTaken() (gas: 133168)
[PASS] test_accrueInterest_NoInterest_NoDebt(uint40) (runs: 5000, μ: 638788, ~: 638616)
Logs:
Bound result 9
[PASS] test_accrueInterest_NoInterest_OnlySupply(uint40) (runs: 5000, μ: 250252, ~: 250250)
Logs:
Bound result 9
[PASS] test_accrueInterest_TenPercentRp(uint256,uint40) (runs: 5000, μ: 582203, ~: 582638)
Logs:
Bound result 68691281934999
Bound result 0
[PASS] test_accrueInterest_fuzz_BorrowAmountAndSkipTime(uint256,uint40) (runs: 5000, μ: 541573, ~: 541931)
Logs:
Bound result 68691281934999
Bound result 0
[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: 5000, μ: 4037391, ~: 4054055)
Logs:
Bound result 301730418587226941537432634264
Bound result 333
Bound result 16136
Bound result 11592
Bound result 9443
Bound result 1711
Bound result 999999999999999401
Bound result 13011
Bound result 10614
Bound result 19497
Bound result 22771
Bound result 75152
Bound result 7635
Bound result 9443
Bound result 1711
Bound result 94808744220882167
Bound result 13011
Suite result: ok. 6 passed; 0 failed; 1 skipped; finished in 113.53s (113.50s 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: 5000, μ: 544531, ~: 544580)
Logs:
Bound result 18883
Bound result 480000000
Bound result 0
Bound result 564379323
[PASS] test_accrueLiquidityFee_fuzz_maxLiquidityFee_with_premium_multiple_users(uint256,uint256,uint256,uint256,uint256) (runs: 5000, μ: 803048, ~: 803144)
Logs:
Bound result 18991
Bound result 192000000
Bound result 3
Bound result 3872
Bound result 6563
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_spoke() (gas: 640624819)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_user() (gas: 261745504)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_with_premium() (gas: 544642)
Logs:
Bound result 5000
Bound result 34560000
Bound result 2
Bound result 500000000000000000000
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 18.65s (18.63s CPU time)
Ran 6 tests for tests/unit/Hub/Hub.PayFee.t.sol:HubPayFeeTest
[PASS] test_payFee_fuzz(uint256,uint256) (runs: 5000, μ: 697353, ~: 697507)
Logs:
Bound result 68691281934999
Bound result 0
Bound result 100
[PASS] test_payFee_fuzz_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 697773, ~: 698055)
Logs:
Bound result 615514462186775432459
Bound result 10765498
Bound result 571193127101173104469
[PASS] test_payFee_revertsWith_InvalidShares() (gas: 20356)
[PASS] test_payFee_revertsWith_SpokeNotActive() (gas: 61390)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded() (gas: 135493)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded_with_interest() (gas: 636899)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 25.35s (25.32s CPU time)
Ran 11 tests for tests/unit/Hub/Hub.Reclaim.t.sol:HubReclaimTest
[PASS] test_reclaim() (gas: 634284)
Logs:
Bound result 1000000000000000000000
Bound result 500000000000000000000
Bound result 200000000000000000000
[PASS] test_reclaim_fullAmount() (gas: 616734)
[PASS] test_reclaim_fuzz(uint256,uint256,uint256) (runs: 5000, μ: 636032, ~: 635224)
Logs:
Bound result 615514462186775432459
Bound result 571193127101173104469
Bound result 564283877115702805413
[PASS] test_reclaim_multipleSweepsAndReclaims() (gas: 725320)
[PASS] test_reclaim_revertsWith_AssetNotListed() (gas: 13093)
[PASS] test_reclaim_revertsWith_InsufficientTransferred() (gas: 438036)
[PASS] test_reclaim_revertsWith_InsufficientTransferred_noSwept() (gas: 102540)
[PASS] test_reclaim_revertsWith_InvalidAmount_zero() (gas: 92710)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController(address) (runs: 5000, μ: 93593, ~: 93593)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController_init() (gas: 40516)
[PASS] test_reclaim_revertsWith_underflow_exceedsSwept_afterSweep() (gas: 601387)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 15.00s (14.97s CPU time)
Ran 4 tests for tests/unit/Spoke/Spoke.Borrow.t.sol:SpokeBorrowTest
[PASS] test_borrow() (gas: 1125894)
[PASS] test_borrow_fuzz_amounts(uint256,uint256) (runs: 5000, μ: 1135467, ~: 1135203)
Logs:
Bound result 68691281934999
Bound result 100
[PASS] test_borrow_revertsWith_ReentrancyGuardReentrantCall_hubDraw() (gas: 400250)
[PASS] test_borrow_revertsWith_ReentrancyGuardReentrantCall_hubRefreshPremium() (gas: 526589)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 27.55s (27.52s CPU time)
Ran 5 tests for tests/unit/Spoke/Spoke.Borro...*[Comment body truncated]* |
|
|
||
| ## Summary | ||
|
|
||
| Dynamic Risk Configuration is a Spoke-level versioning mechanism that isolates collateralization parameters into per-Reserve configuration entries, each identified by a monotonically incrementing `dynamicConfigKey`. When governance updates collateralization parameters for a Reserve, the Spoke typically appends a new configuration entry rather than replacing the existing one (though governance can also update an existing key in place via `updateDynamicReserveConfig`). User positions retain a snapshot of the `dynamicConfigKey` active at the time of their last risk-bearing action. Parameter updates therefore do not immediately affect open positions; existing positions continue to evaluate under their snapshotted configuration until the user performs a risk-increasing action, at which point the Spoke rebinds the snapshot to the latest key. If the rebinding leaves the position under-collateralized, the action reverts. |
Contributor
There was a problem hiding this comment.
I dont think "monotonically increasing" is accurate here, because it's always incrementing by 1 each time
|
|
||
| ## Relationship to the Hub/Spoke Architecture | ||
|
|
||
| Dynamic Risk Configuration is a Spoke-level concern. The three parameters it versions (Collateral Factor (CF), Liquidation Bonus (LB), and Liquidation Fee (LF)) govern how a user's collateral contributes to their health factor and how liquidation economics are computed. The Hub is unaware of these parameters; it maintains interest rate accounting, liquidity caps, and deficit state only. Spokes apply dynamic configs independently: the same underlying asset registered on two different Spokes carries independent configuration histories and independent `dynamicConfigKey` counters. |
Contributor
There was a problem hiding this comment.
maybe should keep it formal and replace "configs" here to "configurations"
Suggested change
| Dynamic Risk Configuration is a Spoke-level concern. The three parameters it versions (Collateral Factor (CF), Liquidation Bonus (LB), and Liquidation Fee (LF)) govern how a user's collateral contributes to their health factor and how liquidation economics are computed. The Hub is unaware of these parameters; it maintains interest rate accounting, liquidity caps, and deficit state only. Spokes apply dynamic configs independently: the same underlying asset registered on two different Spokes carries independent configuration histories and independent `dynamicConfigKey` counters. | |
| Dynamic Risk Configuration is a Spoke-level concern. The three parameters it versions (Collateral Factor (CF), Liquidation Bonus (LB), and Liquidation Fee (LF)) govern how a user's collateral contributes to their health factor and how liquidation economics are computed. The Hub is unaware of these parameters; it maintains interest rate accounting, liquidity caps, and deficit state only. Spokes apply dynamic configurations independently: the same underlying asset registered on two different Spokes carries independent configuration histories and independent `dynamicConfigKey` counters. |
|
|
||
| `updateDynamicReserveConfig` modifies an existing configuration entry in place at a specified `dynamicConfigKey`. It applies the same structural validation as `addDynamicReserveConfig`, with two additional checks: the target key must reference a previously initialized entry, and the `collateralFactor` in the updated config must be strictly greater than zero. | ||
|
|
||
| The guard against setting `collateralFactor = 0` on a historical key is enforced in validation with `InvalidCollateralFactor`. If a historical key were allowed to carry a zero collateral factor, all positions currently snapshotted at that key would lose collateral credit for that Reserve in health factor calculations. Additionally, liquidations read the borrower’s snapshotted dynamic config for the collateral reserve and require `collateralFactor > 0`; therefore that reserve could not be seized as liquidation collateral while bound to a zero-CF key. If it is the only collateral supporting outstanding debt, liquidation could be blocked until the key is updated back to `>0` or the position is migrated to a key with `collateralFactor > 0`. |
Contributor
There was a problem hiding this comment.
Suggested change
| The guard against setting `collateralFactor = 0` on a historical key is enforced in validation with `InvalidCollateralFactor`. If a historical key were allowed to carry a zero collateral factor, all positions currently snapshotted at that key would lose collateral credit for that Reserve in health factor calculations. Additionally, liquidations read the borrower’s snapshotted dynamic config for the collateral reserve and require `collateralFactor > 0`; therefore that reserve could not be seized as liquidation collateral while bound to a zero-CF key. If it is the only collateral supporting outstanding debt, liquidation could be blocked until the key is updated back to `>0` or the position is migrated to a key with `collateralFactor > 0`. | |
| The guard against setting `collateralFactor = 0` on a historical key is enforced in validation with `InvalidCollateralFactor`. If a historical key were altered to carry a zero collateral factor, all positions currently snapshotted at that key would lose collateral credit for that Reserve in health factor calculations. Additionally, liquidations read the borrower’s snapshotted dynamic config for the collateral reserve and require `collateralFactor > 0`; therefore that reserve could not be seized as liquidation collateral while bound to a zero-CF key. If it is the only collateral supporting outstanding debt, liquidation could be blocked until the key is updated back to `>0` or the position is migrated to a key with `collateralFactor > 0`. |
| 2. Recompute the health factor using the newly bound configurations. | ||
| 3. If `healthFactor < HEALTH_FACTOR_LIQUIDATION_THRESHOLD`, revert with `HealthFactorBelowThreshold`. | ||
|
|
||
| This guard prevents a user from taking a risk-increasing action while pinned to a configuration that, after rebinding, would leave the position under-collateralized. The rebind is unconditional; only the resulting health factor check determines whether the action proceeds. |
Contributor
There was a problem hiding this comment.
This "rebind is unconditional" part reads a little strangely. Maybe it could be like
Suggested change
| This guard prevents a user from taking a risk-increasing action while pinned to a configuration that, after rebinding, would leave the position under-collateralized. The rebind is unconditional; only the resulting health factor check determines whether the action proceeds. | |
| This guard prevents a user from taking a risk-increasing action while pinned to a configuration that, after rebinding, would leave the position under-collateralized. The rebind is unconditional; but if the transaction reverts due to the health factor check, the user's position remains unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
docs/features/DynamicConfiguration.md, a technical reference for the DynamicConfiguration implementation.