Conversation
♻️ Forge Gas Snapshots
🔕 Unchanged
|
Forge Build Sizes🔕 Unchanged
|
🌈 Test ResultsNo files changed, compilation skipped
Ran 13 tests for tests/unit/Spoke/Liquidations/Spoke.LiquidationCall.Scenarios.t.sol:SpokeLiquidationCallScenariosTest
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRefreshPremium() (gas: 26245566)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRemove() (gas: 26117243)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubReportDeficit() (gas: 26228362)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRestore() (gas: 26192649)
[PASS] test_liquidationCall_scenario1() (gas: 4611076)
[PASS] test_liquidationCall_scenario2() (gas: 4619402)
[PASS] test_liquidationCall_scenario3() (gas: 3774034)
[PASS] test_liquidationCall_scenario4() (gas: 27938294)
[PASS] test_liquidationCall_scenario5() (gas: 3917157)
[PASS] test_liquidationCall_scenario6() (gas: 2738540)
[PASS] test_liquidationCall_scenario7() (gas: 3783565)
[PASS] test_scenario_halted_asset() (gas: 27157597)
[PASS] test_scenario_halted_asset_with_deficit() (gas: 27000659)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 222.39ms (172.97ms CPU time)
Ran 20 tests for tests/unit/Spoke/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, μ: 19844, ~: 20170)
Logs:
Bound result 1
[PASS] test_getReservePrice() (gas: 48776)
[PASS] test_getReservePrice_revertsWith_InvalidPrice() (gas: 48047)
[PASS] test_getReservePrice_revertsWith_InvalidSource() (gas: 10876)
[PASS] test_getReservePrices() (gas: 80751)
[PASS] test_getReservePrices_revertsWith_InvalidSource() (gas: 50966)
[PASS] test_getReserveSource() (gas: 48946)
[PASS] test_setReserveSource() (gas: 46010)
[PASS] test_setReserveSource_revertsWith_InvalidPrice() (gas: 102780)
[PASS] test_setReserveSource_revertsWith_InvalidSource() (gas: 17228)
[PASS] test_setReserveSource_revertsWith_InvalidSourceDecimals() (gas: 17021)
[PASS] test_setReserveSource_revertsWith_OnlySpoke() (gas: 13043)
[PASS] test_setReserveSource_revertsWith_OracleMismatch() (gas: 5030145)
[PASS] test_setSpoke() (gas: 5058134)
[PASS] test_setSpoke_revertsWith_InvalidAddress() (gas: 10847)
[PASS] test_setSpoke_revertsWith_OnlyDeployer(address) (runs: 5000, μ: 13442, ~: 13442)
[PASS] test_setSpoke_revertsWith_SpokeAlreadySet() (gas: 15102)
Suite result: ok. 20 passed; 0 failed; 0 skipped; finished in 1.17s (1.15s CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateDebt.t.sol:LiquidationLogicLiquidateDebtTest
[PASS] test_liquidateDebt_fuzz(uint256) (runs: 5000, μ: 228399, ~: 218601)
[PASS] test_liquidateDebt_revertsWith_ArithmeticUnderflow() (gas: 106038)
[PASS] test_liquidateDebt_revertsWith_InsufficientAllowance() (gas: 115538)
[PASS] test_liquidateDebt_revertsWith_InsufficientBalance() (gas: 177152)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 2.73s (2.69s CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateUser.t.sol:LiquidationLogicLiquidateUserTest
[PASS] test_liquidateUser() (gas: 369585)
[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 34.63ms (1.68ms CPU time)
Ran 6 tests for tests/unit/Spoke/Spoke.Withdraw.Validation.t.sol:SpokeWithdrawValidationTest
[PASS] test_withdraw_fuzz_revertsWith_InsufficientLiquidity_with_debt(uint256,uint256,uint256,uint256,uint256) (runs: 5000, μ: 434212, ~: 434285)
Logs:
Bound result 0
Bound result 78659549032550765277503148640
Bound result 16554937094930866929515952207
Bound result 82793
Bound result 554680920
[PASS] test_withdraw_fuzz_revertsWith_InsufficientSupply_zero_supplied(uint256) (runs: 5000, μ: 55104, ~: 54812)
Logs:
Bound result 3124043968137
[PASS] test_withdraw_revertsWith_InsufficientLiquidity_with_debt() (gas: 426833)
[PASS] test_withdraw_revertsWith_InvalidAmount_zero_supplied() (gas: 51432)
[PASS] test_withdraw_revertsWith_ReserveNotListed() (gas: 22408)
[PASS] test_withdraw_revertsWith_ReservePaused() (gas: 62971)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 5.95s (5.92s CPU time)
Ran 20 tests for tests/unit/misc/AccessManagerEnumerable.t.sol:AccessManagerEnumerableTest
[PASS] test_getRoleMembers_fuzz(uint256,uint256) (runs: 5000, μ: 1981571, ~: 1980422)
Logs:
Bound result 9
Bound result 10
[PASS] test_getRoleTargetSelectors_fuzz(uint256,uint256) (runs: 5000, μ: 1528869, ~: 1527977)
Logs:
Bound result 9
Bound result 10
[PASS] test_grantRole() (gas: 315853)
[PASS] test_grantRole_fuzz(uint64,uint256) (runs: 5000, μ: 915901, ~: 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, μ: 2141193, ~: 2209517)
Logs:
Bound result 12
[PASS] test_setRoleAdmin_fuzz_trackRolesAndTrackAdminRoles_multipleRoles(uint256) (runs: 5000, μ: 1955582, ~: 1899380)
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.23s (22.23s CPU time)
Ran 23 tests for tests/unit/Hub/AssetInterestRateStrategy.t.sol:AssetInterestRateStrategyTest
[PASS] test_calculateInterestRate_AtKinkPoint() (gas: 24304)
Logs:
Bound result 2000
Bound result 778565440757296803935461404101
[PASS] test_calculateInterestRate_AtMaxUtilization() (gas: 24665)
Logs:
Bound result 10000
Bound result 778565440757296803935461404101
[PASS] test_calculateInterestRate_LeftToKinkPoint(uint256) (runs: 5000, μ: 24211, ~: 24353)
Logs:
Bound result 137
Bound result 252173843969976304268974536488
[PASS] test_calculateInterestRate_RightToKinkPoint(uint256) (runs: 5000, μ: 25325, ~: 25373)
Logs:
Bound result 8137
Bound result 252173843969976304268974536488
[PASS] test_calculateInterestRate_ZeroDebtZeroLiquidity() (gas: 18793)
Logs:
Bound result 0
[PASS] test_calculateInterestRate_fuzz_ZeroDebt(uint256) (runs: 5000, μ: 19050, ~: 18800)
Logs:
Bound result 3124043968137
[PASS] test_calculateInterestRate_revertsWith_InterestRateDataNotSet() (gas: 11203)
[PASS] test_deploy_revertsWith_InvalidAddress() (gas: 3703)
[PASS] test_getBaseVariableBorrowRate() (gas: 14834)
[PASS] test_getInterestRateData() (gas: 19303)
[PASS] test_getMaxVariableBorrowRate() (gas: 15236)
[PASS] test_getOptimalUsageRatio() (gas: 14728)
[PASS] test_getVariableRateSlope1() (gas: 14813)
[PASS] test_getVariableRateSlope2() (gas: 14768)
[PASS] test_maxBorrowRate() (gas: 8334)
[PASS] test_maxOptimalRatio() (gas: 8290)
[PASS] test_minOptimalRatio() (gas: 8321)
[PASS] test_setInterestRateData() (gas: 69011)
[PASS] test_setInterestRateData_revertsWith_InvalidMaxRate() (gas: 41840)
[PASS] test_setInterestRateData_revertsWith_InvalidOptimalUsageRatio() (gas: 42334)
[PASS] test_setInterestRateData_revertsWith_InvalidRateData() (gas: 35291)
[PASS] test_setInterestRateData_revertsWith_OnlyHub() (gas: 23519)
[PASS] test_setInterestRateData_revertsWith_Slope2MustBeGteSlope1() (gas: 37657)
Suite result: ok. 23 passed; 0 failed; 0 skipped; finished in 1.14s (1.13s CPU time)
Ran 8 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationAmounts.t.sol:LiquidationLogicLiquidationAmountsTest
[PASS] test_calculateLiquidationAmounts_EnoughCollateral() (gas: 167907)
[PASS] test_calculateLiquidationAmounts_InsufficientCollateral() (gas: 168613)
[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, μ: 285745, ~: 275502)
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, μ: 241005, ~: 230055)
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, μ: 260063, ~: 249155)
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, μ: 246077, ~: 235281)
Logs:
Bound result 79
Bound result 1243
Bound result 500
Bound result 11996
Bound result 14
Bound result 3
Bound result 11995
Bound result 7994
Bound result 1259637670683968748
Bound result 500
Bound result 5471217465556991
Bound result 9
Bound result 5431
Bound result 47495519811434431156834593382
Bound result 6910
Bound result 142000
Bound result 13562
Bound result 16
Bound result 184
Bound result 2600000000
Bound result 5
Bound result 2600000000
Bound result 5431
[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, μ: 268767, ~: 258032)
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, μ: 251926, ~: 240954)
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 39.19s (39.17s 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: 12531)
[PASS] test_calculateLiquidationBonus_fuzz_ConstantBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 20345, ~: 20128)
Logs:
Bound result 18186
Bound result 867
Bound result 103
Bound result 12111
[PASS] test_calculateLiquidationBonus_fuzz_MaxBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 23289, ~: 23072)
Logs:
Bound result 18186
Bound result 867
Bound result 103
Bound result 12111
Bound result 103
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 1.16s (1.14s 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: 259720)
[PASS] test_validateLiquidationCall_revertsWith_HealthFactorNotBelowThreshold() (gas: 31834)
[PASS] test_validateLiquidationCall_revertsWith_InvalidDebtToCover() (gas: 26839)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotBorrowed() (gas: 26980)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotEnabledAsCollateral_NotUsingAsCollateral() (gas: 27033)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotEnabledAsCollateral_ZeroCollateralFactor() (gas: 27063)
[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 26.02ms (1.46ms CPU time)
Ran 14 tests for tests/unit/misc/EIP712Hash.t.sol:EIP712HashTest
[PASS] test_constants() (gas: 18335)
[PASS] test_hash_borrow_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6689, ~: 6689)
[PASS] test_hash_positionManagerUpdate_fuzz((address,bool)) (runs: 5000, μ: 5361, ~: 5361)
[PASS] test_hash_repay_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6734, ~: 6734)
[PASS] test_hash_setUserPositionManagers_fuzz((address,(address,bool)[],uint256,uint256)) (runs: 5000, μ: 278419, ~: 277841)
[PASS] test_hash_setUsingAsCollateral_fuzz((address,uint256,bool,address,uint256,uint256)) (runs: 5000, μ: 7148, ~: 7148)
[PASS] test_hash_supply_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6755, ~: 6755)
[PASS] test_hash_tokenizedDeposit_fuzz((address,uint256,address,uint256,uint256)) (runs: 5000, μ: 6561, ~: 6561)
[PASS] test_hash_tokenizedMint_fuzz((address,uint256,address,uint256,uint256)) (runs: 5000, μ: 6538, ~: 6538)
[PASS] test_hash_tokenizedRedeem_fuzz((address,uint256,address,uint256,uint256)) (runs: 5000, μ: 6561, ~: 6561)
[PASS] test_hash_tokenizedWithdraw_fuzz((address,uint256,address,uint256,uint256)) (runs: 5000, μ: 6582, ~: 6582)
[PASS] test_hash_updateUserDynamicConfig_fuzz((address,address,uint256,uint256)) (runs: 5000, μ: 6349, ~: 6349)
[PASS] test_hash_updateUserRiskPremium_fuzz((address,address,uint256,uint256)) (runs: 5000, μ: 6348, ~: 6348)
[PASS] test_hash_withdraw_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6711, ~: 6711)
Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 19.24s (19.24s CPU time)
Ran 29 tests for tests/unit/libraries/MathUtils.t.sol:MathUtilsTest
[PASS] test_add_edge_cases() (gas: 4636)
[PASS] test_add_negative_operand(uint256,int256) (runs: 5000, μ: 9131, ~: 8897)
Logs:
Bound result -57896044618658097711785492504343953926634992332820282013197946218740589849150
[PASS] test_add_positive_operand(uint256,int256) (runs: 5000, μ: 3920, ~: 3916)
[PASS] test_calculateLinearInterest() (gas: 4411)
[PASS] test_calculateLinearInterest_add_edge() (gas: 4867)
[PASS] test_calculateLinearInterest_edge_cases() (gas: 16268)
Logs:
Bound result 0
Bound result 1
Bound result 864000000
Bound result 864000000
[PASS] test_calculateLinearInterest_reverts_on_past_timestamp(uint40) (runs: 5000, μ: 7540, ~: 7371)
Logs:
Bound result 9
[PASS] test_constants() (gas: 3110)
[PASS] test_fuzz_calculateLinearInterest(uint96,uint40,uint256) (runs: 5000, μ: 8616, ~: 8847)
Logs:
Bound result 10765498
[PASS] test_fuzz_divUp(uint256,uint256) (runs: 5000, μ: 3540, ~: 3544)
[PASS] test_fuzz_mulDivDown(uint256,uint256,uint256) (runs: 5000, μ: 3513, ~: 3577)
[PASS] test_fuzz_mulDivUp(uint256,uint256,uint256) (runs: 5000, μ: 3590, ~: 3724)
[PASS] test_min(uint256,uint256) (runs: 5000, μ: 3281, ~: 3281)
[PASS] test_mulDivDown_NoRemainder() (gas: 3268)
[PASS] test_mulDivDown_RevertOnDivByZero() (gas: 3085)
[PASS] test_mulDivDown_RevertOnOverflow() (gas: 3183)
[PASS] test_mulDivDown_WithRemainder() (gas: 3268)
[PASS] test_mulDivDown_ZeroAOrB() (gas: 3721)
[PASS] test_mulDivUp_NoRemainder() (gas: 3271)
[PASS] test_mulDivUp_RevertOnDivByZero() (gas: 3106)
[PASS] test_mulDivUp_RevertOnOverflow() (gas: 3162)
[PASS] test_mulDivUp_WithRemainder() (gas: 3270)
[PASS] test_mulDivUp_ZeroAOrB() (gas: 3814)
[PASS] test_signedSub(uint256,uint256) (runs: 5000, μ: 8578, ~: 8508)
Logs:
Bound result 68691281934999
Bound result 100
[PASS] test_signedSub_revertsWith_SafeCastOverflowedUintToInt(uint256) (runs: 5000, μ: 7693, ~: 7746)
Logs:
Bound result 57896044618658097711785492504343953926634992332820282019728792007080608788105
[PASS] test_uncheckedAdd(uint256,uint256) (runs: 5000, μ: 3425, ~: 3416)
[PASS] test_uncheckedExp(uint256,uint256) (runs: 5000, μ: 12580, ~: 9962)
[PASS] test_uncheckedSub(uint256,uint256) (runs: 5000, μ: 3443, ~: 3362)
[PASS] test_zeroFloorSub(uint256,uint256) (runs: 5000, μ: 3312, ~: 3348)
Suite result: ok. 29 passed; 0 failed; 0 skipped; finished in 3.33s (3.31s 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, μ: 953505, ~: 924374)
Logs:
Bound result 812
[PASS] test_extSloads(uint256,bytes) (runs: 5000, μ: 1006659, ~: 975227)
Logs:
Bound result 362
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 60.89s (60.89s CPU time)
Ran 8 tests for tests/unit/position-manager/GatewayBase.t.sol:GatewayBaseTest
[PASS] test_constructor() (gas: 17209)
[PASS] test_registerSpoke_fuzz(address) (runs: 5000, μ: 41585, ~: 41585)
[PASS] test_registerSpoke_revertsWith_InvalidAddress() (gas: 13098)
[PASS] test_registerSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 13836)
[PASS] test_registerSpoke_unregister() (gas: 36076)
[PASS] test_renouncePositionManagerRole() (gas: 65315)
[PASS] test_renouncePositionManagerRole_revertsWith_InvalidAddress() (gas: 74220)
[PASS] test_renouncePositionManagerRole_revertsWith_OwnableUnauthorizedAccount() (gas: 74416)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 387.60ms (363.54ms CPU time)
Ran 5 tests for tests/gas/Gateways.Operations.gas.t.sol:NativeTokenGateway_Gas_Tests
[PASS] test_borrowNative() (gas: 917920)
[PASS] test_repayNative() (gas: 989344)
[PASS] test_supplyAndCollateralNative() (gas: 305177)
[PASS] test_supplyNative() (gas: 286616)
[PASS] test_withdrawNative() (gas: 508766)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 17.54ms (3.91ms CPU time)
Ran 8 tests for tests/gas/Gateways.Operations.gas.t.sol:SignatureGateway_Gas_Tests
[PASS] test_borrowWithSig() (gas: 745169)
[PASS] test_repayWithSig() (gas: 953428)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 209314)
[PASS] test_setUsingAsCollateralWithSig() (gas: 289336)
[PASS] test_supplyWithSig() (gas: 434245)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 145229)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 143172)
[PASS] test_withdrawWithSig() (gas: 409881)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 21.53ms (7.84ms CPU time)
Ran 6 tests for tests/unit/Hub/Hub.Access.t.sol:HubAccessTest
[PASS] test_change_authority() (gas: 206677)
[PASS] test_change_role_responsibility() (gas: 121225)
[PASS] test_hub_access_manager_exposure() (gas: 13433)
[PASS] test_hub_admin_access() (gas: 1350377)
[PASS] test_migrate_role_responsibility() (gas: 709156)
[PASS] test_setInterestRateData_access() (gas: 102695)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 27.75ms (3.74ms CPU time)
Ran 40 tests for tests/unit/position-manager/NativeTokenGateway.t.sol:NativeTokenGatewayTest
[PASS] test_borrowNative() (gas: 664046)
Logs:
Bound result 5000000000000000000
[PASS] test_borrowNative_fuzz(uint256) (runs: 5000, μ: 663492, ~: 664779)
Logs:
Bound result 3124043968137
[PASS] test_borrowNative_revertsWith_InvalidAmount() (gas: 32382)
[PASS] test_borrowNative_revertsWith_NotNativeWrappedAsset() (gas: 32457)
[PASS] test_borrowNative_revertsWith_ReentrancyGuardReentrantCall_hubDraw() (gas: 283024)
[PASS] test_borrowNative_revertsWith_ReentrancyGuardReentrantCall_spokeBorrow() (gas: 271138)
[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: 756556)
Logs:
Bound result 5000000000000000000
[PASS] test_repayNative_excessAmount() (gas: 665087)
[PASS] test_repayNative_fuzz(uint256) (runs: 5000, μ: 752243, ~: 757167)
Logs:
Bound result 3124043968137
[PASS] test_repayNative_fuzz_withInterest(uint256,uint256) (runs: 5000, μ: 675956, ~: 671170)
Logs:
Bound result 90000068691281935000
Bound result 25920101
[PASS] test_repayNative_revertsWith_InvalidAmount() (gas: 32463)
[PASS] test_repayNative_revertsWith_NativeAmountMismatch() (gas: 30030)
[PASS] test_repayNative_revertsWith_NotNativeWrappedAsset() (gas: 39209)
[PASS] test_repayNative_revertsWith_ReentrancyGuardReentrantCall_hubRestore() (gas: 326212)
[PASS] test_repayNative_revertsWith_ReentrancyGuardReentrantCall_spokeRepay() (gas: 303281)
[PASS] test_repayNative_revertsWith_SpokeNotRegistered() (gas: 38728)
[PASS] test_supplyAndCollateralNative() (gas: 333490)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyAndCollateralNative_fuzz(uint256) (runs: 5000, μ: 333812, ~: 333518)
Logs:
Bound result 3124043968137
[PASS] test_supplyNative() (gas: 305206)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyNative_fuzz(uint256) (runs: 5000, μ: 305527, ~: 305233)
Logs:
Bound result 3124043968137
[PASS] test_supplyNative_revertsWith_InvalidAmount() (gas: 32417)
[PASS] test_supplyNative_revertsWith_NativeAmountMismatch() (gas: 30014)
[PASS] test_supplyNative_revertsWith_NotNativeWrappedAsset() (gas: 39197)
[PASS] test_supplyNative_revertsWith_ReentrancyGuardReentrantCall_hubAdd() (gas: 374185)
[PASS] test_supplyNative_revertsWith_ReentrancyGuardReentrantCall_spokeSupply() (gas: 336133)
[PASS] test_supplyNative_revertsWith_SpokeNotRegistered() (gas: 38740)
[PASS] test_withdrawNative() (gas: 331818)
Logs:
Bound result 100000000000000000000
[PASS] test_withdrawNative_fuzz(uint256) (runs: 5000, μ: 331316, ~: 331890)
Logs:
Bound result 3124043968137
[PASS] test_withdrawNative_fuzz_allBalance(uint256) (runs: 5000, μ: 268026, ~: 267819)
Logs:
Bound result 3124043968137
[PASS] test_withdrawNative_fuzz_allBalanceWithInterest(uint256,uint256) (runs: 5000, μ: 615002, ~: 614936)
Logs:
Bound result 68691281934999
Bound result 100
[PASS] test_withdrawNative_revertsWith_InvalidAmount() (gas: 32479)
[PASS] test_withdrawNative_revertsWith_NotNativeWrappedAsset() (gas: 32512)
[PASS] test_withdrawNative_revertsWith_ReentrancyGuardReentrantCall_hubRemove() (gas: 299997)
[PASS] test_withdrawNative_revertsWith_ReentrancyGuardReentrantCall_spokeWithdraw() (gas: 271200)
[PASS] test_withdrawNative_revertsWith_SpokeNotRegistered() (gas: 25395)
Suite result: ok. 40 passed; 0 failed; 0 skipped; finished in 65.31s (65.29s CPU time)
Ran 3 tests for tests/unit/misc/NoncesKeyed.t.sol:NoncesKeyedTest
[PASS] test_useCheckedNonce_monotonic(bytes32) (runs: 5000, μ: 12829, ~: 12829)
[PASS] test_useCheckedNonce_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 95326, ~: 94421)
[PASS] test_useNonce_monotonic(bytes32) (runs: 5000, μ: 13520, ~: 13520)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 3.92s (3.92s CPU time)
Ran 10 tests for tests/unit/libraries/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, μ: 15136, ~: 15261)
Logs:
Bound result 100
Bound result 68691281934999
[PASS] test_percentDivUp_le_value(uint256,uint256) (runs: 5000, μ: 15347, ~: 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, μ: 15330, ~: 15330)
Logs:
Bound result 90101
Bound result 68691281934999
[PASS] test_percentMulUp_le_value(uint256,uint256) (runs: 5000, μ: 15139, ~: 15264)
Logs:
Bound result 100
Bound result 68691281934999
[PASS] test_percentMul_fuzz(uint256,uint256) (runs: 5000, μ: 11525, ~: 12063)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 1.48s (1.48s CPU time)
Ran 14 tests for tests/unit/Spoke/Spoke.Withdraw.t.sol:SpokeWithdrawTest
[PASS] test_fuzz_withdraw_effect_on_ex_rates(uint256,uint256) (runs: 5000, μ: 730497, ~: 732393)
Logs:
Bound result 100
Bound result 68691281934999
[PASS] test_withdraw_all_liquidity() (gas: 383463)
[PASS] test_withdraw_all_liquidity_with_interest_no_premium() (gas: 1157379)
[PASS] test_withdraw_all_liquidity_with_interest_with_premium() (gas: 1164599)
[PASS] test_withdraw_fuzz_all_elapsed_with_interest(uint256,uint256,uint40) (runs: 5000, μ: 766926, ~: 766844)
Logs:
Bound result 999999999999999999999999999998
Bound result 357476815449974192345218464409
Bound result 101524384
[PASS] test_withdraw_fuzz_all_greater_than_supplied(uint256) (runs: 5000, μ: 387325, ~: 387030)
Logs:
Bound result 3124043968137
[PASS] test_withdraw_fuzz_all_liquidity_with_interest_no_premium((uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 1275910, ~: 1290508)
Logs:
Bound result 0
Bound result 3
Bound result 1
Bound result 21000
Bound result 146751677
[PASS] test_withdraw_fuzz_all_liquidity_with_interest_with_premium((uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 1274843, ~: 1289292)
Logs:
Bound result 0
Bound result 3
Bound result 1
Bound result 21000
Bound result 146751677
[PASS] test_withdraw_fuzz_all_with_interest(uint256,uint256) (runs: 5000, μ: 780161, ~: 780100)
Logs:
Bound result 68691281934999
Bound result 100
[PASS] test_withdraw_fuzz_suppliedAmount(uint256) (runs: 5000, μ: 389229, ~: 388934)
Logs:
Bound result 3124043968137
[PASS] test_withdraw_max_greater_than_supplied() (gas: 361384)
[PASS] test_withdraw_revertsWith_ReentrancyGuardReentrantCall_hubRefreshPremium() (gas: 654522)
[PASS] test_withdraw_revertsWith_ReentrancyGuardReentrantCall_hubRemove() (gas: 402147)
[PASS] test_withdraw_same_block() (gas: 308340)
Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 119.12s (119.09s CPU time)
Ran 16 tests for tests/unit/Spoke/SpokeConfigurator.GranularAccessControl.t.sol:SpokeConfiguratorGranularAccessControlTest
[PASS] test_fuzz_unauthorized_cannotCall_liquidationConfigManagerMethods(address) (runs: 5000, μ: 117126, ~: 117126)
[PASS] test_fuzz_unauthorized_cannotCall_positionManagerAdminMethods(address) (runs: 5000, μ: 39761, ~: 39761)
[PASS] test_fuzz_unauthorized_cannotCall_reserveManagerMethods(address) (runs: 5000, μ: 483447, ~: 483447)
[PASS] test_liquidationConfigManager_canCall_updateLiquidationConfig() (gas: 62503)
[PASS] test_liquidationConfigManager_canCall_updateLiquidationTargetHealthFactor() (gas: 62044)
[PASS] test_liquidationConfigManager_cannotCall_anyPositionManagerAdminMethod() (gas: 38976)
[PASS] test_liquidationConfigManager_cannotCall_anyReserveMethod() (gas: 486121)
[PASS] test_positionManagerAdmin_canCall_updatePositionManager() (gas: 75206)
[PASS] test_positionManagerAdmin_cannotCall_anyLiquidationConfigMethod() (gas: 117021)
[PASS] test_positionManagerAdmin_cannotCall_anyReserveMethod() (gas: 485936)
[PASS] test_reserveManager_canCall_freezeAllReserves() (gas: 156941)
[PASS] test_reserveManager_canCall_pauseAllReserves() (gas: 156904)
[PASS] test_reserveManager_canCall_updateFrozen() (gas: 65178)
[PASS] test_reserveManager_canCall_updatePaused() (gas: 65146)
[PASS] test_reserveManager_cannotCall_anyLiquidationConfigMethod() (gas: 116976)
[PASS] test_reserveManager_cannotCall_anyPositionManagerAdminMethod() (gas: 38975)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 6.23s (6.20s CPU time)
Ran 51 tests for tests/unit/Spoke/SpokeConfigurator.t.sol:SpokeConfiguratorTest
[PASS] test_addCollateralFactor() (gas: 125612)
[PASS] test_addCollateralFactor_revertsWith_AccessManagedUnauthorized() (gas: 29173)
[PASS] test_addDynamicReserveConfig() (gas: 105404)
[PASS] test_addDynamicReserveConfig_revertsWith_AccessManagedUnauthorized() (gas: 29344)
[PASS] test_addLiquidationBonus_revertsWith_AccessManagedUnauthorized() (gas: 29095)
[PASS] test_addLiquidationFee() (gas: 125577)
[PASS] test_addLiquidationFee_revertsWith_AccessManagedUnauthorized() (gas: 29073)
[PASS] test_addMaxLiquidationBonus() (gas: 125627)
[PASS] test_addReserve() (gas: 456691)
[PASS] test_addReserve_revertsWith_AccessManagedUnauthorized() (gas: 30019)
[PASS] test_addReserve_revertsWith_MaximumReservesReached() (gas: 289251)
[PASS] test_freezeAllReserves() (gas: 202807)
[PASS] test_freezeAllReserves_revertsWith_AccessManagedUnauthorized() (gas: 26897)
[PASS] test_freezeReserve() (gas: 72324)
[PASS] test_freezeReserve_revertsWith_AccessManagedUnauthorized() (gas: 28978)
[PASS] test_pauseAllReserves() (gas: 202709)
[PASS] test_pauseAllReserves_revertsWith_AccessManagedUnauthorized() (gas: 26808)
[PASS] test_pauseReserve() (gas: 72296)
[PASS] test_pauseReserve_revertsWith_AccessManagedUnauthorized() (gas: 28954)
[PASS] test_updateBorrowable() (gas: 102842)
[PASS] test_updateBorrowable_revertsWith_AccessManagedUnauthorized() (gas: 29057)
[PASS] test_updateCollateralFactor() (gas: 82694)
[PASS] test_updateCollateralFactor_revertsWith_AccessManagedUnauthorized() (gas: 29198)
[PASS] test_updateCollateralRisk() (gas: 76968)
[PASS] test_updateCollateralRisk_revertsWith_AccessManagedUnauthorized() (gas: 29028)
[PASS] test_updateDynamicReserveConfig() (gas: 201314)
[PASS] test_updateDynamicReserveConfig_revertsWith_AccessManagedUnauthorized() (gas: 29433)
[PASS] test_updateFrozen() (gas: 105674)
[PASS] test_updateFrozen_revertsWith_AccessManagedUnauthorized() (gas: 29034)
[PASS] test_updateHealthFactorForMaxBonus() (gas: 68162)
[PASS] test_updateHealthFactorForMaxBonus_revertsWith_AccessManagedUnauthorized() (gas: 26865)
[PASS] test_updateLiquidationBonusFactor() (gas: 71077)
[PASS] test_updateLiquidationBonusFactor_revertsWith_AccessManagedUnauthorized() (gas: 26844)
[PASS] test_updateLiquidationConfig() (gas: 65798)
[PASS] test_updateLiquidationConfig_revertsWith_AccessManagedUnauthorized() (gas: 27171)
[PASS] test_updateLiquidationFee() (gas: 82754)
[PASS] test_updateLiquidationFee_revertsWith_AccessManagedUnauthorized() (gas: 29173)
[PASS] test_updateLiquidationTargetHealthFactor() (gas: 71040)
[PASS] test_updateLiquidationTargetHealthFactor_revertsWith_AccessManagedUnauthorized() (gas: 26909)
[PASS] test_updateMaxLiquidationBonus() (gas: 82778)
[PASS] test_updateMaxLiquidationBonus_revertsWith_AccessManagedUnauthorized() (gas: 29109)
[PASS] test_updateMaxReserves() (gas: 53647)
[PASS] test_updateMaxReserves_revertsWith_AccessManagedUnauthorized() (gas: 26909)
[PASS] test_updatePaused() (gas: 105589)
[PASS] test_updatePaused_revertsWith_AccessManagedUnauthorized() (gas: 29077)
[PASS] test_updatePositionManager() (gas: 74325)
[PASS] test_updatePositionManager_revertsWith_AccessManagedUnauthorized() (gas: 26996)
[PASS] test_updateReceiveSharesEnabled() (gas: 102939)
[PASS] test_updateReceiveSharesEnabled_revertsWith_AccessManagedUnauthorized() (gas: 29099)
[PASS] test_updateReservePriceSource() (gas: 280160)
[PASS] test_updateReservePriceSource_revertsWith_AccessManagedUnauthorized() (gas: 29052)
Suite result: ok. 51 passed; 0 failed; 0 skipped; finished in 40.16ms (14.08ms CPU time)
Ran 6 tests for tests/unit/libraries/SpokeUtils.t.sol:SpokeUtilsTest
[PASS] test_fuzz_toValue(uint256,uint256,uint256) (runs: 5000, μ: 15790, ~: 15844)
Logs:
Bound result 615514462186775432459
Bound result 9
Bound result 9140094126966428
[PASS] test_get() (gas: 180626)
[PASS] test_get_revertsWith_ReserveNotListed() (gas: 167125)
[PASS] test_toValue() (gas: 8806)
[PASS] test_toValue_revertsWith_ArithmeticOverflow() (gas: 8959)
[PASS] test_toValue_revertsWith_ArithmeticUnderflow() (gas: 8734)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 432.42ms (408.42ms CPU time)
Ran 4 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.Config.t.sol:TokenizationSpokeConfigTest
[PASS] test_configuration() (gas: 22893)
[PASS] test_constructor_asset_correctly_set() (gas: 43044)
[PASS] test_constructor_reverts_when_invalid_setup() (gas: 12222)
[PASS] test_setUp() (gas: 69884)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 25.52ms (983.69µs CPU time)
Ran 7 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.Constants.t.sol:TokenizationSpokeConstantsTest
[PASS] test_DOMAIN_SEPARATOR() (gas: 14490)
[PASS] test_deposit_typeHash() (gas: 15183)
[PASS] test_eip712Domain() (gas: 19661)
[PASS] test_mint_typeHash() (gas: 15276)
[PASS] test_permit_typeHash() (gas: 15148)
[PASS] test_redeem_typeHash() (gas: 15081)
[PASS] test_withdraw_typeHash() (gas: 15129)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 26.57ms (1.89ms CPU time)
Ran 4 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.DepositWithPermit.t.sol:TokenizationSpokeDepositWithPermitTest
[PASS] test_depositWithPermit() (gas: 238141)
[PASS] test_depositWithPermit_forwards_correct_call() (gas: 194324)
[PASS] test_depositWithPermit_ignores_permit_reverts() (gas: 183490)
[PASS] test_depositWithPermit_works_with_existing_allowance() (gas: 203615)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 27.04ms (2.70ms CPU time)
Ran 19 tests for tests/unit/Hub/Hub.Add.t.sol:HubAddTest
[PASS] test_add_AddCapReachedButNotExceeded_rounding() (gas: 668461)
[PASS] test_add_fuzz_AddCapReachedButNotExceeded(uint40) (runs: 5000, μ: 166628, ~: 166585)
Logs:
Bound result 9
[PASS] test_add_fuzz_multi_asset_multi_spoke(uint256,uint256,uint256) (runs: 5000, μ: 332647, ~: 332796)
Logs:
Bound result 3
Bound result 218470873395738003579119570309
Bound result 446067553769140138733721804
[PASS] test_add_fuzz_revertsWith_AddCapExceeded(uint40) (runs: 5000, μ: 121169, ~: 121126)
Logs:
Bound result 9
[PASS] test_add_fuzz_revertsWith_AddCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 272609, ~: 272472)
Logs:
Bound result 1291
Bound result 1071208440522043736492
Bound result 173721804
[PASS] test_add_fuzz_revertsWith_InvalidShares_due_to_index(uint256,uint256,uint256) (runs: 5000, μ: 220715, ~: 220916)
Logs:
Bound result 379641678758628584591711171980
Bound result 2210117722
Bound result 3
[PASS] test_add_fuzz_single_asset(uint256,address,uint256) (runs: 5000, μ: 350910, ~: 350929)
Logs:
Bound result 2
Bound result 378088810586379137523864648212
[PASS] test_add_fuzz_single_spoke_multi_add(uint256,uint256) (runs: 5000, μ: 786118, ~: 786143)
Logs:
Bound result 68691281934999
Bound result 100
[PASS] test_add_multi_add_minimal_shares() (gas: 316185)
[PASS] test_add_revertsWith_AmountDowncastOverflow() (gas: 357743)
[PASS] test_add_revertsWith_InsufficientTransferred() (gas: 64504)
[PASS] test_add_revertsWith_InvalidAmount() (gas: 13631)
[PASS] test_add_revertsWith_InvalidShares() (gas: 220255)
[PASS] test_add_revertsWith_SharesDowncastOverflow() (gas: 224358)
[PASS] test_add_revertsWith_SpokeHalted() (gas: 99851)
[PASS] test_add_revertsWith_SpokeNotActive() (gas: 99854)
[PASS] test_add_single_asset() (gas: 339538)
Logs:
Bound result 2
Bound result 100000000000000000000
[PASS] test_add_with_increased_index() (gas: 308692)
[PASS] test_add_with_increased_index_with_premium() (gas: 673277)
Suite result: ok. 19 passed; 0 failed; 0 skipped; finished in 44.71s (44.68s CPU time)
Ran 38 tests for tests/unit/Hub/Hub.Config.t.sol:HubConfigTest
[PASS] test_addAsset_fuzz(address,uint8,address) (runs: 5000, μ: 390239, ~: 390278)
Logs:
Bound result 18
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_feeReceiver(address,uint8,address) (runs: 5000, μ: 45292, ~: 44992)
Logs:
Bound result 0
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_irStrategy(address,uint8,address) (runs: 5000, μ: 45335, ~: 45035)
Logs:
Bound result 0
[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, μ: 45943, ~: 45986)
Logs:
Bound result 20
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals_tooLow(address,uint8,address,address) (runs: 5000, μ: 46021, ~: 46308)
Logs:
Bound result 1
[PASS] test_addAsset_fuzz_reverts_InvalidIrData(address,uint8,address,address) (runs: 5000, μ: 77136474115, ~: 34963)
Logs:
Bound result 1
[PASS] test_addAsset_revertsWith_BlockTimestampDowncastOverflow() (gas: 956611)
[PASS] test_addAsset_revertsWith_DrawnRateDowncastOverflow() (gas: 953755)
[PASS] test_addAsset_reverts_UnderlyingAlreadyListed() (gas: 48980)
[PASS] test_addSpoke_fuzz(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 126676, ~: 126726)
Logs:
Bound result 5
[PASS] test_addSpoke_fuzz_revertsWith_AssetNotListed(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 35290, ~: 35279)
Logs:
Bound result 24377
[PASS] test_addSpoke_fuzz_revertsWith_InvalidAddress_spoke(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 33887, ~: 33937)
Logs:
Bound result 5
[PASS] test_addSpoke_revertsWith_SpokeAlreadyListed() (gas: 39818)
[PASS] test_getAssetId() (gas: 73160)
[PASS] test_getAssetId_fuzz_revertsWith_AssetNotListed(address) (runs: 5000, μ: 18605, ~: 18605)
[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: 714952)
[PASS] test_updateAssetConfig_NewFeeReceiver_revertsWith_SpokeNotActive_noFees() (gas: 612284)
[PASS] test_updateAssetConfig_UseExistingSpokeAndListedAsFeeReceiver_revertsWith_SpokeAlreadyListed() (gas: 70708)
[PASS] test_updateAssetConfig_fuzz(uint256,(address,uint16,address,address)) (runs: 5000, μ: 269267, ~: 269599)
Logs:
Bound result 2
Bound result 3988
[PASS] test_updateAssetConfig_fuzz_FromZeroLiquidityFee(uint256,uint16) (runs: 5000, μ: 817852, ~: 817679)
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, μ: 720258, ~: 720085)
Logs:
Bound result 3
Bound result 1
Bound result 3
Bound result 1
[PASS] test_updateAssetConfig_fuzz_NewFeeReceiver(uint256) (runs: 5000, μ: 819252, ~: 819255)
Logs:
Bound result 3
Bound result 3
Bound result 1000
[PASS] test_updateAssetConfig_fuzz_NewInterestRateStrategy(uint256) (runs: 5000, μ: 697218, ~: 697221)
Logs:
Bound result 3
[PASS] test_updateAssetConfig_fuzz_ReuseFeeReceiver_revertsWith_SpokeAlreadyListed(uint256) (runs: 5000, μ: 870843, ~: 870846)
Logs:
Bound result 3
Bound result 3
Bound result 3
Bound result 1000
[PASS] test_updateAssetConfig_fuzz_Scenario(uint256) (runs: 5000, μ: 700492, ~: 700545)
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 2
Bound result 3988
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidReinvestmentController() (gas: 469358)
[PASS] test_updateAssetConfig_fuzz_revertsWith_calculateInterestRateReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 198927, ~: 199361)
Logs:
Bound result 0
Bound result 1
[PASS] test_updateAssetConfig_fuzz_revertsWith_setInterestRateDataReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 95934, ~: 96293)
Logs:
Bound result 1
Bound result 0
[PASS] test_updateAssetConfig_oldFeeReceiver_flags() (gas: 880116)
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 1
[PASS] test_updateSpokeConfig_fuzz_revertsWith_SpokeNotListed(uint256,address,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 40524, ~: 40592)
Logs:
Bound result 2
[PASS] test_updateSpokeConfig_revertsWith_AssetNotListed() (gas: 29639)
Suite result: ok. 38 passed; 0 failed; 0 skipped; finished in 93.19s (93.17s CPU time)
Ran 16 tests for tests/unit/Hub/Hub.Draw.t.sol:HubDrawTest
[PASS] test_draw_DifferentSpokes() (gas: 352859)
[PASS] test_draw_fuzz_IncreasedBorrowRate(uint256,uint256) (runs: 5000, μ: 693400, ~: 693639)
Logs:
Bound result 3
Bound result 100
[PASS] test_draw_fuzz_amounts_same_block(uint256,uint256) (runs: 5000, μ: 287288, ~: 287410)
Logs:
Bound result 3
Bound result 100
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded(uint40) (runs: 5000, μ: 82495, ~: 82453)
Logs:
Bound result 9
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 284272, ~: 284517)
Logs:
Bound result 1291
Bound result 70309
Bound result 173721804
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity(uint256,uint256) (runs: 5000, μ: 34731, ~: 34508)
Logs:
Bound result 3
Bound result 100
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_draw(uint256) (runs: 5000, μ: 169801, ~: 169507)
Logs:
Bound result 3124043968137
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_remove(uint256) (runs: 5000, μ: 132097, ~: 131890)
Logs:
Bound result 3124043968137
[PASS] test_draw_fuzz_revertsWith_InvalidAddress(uint256) (runs: 5000, μ: 16138, ~: 16138)
[PASS] test_draw_revertsWith_DrawCapExceeded_due_to_deficit() (gas: 267657)
[PASS] test_draw_revertsWith_InsufficientLiquidity() (gas: 28242)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_draw() (gas: 166118)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_remove() (gas: 129226)
[PASS] test_draw_revertsWith_InvalidAmount() (gas: 16224)
[PASS] test_draw_revertsWith_SpokeHalted() (gas: 61606)
[PASS] test_draw_revertsWith_SpokeNotActive() (gas: 61545)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 22.47s (22.44s CPU time)
Ran 32 tests for tests/unit/libraries/PositionStatusMap.t.sol:PositionStatusMapTest
[PASS] test_borrowCount() (gas: 108134)
[PASS] test_borrowCount(uint256) (runs: 5000, μ: 1926607, ~: 1770305)
Logs:
Bound result 812
[PASS] test_borrowCount_ignoresInvalidBits() (gas: 122795)
[PASS] test_bucketId() (gas: 8878)
[PASS] test_collateralCount() (gas: 108082)
[PASS] test_collateralCount(uint256) (runs: 5000, μ: 1942254, ~: 1786687)
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, μ: 14089, ~: 14384)
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, μ: 22330, ~: 32212)
[PASS] test_getBucketWord(uint256) (runs: 5000, μ: 14254, ~: 14254)
[PASS] test_isUsingAsCollateralOrBorrowing_slot0() (gas: 108335)
[PASS] test_isUsingAsCollateralOrBorrowing_slot1() (gas: 43980)
[PASS] test_isolateBorrowing(uint256) (runs: 5000, μ: 153075, ~: 153075)
[PASS] test_isolateBorrowingUntil(uint256,uint256) (runs: 5000, μ: 144688, ~: 144367)
[PASS] test_isolateCollateral(uint256) (runs: 5000, μ: 152994, ~: 152994)
[PASS] test_isolateCollateralUntil(uint256,uint256) (runs: 5000, μ: 144623, ~: 144302)
[PASS] test_isolateUntil(uint256,uint256) (runs: 5000, μ: 134619, ~: 134612)
[PASS] test_next(uint256) (runs: 5000, μ: 20090, ~: 18927)
Logs:
Bound result 649
[PASS] test_nextBorrowing(uint256) (runs: 5000, μ: 18044, ~: 16898)
Logs:
Bound result 649
[PASS] test_nextBorrowing_continuous() (gas: 61801685)
[PASS] test_nextCollateral(uint256) (runs: 5000, μ: 18185, ~: 16963)
Logs:
Bound result 649
[PASS] test_nextCollateral_continuous() (gas: 62157760)
[PASS] test_next_continuous() (gas: 89136467)
[PASS] test_popCount(bytes32) (runs: 5000, μ: 37904, ~: 38034)
[PASS] test_setBorrowing_slot0() (gas: 43906)
[PASS] test_setBorrowing_slot1() (gas: 43942)
[PASS] test_setUseAsCollateral_slot0() (gas: 44140)
[PASS] test_setUseAsCollateral_slot1() (gas: 44176)
[PASS] test_setters_use_correct_slot(uint256) (runs: 5000, μ: 36779, ~: 41539)
Suite result: ok. 32 passed; 0 failed; 0 skipped; finished in 160.62s (160.62s CPU time)
Ran 5 tests for tests/unit/misc/Rescuable.t.sol:RescuableTest
[PASS] test_constructor() (gas: 12525)
[PASS] test_rescueNative_fuzz(uint256) (runs: 5000, μ: 33328, ~: 33531)
Logs:
Bound result 3124043968137
[PASS] test_rescueNative_revertsWith_OnlyRescueGuardian() (gas: 11067)
[PASS] test_rescueToken_fuzz(uint256) (runs: 5000, μ: 206660, ~: 206792)
Logs:
Bound result 3124043968137
[PASS] test_rescueToken_revertsWith_OnlyRescueGuardian() (gas: 180574)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 3.33s (3.31s CPU time)
Ran 8 tests for tests/unit/Hub/Hub.EliminateDeficit.t.sol:HubEliminateDeficitTest
[PASS] test_eliminateDeficit(uint256) (runs: 5000, μ: 652606, ~: 652606)
[PASS] test_eliminateDeficit_fuzz_revertsWith_AccessManagedUnauthorized(address) (runs: 5000, μ: 32610, ~: 32610)
[PASS] test_eliminateDeficit_fuzz_revertsWith_ArithmeticUnderflow_CallerSpokeNoFunds(uint256) (runs: 5000, μ: 348185, ~: 348185)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountNoDeficit() (gas: 36069)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountWithDeficit() (gas: 344316)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_on_UnregisteredCoveredSpoke() (gas: 36390)
[PASS] test_eliminateDeficit_revertsWith_SpokeNotActive_on_UnregisteredAsset() (gas: 380106)
[PASS] test_eliminateDeficit_revertsWith_callerSpokeNotActive() (gas: 159541)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 16.06s (16.03s CPU time)
Ran 6 tests for tests/unit/Hub/Hub.MintFeeShares.t.sol:HubMintFeeSharesTest
[PASS] test_mintFeeShares() (gas: 309843)
[PASS] test_mintFeeShares_noFees() (gas: 365951)
[PASS] test_mintFeeShares_noShares() (gas: 290125)
[PASS] test_mintFeeShares_revertsWith_AccessManagedUnauthorized() (gas: 24139)
[PASS] test_mintFeeShares_revertsWith_AssetNotListed() (gas: 27509)
[PASS] test_mintFeeShares_revertsWith_SpokeNotActive() (gas: 239917)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 27.97ms (3.86ms CPU time)
Ran 9 tests for tests/gas/Hub.Operations.gas.t.sol:HubOperations_Gas_Tests
[PASS] test_add() (gas: 270207)
[PASS] test_deficit() (gas: 1381660)
[PASS] test_draw() (gas: 418594)
[PASS] test_mintFeeShares() (gas: 499964)
[PASS] test_payFee_transferShares() (gas: 931357)
[PASS] test_refreshPremium() (gas: 634383)
[PASS] test_remove() (gas: 310731)
[PASS] test_restore() (gas: 877869)
[PASS] test_restore_with_transfer() (gas: 878556)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 20.16ms (6.53ms CPU time)
Ran 7 tests for tests/unit/libraries/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.31s (1.31s CPU time)
Ran 10 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Constants.t.sol:SignatureGatewayConstantsTest
[PASS] test_DOMAIN_SEPARATOR() (gas: 5650)
[PASS] test_borrow_typeHash() (gas: 9867)
[PASS] test_constructor() (gas: 3749)
[PASS] test_eip712Domain() (gas: 10940)
[PASS] test_repay_typeHash() (gas: 9813)
[PASS] test_setUsingAsCollateral_typeHash() (gas: 9802)
[PASS] test_supply_typeHash() (gas: 9826)
[PASS] test_updateUserDynamicConfig_typeHash() (gas: 9910)
[PASS] test_updateUserRiskPremium_typeHash() (gas: 9911)
[PASS] test_withdraw_typeHash() (gas: 9890)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 26.64ms (2.17ms CPU time)
Ran 5 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.PermitReserve.t.sol:SignatureGatewayPermitReserveTest
[PASS] test_permitReserve() (gas: 101527)
[PASS] test_permitReserve_forwards_correct_call() (gas: 51022)
[PASS] test_permitReserve_ignores_permit_reverts() (gas: 40047)
[PASS] test_permitReserve_revertsWith_ReserveNotListed() (gas: 30997)
[PASS] test_permitReserve_revertsWith_SpokeNotRegistered() (gas: 29350)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 25.50ms (1.40ms 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: 454136)
[PASS] test_supplyWithSig_revertsWith_ERC20InsufficientAllowance() (gas: 87218)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 28.07ms (3.31ms CPU time)
Ran 6 tests for tests/unit/Hub/Hub.PayFee.t.sol:HubPayFeeTest
[PASS] test_payFee_fuzz(uint256,uint256) (runs: 5000, μ: 697043, ~: 697217)
Logs:
Bound result 68691281934999
Bound result 0
Bound result 100
[PASS] test_payFee_fuzz_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 697457, ~: 697721)
Logs:
Bound result 615514462186775432459
Bound result 10765498
Bound result 571193127101173104469
[PASS] test_payFee_revertsWith_InvalidShares() (gas: 20356)
[PASS] test_payFee_revertsWith_SpokeNotActive() (gas: 61566)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded() (gas: 135783)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded_with_interest() (gas: 636452)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 24.75s (24.73s CPU time)
Ran 11 tests for tests/unit/Hub/Hub.Reclaim.t.sol:HubReclaimTest
[PASS] test_reclaim() (gas: 633996)
Logs:
Bound result 1000000000000000000000
Bound result 500000000000000000000
Bound result 200000000000000000000
[PASS] test_reclaim_fullAmount() (gas: 616518)
[PASS] test_reclaim_fuzz(uint256,uint256,uint256) (runs: 5000, μ: 635691, ~: 634937)
Logs:
Bound result 615514462186775432459
Bound result 571193127101173104469
Bound result 564283877115702805413
[PASS] test_reclaim_multipleSweepsAndReclaims() (gas: 725139)
[PASS] test_reclaim_revertsWith_AssetNotListed() (gas: 13093)
[PASS] test_reclaim_revertsWith_InsufficientTransferred() (gas: 437778)
[PASS] test_reclaim_revertsWith_InsufficientTransferred_noSwept() (gas: 102551)
[PASS] test_reclaim_revertsWith_InvalidAmount_zero() (gas: 92721)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController(address) (runs: 5000, μ: 93610, ~: 93610)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController_init() (gas: 40545)
[PASS] test_reclaim_revertsWith_underflow_exceedsSwept_afterSweep() (gas: 601148)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 14.75s (14.72s 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, μ: 158312, ~: 157854)
[PASS] test_borrowWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39091)
[PASS] test_borrowWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37329)
[PASS] test_repayWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 158313, ~: 157855)
[PASS] test_repayWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39024)
[PASS] test_repayWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37351)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 157616, ~: 158752)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39052)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37396)
[PASS] test_supplyWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 158331, ~: 157873)
[PASS] test_supplyWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39069)
[PASS] test_supplyWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37361)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 144659, ~: 143334)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidSignatureDueTo_InvalidSigner() (gas: 25384)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 27068)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 144674, ~: 143349)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidSignatureDueTo_InvalidSigner() (gas: 25406)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 27105)
[PASS] test_withdrawWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 158332, ~: 157874)
[PASS] test_withdrawWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39111)
[PASS] test_withdrawWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37394)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 41.79s (41.77s CPU time)
Ran 26 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.ERC4626Compliance.t.sol:TokenizationSpokeERC4626ComplianceTest
[PASS] test_RT_deposit_redeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 654417, ~: 592571)
Logs:
Bound result 321029667911894843
[PASS] test_RT_deposit_withdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 654818, ~: 593040)
Logs:
Bound result 321029667911894843
[PASS] test_RT_mint_redeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 659963, ~: 596954)
Logs:
Bound result 12694
Bound result 688
[PASS] test_RT_mint_withdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 660277, ~: 597352)
Logs:
Bound result 12694
Bound result 688
[PASS] test_RT_redeem_deposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 654402, ~: 592963)
Logs:
Bound result 31925702956478
[PASS] test_RT_redeem_mint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 654958, ~: 592738)
Logs:
Bound result 80891216523206226866729058589
[PASS] test_RT_withdraw_deposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 659803, ~: 597774)
Logs:
Bound result 31925702956478
[PASS] test_RT_withdraw_mint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 660261, ~: 597529)
Logs:
Bound result 653446709405181635644031222143
Bound result 199866626448165303802968081200
[PASS] test_asset((address[4],uint256[4],uint256[4],int256)) (runs: 5000, μ: 574527, ~: 518762)
[PASS] test_convertToAssets((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 583756, ~: 527078)
Logs:
Bound result 193114763626375255924692215072
[PASS] test_convertToShares((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 583866, ~: 527176)
Logs:
Bound result 193114763626375255924692215072
[PASS] test_deposit((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 5000, μ: 637668, ~: 577488)
Logs:
Bound result 209887959417001521159992097
Bound result 33828858375832022174233787798
[PASS] test_maxDeposit((address[4],uint256[4],uint256[4],int256)) (runs: 5000, μ: 577583, ~: 521488)
[PASS] test_maxMint((address[4],uint256[4],uint256[4],int256)) (runs: 5000, μ: 577656, ~: 521553)
[PASS] test_maxRedeem((address[4],uint256[4],uint256[4],int256)) (runs: 5000, μ: 582584, ~: 525948)
[PASS] test_maxWithdraw((address[4],uint256[4],uint256[4],int256)) (runs: 5000, μ: 582507, ~: 525880)
[PASS] test_mint((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 5000, μ: 643115, ~: 581666)
Logs:
Bound result 7460151375158405
Bound result 529558432846628080274047381762
[PASS] test_previewDeposit((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 633606, ~: 573776)
Logs:
Bound result 321029667911894843
[PASS] test_previewMint((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 638734, ~: 577693)
Logs:
Bound result 12694
Bound result 688
[PASS] test_previewRedeem((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 637579, ~: 576462)
Logs:
Bound result 182708
Bound result 5020
[PASS] test_previewWithdraw((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 643404, ~: 581659)
Logs:
Bound result 394545197267187220278871369893
[PASS] test_redeem((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 5000, μ: 644234, ~: 581646)
Logs:
Bound result 820282019728792003956564819964
Bound result 5941526480816735694
[PASS] test_redeem_zero_allowance((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 594284, ~: 537556)
Logs:
Bound result 182708
Bound result 5020
[PASS] test_totalAssets((address[4],uint256[4],uint256[4],int256)) (runs: 5000, μ: 577969, ~: 521832)
[PASS] test_withdraw((address[4],uint256[4],uint256[4],int256),uint256,uint256) (runs: 5000, μ: 649565, ~: 586416)
Logs:
Bound result 820282019728792003956564819964
Bound result 5941526480816735694
[PASS] test_withdraw_zero_allowance((address[4],uint256[4],uint256[4],int256),uint256) (runs: 5000, μ: 599649, ~: 542328)
Logs:
Bound result 394545197267187220278871369893
Suite result: ok. 26 passed; 0 failed; 0 skipped; finished in 197.17s (197.14s CPU time)
Ran 16 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.Edge.t.sol:TokenizationSpokeEdgeTest
[PASS] test_depositZero_revertsWith_InvalidAmount() (gas: 48685)
[PASS] test_deposit_revertsWith_ERC20InsufficientAllowance_noApproval() (gas: 55967)
[PASS] test_mintZero_revertsWith_InvalidAmount() (gas: 48376)
[PASS] test_mint_revertsWith_ERC20InsufficientAllowance_noApproval() (gas: 61585)
[PASS] test_multipleMintDepositRedeemWithdraw() (gas: 595942)
[PASS] test_redeemZero_revertsWith_InvalidAmount() (gas: 191325)
[PASS] test_redeem_revertsWith_ERC20InsufficientAllowance_callerNotOwner() (gas: 191563)
[PASS] test_redeem_revertsWith_ERC20InsufficientBalance_noShares() (gas: 37289)
[PASS] test_redeem_revertsWith_ERC20InsufficientBalance_on_InsufficientShares() (gas: 187502)
[PASS] test_singleDepositWithdraw() (gas: 227027)
[PASS] test_singleMintRedeem() (gas: 231071)
[PASS] test_vaultInteractionsForSomeoneElse() (gas: 311549)
[PASS] test_withdrawZero_revertsWith_InvalidAmount() (gas: 191889)
[PASS] test_withdraw_revertsWith_ERC20InsufficientAllowance_callerNotOwner() (gas: 197615)
[PASS] test_withdraw_revertsWith_ERC20InsufficientBalance() (gas: 195148)
[PASS] test_withdraw_revertsWith_ERC20InsufficientBalance_noBalance() (gas: 43376)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 35.41ms (6.82ms CPU time)
Ran 2 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.MaxGetters.t.sol:TokenizationSpokeMaxGettersAddCapExactlyReachedTest
[PASS] test_maxDeposit_returnsZero() (gas: 41238)
[PASS] test_maxMint_returnsZero() (gas: 45282)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 26.50ms (283.21µs CPU time)
Ran 2 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.MaxGetters.t.sol:TokenizationSpokeMaxGettersAddCapMaxTest
[PASS] test_maxDeposit_returnsMaxUint() (gas: 23380)
[PASS] test_maxMint_returnsMaxUint() (gas: 23461)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 24.30ms (203.76µs CPU time)
Ran 2 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.MaxGetters.t.sol:TokenizationSpokeMaxGettersAddCapVariableEmptyTest
[PASS] test_maxDeposit_returnsCapTimesUnits() (gas: 44750)
[PASS] test_maxMint_returnsSharesOfCap() (gas: 56916)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 24.67ms (301.33µs CPU time)
Ran 2 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.MaxGetters.t.sol:TokenizationSpokeMaxGettersAddCapVariablePartialTest
[PASS] test_maxDeposit_returnsRemaining() (gas: 49351)
[PASS] test_maxMint_returnsSharesOfRemaining() (gas: 61453)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 24.65ms (354.27µs CPU time)
Ran 2 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.MaxGetters.t.sol:TokenizationSpokeMaxGettersAddCapZeroTest
[PASS] test_maxDeposit_returnsZero() (gas: 41238)
[PASS] test_maxMint_returnsZero() (gas: 45304)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 24.64ms (283.15µs CPU time)
Ran 2 tests for tests/unit/TokenizationSpoke/TokenizationSpoke.MaxGetters.t.sol:TokenizationSpokeMaxGettersCapExceededByYieldTest
[PASS] test_maxDeposit_returnsZero() (gas: 41249)
[PASS] test_maxMint_returnsZero() (gas: 45293)
Suite resul...*[Comment body truncated]* |
| result.userBefore = _snapshotUser(params.spoke, params.reserveId, params.onBehalfOf); | ||
| result.reserveBefore = _snapshotReserve(params.spoke, params.reserveId); | ||
|
|
||
| (result.baseRestored, result.premiumRestored) = _calculateExactRestoreAmount( |
There was a problem hiding this comment.
these values are not checked against executed values. what should be the best approach here?
tests/base/BaseState.sol
Outdated
| import {IAaveOracle} from 'src/spoke/interfaces/IAaveOracle.sol'; | ||
| import {ITreasurySpoke} from 'src/spoke/TreasurySpoke.sol'; | ||
| import {TestTypes} from 'tests/types/TestTypes.sol'; | ||
| import {TestnetERC20} from 'tests/mocks/TestnetERC20.sol'; |
There was a problem hiding this comment.
should we have an imports.sol or something which imports everything and is them imported here and base eventually so for tests we never need to worry about this and its only on one file?
con is when doing major refactors of the codebase, full rft of test is suite is required, incrementally compilation wont work in some cases but i think thats ok tbh bc we will not do that now
| uint32 internal constant MIN_LIQUIDATION_BONUS = uint32(PercentageMath.PERCENTAGE_FACTOR); | ||
| uint32 internal constant MAX_LIQUIDATION_BONUS = 150_00; | ||
| uint16 internal constant MAX_LIQUIDATION_BONUS_FACTOR = uint16(PercentageMath.PERCENTAGE_FACTOR); | ||
| uint16 internal constant MAX_LIQUIDATION_FEE = 100_00; |
tests/unit/setups/BaseState.sol
Outdated
| uint16 internal constant MAX_LIQUIDATION_BONUS_FACTOR = uint16(PercentageMath.PERCENTAGE_FACTOR); | ||
| uint16 internal constant MAX_LIQUIDATION_FEE = 100_00; | ||
| uint16 internal constant MIN_LIQUIDATION_FEE = 0; | ||
| uint128 internal constant HEALTH_FACTOR_LIQUIDATION_THRESHOLD = 1e18; |
There was a problem hiding this comment.
we don't use WAD in src either, I think it's fine as is, wdyt?
There was a problem hiding this comment.
i mean it's a wad scaled quantity. so smt like multiplier * scale is more explicit but yeah nbd
| address internal SPOKE_CONFIGURATOR = makeAddr('SPOKE_CONFIGURATOR'); | ||
|
|
||
| TokenList internal tokenList; | ||
| uint256 internal wethAssetId = 0; |
There was a problem hiding this comment.
for which hub? these should be populated by addAsset and not like this imo
There was a problem hiding this comment.
I definitely agree. however, this is connected more to the refactoring phase where we'll be able to plug&play multiple scenarios. it makes sense to do that refactoring on top of config engine I think, wdyt?
There was a problem hiding this comment.
yeah i don't want to wait for that and ideally this feature completely isolated but sure yep probably makes more sense to just keep these as is for now and rft later
|
|
||
| Decimals internal _decimals = Decimals({usdx: 6, usdy: 18, dai: 18, wbtc: 8, weth: 18, usdz: 18}); | ||
|
|
||
| mapping(ISpoke => SpokeInfo) internal spokeInfo; |
There was a problem hiding this comment.
we have mapping here but above have oracle1, oracle2 etc? can rm those? in the tests just fetch from spoke dynamically but also cache in spokeInfo for validations maybe
There was a problem hiding this comment.
SpokeInfo does not contain info about oracles. Let's keep as is for now, and we can tackle this in the next refactoring phase
There was a problem hiding this comment.
yep, i meant to add it there and clean up above. this is also cosmetic but im good doing it in a follow up pr
tests/unit/setups/BaseState.sol
Outdated
| function _getProxyInitializedVersion(address proxy) internal view returns (uint64) { | ||
| bytes32 slotData = vm.load(proxy, INITIALIZABLE_SLOT); | ||
| return uint64(uint256(slotData) & ((1 << 64) - 1)); | ||
| } | ||
|
|
||
| function makeEntity(string memory id, bytes32 key) internal returns (address) { | ||
| return makeAddr(string.concat(id, '-', vm.toString(uint256(key)))); | ||
| } |
There was a problem hiding this comment.
maybe we sort these by category type or something?
There was a problem hiding this comment.
grouping helpers by category inside this file
tests/base/BaseState.sol
Outdated
| function _underlying(ISpoke spoke, uint256 reserveId) internal view returns (TestnetERC20) { | ||
| return TestnetERC20(spoke.getReserve(reserveId).underlying); | ||
| } | ||
|
|
||
| function _hub(ISpoke spoke, uint256 reserveId) internal view returns (IHub) { | ||
| return IHub(address(spoke.getReserve(reserveId).hub)); | ||
| } | ||
|
|
||
| function _reserveAssetId(ISpoke spoke, uint256 reserveId) internal view returns (uint256) { | ||
| return spoke.getReserve(reserveId).assetId; | ||
| } |
There was a problem hiding this comment.
should be in QueryHelper.sol?
There was a problem hiding this comment.
moved them here bc they are needed in math helpers as well. do you have better ideas? I'm open to suggestions
There was a problem hiding this comment.
math helpers can also inherit query helpers, no? base can still inherit all explicitly and should be fine
There was a problem hiding this comment.
The idea was that helpers would only inherit from BaseState to be more easier to read
There was a problem hiding this comment.
i think it's fine if not. conversion helper overloads would for sure reuse some query helpers, same for config helpers later on etc
| _assertAssetSupply(spoke, reserveId, expectedSuppliedAmount, label); | ||
| } | ||
|
|
||
| function _checkSuppliedAmounts( |
tests/helpers/Assertions.sol
Outdated
| ); | ||
| } | ||
|
|
||
| function _checkSupplyRateIncreasing( |
There was a problem hiding this comment.
checks separate from assertions
tests/helpers/Assertions.sol
Outdated
| /// @dev notify is not called after supply or repay, thus refreshPremium should not be called | ||
| function _assertRefreshPremiumNotCalled() internal { | ||
| vm.expectCall(address(hub1), abi.encodeWithSelector(IHubBase.refreshPremium.selector), 0); | ||
| } |
There was a problem hiding this comment.
this doesnt assert but expect, logically theres a diff so maybe we can rename this method wdyt
There was a problem hiding this comment.
there's more in SigGatewayBase and TOkenizedSpokeBase and eventually in new posms base, good to consolidate all here and then they can reuse base overloaded helpers or ok to keep them there? i think move all here
There was a problem hiding this comment.
those are specific to those contracts, so I think it's fine to keep them there. one thing you could argue we could move here is
function _typedDataHash(
ISignatureGateway _gateway,
bytes32 typeHash
) internal view returns (bytes32) {
return keccak256(abi.encodePacked('\x19\x01', _gateway.DOMAIN_SEPARATOR(), typeHash));
}
We'll need to change first arg to address, but then we'll need to cast all calls to this function, so not sure if it's worth it, wdyt?
There was a problem hiding this comment.
no we can cast it to IERC20Permit or some common interface which all use then they'll cast down normally
There was a problem hiding this comment.
i thought the idea was to accumulate all helpers in one place, eventually idt we need Base. contracts for each if we're splitting all helpers in these separate contracts
| return maxBorrowRate; | ||
| } | ||
|
|
||
| function _reserveDrawnIndex(ISpoke spoke, uint256 reserveId) internal view returns (uint256) { |
| address user, | ||
| uint256 desiredHf | ||
| ) internal returns (uint256 requiredDebtValue) { | ||
| ISpoke.UserAccountData memory userAccountData = _getUserAccountData(spoke, user, true); |
There was a problem hiding this comment.
this should NOT query spoke but rather re implement logic and build this internally (we have _get expected user rp or something which does this, and also this in liquidation logic which can abstracted in one)
this is ofc not cosmetic so something for a followup PR
There was a problem hiding this comment.
this does not query spoke, it uses mock spoke to also update state (and then snapshots to revert state)
There was a problem hiding this comment.
yeah i am saying reimplementing the logic ourselves in the test is much safer and cleaner
There was a problem hiding this comment.
we already have two duplicated helpers in the tests which do most of the process user acc data logic
tests/helpers/TestTypes.sol
Outdated
| /// @title TestTypes | ||
| /// @notice Canonical shared struct definitions for the Aave V4 test suite. | ||
| /// All test base contracts inherit from here to avoid duplicate definitions. | ||
| abstract contract TestTypes { |
There was a problem hiding this comment.
maybe library? not likely
maybe these should be defined where they're used so its easier to reference and things are closer
not convinced this should be a separate file
There was a problem hiding this comment.
these are structs that are used across multiple test files. Others are defined in the test-specific files. We can iterate more on this later, but as a first step I think this file makes sense
There was a problem hiding this comment.
they should be present in base then or where whatever helpers use are defined like checked ones, separate file doesnt make sense just for them
| using SharesMath for uint256; | ||
| using SafeCast for uint256; | ||
|
|
||
| struct HubAddTestState { |
There was a problem hiding this comment.
this is not in types? and i think its fine if its here tbh, same with others
| (uint256 drawnBefore, ) = hub1.getAssetOwed(assetId); | ||
| uint256 liquidityBefore = hub1.getAssetLiquidity(assetId); | ||
| HubSnapshot memory hubBefore = _snapshotHub(hub1, assetId); |
There was a problem hiding this comment.
this is not cosmetic but i think fine for this PR and nice change!
tests/unit/Hub/HubBase.t.sol
Outdated
| function setUp() public virtual override { | ||
| super.setUp(); | ||
| initEnvironment(); |
There was a problem hiding this comment.
hate this in general also, i think super.setUp() just does deployFixtures() so i would replace w that everywhere also
There was a problem hiding this comment.
in some test files we don't override setup, so I think it still makes sense to keep as is, wdyt?
There was a problem hiding this comment.
we would never initEnvironment() without first doing deployFixtures()
| reserveId, | ||
| withdrawable + 1, | ||
| alice | ||
| CheckedWithdrawResult memory r = _checkedWithdraw( |
There was a problem hiding this comment.
love these changes tysm 🙏
can be separate PR maybe bc it increases diff but totally understand if you want to keep here
|
|
||
| assertEq(_getLatestDynamicReserveConfig(spoke, reserveId), config); | ||
| return dynamicConfigKey; | ||
| function _deploySpokeWithOracle( |
There was a problem hiding this comment.
deploy/config helpers? fine here too
There was a problem hiding this comment.
I'm thinking these would be refactored once we bring the config engine, wdyt?
There was a problem hiding this comment.
not talking about refactoring but rather moving here
There was a problem hiding this comment.
but sure we can move once as well bc these might get trimmed/refactored completely
6e6665f to
4e8ebcf
Compare
tests/helpers/Assertions.sol
Outdated
| ); | ||
| } | ||
|
|
||
| function _assertSingleUserProtocolDebt( |
There was a problem hiding this comment.
| function _assertSingleUserProtocolDebt( | |
| function _assertOnlyOneUserDebt( |
| ); | ||
| } | ||
|
|
||
| function _assertAssetSupply( |
There was a problem hiding this comment.
not following what this fn does
There was a problem hiding this comment.
it's just tech debt, here's the function on main:
Line 1988 in d64e58f
One good thing about this first phase of refactoring is the fact that is much easier to detect such anomalies. It will be refactored in later stages.
tests/helpers/MathHelpers.sol
Outdated
| bytes32 internal constant ERC1967_ADMIN_SLOT = | ||
| 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; | ||
| bytes32 internal constant IMPLEMENTATION_SLOT = | ||
| 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; | ||
|
|
||
| /// @notice Pauses the prank mode to allow test helpers to prank other actors. | ||
| modifier pausePrank() { | ||
| (VmSafe.CallerMode callerMode, address msgSender, address txOrigin) = vm.readCallers(); | ||
| if (callerMode == VmSafe.CallerMode.RecurrentPrank) vm.stopPrank(); | ||
| _; | ||
| if (callerMode == VmSafe.CallerMode.RecurrentPrank) vm.startPrank(msgSender, txOrigin); | ||
| } | ||
|
|
There was a problem hiding this comment.
Why are those in MathHelpers ?
00278c1 to
e41e0c9
Compare
d70b55a to
5b5c385
Compare
Uh oh!
There was an error while loading. Please reload this page.