Skip to content

fix: monotonic liquidations#1260

Open
yan-man wants to merge 8 commits intomainfrom
fix/monotonic-liqs
Open

fix: monotonic liquidations#1260
yan-man wants to merge 8 commits intomainfrom
fix/monotonic-liqs

Conversation

@yan-man
Copy link
Contributor

@yan-man yan-man commented Mar 12, 2026

No description provided.

@yan-man yan-man requested a review from avniculae March 12, 2026 03:00
@github-actions
Copy link

github-actions bot commented Mar 12, 2026

♻️ Forge Gas Snapshots

Path Value
snapshots/Spoke.Operations.ZeroRiskPremium.json
liquidationCall (receiveShares): full ↑0% (+3) 305,346
liquidationCall (receiveShares): partial ↑0% (+3) 304,764
liquidationCall (reportDeficit): full ↑0% (+3) 370,497
liquidationCall: full ↑0% (+3) 322,974
liquidationCall: partial ↑0% (+3) 322,392
snapshots/Spoke.Operations.json
liquidationCall (receiveShares): full ↑0% (+3) 337,379
liquidationCall (receiveShares): partial ↑0% (+3) 336,797
liquidationCall (reportDeficit): full ↑0% (+3) 362,697
liquidationCall: full ↑0% (+3) 355,007
liquidationCall: partial ↑0% (+3) 354,425
🔕 Unchanged
Path Value
snapshots/ConfigPositionManager.Operations.json
renounceCanUpdateUserDynamicConfigPermission 27,748
renounceCanUpdateUserRiskPremiumPermission 27,682
renounceCanUpdateUsingAsCollateralPermission 27,705
renounceGlobalPermission 27,663
setCanSetUsingAsCollateralPermission 49,848
setCanUpdateUserDynamicConfigPermission 49,870
setCanUpdateUserRiskPremiumPermission 49,870
setGlobalPermission 49,822
setUsingAsCollateralOnBehalfOf 72,503
updateUserDynamicConfigOnBehalfOf 50,433
updateUserRiskPremiumOnBehalfOf 131,974
snapshots/GiverPositionManager.Operations.json
repayOnBehalfOf 167,904
supplyOnBehalfOf 136,911
snapshots/Hub.Operations.json
add 86,692
add: with transfer 107,989
draw 104,148
eliminateDeficit: full 72,579
eliminateDeficit: partial 82,184
mintFeeShares 82,741
payFee 70,805
refreshPremium 70,362
remove: full 75,596
remove: partial 80,734
reportDeficit 111,925
restore: full 76,552
restore: full - with transfer 169,161
restore: partial 85,262
restore: partial - with transfer 143,242
transferShares 69,619
snapshots/NativeTokenGateway.Operations.json
borrowNative 232,042
repayNative 166,511
supplyAsCollateralNative 160,195
supplyNative 135,794
withdrawNative: full 125,572
withdrawNative: partial 136,764
snapshots/PositionManagerBase.Operations.json
setSelfAsUserPositionManagerWithSig 75,029
snapshots/SignatureGateway.Operations.json
borrowWithSig 215,467
repayWithSig 186,703
setSelfAsUserPositionManagerWithSig 75,126
setUsingAsCollateralWithSig 85,380
supplyWithSig 151,980
updateUserDynamicConfigWithSig 63,113
updateUserRiskPremiumWithSig 61,995
withdrawWithSig 130,797
snapshots/Spoke.Getters.json
getUserAccountData: supplies: 0, borrows: 0 13,014
getUserAccountData: supplies: 1, borrows: 0 51,132
getUserAccountData: supplies: 2, borrows: 0 84,514
getUserAccountData: supplies: 2, borrows: 1 106,572
getUserAccountData: supplies: 2, borrows: 2 127,538
snapshots/Spoke.Operations.ZeroRiskPremium.json
borrow: first 193,708
borrow: second action, same reserve 173,574
permitReserve + repay (multicall) 164,565
permitReserve + supply (multicall) 146,745
permitReserve + supply + enable collateral (multicall) 161,196
repay: full 123,903
repay: partial 128,861
setUserPositionManagersWithSig: disable 46,772
setUserPositionManagersWithSig: enable 68,684
supply + enable collateral (multicall) 141,398
supply: 0 borrows, collateral disabled 122,835
supply: 0 borrows, collateral enabled 105,806
supply: second action, same reserve 105,735
updateUserDynamicConfig: 1 collateral 76,251
updateUserDynamicConfig: 2 collaterals 92,825
updateUserRiskPremium: 1 borrow 99,069
updateUserRiskPremium: 2 borrows 108,749
usingAsCollateral: 0 borrows, enable 59,616
usingAsCollateral: 1 borrow, disable 109,113
usingAsCollateral: 1 borrow, enable 42,504
usingAsCollateral: 2 borrows, disable 132,368
usingAsCollateral: 2 borrows, enable 42,516
withdraw: 0 borrows, full 129,650
withdraw: 0 borrows, partial 134,546
withdraw: 1 borrow, partial 163,306
withdraw: 2 borrows, partial 179,570
withdraw: non collateral 105,891
snapshots/Spoke.Operations.json
borrow: first 262,632
borrow: second action, same reserve 205,498
permitReserve + repay (multicall) 162,036
permitReserve + supply (multicall) 146,745
permitReserve + supply + enable collateral (multicall) 161,196
repay: full 117,982
repay: partial 137,340
setUserPositionManagersWithSig: disable 46,772
setUserPositionManagersWithSig: enable 68,684
supply + enable collateral (multicall) 141,398
supply: 0 borrows, collateral disabled 122,835
supply: 0 borrows, collateral enabled 105,806
supply: second action, same reserve 105,735
updateUserDynamicConfig: 1 collateral 76,251
updateUserDynamicConfig: 2 collaterals 92,825
updateUserRiskPremium: 1 borrow 152,417
updateUserRiskPremium: 2 borrows 202,668
usingAsCollateral: 0 borrows, enable 59,616
usingAsCollateral: 1 borrow, disable 162,458
usingAsCollateral: 1 borrow, enable 42,504
usingAsCollateral: 2 borrows, disable 234,283
usingAsCollateral: 2 borrows, enable 42,516
withdraw: 0 borrows, full 129,650
withdraw: 0 borrows, partial 134,546
withdraw: 1 borrow, partial 214,149
withdraw: 2 borrows, partial 262,020
withdraw: non collateral 105,891
snapshots/TakerPositionManager.Operations.json
approveBorrow 49,802
approveBorrowWithSig 65,684
approveWithdraw 49,833
approveWithdrawWithSig 65,660
borrowOnBehalfOf 312,136
renounceBorrowAllowance 27,924
renounceWithdrawAllowance 28,000
withdrawOnBehalfOf: full 120,697
withdrawOnBehalfOf: partial 130,671
snapshots/TokenizationSpoke.Operations.json
deposit 113,234
depositWithSig 124,138
mint 112,915
mintWithSig 123,782
permit 62,766
redeem: on behalf, full 90,886
redeem: on behalf, partial 113,607
redeem: self, full 88,874
redeem: self, partial 108,074
redeemWithSig 123,456
withdraw: on behalf, full 91,302
withdraw: on behalf, partial 114,127
withdraw: self, full 89,394
withdraw: self, partial 108,594
withdrawWithSig 123,987

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

