-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Treasury spoke compatible with multiple hubs #950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CheyenneAtapour
wants to merge
1
commit into
main
Choose a base branch
from
feat/multi-treasury-spoke
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+110
−196
Conversation
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
Forge Build Sizes
🔕 Unchanged
|
🌈 Test ResultsNo files changed, compilation skipped
Ran 17 tests for tests/unit/AaveOracle.t.sol:AaveOracleTest
[PASS] test_constructor() (gas: 440456)
[PASS] test_decimals() (gas: 8387)
[PASS] test_deploy_revertsWith_InvalidAddress() (gas: 38089)
[PASS] test_description() (gas: 12094)
[PASS] test_fuzz_constructor(uint8) (runs: 5000, μ: 444409, ~: 444703)
[PASS] test_getReservePrice() (gas: 47409)
[PASS] test_getReservePrice_revertsWith_InvalidPrice() (gas: 46669)
[PASS] test_getReservePrice_revertsWith_InvalidSource() (gas: 10976)
[PASS] test_getReservePrices() (gas: 79551)
[PASS] test_getReservePrices_revertsWith_InvalidSource() (gas: 49352)
[PASS] test_getReserveSource() (gas: 47584)
[PASS] test_setReserveSource() (gas: 44466)
[PASS] test_setReserveSource_revertsWith_InvalidPrice() (gas: 97683)
[PASS] test_setReserveSource_revertsWith_InvalidSource() (gas: 15327)
[PASS] test_setReserveSource_revertsWith_InvalidSourceDecimals() (gas: 15149)
[PASS] test_setReserveSource_revertsWith_OnlySpoke() (gas: 11049)
[PASS] test_spoke() (gas: 10614)
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 516.51ms (501.94ms CPU time)
Ran 23 tests for tests/unit/AssetInterestRateStrategy.t.sol:AssetInterestRateStrategyTest
[PASS] test_calculateInterestRate_AtKinkPoint() (gas: 24686)
Logs:
Bound result 2000
Bound result 778565440757296803935461404101
[PASS] test_calculateInterestRate_AtMaxUtilization() (gas: 24958)
Logs:
Bound result 10000
Bound result 778565440757296803935461404101
[PASS] test_calculateInterestRate_LeftToKinkPoint(uint256) (runs: 5000, μ: 24542, ~: 24690)
[PASS] test_calculateInterestRate_RightToKinkPoint(uint256) (runs: 5000, μ: 25651, ~: 25690)
[PASS] test_calculateInterestRate_ZeroDebtZeroLiquidity() (gas: 18944)
Logs:
Bound result 0
[PASS] test_calculateInterestRate_fuzz_ZeroDebt(uint256) (runs: 5000, μ: 19166, ~: 18950)
[PASS] test_calculateInterestRate_revertsWith_InterestRateDataNotSet() (gas: 11361)
[PASS] test_deploy_revertsWith_InvalidAddress() (gas: 36318)
[PASS] test_getBaseVariableBorrowRate() (gas: 14864)
[PASS] test_getInterestRateData() (gas: 19653)
[PASS] test_getMaxVariableBorrowRate() (gas: 15312)
[PASS] test_getOptimalUsageRatio() (gas: 14735)
[PASS] test_getVariableRateSlope1() (gas: 14810)
[PASS] test_getVariableRateSlope2() (gas: 14877)
[PASS] test_maxBorrowRate() (gas: 8431)
[PASS] test_maxOptimalRatio() (gas: 8431)
[PASS] test_minOptimalRatio() (gas: 8440)
[PASS] test_setInterestRateData() (gas: 69812)
[PASS] test_setInterestRateData_revertsWith_InvalidMaxRate() (gas: 42072)
[PASS] test_setInterestRateData_revertsWith_InvalidOptimalUsageRatio() (gas: 43120)
[PASS] test_setInterestRateData_revertsWith_InvalidRateData() (gas: 35395)
[PASS] test_setInterestRateData_revertsWith_OnlyHub() (gas: 23786)
[PASS] test_setInterestRateData_revertsWith_Slope2MustBeGteSlope1() (gas: 37980)
Suite result: ok. 23 passed; 0 failed; 0 skipped; finished in 984.82ms (978.37ms CPU time)
Ran 8 tests for tests/unit/misc/EIP712Hash.t.sol:EIP712HashTest
[PASS] test_constants() (gas: 5450)
[PASS] test_hash_borrow_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 4659, ~: 4659)
[PASS] test_hash_repay_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 4615, ~: 4615)
[PASS] test_hash_setUsingAsCollateral_fuzz((address,uint256,bool,address,uint256,uint256)) (runs: 5000, μ: 4902, ~: 4902)
[PASS] test_hash_supply_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 4703, ~: 4703)
[PASS] test_hash_updateUserDynamicConfig_fuzz((address,address,uint256,uint256)) (runs: 5000, μ: 4441, ~: 4441)
[PASS] test_hash_updateUserRiskPremium_fuzz((address,address,uint256,uint256)) (runs: 5000, μ: 4462, ~: 4462)
[PASS] test_hash_withdraw_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 4681, ~: 4681)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 884.30ms (884.12ms CPU time)
Ran 8 tests for tests/unit/misc/GatewayBase.t.sol:GatewayBaseTest
[PASS] test_constructor() (gas: 430048)
[PASS] test_registerSpoke_fuzz(address) (runs: 5000, μ: 42033, ~: 42033)
[PASS] test_registerSpoke_revertsWith_InvalidAddress() (gas: 13345)
[PASS] test_registerSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 14077)
[PASS] test_registerSpoke_unregister() (gas: 36599)
[PASS] test_renouncePositionManagerRole() (gas: 65218)
[PASS] test_renouncePositionManagerRole_revertsWith_InvalidAddress() (gas: 76616)
[PASS] test_renouncePositionManagerRole_revertsWith_OwnableUnauthorizedAccount() (gas: 76783)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 338.65ms (322.07ms CPU time)
Ran 5 tests for tests/gas/Gateways.Operations.gas.t.sol:NativeTokenGateway_Gas_Tests
[PASS] test_borrowNative() (gas: 913992)
[PASS] test_repayNative() (gas: 1135379)
[PASS] test_supplyAndCollateralNative() (gas: 293572)
[PASS] test_supplyNative() (gas: 275755)
[PASS] test_withdrawNative() (gas: 487386)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 33.87ms (4.82ms CPU time)
Ran 8 tests for tests/gas/Gateways.Operations.gas.t.sol:SignatureGateway_Gas_Tests
[PASS] test_borrowWithSig() (gas: 752310)
[PASS] test_repayWithSig() (gas: 1093534)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 201454)
[PASS] test_setUsingAsCollateralWithSig() (gas: 279941)
[PASS] test_supplyWithSig() (gas: 447071)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 138565)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 135956)
[PASS] test_withdrawWithSig() (gas: 392608)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 31.38ms (8.75ms CPU time)
Ran 6 tests for tests/unit/Hub/Hub.Access.t.sol:HubAccessTest
[PASS] test_change_authority() (gas: 2314519)
[PASS] test_change_role_responsibility() (gas: 102145)
[PASS] test_hub_access_manager_exposure() (gas: 12706)
[PASS] test_hub_admin_access() (gas: 1135155)
[PASS] test_migrate_role_responsibility() (gas: 395195)
[PASS] test_setInterestRateData_access() (gas: 100913)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 19.93ms (3.63ms CPU time)
Ran 21 tests for tests/unit/Hub/Hub.Add.t.sol:HubAddTest
[PASS] test_add_AddCapReachedButNotExceeded_rounding() (gas: 646527)
[PASS] test_add_fuzz_AddCapReachedButNotExceeded(uint40) (runs: 5000, μ: 155328, ~: 155295)
[PASS] test_add_fuzz_multi_asset_multi_spoke(uint256,uint256,uint256) (runs: 5000, μ: 305040, ~: 305176)
[PASS] test_add_fuzz_revertsWith_AddCapExceeded(uint40) (runs: 5000, μ: 78656, ~: 78623)
[PASS] test_add_fuzz_revertsWith_AddCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 276826, ~: 279381)
[PASS] test_add_fuzz_revertsWith_InvalidShares_due_to_index(uint256,uint256,uint256) (runs: 5000, μ: 212661, ~: 212838)
[PASS] test_add_fuzz_revertsWith_TransferFromFailed(uint256) (runs: 5000, μ: 77682, ~: 77410)
[PASS] test_add_fuzz_single_asset(uint256,address,uint256) (runs: 5000, μ: 335230, ~: 335151)
[PASS] test_add_fuzz_single_spoke_multi_add(uint256,uint256) (runs: 5000, μ: 779024, ~: 781211)
[PASS] test_add_multi_add_minimal_shares() (gas: 332600)
[PASS] test_add_revertsWith_AmountDowncastOverflow() (gas: 202174)
[PASS] test_add_revertsWith_InvalidAddress() (gas: 15832)
[PASS] test_add_revertsWith_InvalidAmount() (gas: 15877)
[PASS] test_add_revertsWith_InvalidShares() (gas: 214551)
[PASS] test_add_revertsWith_SharesDowncastOverflow() (gas: 35767)
[PASS] test_add_revertsWith_SpokeNotActive() (gas: 59869)
[PASS] test_add_revertsWith_SpokePaused() (gas: 59986)
[PASS] test_add_revertsWith_TransferFromFailed() (gas: 73984)
[PASS] test_add_single_asset() (gas: 323137)
Logs:
Bound result 2
Bound result 100000000000000000000
[PASS] test_add_with_increased_index() (gas: 315648)
[PASS] test_add_with_increased_index_with_premium() (gas: 668184)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 46.73s (46.71s CPU time)
Ran 32 tests for tests/unit/Hub/Hub.Config.t.sol:HubConfigTest
[PASS] test_addAsset_fuzz(address,uint8,address) (runs: 5000, μ: 843498, ~: 843530)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_feeReceiver(address,uint8,address) (runs: 5000, μ: 46624, ~: 46926)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_irStrategy(address,uint8,address) (runs: 5000, μ: 46700, ~: 47002)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_underlying(uint8,address,address) (runs: 5000, μ: 37733, ~: 37733)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals(address,uint8,address,address) (runs: 5000, μ: 47163, ~: 46982)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals_tooLow(address,uint8,address,address) (runs: 5000, μ: 47447, ~: 47681)
[PASS] test_addAsset_fuzz_reverts_InvalidIrData(address,uint8,address,address) (runs: 5000, μ: 39883, ~: 36252)
[PASS] test_addAsset_revertsWith_BlockTimestampDowncastOverflow() (gas: 81114)
[PASS] test_addAsset_revertsWith_DrawnRateDowncastOverflow() (gas: 78043)
[PASS] test_addSpoke_fuzz(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 125817, ~: 125874)
[PASS] test_addSpoke_fuzz_revertsWith_AssetNotListed(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 34721, ~: 34709)
[PASS] test_addSpoke_fuzz_revertsWith_InvalidAddress_spoke(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 33308, ~: 33365)
[PASS] test_addSpoke_revertsWith_SpokeAlreadyListed() (gas: 38920)
[PASS] test_hub_deploy_revertsWith_InvalidAddress() (gas: 47165)
[PASS] test_hub_max_riskPremium() (gas: 8569)
[PASS] test_updateAssetConfig_UseExistingSpokeAndListedAsFeeReceiver_revertsWith_SpokeAlreadyListed() (gas: 60522)
[PASS] test_updateAssetConfig_fuzz(uint256,(address,uint16,address,address)) (runs: 5000, μ: 243345, ~: 243218)
[PASS] test_updateAssetConfig_fuzz_FromZeroLiquidityFee(uint256,uint16) (runs: 5000, μ: 757024, ~: 756947)
[PASS] test_updateAssetConfig_fuzz_LiquidityFee(uint256,uint16) (runs: 5000, μ: 654935, ~: 654859)
[PASS] test_updateAssetConfig_fuzz_NewFeeReceiver(uint256) (runs: 5000, μ: 726077, ~: 726133)
[PASS] test_updateAssetConfig_fuzz_NewInterestRateStrategy(uint256) (runs: 5000, μ: 1126634, ~: 1126738)
[PASS] test_updateAssetConfig_fuzz_ReuseFeeReceiver_revertsWith_SpokeAlreadyListed(uint256) (runs: 5000, μ: 764038, ~: 764095)
[PASS] test_updateAssetConfig_fuzz_Scenario(uint256) (runs: 5000, μ: 606537, ~: 606591)
[PASS] test_updateAssetConfig_fuzz_UseExistingSpokeAsFeeReceiver_revertsWith_SpokeAlreadyListed(uint256) (runs: 5000, μ: 60150, ~: 60150)
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidInterestRateStrategy(uint256) (runs: 5000, μ: 57824, ~: 57878)
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidLiquidityFee(uint256,(address,uint16,address,address)) (runs: 5000, μ: 41037, ~: 40891)
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidReinvestmentController() (gas: 494041)
[PASS] test_updateAssetConfig_fuzz_revertsWith_calculateInterestRateReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 192103, ~: 191957)
[PASS] test_updateAssetConfig_fuzz_revertsWith_setInterestRateDataReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 65151, ~: 65005)
[PASS] test_updateSpokeConfig_fuzz(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 58383, ~: 58449)
[PASS] test_updateSpokeConfig_fuzz_revertsWith_SpokeNotListed(uint256,address,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 40374, ~: 40438)
[PASS] test_updateSpokeConfig_revertsWith_AssetNotListed() (gas: 29268)
Suite result: ok. 32 passed; 0 failed; 0 skipped; finished in 97.38s (97.37s CPU time)
Ran 16 tests for tests/unit/Hub/Hub.Draw.t.sol:HubDrawTest
[PASS] test_draw_DifferentSpokes() (gas: 363507)
[PASS] test_draw_fuzz_IncreasedBorrowRate(uint256,uint256) (runs: 5000, μ: 680834, ~: 681252)
[PASS] test_draw_fuzz_amounts_same_block(uint256,uint256) (runs: 5000, μ: 283717, ~: 283581)
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded(uint40) (runs: 5000, μ: 81246, ~: 81214)
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 298377, ~: 298496)
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity(uint256,uint256) (runs: 5000, μ: 33875, ~: 33678)
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_draw(uint256) (runs: 5000, μ: 181593, ~: 181321)
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_remove(uint256) (runs: 5000, μ: 125277, ~: 125083)
[PASS] test_draw_fuzz_revertsWith_InvalidAddress(uint256) (runs: 5000, μ: 15760, ~: 15760)
[PASS] test_draw_revertsWith_DrawCapExceeded_due_to_deficit() (gas: 254507)
[PASS] test_draw_revertsWith_InsufficientLiquidity() (gas: 27956)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_draw() (gas: 177896)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_remove() (gas: 122392)
[PASS] test_draw_revertsWith_InvalidAmount() (gas: 15880)
[PASS] test_draw_revertsWith_SpokeNotActive() (gas: 59693)
[PASS] test_draw_revertsWith_SpokePaused() (gas: 59766)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 25.17s (25.14s CPU time)
Ran 6 tests for tests/unit/Hub/Hub.EliminateDeficit.t.sol:HubEliminateDeficitTest
[PASS] test_eliminateDeficit(uint256) (runs: 5000, μ: 495092, ~: 495092)
[PASS] test_eliminateDeficit_allowSpokePaused() (gas: 337136)
[PASS] test_eliminateDeficit_fuzz_revertsWith_InvalidAmount_Excess(uint256) (runs: 5000, μ: 249383, ~: 249383)
[PASS] test_eliminateDeficit_fuzz_revertsWith_callerSpokeNotActive(address) (runs: 5000, μ: 29096, ~: 29096)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountNoDeficit() (gas: 20023)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountWithDeficit() (gas: 250527)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 12.53s (12.51s CPU time)
Ran 7 tests for tests/gas/Hub.Operations.gas.t.sol:HubOperations_Gas_Tests
[PASS] test_add() (gas: 127997)
[PASS] test_deficit() (gas: 1043112)
[PASS] test_draw() (gas: 369875)
[PASS] test_payFee_transferShares() (gas: 919747)
[PASS] test_refreshPremium() (gas: 617928)
[PASS] test_remove() (gas: 268388)
[PASS] test_restore() (gas: 721918)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 27.63ms (4.86ms CPU time)
Ran 6 tests for tests/unit/Hub/Hub.PayFee.t.sol:HubPayFeeTest
[PASS] test_payFee_fuzz(uint256,uint256) (runs: 5000, μ: 664867, ~: 664953)
[PASS] test_payFee_fuzz_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 665146, ~: 665176)
[PASS] test_payFee_revertsWith_InvalidShares() (gas: 20213)
[PASS] test_payFee_revertsWith_SpokeNotActive() (gas: 59732)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded() (gas: 131440)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded_with_interest() (gas: 631021)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 23.31s (23.29s CPU time)
Ran 7 tests for tests/unit/Spoke/Spoke.AccrueInterest.t.sol:SpokeAccrueInterestTest
[PASS] test_accrueInterest_NoActionTaken() (gas: 134821)
[PASS] test_accrueInterest_NoInterest_NoDebt(uint32) (runs: 5000, μ: 641630, ~: 641543)
[PASS] test_accrueInterest_NoInterest_OnlySupply(uint32) (runs: 5000, μ: 251966, ~: 252192)
[PASS] test_accrueInterest_TenPercentRp(uint256,uint32) (runs: 5000, μ: 585263, ~: 586074)
[PASS] test_accrueInterest_fuzz_BorrowAmountAndSkipTime(uint256,uint32) (runs: 5000, μ: 545580, ~: 545964)
[PASS] test_accrueInterest_fuzz_RPBorrowAndSkipTime((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint32) (runs: 5000, μ: 3872267, ~: 3886308)
[PASS] test_accrueInterest_fuzz_RatesRPBorrowAndSkipTime((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),(uint96,uint96,uint96,uint96),uint32) (runs: 5000, μ: 3933673, ~: 3945360)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 209.31s (209.29s CPU time)
Ran 10 tests for tests/unit/Hub/Hub.Reclaim.t.sol:HubReclaimTest
[PASS] test_reclaim() (gas: 677135)
Logs:
Bound result 1000000000000000000000
Bound result 500000000000000000000
Bound result 200000000000000000000
[PASS] test_reclaim_fullAmount() (gas: 657934)
[PASS] test_reclaim_fuzz(uint256,uint256,uint256) (runs: 5000, μ: 678578, ~: 678135)
[PASS] test_reclaim_multipleSweepsAndReclaims() (gas: 784778)
[PASS] test_reclaim_revertsWith_AssetNotListed() (gas: 12461)
[PASS] test_reclaim_revertsWith_InvalidAmount_zero() (gas: 90354)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController(address) (runs: 5000, μ: 91219, ~: 91219)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController_init() (gas: 38018)
[PASS] test_reclaim_revertsWith_underflow_exceedsSwept() (gas: 112918)
[PASS] test_reclaim_revertsWith_underflow_exceedsSwept_afterSweep() (gas: 466010)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 14.47s (14.46s 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, μ: 549115, ~: 549278)
[PASS] test_accrueLiquidityFee_fuzz_maxLiquidityFee_with_premium_multiple_users(uint256,uint256,uint256,uint256,uint256) (runs: 5000, μ: 791503, ~: 791496)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_spoke() (gas: 587982900)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_user() (gas: 248830980)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_with_premium() (gas: 549597)
Logs:
Bound result 500000000000000000000
Bound result 5000
Bound result 34560000
Bound result 2
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 20.30s (20.28s CPU time)
Ran 10 tests for tests/unit/Hub/Hub.RefreshPremium.t.sol:HubRefreshPremiumTest
[PASS] test_refreshPremium_emitsEvent() (gas: 265392)
[PASS] test_refreshPremium_fuzz_positiveDeltas(uint256,int256,int256,int256,bool) (runs: 5000, μ: 476549, ~: 480177)
[PASS] test_refreshPremium_fuzz_withAccrual(uint256,uint256,uint256,uint256) (runs: 5000, μ: 553961, ~: 559969)
[PASS] test_refreshPremium_maxRiskPremiumCap() (gas: 903089)
[PASS] test_refreshPremium_negativeDeltas(int256,int256) (runs: 5000, μ: 471848, ~: 472333)
[PASS] test_refreshPremium_negativeDeltas_withAccrual(uint256,uint256) (runs: 5000, μ: 541418, ~: 550479)
[PASS] test_refreshPremium_pausedSpokesAllowed() (gas: 111525)
[PASS] test_refreshPremium_revertsWith_SpokeNotActive() (gas: 57662)
[PASS] test_refreshPremium_riskPremiumCap() (gas: 929296)
[PASS] test_refreshPremium_spokePremiumUpdateIsContained() (gas: 734706)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 23.28s (23.26s CPU time)
Ran 7 tests for tests/unit/Spoke/Spoke.AccrueLiquidityFee.t.sol:SpokeAccrueLiquidityFeeTest
[PASS] test_accrueLiquidityFee() (gas: 822726)
[PASS] test_accrueLiquidityFee_NoActionTaken() (gas: 97373)
[PASS] test_accrueLiquidityFee_NoInterest_OnlySupply(uint32) (runs: 5000, μ: 233589, ~: 233723)
[PASS] test_accrueLiquidityFee_exact() (gas: 811618)
[PASS] test_accrueLiquidityFee_fuzz_BorrowAmountAndSkipTime(uint256,uint32) (runs: 5000, μ: 814390, ~: 839705)
[PASS] test_accrueLiquidityFee_maxLiquidityFee() (gas: 544259)
[PASS] test_accrueLiquidityFee_setUsingAsCollateral() (gas: 876286)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 18.49s (18.47s CPU time)
Ran 15 tests for tests/unit/Hub/Hub.Remove.t.sol:HubRemoveTest
[PASS] test_remove() (gas: 192256)
Logs:
Bound result 2
Bound result 100000000000000000000
[PASS] test_remove_all_with_interest() (gas: 387739)
[PASS] test_remove_fuzz(uint256,uint256) (runs: 5000, μ: 190820, ~: 190625)
[PASS] test_remove_fuzz_all_liquidity_with_interest(uint256,uint256) (runs: 5000, μ: 423558, ~: 426155)
[PASS] test_remove_fuzz_multi_spoke(uint256,uint256) (runs: 5000, μ: 267313, ~: 267467)
[PASS] test_remove_fuzz_multi_spoke_with_interest(uint256,uint256,uint256,uint256) (runs: 5000, μ: 433596, ~: 436742)
[PASS] test_remove_revertsWith_InsufficientLiquidity() (gas: 166728)
[PASS] test_remove_revertsWith_InsufficientLiquidity_exceeding_added_amount() (gas: 134739)
[PASS] test_remove_revertsWith_InsufficientLiquidity_zero_added() (gas: 20709)
[PASS] test_remove_revertsWith_InvalidAddress() (gas: 15680)
[PASS] test_remove_revertsWith_InvalidAmount() (gas: 17781)
[PASS] test_remove_revertsWith_SpokeNotActive() (gas: 59835)
[PASS] test_remove_revertsWith_SpokePaused() (gas: 59941)
[PASS] test_remove_revertsWith_underflow_exceeding_added_amount() (gas: 167339)
[PASS] test_remove_revertsWtih_underflow_one_extra_wei() (gas: 343509)
Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 29.98s (29.97s CPU time)
Ran 6 tests for tests/unit/Hub/Hub.ReportDeficit.t.sol:HubReportDeficitTest
[PASS] test_reportDeficit_fuzz_revertsWith_SurplusDeficitReported(uint256,uint256,uint256,uint256) (runs: 5000, μ: 159917, ~: 159930)
[PASS] test_reportDeficit_fuzz_with_premium(uint256,uint256,uint256,uint256) (runs: 5000, μ: 666741, ~: 669228)
[PASS] test_reportDeficit_revertsWith_InvalidAmount() (gas: 18215)
[PASS] test_reportDeficit_revertsWith_SpokeNotActive(address) (runs: 5000, μ: 26660, ~: 26660)
[PASS] test_reportDeficit_surplus_drawn_revertsWith_SurplusDeficitReported() (gas: 199053)
[PASS] test_reportDeficit_with_premium() (gas: 667825)
Logs:
Bound result 10000000000
Bound result 31536000
Bound result 5000000000
Bound result 0
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 14.68s (14.66s CPU time)
Ran 21 tests for tests/unit/Hub/Hub.Restore.t.sol:HubRestoreTest
[PASS] test_restore_full_amount_with_interest() (gas: 354305)
Logs:
Bound result 1000000000000000000000
Bound result 500000000000000000000
Bound result 31536000
[PASS] test_restore_full_amount_with_interest_and_premium() (gas: 657032)
Logs:
Bound result 100000000000000000000
Bound result 50000000000000000000
Bound result 31536000
Bound result 1
[PASS] test_restore_fuzz_full_amount_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 353006, ~: 355522)
[PASS] test_restore_fuzz_full_amount_with_interest_and_premium(uint256,uint256,uint256,uint256) (runs: 5000, μ: 640594, ~: 658391)
[PASS] test_restore_fuzz_revertsWith_SurplusAmountRestored_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 249155, ~: 252938)
[PASS] test_restore_fuzz_revertsWith_SurplusAmountRestored_with_interest_and_premium(uint256,uint256,uint256,uint256) (runs: 5000, μ: 627929, ~: 631610)
[PASS] test_restore_one_share_delta_increase_revertsWith_InvalidPremiumChange() (gas: 237978)
[PASS] test_restore_partial_drawn() (gas: 327677)
[PASS] test_restore_partial_same_block() (gas: 309144)
[PASS] test_restore_premiumDeltas_twoWeiIncrease_realizedDelta() (gas: 252218)
[PASS] test_restore_revertsWith_InvalidAmount_zero() (gas: 46939)
[PASS] test_restore_revertsWith_InvalidPremiumChange_premiumIncrease() (gas: 194608)
[PASS] test_restore_revertsWith_InvalidPremiumChange_premiumSharesIncrease() (gas: 194606)
[PASS] test_restore_revertsWith_SpokeNotActive_whenPaused() (gas: 159473)
[PASS] test_restore_revertsWith_SpokePaused() (gas: 86911)
[PASS] test_restore_revertsWith_SurplusAmountRestored() (gas: 338627)
[PASS] test_restore_revertsWith_SurplusAmountRestored_with_interest() (gas: 251996)
Logs:
Bound result 100000000000000000000
Bound result 50000000000000000000
Bound result 15768000
[PASS] test_restore_revertsWith_SurplusAmountRestored_with_interest_and_premium() (gas: 630292)
Logs:
Bound result 100000000000000000000
Bound result 50000000000000000000
Bound result 31536000
Bound result 1
[PASS] test_restore_revertsWith_underflow_offsetIncrease() (gas: 194617)
[PASS] test_restore_tooMuchDrawn_revertsWith_SurplusAmountRestored() (gas: 233633)
[PASS] test_restore_when_asset_frozen() (gas: 413171)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 18.43s (18.42s CPU time)
Ran 5 tests for tests/unit/Spoke/Spoke.Borrow.EdgeCases.t.sol:SpokeBorrowEdgeCasesTest
[PASS] test_borrow_fuzz_rounding_effect(uint256,uint256) (runs: 5000, μ: 1059816, ~: 1059966)
[PASS] test_borrow_fuzz_rounding_effect_inflated_ex_rate(uint256,uint256,uint256) (runs: 5000, μ: 1439529, ~: 1439673)
[PASS] test_borrow_fuzz_rounding_effect_shares(uint256,uint256) (runs: 5000, μ: 1106283, ~: 1106051)
[PASS] test_borrow_rounding_effect_multiple_actions() (gas: 1164656)
[PASS] test_borrow_rounding_effect_shares() (gas: 1105266)
Logs:
Bound result 5000000000000000000
Bound result 94608000
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 63.24s (63.23s CPU time)
Ran 1 test for tests/unit/Hub/Hub.Rounding.t.sol:HubRoundingTest
[PASS] test_sharePriceWithMultipleDonations() (gas: 653078358)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 3.23s (3.22s CPU time)
Ran 8 tests for tests/unit/Hub/Hub.Sweep.t.sol:HubSweepTest
[PASS] test_sweep() (gas: 483532)
Logs:
Bound result 1000000000000000000000
Bound result 1000000000000000000000
[PASS] test_sweep_does_not_impact_utilization(uint256,uint256) (runs: 5000, μ: 646812, ~: 647964)
[PASS] test_sweep_fuzz(uint256,uint256) (runs: 5000, μ: 484049, ~: 484056)
[PASS] test_sweep_revertsWith_AssetNotListed() (gas: 12340)
[PASS] test_sweep_revertsWith_InsufficientLiquidity() (gas: 229570)
[PASS] test_sweep_revertsWith_InvalidAmount() (gas: 101299)
[PASS] test_sweep_revertsWith_OnlyReinvestmentController(address) (runs: 5000, μ: 91853, ~: 91853)
[PASS] test_sweep_revertsWith_OnlyReinvestmentController_init() (gas: 37943)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 17.56s (17.53s CPU time)
Ran 7 tests for tests/unit/Hub/Hub.TransferShares.t.sol:HubTransferSharesTest
[PASS] test_transferShares() (gas: 169358)
Logs:
Bound result 1000000000000000000000
Bound result 1000000000000000000000
[PASS] test_transferShares_fuzz(uint256,uint256) (runs: 5000, μ: 172791, ~: 172943)
[PASS] test_transferShares_fuzz_revertsWith_underflow_spoke_added_shares_exceeded(uint256) (runs: 5000, μ: 139470, ~: 139198)
[PASS] test_transferShares_revertsWith_AddCapExceeded() (gas: 182644)
[PASS] test_transferShares_revertsWith_SpokeNotActive() (gas: 164299)
[PASS] test_transferShares_revertsWith_SpokePaused() (gas: 166658)
[PASS] test_transferShares_zeroShares_revertsWith_InvalidShares() (gas: 22486)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 6.53s (6.51s CPU time)
Ran 6 tests for tests/unit/Hub/HubAccrueInterest.t.sol:HubAccrueInterestTest
[PASS] test_accrueInterest_NoActionTaken() (gas: 40872)
[PASS] test_accrueInterest_NoInterest_NoDebt(uint32) (runs: 5000, μ: 325362, ~: 325291)
[PASS] test_accrueInterest_NoInterest_OnlyAdd(uint32) (runs: 5000, μ: 185139, ~: 185068)
[PASS] test_accrueInterest_fuzz_BorrowAmountAndElapsed(uint256,uint32) (runs: 5000, μ: 259529, ~: 261915)
[PASS] test_accrueInterest_fuzz_BorrowAmountRateAndElapsed(uint256,uint256,uint32) (runs: 5000, μ: 357358, ~: 360811)
[PASS] test_accrueInterest_fuzz_BorrowAndWait(uint32) (runs: 5000, μ: 260942, ~: 260871)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 20.45s (20.43s CPU time)
Ran 60 tests for tests/unit/HubConfigurator.t.sol:HubConfiguratorTest
[PASS] test_addAsset_fuzz(bool,address,uint8,address,uint256,uint16,uint32,uint32,uint32) (runs: 5000, μ: 875899, ~: 876211)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals(bool,address,uint8,address,uint256,address) (runs: 5000, μ: 57692, ~: 57658)
[PASS] test_addAsset_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 31197, ~: 31197)
[PASS] test_addAsset_revertsWith_InvalidAddress_irStrategy() (gas: 50828)
[PASS] test_addAsset_revertsWith_InvalidAddress_underlying() (gas: 50815)
[PASS] test_addAsset_revertsWith_InvalidLiquidityFee() (gas: 800347)
[PASS] test_addAsset_reverts_invalidIrData() (gas: 44616)
[PASS] test_addSpoke() (gas: 126251)
[PASS] test_addSpokeToAssets() (gas: 222893)
[PASS] test_addSpokeToAssets_revertsWith_MismatchedConfigs() (gas: 24824)
[PASS] test_addSpokeToAssets_revertsWith_OwnableUnauthorizedAccount() (gas: 17215)
[PASS] test_addSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 16882)
[PASS] test_deactivateAsset() (gas: 158830)
[PASS] test_deactivateAsset_revertsWith_OwnableUnauthorizedAccount() (gas: 17899)
[PASS] test_deactivateSpoke() (gas: 155692)
[PASS] test_deactivateSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 18060)
[PASS] test_freezeAsset() (gas: 233441)
[PASS] test_freezeAsset_revertsWith_OwnableUnauthorizedAccount() (gas: 18007)
[PASS] test_freezeSpoke() (gas: 249062)
[PASS] test_freezeSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 18038)
[PASS] test_pauseAsset() (gas: 158818)
[PASS] test_pauseAsset_revertsWith_OwnableUnauthorizedAccount() (gas: 17921)
[PASS] test_pauseSpoke() (gas: 155836)
[PASS] test_pauseSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 18103)
[PASS] test_updateFeeConfig_Scenario() (gas: 323791)
Logs:
Bound result 0
Bound result 1800
Bound result 0
Bound result 400
Bound result 0
Bound result 0
[PASS] test_updateFeeConfig_fuzz(uint256,uint16,address) (runs: 5000, μ: 175043, ~: 174920)
[PASS] test_updateFeeConfig_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 17695, ~: 17695)
[PASS] test_updateFeeConfig_revertsWith_InvalidAddress_spoke() (gas: 48137)
[PASS] test_updateFeeConfig_revertsWith_InvalidLiquidityFee() (gas: 50026)
[PASS] test_updateFeeReceiver_Scenario() (gas: 205028)
[PASS] test_updateFeeReceiver_WithdrawFromOldSpoke() (gas: 848963)
[PASS] test_updateFeeReceiver_correctAccruals() (gas: 874378)
[PASS] test_updateFeeReceiver_fuzz(address) (runs: 5000, μ: 171406, ~: 171406)
[PASS] test_updateFeeReceiver_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 17247, ~: 17247)
[PASS] test_updateFeeReceiver_revertsWith_InvalidAddress_spoke() (gas: 52684)
[PASS] test_updateFeeReceiver_revertsWith_SpokeAlreadyListed() (gas: 74613)
[PASS] test_updateInterestRateData() (gas: 71332)
[PASS] test_updateInterestRateData_revertsWith_OwnableUnauthorizedAccount() (gas: 19152)
[PASS] test_updateInterestRateStrategy() (gas: 90932)
[PASS] test_updateInterestRateStrategy_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 28659, ~: 28659)
[PASS] test_updateInterestRateStrategy_revertsWith_InterestRateStrategyReverts() (gas: 74562)
[PASS] test_updateInterestRateStrategy_revertsWith_InvalidAddress_irStrategy() (gas: 64287)
[PASS] test_updateInterestRateStrategy_revertsWith_InvalidInterestRateStrategy() (gas: 64781)
[PASS] test_updateLiquidityFee_fuzz(uint256,uint16) (runs: 5000, μ: 84127, ~: 83987)
[PASS] test_updateLiquidityFee_revertsWith_InvalidLiquidityFee() (gas: 52671)
[PASS] test_updateLiquidityFee_revertsWith_OwnableUnauthorizedAccount() (gas: 16655)
[PASS] test_updateReinvestmentController() (gas: 98816)
[PASS] test_updateReinvestmentController_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 17249, ~: 17249)
[PASS] test_updateSpokeActive() (gas: 84278)
[PASS] test_updateSpokeActive_revertsWith_OwnableUnauthorizedAccount() (gas: 20285)
[PASS] test_updateSpokeCaps() (gas: 64641)
[PASS] test_updateSpokeCaps_revertsWith_OwnableUnauthorizedAccount() (gas: 20262)
[PASS] test_updateSpokeDrawCap() (gas: 64199)
[PASS] test_updateSpokeDrawCap_revertsWith_OwnableUnauthorizedAccount() (gas: 20223)
[PASS] test_updateSpokePaused() (gas: 87258)
[PASS] test_updateSpokePaused_revertsWith_OwnableUnauthorizedAccount() (gas: 20330)
[PASS] test_updateSpokeRiskPremiumCap() (gas: 64263)
[PASS] test_updateSpokeRiskPremiumCap_revertsWith_OwnableUnauthorizedAccount() (gas: 20236)
[PASS] test_updateSpokeSupplyCap() (gas: 64245)
[PASS] test_updateSpokeSupplyCap_revertsWith_OwnableUnauthorizedAccount() (gas: 20182)
Suite result: ok. 60 passed; 0 failed; 0 skipped; finished in 10.02s (10.00s CPU time)
Ran 2 tests for tests/invariant/HubInvariant.t.sol:HubInvariant
[SKIP] invariant_exchangeRateMonotonicallyIncreasing() (runs: 1, calls: 1, reverts: 1)
[SKIP] invariant_reserveTotalAssets() (runs: 1, calls: 1, reverts: 1)
Suite result: ok. 0 passed; 0 failed; 2 skipped; finished in 3.43ms (681.41µs CPU time)
Ran 9 tests for tests/unit/KeyValueList.t.sol:KeyValueListTest
[PASS] test_add_unique() (gas: 325391)
[PASS] test_fuzz_add(uint256,uint256) (runs: 5000, μ: 200011, ~: 201361)
[PASS] test_fuzz_add_unique(uint256,uint256) (runs: 5000, μ: 234671, ~: 235413)
[PASS] test_fuzz_get(uint256[]) (runs: 5000, μ: 413030, ~: 411058)
[PASS] test_fuzz_get_uninitialized(uint256[]) (runs: 5000, μ: 263153, ~: 252829)
[PASS] test_fuzz_get_uninitialized_sorted(uint256[]) (runs: 5000, μ: 204973, ~: 184967)
[PASS] test_fuzz_sortByKey(uint256[]) (runs: 5000, μ: 463630, ~: 454602)
[PASS] test_fuzz_sortByKey_length(uint256) (runs: 5000, μ: 201174, ~: 203742)
[PASS] test_fuzz_sortByKey_with_collision(uint256[]) (runs: 5000, μ: 547897, ~: 538224)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 74.09s (74.09s CPU time)
Ran 17 tests for tests/unit/Spoke/Spoke.Borrow.HealthFactor.t.sol:SpokeBorrowHealthFactorTest
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_collateral_price_drop(uint256,uint256) (runs: 5000, μ: 891412, ~: 891479)
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_multiple_colls(uint256,uint256) (runs: 5000, μ: 849947, ~: 850860)
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_multiple_colls_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 893578, ~: 890834)
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_multiple_debts(uint256,uint256) (runs: 5000, μ: 1109541, ~: 1109664)
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_multiple_debts_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 1170187, ~: 1171647)
[PASS] test_borrow_fuzz_revertsWith_HealthFactorBelowThreshold_with_interest(uint256,uint256) (runs: 5000, μ: 685667, ~: 686244)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold() (gas: 643175)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_collateral_price_drop_weth() (gas: 885561)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls() (gas: 844460)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_collateral_price_drop_dai() (gas: 1097130)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_collateral_price_drop_weth() (gas: 1097174)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_with_interest() (gas: 894201)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_debts() (gas: 1102708)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_multiple_debts_with_interest() (gas: 1164422)
[PASS] test_borrow_revertsWith_HealthFactorBelowThreshold_with_interest() (gas: 681516)
[PASS] test_fuzz_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_collateral_price_drop_dai(uint256,uint256,uint256) (runs: 5000, μ: 1100843, ~: 1101886)
[PASS] test_fuzz_borrow_revertsWith_HealthFactorBelowThreshold_multiple_colls_collateral_price_drop_weth(uint256,uint256,uint256) (runs: 5000, μ: 1101451, ~: 1101908)
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 129.94s (129.93s CPU time)
Ran 3 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.DebtToLiquidate.t.sol:LiquidationLogicDebtToLiquidateTest
[PASS] test_calculateDebtToLiquidate_fuzz((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 30517, ~: 30445)
[PASS] test_calculateDebtToLiquidate_fuzz_AmountAdjustedDueToDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 32257, ~: 32352)
[PASS] test_calculateDebtToLiquidate_fuzz_ImpossibleToAdjustForDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 34410, ~: 34373)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 3.31s (3.29s CPU time)
Ran 7 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.DebtToTargetHealthFactor.t.sol:LiquidationLogicDebtToTargetHealthFactorTest
[PASS] test_calculateDebtToTargetHealthFactor_HealthFactorEqualsTargetHealthFactor((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 22971, ~: 23027)
[PASS] test_calculateDebtToTargetHealthFactor_NoPrecisionLoss() (gas: 25301)
[PASS] test_calculateDebtToTargetHealthFactor_PrecisionLoss() (gas: 15275)
[PASS] test_calculateDebtToTargetHealthFactor_UnitPrice() (gas: 25234)
[PASS] test_calculateDebtToTargetHealthFactor_fuzz_NoRevert((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 20029, ~: 20085)
[PASS] test_calculateDebtToTargetHealthFactor_fuzz_revertsWith_DivisionByZero_ZeroAssetPrice((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 22728, ~: 22784)
[PASS] test_calculateDebtToTargetHealthFactor_revertsWith_ArithmeticError_TargetHealthFactorLessThanHealthFactor((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 22811, ~: 22867)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 2.74s (2.72s CPU time)
Ran 16 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.EvaluateDeficit.t.sol:LiquidationLogicEvaluateDeficitTest
[PASS] test_evaluateDeficit_CRE_SCCM_DRE_BRCM() (gas: 8970)
[PASS] test_evaluateDeficit_CRE_SCCM_DRE_BRCO() (gas: 8938)
[PASS] test_evaluateDeficit_CRE_SCCM_DRN_BRCM() (gas: 8959)
[PASS] test_evaluateDeficit_CRE_SCCM_DRN_BRCO() (gas: 8926)
[PASS] test_evaluateDeficit_CRE_SCCO_DRE_BRCM() (gas: 8952)
[PASS] test_evaluateDeficit_CRE_SCCO_DRE_BRCO() (gas: 9019)
[PASS] test_evaluateDeficit_CRE_SCCO_DRN_BRCM() (gas: 8984)
[PASS] test_evaluateDeficit_CRE_SCCO_DRN_BRCO() (gas: 8972)
[PASS] test_evaluateDeficit_CRN_SCCM_DRE_BRCM() (gas: 8972)
[PASS] test_evaluateDeficit_CRN_SCCM_DRE_BRCO() (gas: 8961)
[PASS] test_evaluateDeficit_CRN_SCCM_DRN_BRCM() (gas: 8895)
[PASS] test_evaluateDeficit_CRN_SCCM_DRN_BRCO() (gas: 8928)
[PASS] test_evaluateDeficit_CRN_SCCO_DRE_BRCM() (gas: 8905)
[PASS] test_evaluateDeficit_CRN_SCCO_DRE_BRCO() (gas: 8962)
[PASS] test_evaluateDeficit_CRN_SCCO_DRN_BRCM() (gas: 8913)
[PASS] test_evaluateDeficit_CRN_SCCO_DRN_BRCO() (gas: 8991)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 18.10ms (971.28µs CPU time)
Ran 3 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateCollateral.t.sol:LiquidationLogicLiquidateCollateralTest
[PASS] test_liquidateCollateral_fuzz(uint256,uint256) (runs: 5000, μ: 266341, ~: 266809)
[PASS] test_liquidateCollateral_fuzz_revertsWith_ArithmeticUnderflow(uint256,uint256) (runs: 5000, μ: 98384, ~: 98186)
[PASS] test_liquidateCollateral_fuzz_revertsWith_InvalidAmount(uint256) (runs: 5000, μ: 102991, ~: 102910)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 3.81s (3.79s CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateDebt.t.sol:LiquidationLogicLiquidateDebtTest
[PASS] test_liquidateDebt_fuzz(uint256) (runs: 5000, μ: 186544, ~: 186544)
[PASS] test_liquidateDebt_revertsWith_ArithmeticUnderflow() (gas: 151305)
[PASS] test_liquidateDebt_revertsWith_InsufficientAllowance() (gas: 155423)
[PASS] test_liquidateDebt_revertsWith_InsufficientBalance() (gas: 202482)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 2.35s (2.33s CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateUser.t.sol:LiquidationLogicLiquidateUserTest
[PASS] test_liquidateUser() (gas: 352360)
[PASS] test_liquidateUser_revertsWith_InvalidDebtToCover() (gas: 74815)
[PASS] test_liquidateUser_revertsWith_MustNotLeaveDust_Collateral() (gas: 108652)
[PASS] test_liquidateUser_revertsWith_MustNotLeaveDust_Debt() (gas: 118013)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 22.63ms (1.32ms CPU time)
Ran 8 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationAmounts.t.sol:LiquidationLogicLiquidationAmountsTest
[PASS] test_calculateLiquidationAmounts_EnoughCollateral() (gas: 15304)
[PASS] test_calculateLiquidationAmounts_InsufficientCollateral() (gas: 15595)
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_CollateralDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 57502, ~: 56993)
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_NoCollateralDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 56373, ~: 56443)
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_NoDebtLeft((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 74905, ~: 74844)
[PASS] test_calculateLiquidationAmounts_fuzz_InsufficientCollateral((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 60278, ~: 60159)
[PASS] test_calculateLiquidationAmounts_fuzz_revertsWith_MustNotLeaveDust_Collateral((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 56857, ~: 56851)
[PASS] test_calculateLiquidationAmounts_fuzz_revertsWith_MustNotLeaveDust_Debt((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 70344, ~: 70298)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 17.92s (17.90s CPU time)
Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationBonus.t.sol:LiquidationLogicLiquidationBonusTest
[PASS] test_calculateLiquidationBonus_MinBonusDueToRounding() (gas: 9360)
[PASS] test_calculateLiquidationBonus_PartialBonus() (gas: 9381)
[PASS] test_calculateLiquidationBonus_fuzz_ConstantBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 17251, ~: 17178)
[PASS] test_calculateLiquidationBonus_fuzz_MaxBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 19589, ~: 19506)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 972.32ms (954.07ms CPU time)
Ran 13 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.ValidateLiquidationCall.t.sol:LiquidationLogicValidateLiquidationCallTest
[PASS] test_validateLiquidationCall() (gas: 31018)
[PASS] test_validateLiquidationCall_revertsWith_CannotReceiveShares_CollateralFrozen() (gas: 63008)
[PASS] test_validateLiquidationCall_revertsWith_CollateralCannotBeLiquidated_NotUsingAsCollateral() (gas: 32027)
[PASS] test_validateLiquidationCall_revertsWith_CollateralCannotBeLiquidated_ZeroCollateralFactor() (gas: 32054)
[PASS] test_validateLiquidationCall_revertsWith_HealthFactorNotBelowThreshold() (gas: 36791)
[PASS] test_validateLiquidationCall_revertsWith_InvalidDebtToCover() (gas: 31762)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotBorrowed() (gas: 32074)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotListed_ZeroCollateralHub() (gas: 31837)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotListed_ZeroDebtHub() (gas: 31894)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotSupplied() (gas: 32041)
[PASS] test_validateLiquidationCall_revertsWith_ReservePaused_CollateralPaused() (gas: 36728)
[PASS] test_validateLiquidationCall_revertsWith_ReservePaused_DebtPaused() (gas: 36811)
[PASS] test_validateLiquidationCall_revertsWith_SelfLiquidation() (gas: 38718)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 17.85ms (1.07ms CPU time)
Ran 26 tests for tests/unit/MathUtils.t.sol:MathUtilsTest
[PASS] test_add_edge_cases() (gas: 4788)
[PASS] test_add_negative_operand(uint256,int256) (runs: 5000, μ: 9324, ~: 9561)
[PASS] test_add_positive_operand(uint256,int256) (runs: 5000, μ: 4013, ~: 4010)
[PASS] test_calculateLinearInterest() (gas: 4511)
[PASS] test_calculateLinearInterest_add_edge() (gas: 5087)
[PASS] test_calculateLinearInterest_edge_cases() (gas: 16870)
Logs:
Bound result 0
Bound result 1
Bound result 864000000
Bound result 864000000
[PASS] test_calculateLinearInterest_reverts_on_past_timestamp(uint32) (runs: 5000, μ: 7587, ~: 7508)
[PASS] test_constants() (gas: 3211)
[PASS] test_fuzz_calculateLinearInterest(uint96,uint32,uint256) (runs: 5000, μ: 8698, ~: 8997)
[PASS] test_fuzz_mulDivDown(uint256,uint256,uint256) (runs: 5000, μ: 3491, ~: 3545)
[PASS] test_fuzz_mulDivUp(uint256,uint256,uint256) (runs: 5000, μ: 3667, ~: 3781)
[PASS] test_min(uint256,uint256) (runs: 5000, μ: 3338, ~: 3338)
[PASS] test_mulDivDown_NoRemainder() (gas: 3324)
[PASS] test_mulDivDown_RevertOnDivByZero() (gas: 3191)
[PASS] test_mulDivDown_RevertOnOverflow() (gas: 3203)
[PASS] test_mulDivDown_WithRemainder() (gas: 3236)
[PASS] test_mulDivDown_ZeroAOrB() (gas: 3768)
[PASS] test_mulDivUp_NoRemainder() (gas: 3350)
[PASS] test_mulDivUp_RevertOnDivByZero() (gas: 3146)
[PASS] test_mulDivUp_RevertOnOverflow() (gas: 3204)
[PASS] test_mulDivUp_WithRemainder() (gas: 3349)
[PASS] test_mulDivUp_ZeroAOrB() (gas: 3818)
[PASS] test_signedSub(uint256,uint256) (runs: 5000, μ: 8638, ~: 8594)
[PASS] test_uncheckedAdd(uint256,uint256) (runs: 5000, μ: 3460, ~: 3452)
[PASS] test_uncheckedExp(uint256,uint256) (runs: 5000, μ: 11458, ~: 7347)
[PASS] test_uncheckedSub(uint256,uint256) (runs: 5000, μ: 3456, ~: 3374)
Suite result: ok. 26 passed; 0 failed; 0 skipped; finished in 1.46s (1.45s CPU time)
Ran 32 tests for tests/unit/misc/NativeTokenGateway.t.sol:NativeTokenGatewayTest
[PASS] test_borrowNative() (gas: 624557)
Logs:
Bound result 5000000000000000000
[PASS] test_borrowNative_fuzz(uint256) (runs: 5000, μ: 624787, ~: 624586)
[PASS] test_borrowNative_revertsWith_InvalidAmount() (gas: 32814)
[PASS] test_borrowNative_revertsWith_NotNativeWrappedAsset() (gas: 32889)
[PASS] test_borrowNative_revertsWith_SpokeNotRegistered() (gas: 25320)
[PASS] test_constructor() (gas: 1059124)
[PASS] test_constructor_revertsWith_InvalidAddress() (gas: 65422)
[PASS] test_fallback_revertsWith_UnsupportedAction() (gas: 17427)
[PASS] test_receive_revertsWith_UnsupportedAction() (gas: 17212)
[PASS] test_repayNative() (gas: 749688)
Logs:
Bound result 5000000000000000000
[PASS] test_repayNative_excessAmount() (gas: 640115)
[PASS] test_repayNative_fuzz(uint256) (runs: 5000, μ: 749213, ~: 750323)
[PASS] test_repayNative_fuzz_withInterest(uint256,uint256) (runs: 5000, μ: 650571, ~: 644913)
[PASS] test_repayNative_revertsWith_InvalidAmount() (gas: 33177)
[PASS] test_repayNative_revertsWith_NativeAmountMismatch() (gas: 30659)
[PASS] test_repayNative_revertsWith_NotNativeWrappedAsset() (gas: 39866)
[PASS] test_repayNative_revertsWith_SpokeNotRegistered() (gas: 39286)
[PASS] test_supplyAndCollateralNative() (gas: 274570)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyAndCollateralNative_fuzz(uint256) (runs: 5000, μ: 274782, ~: 274509)
[PASS] test_supplyNative() (gas: 246786)
Logs:
Bound result 100000000000000000000
[PASS] test_supplyNative_fuzz(uint256) (runs: 5000, μ: 247131, ~: 246858)
[PASS] test_supplyNative_revertsWith_InvalidAmount() (gas: 33142)
[PASS] test_supplyNative_revertsWith_NativeAmountMismatch() (gas: 30390)
[PASS] test_supplyNative_revertsWith_NotNativeWrappedAsset() (gas: 39829)
[PASS] test_supplyNative_revertsWith_SpokeNotRegistered() (gas: 39197)
[PASS] test_withdrawNative() (gas: 274319)
Logs:
Bound result 100000000000000000000
[PASS] test_withdrawNative_fuzz(uint256) (runs: 5000, μ: 274302, ~: 274369)
[PASS] test_withdrawNative_fuzz_allBalance(uint256) (runs: 5000, μ: 227012, ~: 226817)
[PASS] test_withdrawNative_fuzz_allBalanceWithInterest(uint256,uint256) (runs: 5000, μ: 604794, ~: 605911)
[PASS] test_withdrawNative_revertsWith_InvalidAmount() (gas: 32900)
[PASS] test_withdrawNative_revertsWith_NotNativeWrappedAsset() (gas: 32844)
[PASS] test_withdrawNative_revertsWith_SpokeNotRegistered() (gas: 25408)
Suite result: ok. 32 passed; 0 failed; 0 skipped; finished in 64.01s (63.99s CPU time)
Ran 4 tests for tests/unit/NoncesKeyed.t.sol:NoncesKeyedTest
[PASS] test_useCheckedNonce_monotonic(bytes32) (runs: 5000, μ: 16229, ~: 16229)
[PASS] test_useCheckedNonce_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 107533, ~: 107533)
[PASS] test_useNonce_monotonic(bytes32) (runs: 5000, μ: 17035, ~: 17035)
[PASS] test_useNonce_zeroKey_monotonic(bytes32) (runs: 5000, μ: 16983, ~: 16983)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 4.60s (4.60s CPU time)
Ran 10 tests for tests/unit/PercentageMath.t.sol:PercentageMathTests
[PASS] test_constants() (gas: 8664)
[PASS] test_fromBpsDown() (gas: 9678)
[PASS] test_percentDiv() (gas: 15222)
[PASS] test_percentDivUp_ge_value(uint256,uint256) (runs: 5000, μ: 15286, ~: 15509)
[PASS] test_percentDivUp_le_value(uint256,uint256) (runs: 5000, μ: 15668, ~: 15662)
[PASS] test_percentDiv_fuzz(uint256,uint256) (runs: 5000, μ: 12885, ~: 13012)
[PASS] test_percentMul() (gas: 15116)
[PASS] test_percentMulUp_ge_value(uint256,uint256) (runs: 5000, μ: 15651, ~: 15645)
[PASS] test_percentMulUp_le_value(uint256,uint256) (runs: 5000, μ: 15289, ~: 15512)
[PASS] test_percentMul_fuzz(uint256,uint256) (runs: 5000, μ: 11767, ~: 12247)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 1.45s (1.45s CPU time)
Ran 6 tests for tests/unit/Spoke/Spoke.Borrow.Scenario.t.sol:SpokeBorrowScenarioTest
[PASS] test_borrow_fuzz_multi_spoke_multi_reserves(uint256,uint256,uint256,uint256,uint256) (runs: 5000, μ: 2173312, ~: 2183395)
[PASS] test_borrow_fuzz_single_spoke_multi_reserves(uint256,uint256,uint256,uint256) (runs: 5000, μ: 2320927, ~: 2329739)
[PASS] test_borrow_fuzz_single_spoke_multi_reserves_multi_user(uint256,uint256,uint256,uint256) (runs: 5000, μ: 2724151, ~: 2732395)
[PASS] test_borrow_fuzz_skip_borrow(uint256,uint256,uint256) (runs: 5000, μ: 1077807, ~: 1080103)
[PASS] test_borrow_skip_borrow() (gas: 1079288)
Logs:
Bound result 10000000000000000000
Bound result 20000000000000000000
Bound result 31536000
[PASS] test_userAccountData_does_not_include_zero_cf_collateral() (gas: 1153479)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 177.29s (177.28s CPU time)
Ran 14 tests for tests/unit/Spoke/Spoke.Borrow.Validation.t.sol:SpokeBorrowValidationTest
[PASS] test_borrow_fuzz_revertsWith_DrawCapExceeded(uint256,uint40) (runs: 5000, μ: 108006, ~: 108030)
[PASS] test_borrow_fuzz_revertsWith_DrawCapExceeded_due_to_interest(uint256) (runs: 5000, μ: 694602, ~: 694890)
[PASS] test_borrow_fuzz_revertsWith_InsufficientLiquidity(uint256,uint256) (runs: 5000, μ: 279313, ~: 279089)
[PASS] test_borrow_fuzz_revertsWith_InvalidAmount(uint256) (runs: 5000, μ: 32640, ~: 32697)
[PASS] test_borrow_fuzz_revertsWith_ReserveFrozen(uint256,uint256) (runs: 5000, μ: 69404, ~: 69200)
[PASS] test_borrow_fuzz_revertsWith_ReserveNotBorrowable(uint256,uint256) (runs: 5000, μ: 69617, ~: 69413)
[PASS] test_borrow_fuzz_revertsWith_ReserveNotListed(uint256,uint256) (runs: 5000, μ: 26063, ~: 25806)
[PASS] test_borrow_fuzz_revertsWith_ReservePaused(uint256,uint256) (runs: 5000, μ: 69239, ~: 69035)
[PASS] test_borrow_revertsWith_InsufficientLiquidity() (gas: 278956)
Logs:
Bound result 10000000000000000000
[PASS] test_borrow_revertsWith_InvalidAmount() (gas: 34330)
Logs:
Bound result 2
[PASS] test_borrow_revertsWith_ReserveFrozen() (gas: 70806)
Logs:
Bound result 2
Bound result 1
[PASS] test_borrow_revertsWith_ReserveNotBorrowable() (gas: 70995)
Logs:
Bound result 2
Bound result 1
[PASS] test_borrow_revertsWith_ReserveNotListed() (gas: 27068)
Logs:
Bound result 1
[PASS] test_borrow_revertsWith_ReservePaused() (gas: 70683)
Logs:
Bound result 2
Bound result 1
Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 14.74s (14.73s CPU time)
Ran 29 tests for tests/unit/libraries/PositionStatusMap.t.sol:PositionStatusMapTest
[PASS] test_bucketId() (gas: 8971)
[PASS] test_collateralCount() (gas: 110158)
[PASS] test_collateralCount(uint256) (runs: 5000, μ: 2073702, ~: 1895419)
[PASS] test_collateralCount_ignoresInvalidBits() (gas: 124482)
[PASS] test_constants() (gas: 44966)
[PASS] test_fls() (gas: 545261)
[PASS] test_fromBitId(uint256,uint256) (runs: 5000, μ: 14105, ~: 14336)
[PASS] test_fuzz_setBorrowing(uint256,bool) (runs: 5000, μ: 22353, ~: 32140)
[PASS] test_fuzz_setUseAsCollateral(uint256,bool) (runs: 5000, μ: 22449, ~: 32236)
[PASS] test_getBucketWord(uint256) (runs: 5000, μ: 14489, ~: 14489)
[PASS] test_isUsingAsCollateralOrBorrowing_slot0() (gas: 108801)
[PASS] test_isUsingAsCollateralOrBorrowing_slot1() (gas: 44065)
[PASS] test_isolateBorrowing(uint256) (runs: 5000, μ: 162282, ~: 162282)
[PASS] test_isolateBorrowingUntil(uint256,uint256) (runs: 5000, μ: 154820, ~: 154843)
[PASS] test_isolateCollateral(uint256) (runs: 5000, μ: 162044, ~: 162044)
[PASS] test_isolateCollateralUntil(uint256,uint256) (runs: 5000, μ: 154799, ~: 154822)
[PASS] test_isolateUntil(uint256,uint256) (runs: 5000, μ: 143622, ~: 143623)
[PASS] test_next(uint256) (runs: 5000, μ: 20432, ~: 20328)
[PASS] test_nextBorrowing(uint256) (runs: 5000, μ: 18216, ~: 18289)
[PASS] test_nextBorrowing_continuous() (gas: 63845326)
[PASS] test_nextCollateral(uint256) (runs: 5000, μ: 18117, ~: 17716)
[PASS] test_nextCollateral_continuous() (gas: 64381718)
[PASS] test_next_continuous() (gas: 91795620)
[PASS] test_popCount(bytes32) (runs: 5000, μ: 38133, ~: 38133)
[PASS] test_setBorrowing_slot0() (gas: 44129)
[PASS] test_setBorrowing_slot1() (gas: 44166)
[PASS] test_setUseAsCollateral_slot0() (gas: 44203)
[PASS] test_setUseAsCollateral_slot1() (gas: 44185)
[PASS] test_setters_use_correct_slot(uint256) (runs: 5000, μ: 22195, ~: 22195)
Suite result: ok. 29 passed; 0 failed; 0 skipped; finished in 101.17s (101.17s CPU time)
Ran 5 tests for tests/unit/Rescuable.t.sol:RescuableTest
[PASS] test_constructor() (gas: 12654)
[PASS] test_rescueNative_fuzz(uint256) (runs: 5000, μ: 33692, ~: 33370)
[PASS] test_rescueNative_revertsWith_OnlyRescueGuardian() (gas: 11400)
[PASS] test_rescueToken_fuzz(uint256) (runs: 5000, μ: 209619, ~: 209387)
[PASS] test_rescueToken_revertsWith_OnlyRescueGuardian() (gas: 183212)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 3.39s (3.37s CPU time)
Ran 10 tests for tests/unit/misc/SignatureGateway/SignatureGateway.Constants.t.sol:SignatureGatewayConstantsTest
[PASS] test_DOMAIN_SEPARATOR() (gas: 2102520)
[PASS] test_borrow_typeHash() (gas: 9874)
[PASS] test_constructor() (gas: 53857)
[PASS] test_eip712Domain() (gas: 2108085)
[PASS] test_repay_typeHash() (gas: 9975)
[PASS] test_setUsingAsCollateral_typeHash() (gas: 9943)
[PASS] test_supply_typeHash() (gas: 9945)
[PASS] test_updateUserDynamicConfig_typeHash() (gas: 10045)
[PASS] test_updateUserRiskPremium_typeHash() (gas: 9876)
[PASS] test_withdraw_typeHash() (gas: 9919)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 18.83ms (1.75ms CPU time)
Ran 5 tests for tests/unit/misc/SignatureGateway/SignatureGateway.PermitReserve.t.sol:SignatureGatewayPermitReserveTest
[PASS] test_permitReserve() (gas: 104990)
[PASS] test_permitReserve_forwards_correct_call() (gas: 52113)
[PASS] test_permitReserve_ignores_permit_reverts() (gas: 40969)
[PASS] test_permitReserve_revertsWith_ReserveNotListed() (gas: 30890)
[PASS] test_permitReserve_revertsWith_SpokeNotRegistered() (gas: 29451)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 18.19ms (1.42ms CPU time)
Ran 2 tests for tests/unit/misc/SignatureGateway/SignatureGateway.Reverts.InsufficientAllowance.t.sol:SignatureGateway_InsufficientAllowance_Test
[PASS] test_repayWithSig_revertsWith_TransferFromFailed_on_InsufficientAllowance() (gas: 464303)
[PASS] test_supplyWithSig_revertsWith_TransferFromFailed_on_InsufficientAllowance() (gas: 84603)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 19.69ms (1.80ms CPU time)
Ran 2 tests for tests/unit/Spoke/Spoke.Borrow.t.sol:SpokeBorrowTest
[PASS] test_borrow() (gas: 1066455)
[PASS] test_borrow_fuzz_amounts(uint256,uint256) (runs: 5000, μ: 1058522, ~: 1058570)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 26.43s (26.42s CPU time)
Ran 24 tests for tests/unit/Spoke/Spoke.Config.t.sol:SpokeConfigTest
[PASS] test_addReserve() (gas: 390148)
[PASS] test_addReserve_fuzz_revertsWith_AssetNotListed() (gas: 245588)
[PASS] test_addReserve_revertsWith_InvalidAddress_hub() (gas: 5973962)
[PASS] test_addReserve_revertsWith_InvalidAddress_oracle() (gas: 6011020)
[PASS] test_addReserve_revertsWith_InvalidAssetId() (gas: 33171)
[PASS] test_addReserve_revertsWith_ReserveExists() (gas: 374701)
[PASS] test_spoke_deploy() (gas: 4908141)
[PASS] test_spoke_deploy_revertsWith_InvalidOracleDecimals() (gas: 46391)
[PASS] test_spoke_deploy_reverts_on_InvalidConstructorInput() (gas: 43792)
[PASS] test_updateLiquidationConfig_fuzz_liqBonusConfig((uint128,uint64,uint16)) (runs: 5000, μ: 52157, ~: 52143)
[PASS] test_updateLiquidationConfig_fuzz_revertsWith_InvalidLiquidationConfig_healthFactorForMaxBonus((uint128,uint64,uint16)) (runs: 5000, μ: 37811, ~: 37949)
[PASS] test_updateLiquidationConfig_fuzz_revertsWith_InvalidLiquidationConfig_liquidationBonusFactor((uint128,uint64,uint16)) (runs: 5000, μ: 37382, ~: 37159)
[PASS] test_updateLiquidationConfig_fuzz_targetHealthFactor(uint128) (runs: 5000, μ: 46861, ~: 47159)
[PASS] test_updateLiquidationConfig_liqBonusConfig() (gas: 51102)
Logs:
Bound result 900000000000000000
Bound result 1000
Bound result 1000000000000000000
[PASS] test_updateLiquidationConfig_revertsWith_InvalidLiquidationConfig_healthFactorForMaxBonus() (gas: 36462)
Logs:
Bound result 1000000000000000000
Bound result 1000
Bound result 1000000000000000000
[PASS] test_updateLiquidationConfig_revertsWith_InvalidLiquidationConfig_liquidationBonusFactor() (gas: 36256)
Logs:
Bound result 900000000000000000
Bound result 10001
Bound result 1000000000000000000
[PASS] test_updateLiquidationConfig_targetHealthFactor() (gas: 46442)
Logs:
Bound result 1000000000000000001
[PASS] test_updateReserveConfig() (gas: 53882)
[PASS] test_updateReserveConfig_fuzz((bool,bool,bool,uint24)) (runs: 5000, μ: 55298, ~: 55127)
[PASS] test_updateReserveConfig_revertsWith_InvalidCollateralRisk() (gas: 39603)
[PASS] test_updateReserveConfig_revertsWith_ReserveNotListed() (gas: 36252)
[PASS] test_updateReservePriceSource() (gas: 240092)
[PASS] test_updateReservePriceSource_revertsWith_AccessManagedUnauthorized(address) (runs: 5000, μ: 31103, ~: 31103)
[PASS] test_updateReservePriceSource_revertsWith_ReserveNotListed() (gas: 34277)
Suite result: ok. 24 passed; 0 failed; 0 skipped; finished in 3.90s (3.89s CPU time)
Ran 10 tests for tests/unit/Spoke/Spoke.DynamicConfig.Triggers.t.sol:SpokeDynamicConfigTriggersTest
[PASS] test_borrow_triggers_dynamicConfigUpdate() (gas: 1323742)
[PASS] test_liquidate_does_not_trigger_dynamicConfigUpdate() (gas: 1601391)
[PASS] test_repay_does_not_trigger_dynamicConfigUpdate() (gas: 909452)
[PASS] test_supply_does_not_trigger_dynamicConfigUpdate() (gas: 1067113)
[PASS] test_updateUserDynamicConfig_doesHFCheck() (gas: 798835)
[PASS] test_updateUserDynamicConfig_reverts_when_not_authorized(address) (runs: 5000, μ: 1191610, ~: 1191610)
[PASS] test_updateUserDynamicConfig_triggers_dynamicConfigUpdate() (gas: 675164)
[PASS] test_updateUserDynamicConfig_updatesRP() (gas: 1290262)
[PASS] test_usingAsCollateral_triggers_dynamicConfigUpdate() (gas: 1340651)
[PASS] test_withdraw_triggers_dynamicConfigUpdate() (gas: 1352161)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 27.08s (27.06s CPU time)
Ran 21 tests for tests/unit/misc/SignatureGateway/SignatureGateway.Reverts.InvalidSignature.t.sol:SignatureGatewayInvalidSignatureTest
[PASS] test_borrowWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 190113, ~: 190113)
[PASS] test_borrowWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 38516)
[PASS] test_borrowWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 36958)
[PASS] test_repayWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 190069, ~: 190069)
[PASS] test_repayWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 38449)
[PASS] test_repayWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37024)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 233692, ~: 233692)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 38477)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37073)
[PASS] test_supplyWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 190132, ~: 190132)
[PASS] test_supplyWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 38494)
[PASS] test_supplyWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 36989)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 67897, ~: 67897)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidSignatureDueTo_InvalidSigner() (gas: 25626)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 27058)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 67940, ~: 67940)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidSignatureDueTo_InvalidSigner() (gas: 25631)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 27146)
[PASS] test_withdrawWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 190066, ~: 190066)
[PASS] test_withdrawWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 38536)
[PASS] test_withdrawWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37022)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 43.95s (43.94s CPU time)
Ran 7 tests for tests/unit/misc/SignatureGateway/SignatureGateway.Reverts.SpokeNotRegistered.t.sol:SignatureGateway_SpokeNotRegistered_Test
[PASS] test_borrowWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13902, ~: 13902)
[PASS] test_repayWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13902, ~: 13902)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_SpokeNotRegistered((address,uint256,bool,address,uint256,uint256)) (runs: 5000, μ: 13903, ~: 13903)
[PASS] test_supplyWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13900, ~: 13900)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_SpokeNotRegistered((address,address,uint256,uint256)) (runs: 5000, μ: 14114, ~: 14114)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_SpokeNotRegistered((address,address,uint256,uint256)) (runs: 5000, μ: 14114, ~: 14114)
[PASS] test_withdrawWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13967, ~: 13967)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 7.13s (7.11s CPU time)
Ran 7 tests for tests/unit/misc/SignatureGateway/SignatureGateway.Reverts.Unauthorized.t.sol:SignatureGateway_Unauthorized_PositionManagerActive_Test
[PASS] test_borrowWithSig_revertsWith_Unauthorized() (gas: 80480)
[PASS] test_repayWithSig_revertsWith_Unauthorized() (gas: 116465)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_Unauthorized() (gas: 73090)
[PASS] test_supplyWithSig_revertsWith_Unauthorized() (gas: 140887)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_Unauthorized() (gas: 82686)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_Unauthorized() (gas: 82561)
[PASS] test_withdrawWithSig_revertsWith_Unauthorized() (gas: 80603)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 21.94ms (4.16ms CPU time)
Ran 7 tests for tests/unit/misc/SignatureGateway/SignatureGateway.Reverts.Unauthorized.t.sol:SignatureGateway_Unauthorized_PositionManagerNotActive_Test
[PASS] test_borrowWithSig_revertsWith_Unauthorized() (gas: 78279)
[PASS] test_repayWithSig_revertsWith_Unauthorized() (gas: 114264)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_Unauthorized() (gas: 70889)
[PASS] test_supplyWithSig_revertsWith_Unauthorized() (gas: 138686)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_Unauthorized() (gas: 80485)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_Unauthorized() (gas: 80360)
[PASS] test_withdrawWithSig_revertsWith_Unauthorized() (gas: 78402)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 21.51ms (4.08ms CPU time)
Ran 11 tests for tests/unit/misc/SignatureGateway/SignatureGateway.t.sol:SignatureGatewayTest
[PASS] test_borrowWithSig() (gas: 818038)
[PASS] test_renouncePositionManagerRole() (gas: 26829)
[PASS] test_renouncePositionManagerRole_revertsWith_OnlyOwner() (gas: 18352)
[PASS] test_repayWithSig() (gas: 795695)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 311213)
[PASS] test_setUsingAsCollateralWithSig() (gas: 621241)
[PASS] test_supplyWithSig() (gas: 593427)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 324069)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 908572)
[PASS] test_useNonce_monotonic(bytes32) (runs: 5000, μ: 16886, ~: 16886)
[PASS] test_withdrawWithSig() (gas: 591764)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 461.43ms (443.95ms CPU time)
Ran 3 tests for tests/unit/Spoke/Spoke.Access.t.sol:SpokeAccessTest
[PASS] testAccess_change_authority() (gas: 2612612)
[PASS] testAccess_hub_functions_callable_by_spokes() (gas: 598376)
[PASS] testAccess_spoke_admin_config_access() (gas: 490316)
Suite result:...*[Comment body truncated]* |
♻️ Forge Gas Snapshots🔕 Unchanged
|
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.
This implementation removes the inherited interface
ISpoke, because it changes the interface for the TreasurySpoke functions to include a hub.The alternative to this approach would be to keep the interface, but keep a mapping in storage to determine the correct hub to call, similar to the current Spoke implementation.