Forge Build Sizes

Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
ConfigPositionManager ↑31% (+3085) 12,937 ↑30% (+3122) 13,491 ↓21% (-3085) 11,639 ↓8% (-3122) 35,661
EIP712Hash (src/position-manager/libraries/EIP712Hash.sol) ↑39% (+215) 771 ↑35% (+215) 823 ↓1% (-215) 23,805 ↓0% (-215) 48,329
GiverPositionManager ↓16% (-1303) 6,614 ↓18% (-1545) 6,889 ↑8% (+1303) 17,962 ↑4% (+1545) 42,263
LiquidationLogic ↑0% (+1) 12,520 ↑0% (+1) 12,572 ↓0% (-1) 12,056 ↓0% (-1) 36,580
LiquidationLogic.spoke ↑0% (+1) 9,836 ↑0% (+1) 9,868 ↓0% (-1) 14,740 ↓0% (-1) 39,284
LiquidationLogicWrapper ↑0% (+1) 18,612 ↑0% (+1) 18,786 ↓0% (-1) 5,964 ↓0% (-1) 30,366
NativeTokenGateway ↓14% (-1387) 8,685 ↓15% (-1617) 9,102 ↑10% (+1387) 15,891 ↑4% (+1617) 40,050
PositionManagerBaseWrapper ↓20% (-1288) 4,998 ↓22% (-1530) 5,273 ↑7% (+1288) 19,578 ↑4% (+1530) 43,879
PositionManagerNoMulticall ↓21% (-1288) 4,934 ↓23% (-1530) 5,209 ↑7% (+1288) 19,642 ↑4% (+1530) 43,943
SignatureGateway 12,107 ↑0% (+2) 12,648 12,469 ↓0% (-2) 36,504
TakerPositionManager 10,996 ↑0% (+2) 11,550 13,580 ↓0% (-2) 37,602
JsonBindings 20,364 20,416 4,212 28,736
🔕 Unchanged
Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
AaveOracle 2,396 2,529 22,180 46,623
AccessManager 12,985 14,210 11,591 34,942
AccessManagerEnumerable 16,917 18,756 7,659 30,396
Address 44 94 24,532 49,058
Arrays 44 94 24,532 49,058
Arrays.hub 16 44 24,560 49,108
Arrays.spoke 16 44 24,560 49,108
AssetInterestRateStrategy 2,626 2,811 21,950 46,341
AssetLogic 44 94 24,532 49,058
AssetLogic.hub 16 44 24,560 49,108
AuthorityUtils 44 94 24,532 49,058
AuthorityUtils.hub 16 44 24,560 49,108
AuthorityUtils.spoke 16 44 24,560 49,108
Bytes 44 94 24,532 49,058
Bytes.spoke 16 44 24,560 49,108
Comparators 44 94 24,532 49,058
Comparators.hub 16 44 24,560 49,108
Comparators.spoke 16 44 24,560 49,108
ConfigPermissionsMap 44 94 24,532 49,058
ConfigPermissionsWrapper 1,001 1,029 23,575 48,123
Constants 499 551 24,077 48,601
Create2Utils 134 184 24,442 48,968
DeployUtils 44 94 24,532 49,058
DeployWrapper 3,330 3,358 21,246 45,794
ECDSA 44 94 24,532 49,058
ECDSA.spoke 16 44 24,560 49,108
EIP712Hash (src/spoke/libraries/EIP712Hash.sol) 441 493 24,135 48,659
EIP712Hash.spoke 491 521 24,085 48,631
EIP712Types 44 94 24,532 49,058
ERC1967Proxy 135 891 24,441 48,261
ERC1967Utils 44 94 24,532 49,058
EnumerableSet 44 94 24,532 49,058
EnumerableSet.hub 16 44 24,560 49,108
Errors 44 94 24,532 49,058
ExtSloadWrapper 394 422 24,182 48,730
Hashes 44 94 24,532 49,058
Hub 23,538 23,735 1,038 25,417
HubConfigurator 13,833 14,067 10,743 35,085
KeyValueList 44 94 24,532 49,058
KeyValueList.spoke 16 44 24,560 49,108
KeyValueListWrapper 957 985 23,619 48,167
LibBit 44 94 24,532 49,058
LibBit.spoke 16 44 24,560 49,108
LowLevelCall 44 94 24,532 49,058
Math 44 94 24,532 49,058
Math.hub 16 44 24,560 49,108
Math.spoke 16 44 24,560 49,108
MathUtils 44 94 24,532 49,058
MathUtils.hub 16 44 24,560 49,108
MathUtils.spoke 16 44 24,560 49,108
MockERC1271Wallet 828 962 23,748 48,190
MockERC20 2,540 3,006 22,036 46,146
MockNoncesKeyed 858 886 23,718 48,266
MockPriceFeed 538 1,187 24,038 47,965
MockReentrantCaller 882 1,083 23,694 48,069
MockSkimSpoke 1,116 1,275 23,460 47,877
NoncesKeyed 644 672 23,932 48,480
NoncesKeyed.spoke 387 413 24,189 48,739
Panic 44 94 24,532 49,058
Panic.hub 16 44 24,560 49,108
Panic.spoke 16 44 24,560 49,108
PercentageMath 44 94 24,532 49,058
PercentageMath.hub 16 44 24,560 49,108
PercentageMath.spoke 16 44 24,560 49,108
PercentageMathWrapper 632 660 23,944 48,492
PositionStatusMap 44 94 24,532 49,058
PositionStatusMap.spoke 16 44 24,560 49,108
PositionStatusMapWrapper 3,341 3,369 21,235 45,783
Premium 44 94 24,532 49,058
Premium.hub 16 44 24,560 49,108
Premium.spoke 16 44 24,560 49,108
ProxyAdmin 1,320 1,556 23,256 47,596
RescuableWrapper 908 1,042 23,668 48,110
ReserveFlagsMap 44 94 24,532 49,058
ReserveFlagsMap.spoke 16 44 24,560 49,108
ReserveFlagsMapWrapper 928 956 23,648 48,196
Roles 218 269 24,358 48,883
SafeCast 44 94 24,532 49,058
SafeCast.hub 16 44 24,560 49,108
SafeCast.spoke 16 44 24,560 49,108
SafeERC20 44 94 24,532 49,058
SafeERC20.hub 16 44 24,560 49,108
SafeERC20.spoke 16 44 24,560 49,108
SharesMath 44 94 24,532 49,058
SharesMath.hub 16 44 24,560 49,108
SignatureChecker 44 94 24,532 49,058
SignatureChecker.spoke 16 44 24,560 49,108
SlotDerivation 44 94 24,532 49,058
SlotDerivation.hub 16 44 24,560 49,108
SlotDerivation.spoke 16 44 24,560 49,108
SpokeConfigurator 11,825 12,059 12,751 37,093
SpokeInstance 24,291 25,098 285 24,054
SpokeUtils 96 146 24,480 49,006
SpokeUtils.spoke 71 99 24,505 49,053
SpokeUtilsWrapper 1,827 1,855 22,749 47,297
StorageSlot 44 94 24,532 49,058
StorageSlot.hub 16 44 24,560 49,108
StorageSlot.spoke 16 44 24,560 49,108
TestnetERC20 3,649 4,525 20,927 44,627
Time 44 94 24,532 49,058
TokenizationSpokeInstance 13,627 14,953 10,949 34,199
TransientSlot 44 94 24,532 49,058
TransientSlot.spoke 16 44 24,560 49,108
TransparentUpgradeableProxy 1,419 4,078 23,157 45,074
TreasurySpokeInstance 4,004 4,218 20,572 44,934
UserPositionUtils 44 94 24,532 49,058
UserPositionUtils.spoke 16 44 24,560 49,108
UserPositionUtilsWrapper (tests/mocks/UserPositionDebtWrapper.sol) 3,263 3,291 21,313 45,861
UserPositionUtilsWrapper (tests/mocks/UserPositionUtilsWrapper.sol) 3,263 3,291 21,313 45,861
Utils 44 94 24,532 49,058
WETH9 2,148 2,614 22,428 46,538
WadRayMath 44 94 24,532 49,058
WadRayMath.hub 16 44 24,560 49,108
WadRayMath.spoke 16 44 24,560 49,108
WadRayMathWrapper 1,514 1,542 23,062 47,610

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

🌈 Test Results
No files changed, compilation skipped

Ran 2 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.InsufficientAllowance.t.sol:SignatureGateway_InsufficientAllowance_Test
[PASS] test_repayWithSig_revertsWith_ERC20InsufficientAllowance() (gas: 455825)
[PASS] test_supplyWithSig_revertsWith_ERC20InsufficientAllowance() (gas: 87268)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 42.09ms (4.18ms CPU time)

Ran 5 tests for tests/gas/Spoke.Getters.gas.t.sol:SpokeGetters_Gas_Tests
[PASS] test_getUserAccountData() (gas: 23594)
[PASS] test_getUserAccountData_oneSupplies() (gas: 285291)
[PASS] test_getUserAccountData_twoSupplies() (gas: 521822)
[PASS] test_getUserAccountData_twoSupplies_oneBorrows() (gas: 1051246)
[PASS] test_getUserAccountData_twoSupplies_twoBorrows() (gas: 1619782)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 61.05ms (4.48ms CPU time)

Ran 19 tests for tests/unit/AaveOracle.t.sol:AaveOracleTest
[PASS] test_constructor() (gas: 15306)
[PASS] test_decimals() (gas: 8313)
[PASS] test_fuzz_constructor(uint8) (runs: 5000, μ: 16711, ~: 17038)
Logs:
  Bound result 1

[PASS] test_getReservePrice() (gas: 46772)
[PASS] test_getReservePrice_revertsWith_InvalidPrice() (gas: 44558)
[PASS] test_getReservePrice_revertsWith_InvalidSource() (gas: 10876)
[PASS] test_getReservePrices() (gas: 76731)
[PASS] test_getReservePrices_revertsWith_InvalidSource() (gas: 48897)
[PASS] test_getReserveSource() (gas: 47161)
[PASS] test_setReserveSource() (gas: 44226)
[PASS] test_setReserveSource_revertsWith_InvalidPrice() (gas: 97405)
[PASS] test_setReserveSource_revertsWith_InvalidSource() (gas: 17138)
[PASS] test_setReserveSource_revertsWith_InvalidSourceDecimals() (gas: 16953)
[PASS] test_setReserveSource_revertsWith_OnlySpoke() (gas: 12996)
[PASS] test_setReserveSource_revertsWith_OracleMismatch() (gas: 5029298)
[PASS] test_setSpoke() (gas: 5057662)
[PASS] test_setSpoke_revertsWith_InvalidAddress() (gas: 10914)
[PASS] test_setSpoke_revertsWith_OnlyDeployer(address) (runs: 5000, μ: 13485, ~: 13485)
[PASS] test_setSpoke_revertsWith_SpokeAlreadySet() (gas: 15102)
Suite result: ok. 19 passed; 0 failed; 0 skipped; finished in 1.06s (1.04s CPU time)

Ran 6 tests for tests/unit/Spoke/Spoke.Getters.t.sol:SpokeGettersTest
[PASS] test_getLiquidationBonus_configured() (gas: 100816)
Logs:
  Bound result 2
  Bound result 1000000000000000000
  Bound result 4000
  Bound result 900000000000000000

[PASS] test_getLiquidationBonus_fuzz_configured(uint256,uint256,uint16,uint64) (runs: 5000, μ: 99641, ~: 99990)
Logs:
  Bound result 2
  Bound result 247316907484828394
  Bound result 79
  Bound result 427395439924470173

[PASS] test_getLiquidationBonus_fuzz_notConfigured(uint256,uint256) (runs: 5000, μ: 77601, ~: 77823)
Logs:
  Bound result 4
  Bound result 100

[PASS] test_getLiquidationBonus_notConfigured() (gas: 78811)
Logs:
  Bound result 2
  Bound result 1000000000000000000

[PASS] test_premiumRayGetters() (gas: 1539405)
[PASS] test_protocol_getters() (gas: 288396)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 2.42s (2.40s CPU time)

Ran 4 tests for tests/unit/Spoke/Liquidations/Spoke.LiquidationCall.Dust.t.sol:SpokeLiquidationCallDustTest
[PASS] test_collateralDust_min_debtToTarget() (gas: 17747619)
[PASS] test_debtToCover_exceeds_collateralValue() (gas: 17736030)
[PASS] test_dustColl_allowed() (gas: 17596722)
[PASS] test_dustDebt_allowed() (gas: 17727296)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 53.90ms (21.83ms CPU time)

Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateDebt.t.sol:LiquidationLogicLiquidateDebtTest
[PASS] test_liquidateDebt_fuzz(uint256) (runs: 5000, μ: 228386, ~: 218588)
[PASS] test_liquidateDebt_revertsWith_ArithmeticUnderflow() (gas: 106091)
[PASS] test_liquidateDebt_revertsWith_InsufficientAllowance() (gas: 115525)
[PASS] test_liquidateDebt_revertsWith_InsufficientBalance() (gas: 177141)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 2.65s (2.60s CPU time)

Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateUser.t.sol:LiquidationLogicLiquidateUserTest
[PASS] test_liquidateUser() (gas: 373079)
[PASS] test_liquidateUser_revertsWith_InvalidDebtToCover() (gas: 73786)
[PASS] test_liquidateUser_revertsWith_MustNotLeaveDust_Collateral() (gas: 141521)
[PASS] test_liquidateUser_revertsWith_MustNotLeaveDust_Debt() (gas: 146114)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 34.70ms (1.71ms CPU time)

Ran 15 tests for tests/unit/Spoke/Liquidations/Spoke.LiquidationCall.Scenarios.t.sol:SpokeLiquidationCallScenariosTest
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRefreshPremium() (gas: 25955736)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRemove() (gas: 25828066)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubReportDeficit() (gas: 25939163)
[PASS] test_liquidationCall_revertsWith_ReentrancyGuardReentrantCall_hubRestore() (gas: 25903472)
[PASS] test_liquidationCall_scenario1() (gas: 3848940)
[PASS] test_liquidationCall_scenario2() (gas: 3857266)
[PASS] test_liquidationCall_scenario3() (gas: 3263193)
[PASS] test_liquidationCall_scenario4() (gas: 27490843)
[PASS] test_liquidationCall_scenario5() (gas: 3400849)
[PASS] test_liquidationCall_scenario6() (gas: 2237766)
[PASS] test_liquidationCall_scenario7() (gas: 2981704)
[PASS] test_liquidationCall_scenario8() (gas: 2207135)
[PASS] test_liquidationCall_scenario9() (gas: 1627901)
[PASS] test_scenario_halted_asset() (gas: 26575931)
[PASS] test_scenario_halted_asset_with_deficit() (gas: 26420075)
Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 175.00ms (142.28ms CPU time)

Ran 21 tests for tests/unit/AccessManagerEnumerable.t.sol:AccessManagerEnumerableTest
[PASS] test_getRoleMembers_fuzz(uint256,uint256) (runs: 5000, μ: 1982095, ~: 1980880)
Logs:
  Bound result 9
  Bound result 10

[PASS] test_getRoleTargetSelectors_fuzz(uint256,uint256) (runs: 5000, μ: 1601097, ~: 1600128)
Logs:
  Bound result 9
  Bound result 10

[PASS] test_grantRole() (gas: 315933)
[PASS] test_grantRole_fuzz(uint64,uint256) (runs: 5000, μ: 917560, ~: 920059)
Logs:
  Bound result 5

[PASS] test_renounceRole() (gas: 321091)
[PASS] test_renounceRole_shouldNotTrack() (gas: 24510)
[PASS] test_revokeRole() (gas: 323262)
[PASS] test_revokeRole_shouldNotTrack() (gas: 33158)
[PASS] test_setRoleAdmin_fuzz_trackAdminRoles_multipleRoles_multipleAdmins(uint256) (runs: 5000, μ: 2139108, ~: 2196726)
Logs:
  Bound result 12

[PASS] test_setRoleAdmin_fuzz_trackRolesAndTrackAdminRoles_multipleRoles(uint256) (runs: 5000, μ: 1954729, ~: 1899678)
Logs:
  Bound result 12

[PASS] test_setRoleAdmin_trackAdminOfRoles() (gas: 606166)
[PASS] test_setRoleAdmin_trackAdminOfRoles_changeAdminRole() (gas: 577193)
[PASS] test_setRoleAdmin_trackAdminRoles() (gas: 602394)
[PASS] test_setRoleAdmin_trackRolesAndTrackAdminRoles() (gas: 378260)
[PASS] test_setRoleGuardian_trackRoles() (gas: 262021)
[PASS] test_setTargetFunctionRole() (gas: 489773)
[PASS] test_setTargetFunctionRole_multipleTargets() (gas: 1181595)
[PASS] test_setTargetFunctionRole_removeTarget() (gas: 1018326)
[PASS] test_setTargetFunctionRole_skipAddPublicRole() (gas: 206355)
[PASS] test_setTargetFunctionRole_skipAddToAdminRole() (gas: 34319)
[PASS] test_setTargetFunctionRole_withReplace() (gas: 672090)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 23.26s (23.26s CPU time)

Ran 22 tests for tests/unit/AssetInterestRateStrategy.t.sol:AssetInterestRateStrategyTest
[PASS] test_calculateInterestRate_AtMaxUtilization() (gas: 24621)
Logs:
  Bound result 10000
  Bound result 778565440757296803935461404101

[PASS] test_calculateInterestRate_AtOptimalPoint() (gas: 24281)
Logs:
  Bound result 2000
  Bound result 778565440757296803935461404101

[PASS] test_calculateInterestRate_LeftToOptimalPoint(uint256) (runs: 5000, μ: 24191, ~: 24330)
Logs:
  Bound result 137
  Bound result 252173843969976304268974536488

[PASS] test_calculateInterestRate_RightToOptimalPoint(uint256) (runs: 5000, μ: 25302, ~: 25349)
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, μ: 19074, ~: 18822)
Logs:
  Bound result 3124043968137

[PASS] test_calculateInterestRate_revertsWith_InterestRateDataNotSet() (gas: 11203)
[PASS] test_deploy_revertsWith_InvalidAddress() (gas: 3724)
[PASS] test_getBaseDrawnRate() (gas: 14746)
[PASS] test_getInterestRateData() (gas: 19268)
[PASS] test_getMaxDrawnRate() (gas: 15234)
[PASS] test_getOptimalUsageRatio() (gas: 14727)
[PASS] test_getRateGrowthAfterOptimal() (gas: 14791)
[PASS] test_getRateGrowthBeforeOptimal() (gas: 14791)
[PASS] test_maxDrawnRate() (gas: 8314)
[PASS] test_maxOptimalRatio() (gas: 8357)
[PASS] test_minOptimalRatio() (gas: 8299)
[PASS] test_setInterestRateData() (gas: 68942)
[PASS] test_setInterestRateData_revertsWith_InvalidMaxDrawnRate() (gas: 41762)
[PASS] test_setInterestRateData_revertsWith_InvalidOptimalUsageRatio() (gas: 42403)
[PASS] test_setInterestRateData_revertsWith_InvalidRateData() (gas: 35291)
[PASS] test_setInterestRateData_revertsWith_OnlyHub() (gas: 23502)
Suite result: ok. 22 passed; 0 failed; 0 skipped; finished in 1.13s (1.11s CPU time)

Ran 6 tests for tests/unit/position-manager/libraries/ConfigPermissions.t.sol:ConfigPermissionsTests
[PASS] test_constants() (gas: 12052)
[PASS] test_getConfigPermissionValues(uint8) (runs: 5000, μ: 13682, ~: 13682)
[PASS] test_setCanSetUsingAsCollateral_fuzz(uint8,bool) (runs: 5000, μ: 10623, ~: 10611)
[PASS] test_setCanUpdateUserDynamicConfig_fuzz(uint8,bool) (runs: 5000, μ: 10602, ~: 10590)
[PASS] test_setCanUpdateUserRiskPremium_fuzz(uint8,bool) (runs: 5000, μ: 10612, ~: 10600)
[PASS] test_setFullPermissions_fuzz(bool) (runs: 5000, μ: 13124, ~: 13134)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 971.51ms (971.06ms CPU time)

Ran 21 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.InvalidSignature.t.sol:SignatureGatewayInvalidSignatureTest
[PASS] test_borrowWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 154991, ~: 154552)
[PASS] test_borrowWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39084)
[PASS] test_borrowWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37322)
[PASS] test_repayWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 154947, ~: 154508)
[PASS] test_repayWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39017)
[PASS] test_repayWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37344)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 154325, ~: 155416)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39067)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37411)
[PASS] test_supplyWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 155010, ~: 154571)
[PASS] test_supplyWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39084)
[PASS] test_supplyWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37376)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 141405, ~: 140132)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidSignatureDueTo_InvalidSigner() (gas: 25399)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 27083)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 141354, ~: 140081)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidSignatureDueTo_InvalidSigner() (gas: 25333)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 27032)
[PASS] test_withdrawWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 155011, ~: 154572)
[PASS] test_withdrawWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 39126)
[PASS] test_withdrawWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 37386)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 41.43s (41.41s CPU time)

Ran 9 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationAmounts.t.sol:LiquidationLogicLiquidationAmountsTest
[PASS] test_calculateLiquidationAmounts_EnoughCollateral() (gas: 166686)
[PASS] test_calculateLiquidationAmounts_InsufficientCollateral() (gas: 167392)
[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, μ: 285796, ~: 274675)
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, μ: 240680, ~: 228842)
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, μ: 259916, ~: 248053)
Logs:
  Bound result 98020581243928659
  Bound result 9434
  Bound result 0
  Bound result 10008
  Bound result 14
  Bound result 362902507454157297736832118868343942642399513960811609542965143241
  Bound result 10008
  Bound result 4779
  Bound result 1000000000000000131
  Bound result 0
  Bound result 2508165906222592
  Bound result 9
  Bound result 20241
  Bound result 99000000000000000000000015361
  Bound result 2000
  Bound result 343
  Bound result 432000
  Bound result 13
  Bound result 200
  Bound result 120000000
  Bound result 2
  Bound result 362902507454157297736832118868343942642399513960811609542965143241
  Bound result 10008
  Bound result 4779
  Bound result 1000000000000000131
  Bound result 0
  Bound result 2508165906222592
  Bound result 9
  Bound result 20241
  Bound result 99000000000000000000000015361
  Bound result 2000
  Bound result 343
  Bound result 2508165906222592
  Bound result 371
  Bound result 1000000000000000000000120000000
  Bound result 115792089237316195423570985008687907853269984665640564039457584007913129606497

[PASS] test_calculateLiquidationAmounts_fuzz_ExactCollateral((address,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 245170, ~: 233062)
Logs:
  Bound result 493707029584030159
  Bound result 4726
  Bound result 728161183272615584
  Bound result 11178
  Bound result 15
  Bound result 29815
  Bound result 10889
  Bound result 7141
  Bound result 1476533684402258488
  Bound result 728161183272615584
  Bound result 5129744233314671
  Bound result 12
  Bound result 1000000000000000000000000000000
  Bound result 11510029575607604883612971089
  Bound result 121956329
  Bound result 164468887
  Bound result 9454033835407639
  Bound result 15
  Bound result 9294
  Bound result 570558597754027936591560378176
  Bound result 3
  Bound result 1000000000000000000000000000000

[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, μ: 246125, ~: 234153)
Logs:
  Bound result 493707029584030159
  Bound result 4726
  Bound result 728161183272615584
  Bound result 11178
  Bound result 15
  Bound result 29815
  Bound result 10889
  Bound result 7141
  Bound result 1476533684402258488
  Bound result 728161183272615584
  Bound result 5129744233314671
  Bound result 12
  Bound result 1000000000000000000000000000000
  Bound result 11510029575607604883612971089
  Bound result 121956329
  Bound result 164468887
  Bound result 9454033835407639
  Bound result 15
  Bound result 9294
  Bound result 570558597754027936591560378176
  Bound result 3
  Bound result 304091136
  Bound result 1000000000000000000000000000000

[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, μ: 268694, ~: 257099)
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, μ: 255963, ~: 244050)
Logs:
  Bound result 98020581243928659
  Bound result 9434
  Bound result 0
  Bound result 10008
  Bound result 14
  Bound result 362902507454157297736832118868343942642399513960811609542965143241
  Bound result 10008
  Bound result 4779
  Bound result 1000000000000000131
  Bound result 0
  Bound result 2508165906222592
  Bound result 9
  Bound result 20241
  Bound result 99000000000000000000000015361
  Bound result 2000
  Bound result 343
  Bound result 432000
  Bound result 13
  Bound result 200
  Bound result 120000000
  Bound result 2
  Bound result 362902507454157297736832118868343942642399513960811609542965143241
  Bound result 10008
  Bound result 4779
  Bound result 1000000000000000131
  Bound result 0
  Bound result 2508165906222592
  Bound result 9
  Bound result 20241
  Bound result 99000000000000000000000015361
  Bound result 2000
  Bound result 343
  Bound result 2508165906222592
  Bound result 371

Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 41.18s (41.16s CPU time)

Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationBonus.t.sol:LiquidationLogicLiquidationBonusTest
[PASS] test_calculateLiquidationBonus_MinBonusDueToRounding() (gas: 12488)
[PASS] test_calculateLiquidationBonus_PartialBonus() (gas: 12509)
[PASS] test_calculateLiquidationBonus_fuzz_ConstantBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 20353, ~: 20128)
Logs:
  Bound result 3467785138
  Bound result 4390
  Bound result 0
  Bound result 13124

[PASS] test_calculateLiquidationBonus_fuzz_MaxBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 23297, ~: 23072)
Logs:
  Bound result 3467785138
  Bound result 4390
  Bound result 0
  Bound result 13124
  Bound result 0

Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 1.12s (1.09s CPU time)

Ran 11 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.ValidateLiquidationCall.t.sol:LiquidationLogicValidateLiquidationCallTest
[PASS] test_validateLiquidationCall() (gas: 26036)
[PASS] test_validateLiquidationCall_revertsWith_CannotReceiveShares() (gas: 259738)
[PASS] test_validateLiquidationCall_revertsWith_HealthFactorNotBelowThreshold() (gas: 31769)
[PASS] test_validateLiquidationCall_revertsWith_InvalidDebtToCover() (gas: 26861)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotBorrowed() (gas: 26980)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotEnabledAsCollateral_NotUsingAsCollateral() (gas: 27033)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotEnabledAsCollateral_ZeroCollateralFactor() (gas: 27018)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotSupplied() (gas: 26947)
[PASS] test_validateLiquidationCall_revertsWith_ReservePaused_CollateralPaused() (gas: 31989)
[PASS] test_validateLiquidationCall_revertsWith_ReservePaused_DebtPaused() (gas: 31989)
[PASS] test_validateLiquidationCall_revertsWith_SelfLiquidation() (gas: 33724)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 34.80ms (2.13ms CPU time)

Ran 29 tests for tests/unit/MathUtils.t.sol:MathUtilsTest
[PASS] test_add_edge_cases() (gas: 4679)
[PASS] test_add_negative_operand(uint256,int256) (runs: 5000, μ: 9050, ~: 8812)
Logs:
  Bound result -57896044618658097711785492504343953926634992332820282013197946218740589849150

[PASS] test_add_positive_operand(uint256,int256) (runs: 5000, μ: 3920, ~: 3916)
[PASS] test_calculateLinearInterest() (gas: 4368)
[PASS] test_calculateLinearInterest_add_edge() (gas: 4890)
[PASS] test_calculateLinearInterest_edge_cases() (gas: 16246)
Logs:
  Bound result 0
  Bound result 1
  Bound result 864000000
  Bound result 864000000

[PASS] test_calculateLinearInterest_reverts_on_past_timestamp(uint40) (runs: 5000, μ: 7544, ~: 7381)
Logs:
  Bound result 9

[PASS] test_constants() (gas: 3133)
[PASS] test_fuzz_calculateLinearInterest(uint96,uint40,uint256) (runs: 5000, μ: 8592, ~: 8824)
Logs:
  Bound result 10765498

[PASS] test_fuzz_divUp(uint256,uint256) (runs: 5000, μ: 3540, ~: 3544)
[PASS] test_fuzz_mulDivDown(uint256,uint256,uint256) (runs: 5000, μ: 3514, ~: 3577)
[PASS] test_fuzz_mulDivUp(uint256,uint256,uint256) (runs: 5000, μ: 3592, ~: 3724)
[PASS] test_min(uint256,uint256) (runs: 5000, μ: 3281, ~: 3281)
[PASS] test_mulDivDown_NoRemainder() (gas: 3223)
[PASS] test_mulDivDown_RevertOnDivByZero() (gas: 3107)
[PASS] test_mulDivDown_RevertOnOverflow() (gas: 3183)
[PASS] test_mulDivDown_WithRemainder() (gas: 3268)
[PASS] test_mulDivDown_ZeroAOrB() (gas: 3721)
[PASS] test_mulDivUp_NoRemainder() (gas: 3272)
[PASS] test_mulDivUp_RevertOnDivByZero() (gas: 3084)
[PASS] test_mulDivUp_RevertOnOverflow() (gas: 3184)
[PASS] test_mulDivUp_WithRemainder() (gas: 3293)
[PASS] test_mulDivUp_ZeroAOrB() (gas: 3792)
[PASS] test_signedSub(uint256,uint256) (runs: 5000, μ: 8599, ~: 8530)
Logs:
  Bound result 68691281934999
  Bound result 100

[PASS] test_signedSub_revertsWith_SafeCastOverflowedUintToInt(uint256) (runs: 5000, μ: 7650, ~: 7702)
Logs:
  Bound result 57896044618658097711785492504343953926634992332820282019728792007080608788105

[PASS] test_uncheckedAdd(uint256,uint256) (runs: 5000, μ: 3447, ~: 3438)
[PASS] test_uncheckedExp(uint256,uint256) (runs: 5000, μ: 12556, ~: 9884)
[PASS] test_uncheckedSub(uint256,uint256) (runs: 5000, μ: 3443, ~: 3362)
[PASS] test_zeroFloorSub(uint256,uint256) (runs: 5000, μ: 3290, ~: 3326)
Suite result: ok. 29 passed; 0 failed; 0 skipped; finished in 2.73s (2.71s CPU time)

Ran 7 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.SpokeNotRegistered.t.sol:SignatureGateway_SpokeNotRegistered_Test
[PASS] test_borrowWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13410, ~: 13410)
[PASS] test_repayWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13410, ~: 13410)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_SpokeNotRegistered((address,uint256,bool,address,uint256,uint256)) (runs: 5000, μ: 13401, ~: 13401)
[PASS] test_supplyWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13475, ~: 13475)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_SpokeNotRegistered((address,address,uint256,uint256)) (runs: 5000, μ: 13686, ~: 13686)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_SpokeNotRegistered((address,address,uint256,uint256)) (runs: 5000, μ: 13665, ~: 13665)
[PASS] test_withdrawWithSig_revertsWith_SpokeNotRegistered((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 13497, ~: 13497)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 18.52s (18.50s CPU time)

Ran 7 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.Unauthorized.t.sol:SignatureGateway_Unauthorized_PositionManagerActive_Test
[PASS] test_borrowWithSig_revertsWith_Unauthorized() (gas: 80414)
[PASS] test_repayWithSig_revertsWith_Unauthorized() (gas: 113529)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_Unauthorized() (gas: 72985)
[PASS] test_supplyWithSig_revertsWith_Unauthorized() (gas: 140065)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_Unauthorized() (gas: 81380)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_Unauthorized() (gas: 81469)
[PASS] test_withdrawWithSig_revertsWith_Unauthorized() (gas: 79447)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 32.38ms (4.36ms CPU time)

Ran 7 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.Unauthorized.t.sol:SignatureGateway_Unauthorized_PositionManagerNotActive_Test
[PASS] test_borrowWithSig_revertsWith_Unauthorized() (gas: 78206)
[PASS] test_repayWithSig_revertsWith_Unauthorized() (gas: 111321)
[PASS] test_setUsingAsCollateralWithSig_revertsWith_Unauthorized() (gas: 70777)
[PASS] test_supplyWithSig_revertsWith_Unauthorized() (gas: 137857)
[PASS] test_updateUserDynamicConfigWithSig_revertsWith_Unauthorized() (gas: 79172)
[PASS] test_updateUserRiskPremiumWithSig_revertsWith_Unauthorized() (gas: 79261)
[PASS] test_withdrawWithSig_revertsWith_Unauthorized() (gas: 77239)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 29.97ms (4.26ms CPU time)

Ran 4 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.SetSelfAsUserPositionManagerWithSig.t.sol:SignatureGatewaySetSelfAsUserPositionManagerTest
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 140181)
[PASS] test_setSelfAsUserPositionManagerWithSig_forwards_correct_call() (gas: 32642)
[PASS] test_setSelfAsUserPositionManagerWithSig_ignores_underlying_spoke_reverts() (gas: 29661)
[PASS] test_setSelfAsUserPositionManagerWithSig_revertsWith_SpokeNotRegistered() (gas: 16473)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 26.24ms (1.14ms CPU time)

Ran 14 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.t.sol:SignatureGatewayTest
[PASS] test_borrowWithSig() (gas: 813771)
[PASS] test_multicall() (gas: 628738)
[PASS] test_multicall_atomicity_on_revert() (gas: 523532)
[PASS] test_multicall_no_atomicity_with_trycatch() (gas: 625435)
[PASS] test_renouncePositionManagerRole() (gas: 27532)
[PASS] test_renouncePositionManagerRole_revertsWith_OnlyOwner() (gas: 18068)
[PASS] test_repayWithSig() (gas: 817382)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 330140)
[PASS] test_setUsingAsCollateralWithSig() (gas: 631699)
[PASS] test_supplyWithSig() (gas: 601458)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 340321)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 1036587)
[PASS] test_useNonce_monotonic(bytes32) (runs: 5000, μ: 13323, ~: 13323)
[PASS] test_withdrawWithSig() (gas: 605099)
Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 480.04ms (454.26ms CPU time)

Ran 3 tests for tests/unit/Spoke/Spoke.Access.t.sol:SpokeAccessTest
[PASS] testAccess_change_authority() (gas: 514218)
[PASS] testAccess_hub_functions_callable_by_spokes() (gas: 569372)
[PASS] testAccess_spoke_admin_config_access() (gas: 491538)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 34.43ms (3.02ms CPU time)

Ran 26 tests for tests/unit/position-manager/ConfigPositionManager/ConfigPositionManager.Permit.t.sol:ConfigPositionManagerPermitTest
[PASS] test_DOMAIN_SEPARATOR() (gas: 5688)
[PASS] test_eip712Domain() (gas: 10941)
[PASS] test_setCanSetUsingAsCollateralPermissionPermit_typeHash() (gas: 9951)
[PASS] test_setCanSetUsingAsCollateralPermissionWithSig_fuzz(address,bool) (runs: 5000, μ: 158421, ~: 157009)
[PASS] test_setCanSetUsingAsCollateralPermissionWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 144916, ~: 142519)
[PASS] test_setCanSetUsingAsCollateralPermissionWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 28199)
[PASS] test_setCanSetUsingAsCollateralPermissionWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 32591)
[PASS] test_setCanSetUsingAsCollateralPermissionWithSig_revertsWith_SpokeNotRegistered() (gas: 61515)
[PASS] test_setCanUpdateUserDynamicConfigPermissionPermit_typeHash() (gas: 9863)
[PASS] test_setCanUpdateUserDynamicConfigPermissionWithSig_fuzz(address,bool) (runs: 5000, μ: 158427, ~: 157015)
[PASS] test_setCanUpdateUserDynamicConfigPermissionWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 144938, ~: 142541)
[PASS] test_setCanUpdateUserDynamicConfigPermissionWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 28190)
[PASS] test_setCanUpdateUserDynamicConfigPermissionWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 32571)
[PASS] test_setCanUpdateUserDynamicConfigPermissionWithSig_revertsWith_SpokeNotRegistered() (gas: 61528)
[PASS] test_setCanUpdateUserRiskPremiumPermissionPermit_typeHash() (gas: 9949)
[PASS] test_setCanUpdateUserRiskPremiumPermissionWithSig_fuzz(address,bool) (runs: 5000, μ: 158404, ~: 156992)
[PASS] test_setCanUpdateUserRiskPremiumPermissionWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 144873, ~: 142476)
[PASS] test_setCanUpdateUserRiskPremiumPermissionWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 28189)
[PASS] test_setCanUpdateUserRiskPremiumPermissionWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 32560)
[PASS] test_setCanUpdateUserRiskPremiumPermissionWithSig_revertsWith_SpokeNotRegistered() (gas: 61460)
[PASS] test_setGlobalPermissionPermit_typeHash() (gas: 9957)
[PASS] test_setGlobalPermissionWithSig_fuzz(address,bool) (runs: 5000, μ: 162674, ~: 161111)
[PASS] test_setGlobalPermissionWithSig_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 144899, ~: 142502)
[PASS] test_setGlobalPermissionWithSig_revertsWith_InvalidSignature_dueTo_ExpiredDeadline() (gas: 28176)
[PASS] test_setGlobalPermissionWithSig_revertsWith_InvalidSignature_dueTo_InvalidSigner() (gas: 32532)
[PASS] test_setGlobalPermissionWithSig_revertsWith_SpokeNotRegistered() (gas: 61468)
Suite result: ok. 26 passed; 0 failed; 0 skipped; finished in 46.50s (46.47s CPU time)

Ran 39 tests for tests/unit/position-manager/ConfigPositionManager/ConfigPositionManager.t.sol:ConfigPositionManagerTest
[PASS] test_multicall() (gas: 84518)
[PASS] test_renounceCanUpdateUserDynamicConfigPermission() (gas: 41286)
[PASS] test_renounceCanUpdateUserDynamicConfigPermission_revertsWith_SpokeNotRegistered() (gas: 17489)
[PASS] test_renounceCanUpdateUserRiskPremiumPermission() (gas: 41198)
[PASS] test_renounceCanUpdateUserRiskPremiumPermission_revertsWith_SpokeNotRegistered() (gas: 17380)
[PASS] test_renounceCanUpdateUsingAsCollateralPermission() (gas: 41215)
[PASS] test_renounceCanUpdateUsingAsCollateralPermission_revertsWith_SpokeNotRegistered() (gas: 17402)
[PASS] test_renounceGlobalPermission() (gas: 42252)
[PASS] test_renounceGlobalPermission_revertsWith_SpokeNotRegistered() (gas: 17423)
[PASS] test_setCanSetUsingAsCollateralPermission() (gas: 54009)
[PASS] test_setCanSetUsingAsCollateralPermission_remove() (gas: 41304)
[PASS] test_setCanSetUsingAsCollateralPermission_revertsWith_InvalidAddress_zeroDelegatee() (gas: 17885)
[PASS] test_setCanSetUsingAsCollateralPermission_revertsWith_SpokeNotRegistered() (gas: 17497)
[PASS] test_setCanUpdateUserDynamicConfigPermission() (gas: 54032)
[PASS] test_setCanUpdateUserDynamicConfigPermission_remove() (gas: 41359)
[PASS] test_setCanUpdateUserDynamicConfigPermission_revertsWith_InvalidAddress_zeroDelegatee() (gas: 17937)
[PASS] test_setCanUpdateUserDynamicConfigPermission_revertsWith_SpokeNotRegistered() (gas: 17561)
[PASS] test_setCanUpdateUserRiskPremiumPermission() (gas: 54033)
[PASS] test_setCanUpdateUserRiskPremiumPermission_remove() (gas: 41341)
[PASS] test_setCanUpdateUserRiskPremiumPermission_revertsWith_InvalidAddress_zeroDelegatee() (gas: 17916)
[PASS] test_setCanUpdateUserRiskPremiumPermission_revertsWith_SpokeNotRegistered() (gas: 17542)
[PASS] test_setGlobalPermission() (gas: 55612)
[PASS] test_setGlobalPermission_removeAllPermissions() (gas: 42393)
[PASS] test_setGlobalPermission_removePreviousPermissions() (gas: 46538)
[PASS] test_setGlobalPermission_revertsWith_InvalidAddress_zeroDelegatee() (gas: 17869)
[PASS] test_setGlobalPermission_revertsWith_SpokeNotRegistered() (gas: 17540)
[PASS] test_setGlobalPermission_setThenRemove() (gas: 50008)
[PASS] test_setUsingAsCollateralOnBehalfOf_fuzz_withGlobalPermission(uint256,bool) (runs: 5000, μ: 105690, ~: 110529)
Logs:
  Bound result 2

[PASS] test_setUsingAsCollateralOnBehalfOf_fuzz_withPermission(uint256,bool) (runs: 5000, μ: 105750, ~: 110589)
Logs:
  Bound result 2

[PASS] test_setUsingAsCollateralOnBehalfOf_revertsWith_CallerNotAllowed() (gas: 22151)
[PASS] test_setUsingAsCollateralOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 17584)
[PASS] test_updateUserDynamicConfigOnBehalfOf_revertsWith_CallerNotAllowed() (gas: 19908)
[PASS] test_updateUserDynamicConfigOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 17422)
[PASS] test_updateUserDynamicConfigOnBehalfOf_withGlobalPermission() (gas: 69720)
[PASS] test_updateUserDynamicConfigOnBehalfOf_withPermission() (gas: 69822)
[PASS] test_updateUserRiskPremiumOnBehalfOf_revertsWith_CallerNotAllowed() (gas: 19909)
[PASS] test_updateUserRiskPremiumOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 17469)
[PASS] test_updateUserRiskPremiumOnBehalfOf_withGlobalPermission() (gas: 809271)
[PASS] test_updateUserRiskPremiumOnBehalfOf_withPermission() (gas: 809284)
Suite result: ok. 39 passed; 0 failed; 0 skipped; finished in 11.03s (11.00s CPU time)

Ran 41 tests for tests/unit/position-manager/NativeTokenGateway.t.sol:NativeTokenGatewayTest
[PASS] test_borrowNative() (gas: 667531)
Logs:
  Bound result 5000000000000000000

[PASS] test_borrowNative_fuzz(uint256) (runs: 5000, μ: 666918, ~: 668264)
Logs:
  Bound result 3124043968137

[PASS] test_borrowNative_revertsWith_InvalidAmount() (gas: 32444)
[PASS] test_borrowNative_revertsWith_NotNativeWrappedAsset() (gas: 32519)
[PASS] test_borrowNative_revertsWith_ReentrancyGuardReentrantCall_hubDraw() (gas: 283143)
[PASS] test_borrowNative_revertsWith_ReentrancyGuardReentrantCall_spokeBorrow() (gas: 271222)
[PASS] test_borrowNative_revertsWith_SpokeNotRegistered() (gas: 25378)
[PASS] test_constructor() (gas: 12675)
[PASS] test_constructor_revertsWith_InvalidAddress() (gas: 5958)
[PASS] test_fallback_revertsWith_UnsupportedAction() (gas: 17595)
[PASS] test_multicall_revertsWith_UnsupportedAction() (gas: 11265)
[PASS] test_receive_revertsWith_UnsupportedAction() (gas: 17408)
[PASS] test_repayNative() (gas: 759989)
Logs:
  Bound result 5000000000000000000

[PASS] test_repayNative_excessAmount() (gas: 668542)
[PASS] test_repayNative_fuzz(uint256) (runs: 5000, μ: 755423, ~: 760622)
Logs:
  Bound result 3124043968137

[PASS] test_repayNative_fuzz_withInterest(uint256,uint256) (runs: 5000, μ: 679424, ~: 674621)
Logs:
  Bound result 90000068691281935000
  Bound result 25920101

[PASS] test_repayNative_revertsWith_InvalidAmount() (gas: 32481)
[PASS] test_repayNative_revertsWith_NativeAmountMismatch() (gas: 30002)
[PASS] test_repayNative_revertsWith_NotNativeWrappedAsset() (gas: 39249)
[PASS] test_repayNative_revertsWith_ReentrancyGuardReentrantCall_hubRestore() (gas: 326265)
[PASS] test_repayNative_revertsWith_ReentrancyGuardReentrantCall_spokeRepay() (gas: 303321)
[PASS] test_repayNative_revertsWith_SpokeNotRegistered() (gas: 38722)
[PASS] test_supplyAndCollateralNative() (gas: 333564)
Logs:
  Bound result 100000000000000000000

[PASS] test_supplyAndCollateralNative_fuzz(uint256) (runs: 5000, μ: 333885, ~: 333592)
Logs:
  Bound result 3124043968137

[PASS] test_supplyNative() (gas: 305258)
Logs:
  Bound result 100000000000000000000

[PASS] test_supplyNative_fuzz(uint256) (runs: 5000, μ: 305578, ~: 305285)
Logs:
  Bound result 3124043968137

[PASS] test_supplyNative_revertsWith_InvalidAmount() (gas: 32457)
[PASS] test_supplyNative_revertsWith_NativeAmountMismatch() (gas: 29986)
[PASS] test_supplyNative_revertsWith_NotNativeWrappedAsset() (gas: 39237)
[PASS] test_supplyNative_revertsWith_ReentrancyGuardReentrantCall_hubAdd() (gas: 374260)
[PASS] test_supplyNative_revertsWith_ReentrancyGuardReentrantCall_spokeSupply() (gas: 336151)
[PASS] test_supplyNative_revertsWith_SpokeNotRegistered() (gas: 38734)
[PASS] test_withdrawNative() (gas: 331913)
Logs:
  Bound result 100000000000000000000

[PASS] test_withdrawNative_fuzz(uint256) (runs: 5000, μ: 331437, ~: 331919)
Logs:
  Bound result 3124043968137

[PASS] test_withdrawNative_fuzz_allBalance(uint256) (runs: 5000, μ: 268049, ~: 267842)
Logs:
  Bound result 3124043968137

[PASS] test_withdrawNative_fuzz_allBalanceWithInterest(uint256,uint256) (runs: 5000, μ: 616160, ~: 616089)
Logs:
  Bound result 68691281934999
  Bound result 100

[PASS] test_withdrawNative_revertsWith_InvalidAmount() (gas: 32475)
[PASS] test_withdrawNative_revertsWith_NotNativeWrappedAsset() (gas: 32508)
[PASS] test_withdrawNative_revertsWith_ReentrancyGuardReentrantCall_hubRemove() (gas: 300006)
[PASS] test_withdrawNative_revertsWith_ReentrancyGuardReentrantCall_spokeWithdraw() (gas: 271196)
[PASS] test_withdrawNative_revertsWith_SpokeNotRegistered() (gas: 25345)
Suite result: ok. 41 passed; 0 failed; 0 skipped; finished in 73.07s (73.04s CPU time)

Ran 3 tests for tests/unit/NoncesKeyed.t.sol:NoncesKeyedTest
[PASS] test_useCheckedNonce_monotonic(bytes32) (runs: 5000, μ: 12902, ~: 12902)
[PASS] test_useCheckedNonce_revertsWith_InvalidAccountNonce(bytes32) (runs: 5000, μ: 95279, ~: 94374)
[PASS] test_useNonce_monotonic(bytes32) (runs: 5000, μ: 13570, ~: 13570)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 3.85s (3.84s CPU time)

Ran 10 tests for tests/unit/PercentageMath.t.sol:PercentageMathTests
[PASS] test_constants() (gas: 8604)
[PASS] test_fromBpsDown() (gas: 9654)
[PASS] test_percentDiv() (gas: 14993)
[PASS] test_percentDivUp_ge_value(uint256,uint256) (runs: 5000, μ: 15140, ~: 15261)
Logs:
  Bound result 100
  Bound result 68691281934999

[PASS] test_percentDivUp_le_value(uint256,uint256) (runs: 5000, μ: 15345, ~: 15347)
Logs:
  Bound result 90101
  Bound result 68691281934999

[PASS] test_percentDiv_fuzz(uint256,uint256) (runs: 5000, μ: 12597, ~: 12760)
[PASS] test_percentMul() (gas: 14932)
[PASS] test_percentMulUp_ge_value(uint256,uint256) (runs: 5000, μ: 15328, ~: 15330)
Logs:
  Bound result 90101
  Bound result 68691281934999

[PASS] test_percentMulUp_le_value(uint256,uint256) (runs: 5000, μ: 15143, ~: 15264)
Logs:
  Bound result 100
  Bound result 68691281934999

[PASS] test_percentMul_fuzz(uint256,uint256) (runs: 5000, μ: 11516, ~: 12063)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 1.41s (1.41s CPU time)

Ran 17 tests for tests/unit/position-manager/PositionManagerBase.t.sol:PositionManagerBaseTest
[PASS] test_constructor() (gas: 17209)
[PASS] test_getReserveUnderlying_fuzz(uint256) (runs: 5000, μ: 36890, ~: 36947)
Logs:
  Bound result 2

[PASS] test_getReserveUnderlying_revertsWith_ReserveNotListed() (gas: 25763)
[PASS] test_multicall() (gas: 73158)
[PASS] test_multicall_atomicity_on_revert() (gas: 48181)
[PASS] test_multicall_revertsWith_UnsupportedAction() (gas: 11243)
[PASS] test_permitReserveUnderlying() (gas: 128765)
[PASS] test_permitReserveUnderlying_forwards_correct_call() (gas: 78195)
[PASS] test_permitReserveUnderlying_ignores_permit_reverts() (gas: 67273)
[PASS] test_permitReserveUnderlying_revertsWith_ReserveNotListed() (gas: 58153)
[PASS] test_registerSpoke_fuzz(address) (runs: 5000, μ: 41640, ~: 41640)
[PASS] test_registerSpoke_revertsWith_InvalidAddress() (gas: 13087)
[PASS] test_registerSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 15935)
[PASS] test_registerSpoke_unregister() (gas: 36116)
[PASS] test_renouncePositionManagerRole() (gas: 65242)
[PASS] test_renouncePositionManagerRole_revertsWith_OwnableUnauthorizedAccount() (gas: 74572)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 131425)
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 955.82ms (929.71ms CPU time)

Ran 10 tests for tests/unit/position-manager/libraries/PositionManagerEIP712Hash.t.sol:PositionManagerEIP712HashTest
[PASS] test_constants() (gas: 13419)
[PASS] test_hash_borrow_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6712, ~: 6712)
[PASS] test_hash_creditDelegation_fuzz((address,uint256,address,address,uint256,uint256,uint256)) (runs: 5000, μ: 4810, ~: 4810)
[PASS] test_hash_repay_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6690, ~: 6690)
[PASS] test_hash_setUsingAsCollateral_fuzz((address,uint256,bool,address,uint256,uint256)) (runs: 5000, μ: 7171, ~: 7171)
[PASS] test_hash_supply_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6711, ~: 6711)
[PASS] test_hash_updateUserDynamicConfig_fuzz((address,address,uint256,uint256)) (runs: 5000, μ: 6349, ~: 6349)
[PASS] test_hash_updateUserRiskPremium_fuzz((address,address,uint256,uint256)) (runs: 5000, μ: 6370, ~: 6370)
[PASS] test_hash_withdrawPermit_fuzz((address,uint256,address,address,uint256,uint256,uint256)) (runs: 5000, μ: 4832, ~: 4832)
[PASS] test_hash_withdraw_fuzz((address,uint256,uint256,address,uint256,uint256)) (runs: 5000, μ: 6689, ~: 6689)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 4.51s (4.51s CPU time)

Ran 11 tests for tests/gas/PositionManagers.Operations.gas.t.sol:ConfigPositionManager_Gas_Tests
[PASS] test_renounceCanUpdateUserDynamicConfigPermission() (gas: 93331)
[PASS] test_renounceCanUpdateUserRiskPremiumPermission() (gas: 93308)
[PASS] test_renounceCanUpdateUsingAsCollateralPermission() (gas: 93243)
[PASS] test_renounceGlobalPermission() (gas: 93180)
[PASS] test_setCanSetUsingAsCollateralPermission() (gas: 69240)
[PASS] test_setCanUpdateUserDynamicConfigPermission() (gas: 69259)
[PASS] test_setCanUpdateUserRiskPremiumPermission() (gas: 69282)
[PASS] test_setGlobalPermission() (gas: 69173)
[PASS] test_setUsingAsCollateralOnBehalfOf_fuzz_withGlobalPermission() (gas: 145058)
[PASS] test_updateUserDynamicConfigOnBehalfOf_withGlobalPermission() (gas: 120767)
[PASS] test_updateUserRiskPremiumOnBehalfOf_withGlobalPermission() (gas: 713857)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 48.62ms (2.44ms CPU time)

Ran 2 tests for tests/gas/PositionManagers.Operations.gas.t.sol:GiverPositionManager_Gas_Tests
[PASS] test_repayOnBehalfOf() (gas: 919766)
[PASS] test_supplyOnBehalfOf() (gas: 282870)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 47.04ms (1.81ms CPU time)

Ran 1 test for tests/gas/PositionManagers.Operations.gas.t.sol:PositionManager_Gas_Tests
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 215923)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 45.46ms (812.02µs CPU time)

Ran 8 tests for tests/gas/PositionManagers.Operations.gas.t.sol:TakerPositionManager_Gas_Tests
[PASS] test_approveWithdraw() (gas: 69195)
[PASS] test_approveWithdrawWithSig() (gas: 155438)
[PASS] test_borrowOnBehalfOf() (gas: 763831)
[PASS] test_creditDelegation() (gas: 69162)
[PASS] test_delegateCreditWithSig() (gas: 155432)
[PASS] test_renounceCreditDelegation() (gas: 93655)
[PASS] test_renounceWithdrawAllowance() (gas: 93762)
[PASS] test_withdrawOnBehalfOf() (gas: 584219)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 48.39ms (3.62ms 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, μ: 949366, ~: 905610)
Logs:
  Bound result 812

[PASS] test_extSloads(uint256,bytes) (runs: 5000, μ: 1008419, ~: 968863)
Logs:
  Bound result 362

Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 56.38s (56.38s CPU time)

Ran 5 tests for tests/gas/Gateways.Operations.gas.t.sol:NativeTokenGateway_Gas_Tests
[PASS] test_borrowNative() (gas: 924794)
[PASS] test_repayNative() (gas: 992785)
[PASS] test_supplyAndCollateralNative() (gas: 305250)
[PASS] test_supplyNative() (gas: 286691)
[PASS] test_withdrawNative() (gas: 508792)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 49.95ms (4.35ms CPU time)

Ran 8 tests for tests/gas/Gateways.Operations.gas.t.sol:SignatureGateway_Gas_Tests
[PASS] test_borrowWithSig() (gas: 748631)
[PASS] test_repayWithSig() (gas: 955129)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 209293)
[PASS] test_setUsingAsCollateralWithSig() (gas: 289353)
[PASS] test_supplyWithSig() (gas: 434276)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 145250)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 143115)
[PASS] test_withdrawWithSig() (gas: 409926)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 53.52ms (8.15ms CPU time)

Ran 12 tests for tests/unit/position-manager/GiverPositionManager.t.sol:GiverPositionManagerTest
[PASS] test_multicall() (gas: 334903)
[PASS] test_repayOnBehalfOf() (gas: 640360)
Logs:
  Bound result 50000000000000000000

[PASS] test_repayOnBehalfOf_fuzz(uint256) (runs: 5000, μ: 637476, ~: 640655)
Logs:
  Bound result 3124043968137

[PASS] test_repayOnBehalfOf_fuzz_withInterest(uint256,uint256) (runs: 5000, μ: 571458, ~: 567797)
Logs:
  Bound result 900000068691281935000
  Bound result 25920101

[PASS] test_repayOnBehalfOf_maxRepay() (gas: 561613)
[PASS] test_repayOnBehalfOf_maxRepay_revertsWith_InvalidRepayAmount() (gas: 483216)
[PASS] test_repayOnBehalfOf_revertsWith_ReserveNotListed() (gas: 32366)
[PASS] test_repayOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 28744)
[PASS] test_supplyOnBehalfOf() (gas: 296643)
Logs:
  Bound result 100000000000000000000

[PASS] test_supplyOnBehalfOf_fuzz(uint256) (runs: 5000, μ: 296914, ~: 296693)
Logs:
  Bound result 3124043968137

[PASS] test_supplyOnBehalfOf_revertsWith_ReserveNotListed() (gas: 32405)
[PASS] test_supplyOnBehalfOf_revertsWith_SpokeNotRegistered() (gas: 28794)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 30.58s (30.56s CPU time)

Ran 6 tests for tests/unit/Hub/Hub.Access.t.sol:HubAccessTest
[PASS] test_change_authority() (gas: 206679)
[PASS] test_change_role_responsibility() (gas: 121287)
[PASS] test_hub_access_manager_exposure() (gas: 13439)
[PASS] test_hub_admin_access() (gas: 1350370)
[PASS] test_migrate_role_responsibility() (gas: 709202)
[PASS] test_setInterestRateData_access() (gas: 102610)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 29.18ms (3.93ms CPU time)

Ran 1 test for tests/unit/Spoke/Spoke.AccrueInterest.Scenario.t.sol:SpokeAccrueInterestScenarioTest
[PASS] test_accrueInterest_fuzz_RPBorrowAndSkipTime_twoActions((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint40) (runs: 5000, μ: 5586220, ~: 5436967)
Logs:
  Bound result 416966230219621053938274952927
  Bound result 0
  Bound result 255831241153786906
  Bound result 41191294854201435881
  Bound result 124281697546210950467266407747
  Bound result 33522909571553656
  Bound result 481970306954558904
  Bound result 12412
  Bound result 6
  Bound result 124281697546210950467266407747
  Bound result 33522909571553656
  Bound result 481970306954558904
  Bound result 12412

Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 130.25s (130.23s CPU time)

Ran 19 tests for tests/unit/Hub/Hub.Add.t.sol:HubAddTest
[PASS] test_add_AddCapReachedButNotExceeded_rounding() (gas: 660714)
[PASS] test_add_fuzz_AddCapReachedButNotExceeded(uint40) (runs: 5000, μ: 157881, ~: 157837)
Logs:
  Bound result 9

[PASS] test_add_fuzz_multi_asset_multi_spoke(uint256,uint256,uint256) (runs: 5000, μ: 332470, ~: 332622)
Logs:
  Bound result 3
  Bound result 218470873395738003579119570309
  Bound result 446067553769140138733721804

[PASS] test_add_fuzz_revertsWith_AddCapExceeded(uint40) (runs: 5000, μ: 112437, ~: 112393)
Logs:
  Bound result 9

[PASS] test_add_fuzz_revertsWith_AddCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 263830, ~: 263690)
Logs:
  Bound result 1291
  Bound result 1071208440522043736492
  Bound result 173721804

[PASS] test_add_fuzz_revertsWith_InvalidShares_due_to_index(uint256,uint256,uint256) (runs: 5000, μ: 220659, ~: 220858)
Logs:
  Bound result 494814332414361652770697333760
  Bound result 3122066956
  Bound result 8

[PASS] test_add_fuzz_single_asset(uint256,address,uint256) (runs: 5000, μ: 342356, ~: 342395)
Logs:
  Bound result 1
  Bound result 22978

[PASS] test_add_fuzz_single_spoke_multi_add(uint256,uint256) (runs: 5000, μ: 785683, ~: 785711)
Logs:
  Bound result 68691281934999
  Bound result 100

[PASS] test_add_multi_add_minimal_shares() (gas: 316011)
[PASS] test_add_revertsWith_AmountDowncastOverflow() (gas: 357696)
[PASS] test_add_revertsWith_InsufficientTransferred() (gas: 64504)
[PASS] test_add_revertsWith_InvalidAmount() (gas: 13631)
[PASS] test_add_revertsWith_InvalidShares() (gas: 220197)
[PASS] test_add_revertsWith_SharesDowncastOverflow() (gas: 224358)
[PASS] test_add_revertsWith_SpokeHalted() (gas: 99705)
[PASS] test_add_revertsWith_SpokeNotActive() (gas: 99741)
[PASS] test_add_single_asset() (gas: 330246)
Logs:
  Bound result 2
  Bound result 100000000000000000000

[PASS] test_add_with_increased_index() (gas: 298042)
[PASS] test_add_with_increased_index_with_premium() (gas: 674207)
Suite result: ok. 19 passed; 0 failed; 0 skipped; finished in 45.26s (45.24s CPU time)

Ran 32 tests for tests/unit/libraries/PositionStatusMap.t.sol:PositionStatusMapTest
[PASS] test_borrowCount() (gas: 108134)
[PASS] test_borrowCount(uint256) (runs: 5000, μ: 1930883, ~: 1770259)
Logs:
  Bound result 812

[PASS] test_borrowCount_ignoresInvalidBits() (gas: 122795)
[PASS] test_bucketId() (gas: 8922)
[PASS] test_collateralCount() (gas: 108082)
[PASS] test_collateralCount(uint256) (runs: 5000, μ: 1946596, ~: 1786685)
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, μ: 14038, ~: 14336)
Logs:
  Bound result 151
  Bound result 100

[PASS] test_fuzz_setBorrowing(uint256,bool) (runs: 5000, μ: 22255, ~: 32137)
[PASS] test_fuzz_setUseAsCollateral(uint256,bool) (runs: 5000, μ: 22307, ~: 32189)
[PASS] test_getBucketWord(uint256) (runs: 5000, μ: 14179, ~: 14179)
[PASS] test_isUsingAsCollateralOrBorrowing_slot0() (gas: 108352)
[PASS] test_isUsingAsCollateralOrBorrowing_slot1() (gas: 43997)
[PASS] test_isolateBorrowing(uint256) (runs: 5000, μ: 153030, ~: 153030)
[PASS] test_isolateBorrowingUntil(uint256,uint256) (runs: 5000, μ: 144782, ~: 144548)
[PASS] test_isolateCollateral(uint256) (runs: 5000, μ: 152949, ~: 152949)
[PASS] test_isolateCollateralUntil(uint256,uint256) (runs: 5000, μ: 144717, ~: 144483)
[PASS] test_isolateUntil(uint256,uint256) (runs: 5000, μ: 134621, ~: 134616)
[PASS] test_next(uint256) (runs: 5000, μ: 20038, ~: 18925)
Logs:
  Bound result 649

[PASS] test_nextBorrowing(uint256) (runs: 5000, μ: 18007, ~: 16874)
Logs:
  Bound result 649

[PASS] test_nextBorrowing_continuous() (gas: 61801685)
[PASS] test_nextCollateral(uint256) (runs: 5000, μ: 18165, ~: 16983)
Logs:
  Bound result 649

[PASS] test_nextCollateral_continuous() (gas: 62157760)
[PASS] test_next_continuous() (gas: 89136467)
[PASS] test_popCount(bytes32) (runs: 5000, μ: 37881, ~: 38011)
[PASS] test_setBorrowing_slot0() (gas: 43906)
[PASS] test_setBorrowing_slot1() (gas: 43942)
[PASS] test_setUseAsCollateral_slot0() (gas: 44158)
[PASS] test_setUseAsCollateral_slot1() (gas: 44140)
[PASS] test_setters_use_correct_slot(uint256) (runs: 5000, μ: 36549, ~: 41309)
Suite result: ok. 32 passed; 0 failed; 0 skipped; finished in 159.67s (159.66s CPU time)

Ran 5 tests for tests/unit/Rescuable.t.sol:RescuableTest
[PASS] test_constructor() (gas: 12531)
[PASS] test_rescueNative_fuzz(uint256) (runs: 5000, μ: 33306, ~: 33509)
Logs:
  Bound result 3124043968137

[PASS] test_rescueNative_revertsWith_OnlyRescueGuardian() (gas: 11089)
[PASS] test_rescueToken_fuzz(uint256) (runs: 5000, μ: 206643, ~: 206782)
Logs:
  Bound result 3124043968137

[PASS] test_rescueToken_revertsWith_OnlyRescueGuardian() (gas: 180556)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 3.16s (3.14s CPU time)

Ran 7 tests for tests/unit/ReserveFlags.t.sol:ReserveFlagsTests
[PASS] test_constants() (gas: 12118)
[PASS] test_create_fuzz(bool,bool,bool,bool) (runs: 5000, μ: 14707, ~: 14707)
[PASS] test_setBorrowable_fuzz(uint8) (runs: 5000, μ: 13338, ~: 13338)
[PASS] test_setFrozen_fuzz(uint8) (runs: 5000, μ: 13280, ~: 13280)
[PASS] test_setPaused_fuzz(uint8) (runs: 5000, μ: 13289, ~: 13289)
[PASS] test_setReceiveSharesEnabled_fuzz(uint8) (runs: 5000, μ: 13196, ~: 13196)
[PASS] test_set_flags() (gas: 65513)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 1.26s (1.25s CPU time)

Ran 10 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.Constants.t.sol:SignatureGatewayConstantsTest
[PASS] test_DOMAIN_SEPARATOR() (gas: 5628)
[PASS] test_borrow_typeHash() (gas: 9733)
[PASS] test_constructor() (gas: 3749)
[PASS] test_eip712Domain() (gas: 10940)
[PASS] test_repay_typeHash() (gas: 9857)
[PASS] test_setUsingAsCollateral_typeHash() (gas: 9780)
[PASS] test_supply_typeHash() (gas: 9871)
[PASS] test_updateUserDynamicConfig_typeHash() (gas: 9758)
[PASS] test_updateUserRiskPremium_typeHash() (gas: 9779)
[PASS] test_withdraw_typeHash() (gas: 9756)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 28.21ms (2.34ms CPU time)

Ran 5 tests for tests/unit/position-manager/SignatureGateway/SignatureGateway.PermitReserve.t.sol:SignatureGatewayPermitReserveTest
[PASS] test_permitReserve() (gas: 101550)
[PASS] test_permitReserve_forwards_correct_call() (gas: 51045)
[PASS] test_permitReserve_ignores_permit_reverts() (gas: 40070)
[PASS] test_permitReserve_revertsWith_ReserveNotListed() (gas: 30985)
[PASS] test_permitReserve_revertsWith_SpokeNotRegistered() (gas: 29349)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 27.34ms (1.59ms CPU time)

Ran 7 tests for tests/unit/Spoke/Spoke.AccrueInterest.t.sol:SpokeAccrueInterestTest
[PASS] test_accrueInterest_NoActionTaken() (gas: 133168)
[PASS] test_accrueInterest_NoInterest_NoDebt(uint40) (runs: 5000, μ: 640199, ~: 640028)
Logs:
  Bound result 9

[PASS] test_accrueInterest_NoInterest_OnlySupply(uint40) (runs: 5000, μ: 250256, ~: 250250)
Logs:
  Bound result 9

[PASS] test_accrueInterest_TenPercentRp(uint256,uint40) (runs: 5000, μ: 583625, ~: 584050)
Logs:
  Bound result 68691281934999
  Bound result 0

[PASS] test_accrueInterest_fuzz_BorrowAmountAndSkipTime(uint256,uint40) (runs: 5000, μ: 542989, ~: 543343)
Logs:
  Bound result 68691281934999
  Bound result 0

[SKIP: pending rft] test_accrueInterest_fuzz_RPBorrowAndSkipTime((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint40) (runs: 0, μ: 0, ~: 0)
[PASS] test_accrueInterest_fuzz_RatesRPBorrowAndSkipTime((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),(uint96,uint96,uint96,uint96),uint40) (runs: 5000, μ: 4030057, ~: 4046716)
Logs:
  Bound result 20917
  Bound result 400
  Bound result 1252
  Bound result 11146
  Bound result 9958
  Bound result 1990
  Bound result 11000
  Bound result 3521021950
  Bound result 6198
  Bound result 18578
  Bound result 11809
  Bound result 50335
  Bound result 3808
  Bound result 9958
  Bound result 1990
  Bound result 11000
  Bound result 3475

Suite result: ok. 6 passed; 0 failed; 1 skipped; finished in 111.49s (111.46s CPU time)

Ran 38 tests for tests/unit/Hub/Hub.Config.t.sol:HubConfigTest
[PASS] test_addAsset_fuzz(address,uint8,address) (runs: 5000, μ: 390278, ~: 390317)
Logs:
  Bound result 18

[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_feeReceiver(address,uint8,address) (runs: 5000, μ: 45293, ~: 44992)
Logs:
  Bound result 0

[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_irStrategy(address,uint8,address) (runs: 5000, μ: 45358, ~: 45057)
Logs:
  Bound result 0

[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_underlying(uint8,address,address) (runs: 5000, μ: 36654, ~: 36654)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals(address,uint8,address,address) (runs: 5000, μ: 45895, ~: 45941)
Logs:
  Bound result 21

[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals_tooLow(address,uint8,address,address) (runs: 5000, μ: 46042, ~: 46330)
Logs:
  Bound result 3

[PASS] test_addAsset_fuzz_reverts_InvalidIrData(address,uint8,address,address) (runs: 5000, μ: 80332734889, ~: 34985)
Logs:
  Bound result 2

[PASS] test_addAsset_revertsWith_BlockTimestampDowncastOverflow() (gas: 956555)
[PASS] test_addAsset_revertsWith_DrawnRateDowncastOverflow() (gas: 953681)
[PASS] test_addAsset_reverts_UnderlyingAlreadyListed() (gas: 48915)
[PASS] test_addSpoke_fuzz(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 126697, ~: 126748)
Logs:
  Bound result 4

[PASS] test_addSpoke_fuzz_revertsWith_AssetNotListed(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 35268, ~: 35257)
Logs:
  Bound result 12802

[PASS] test_addSpoke_fuzz_revertsWith_InvalidAddress_spoke(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 33864, ~: 33915)
Logs:
  Bound result 4

[PASS] test_addSpoke_revertsWith_SpokeAlreadyListed() (gas: 39795)
[PASS] test_getAssetId() (gas: 73181)
[PASS] test_getAssetId_fuzz_revertsWith_AssetNotListed(address) (runs: 5000, μ: 18582, ~: 18583)
[PASS] test_hub_deploy_reverts_on_InvalidConstructorInput() (gas: 828575)
[PASS] test_hub_max_riskPremium() (gas: 8643)
[PASS] test_isUnderlyingListed() (gas: 1178368)
[PASS] test_updateAssetConfig_NewFeeReceiver_noFees() (gas: 716118)
[PASS] test_updateAssetConfig_NewFeeReceiver_revertsWith_SpokeNotActive_noFees() (gas: 613450)
[PASS] test_updateAssetConfig_UseExistingSpokeAndListedAsFeeReceiver_revertsWith_SpokeAlreadyListed() (gas: 70730)
[PASS] test_updateAssetConfig_fuzz(uint256,(address,uint16,address,address)) (runs: 5000, μ: 269193, ~: 269545)
Logs:
  Bound result 5
  Bound result 182

[PASS] test_updateAssetConfig_fuzz_FromZeroLiquidityFee(uint256,uint16) (runs: 5000, μ: 819031, ~: 818857)
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, μ: 721451, ~: 721277)
Logs:
  Bound result 3
  Bound result 1
  Bound result 3
  Bound result 1

[PASS] test_updateAssetConfig_fuzz_NewDrawnRateStrategy(uint256) (runs: 5000, μ: 698285, ~: 698285)
Logs:
  Bound result 3

[PASS] test_updateAssetConfig_fuzz_NewFeeReceiver(uint256) (runs: 5000, μ: 820365, ~: 820365)
Logs:
  Bound result 3
  Bound result 3
  Bound result 1000

[PASS] test_updateAssetConfig_fuzz_ReuseFeeReceiver_revertsWith_SpokeAlreadyListed(uint256) (runs: 5000, μ: 872045, ~: 872045)
Logs:
  Bound result 3
  Bound result 3
  Bound result 3
  Bound result 1000

[PASS] test_updateAssetConfig_fuzz_Scenario(uint256) (runs: 5000, μ: 700435, ~: 700489)
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, μ: 61104, ~: 61158)
Logs:
  Bound result 3

[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidLiquidityFee(uint256,(address,uint16,address,address)) (runs: 5000, μ: 40144, ~: 40042)
Logs:
  Bound result 5
  Bound result 182

[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidReinvestmentController() (gas: 469741)
[PASS] test_updateAssetConfig_fuzz_revertsWith_calculateInterestRateReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 198869, ~: 199317)
Logs:
  Bound result 5
  Bound result 4

[PASS] test_updateAssetConfig_fuzz_revertsWith_setInterestRateDataReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 95894, ~: 96293)
Logs:
  Bound result 3
  Bound result 0

[PASS] test_updateAssetConfig_oldFeeReceiver_flags() (gas: 880059)
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, μ: 59179, ~: 59239)
Logs:
  Bound result 2

[PASS] test_updateSpokeConfig_fuzz_revertsWith_SpokeNotListed(uint256,address,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 40546, ~: 40614)
Logs:
  Bound result 0

[PASS] test_updateSpokeConfig_revertsWith_AssetNotListed() (gas: 29661)
Suite result: ok. 38 passed; 0 failed; 0 skipped; finished in 93.84s (93.82s CPU time)

Ran 12 tests for tests/unit/Hub/Hub.RefreshPremium.t.sol:HubRefreshPremiumTest
[PASS] test_refreshPremium_emitsEvent() (gas: 254727)
[PASS] test_refreshPremium_fuzz_positiveDeltas(uint256,int256,int256) (runs: 5000, μ: 490186, ~: 495399)
Logs:
  Bound result 999999999910000000000000000001
  Bound result 1
  Bound result 2504

[PASS] test_refreshPremium_fuzz_withAccrual(uint256,uint256,uint256,uint256) (runs: 5000, μ: 467770, ~: 476864)
Logs:
  Bound result 1118761457
  Bound result 102
  Bound result 25000000000000000000
  Bound result 13098

[PASS] test_refreshPremium_haltedSpokesAllowed() (gas: 121430)
[PASS] test_refreshPremium_maxRiskPremiumThreshold() (gas: 897881)
[PASS] test_refreshPremium_negativeDeltas(uint256) (runs: 5000, μ: 460181, ~: 460729)
Logs:
  Bound result 3124043968137

[PASS] test_refreshPremium_negativeDeltas_withAccrual(uint256) (runs: 5000, μ: 529757, ~: 529971)
Logs:
  Bound result 3124043968137

[PASS] test_refreshPremium_revertsWith_InvalidPremiumChange_NonZeroRestoredPremiumRay() (gas: 853291)
[PASS] test_refreshPremium_revertsWith_InvalidPremiumChange_RiskPremiumThresholdExceeded_DecreasingPremium() (gas: 874603)
[PASS] test_refreshPremium_revertsWith_SpokeNotActive() (gas: 58921)
[PASS] test_refreshPremium_riskPremiumThreshold() (gas: 920059)
[PASS] test_refreshPremium_spokePremiumUpdateIsContained() (gas: 710944)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 19.98s (19.96s 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, μ: 545650, ~: 545698)
Logs:
  Bound result 8058
  Bound result 160000000
  Bound result 2
  Bound result 1300

[PASS] test_accrueLiquidityFee_fuzz_maxLiquidityFee_with_premium_multiple_users(uint256,uint256,uint256,uint256,uint256) (runs: 5000, μ: 803281, ~: 803380)
Logs:
  Bound result 4558
  Bound result 704000000
  Bound result 3
  Bound result 2434413586
  Bound result 12707

[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_spoke() (gas: 639919045)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_user() (gas: 261369126)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_with_premium() (gas: 545760)
Logs:
  Bound result 5000
  Bound result 34560000
  Bound result 2
  Bound result 500000000000000000000

Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 18.47s (18.44s CPU time)

Ran 16 tests for tests/unit/Hub/Hub.Draw.t.sol:HubDrawTest
[PASS] test_draw_DifferentSpokes() (gas: 352273)
[PASS] test_draw_fuzz_IncreasedDrawnRate(uint256,uint256) (runs: 5000, μ: 693479, ~: 693712)
Logs:
  Bound result 3
  Bound result 100

[PASS] test_draw_fuzz_amounts_same_block(uint256,uint256) (runs: 5000, μ: 285887, ~: 286020)
Logs:
  Bound result 3
  Bound result 100

[PASS] test_draw_fuzz_revertsWith_DrawCapEx...*[Comment body truncated]*

@yan-man yan-man marked this pull request as ready for review March 13, 2026 18:08
});

uint256 liquidatorDebtAfter = tokenList.weth.balanceOf(liquidator);
// without recalculation, the debt to liquidate would be 183 (drawnShares to liquidate 122)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this says 183, but comment above says 184

// liquidate 184 debt assets, 184 / 1.5 -> 122 drawn shares to liquidate (rounded down)

I think it would be better if we can make comments and checks in share terms (drawnShares) , this would be more accurate I think

Copy link
Contributor Author

@yan-man yan-man Mar 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checks in share terms

reason why i didnt do that is, due to all coll being liquidated, it means deficit so the user position no longer has any drawnShares remaining so it is more roundabout to get the "true" shares diff as a result of the liquidation.

this says 183, but comment above says 184

comment discrepancy is bc: input is 184 (debtToCover), which is 122 drawnShares to liquidate, but drawnAmountToRestore & debtRayToLiquidate is 183. Added some comments to clarify 7d4681b

uint256 liquidatorDebtBefore = tokenList.weth.balanceOf(liquidator);

// liquidate 184 debt assets, 184 / 1.5 -> 122 drawn shares to liquidate (rounded down)
// 122 drawn shares to liquidate -> 183 debt assets, $366 collateral value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this says 183, but below we say 182

// now with recalculation, the debt to liquidate is 182 (drawnShares to liquidate 121)

Copy link
Contributor Author

@yan-man yan-man Mar 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i meant this part as before the recalculation, and below when it comes to 182 is after a recalculation that we've added here. added more commetns 7d4681b

LiquidationLogic.LiquidationAmounts
memory expectedLiquidationAmounts = _calculateAdjustedLiquidationAmounts(params);

params.debtToCover = bound(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this already bounded? don't we invalidate scenario here? can we check after liquidation that entire collateral was liquidated (by checking drawn shares is 0), just to be extra sure?

Copy link
Contributor Author

@yan-man yan-man Mar 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to bound this again in order to avoid the dust condition on the collateral, ie must be high enough so that it leads to 100% of coll being liquidated.

by checking drawn shares is 0

I think you mean added shares on coll side, added this 7d4681b

@yan-man yan-man removed the priority label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants