Skip to content

Conversation

@Kogaroshi
Copy link
Contributor

Add 2 new enum tracking in AccessManagerEnumerable :

  • track created/managed roles
  • track target contract with selectors assigned to a specific role

Regarding the Guardian Roles, we need to define in our deployment scripts one or multiple roles acting as Guardians for the current role list. The wanted hierarchy being : DEFAULT_ADMIN => GUARDIAN_ROLE => ROLE (with DEFAULT_ADMIN being the admin of both ROLE & GUARDIAN_ROLE)

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

Forge Build Sizes

🔕 Unchanged
Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
AaveOracle 1,842 2,580 22,734 46,572
AccessManager 10,198 11,423 14,378 37,729
AccessManagerEnumerable 12,974 14,411 11,602 34,741
Address 44 94 24,532 49,058
Arrays 44 94 24,532 49,058
AssetInterestRateStrategy 2,349 2,534 22,227 46,618
AssetLogic 44 94 24,532 49,058
AuthorityUtils 44 94 24,532 49,058
Bytes 44 94 24,532 49,058
Comparators 44 94 24,532 49,058
Constants 447 499 24,129 48,653
ECDSA 44 94 24,532 49,058
EIP712Hash 441 493 24,135 48,659
EIP712Types 44 94 24,532 49,058
ERC1967Proxy 122 934 24,454 48,218
ERC1967Utils 44 94 24,532 49,058
EnumerableSet 44 94 24,532 49,058
Errors 44 94 24,532 49,058
GatewayBaseWrapper 1,810 2,085 22,766 47,067
Hub 21,598 21,832 2,978 27,320
HubConfigurator 9,981 10,254 14,595 38,898
JsonBindings 9,244 9,296 15,332 39,856
KeyValueList 44 94 24,532 49,058
KeyValueListWrapper 802 830 23,774 48,322
LibBit 44 94 24,532 49,058
LiquidationLogic 6,542 6,594 18,034 42,558
LiquidationLogicWrapper 10,943 11,117 13,633 38,035
Math 44 94 24,532 49,058
MathUtils 44 94 24,532 49,058
MockERC1271Wallet 599 733 23,977 48,419
MockERC20 1,913 2,379 22,663 46,773
MockNoncesKeyed 601 629 23,975 48,523
MockPriceFeed 642 1,300 23,934 47,852
MockSkimSpoke 923 1,082 23,653 48,070
NativeTokenGateway 4,889 5,306 19,687 43,846
NoncesKeyed 425 453 24,151 48,699
Panic 44 94 24,532 49,058
PercentageMath 44 94 24,532 49,058
PercentageMathWrapper 592 620 23,984 48,532
PositionStatusMap 44 94 24,532 49,058
PositionStatusMapWrapper 2,389 2,417 22,187 46,735
Premium 44 94 24,532 49,058
ProxyAdmin 977 1,213 23,599 47,939
RescuableWrapper 770 904 23,806 48,248
ReserveFlagsMap 44 94 24,532 49,058
ReserveFlagsMapWrapper 1,075 1,103 23,501 48,049
Roles 153 203 24,423 48,949
SafeCast 44 94 24,532 49,058
SafeERC20 44 94 24,532 49,058
SharesMath 44 94 24,532 49,058
SignatureChecker 44 94 24,532 49,058
SignatureGateway 9,913 10,424 14,663 38,728
SlotDerivation 44 94 24,532 49,058
SpokeConfigurator 8,659 8,932 15,917 40,220
SpokeInstance 24,523 25,266 53 23,886
StorageSlot 44 94 24,532 49,058
TestnetERC20 2,810 3,686 21,766 45,466
Time 44 94 24,532 49,058
TransientSlot 44 94 24,532 49,058
TransparentUpgradeableProxy 1,073 3,445 23,503 45,707
TreasurySpoke 2,764 3,179 21,812 45,973
UnitPriceFeed 700 1,635 23,876 47,517
UserPositionDebt 44 94 24,532 49,058
UserPositionDebtWrapper 2,677 2,705 21,899 46,447
Utils 44 94 24,532 49,058
WETH9 1,864 2,330 22,712 46,822
WadRayMath 44 94 24,532 49,058
WadRayMathWrapper 1,371 1,399 23,205 47,753

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

♻️ Forge Gas Snapshots

🔕 Unchanged
Path Value
snapshots/Hub.Operations.json
add 88,006
add: with transfer 109,613
draw 105,931
eliminateDeficit: full 59,781
eliminateDeficit: partial 69,429
mintFeeShares 84,007
payFee 72,302
refreshPremium 71,999
remove: full 76,993
remove: partial 81,640
reportDeficit 115,225
restore: full 80,471
restore: full - with transfer 173,377
restore: partial 89,137
restore: partial - with transfer 147,400
transferShares 71,192
snapshots/NativeTokenGateway.Operations.json
borrowNative 229,316
repayNative 168,024
supplyAsCollateralNative 160,373
supplyNative 136,476
withdrawNative: full 125,620
withdrawNative: partial 136,825
snapshots/SignatureGateway.Operations.json
borrowWithSig 215,605
repayWithSig 188,872
setSelfAsUserPositionManagerWithSig 75,402
setUsingAsCollateralWithSig 85,053
supplyWithSig 153,205
updateUserDynamicConfigWithSig 62,769
updateUserRiskPremiumWithSig 61,579
withdrawWithSig 131,696
snapshots/Spoke.Getters.json
getUserAccountData: supplies: 0, borrows: 0 11,937
getUserAccountData: supplies: 1, borrows: 0 48,600
getUserAccountData: supplies: 2, borrows: 0 80,378
getUserAccountData: supplies: 2, borrows: 1 100,166
getUserAccountData: supplies: 2, borrows: 2 118,596
snapshots/Spoke.Operations.ZeroRiskPremium.json
borrow: first 191,325
borrow: second action, same reserve 171,297
liquidationCall (receiveShares): full 300,103
liquidationCall (receiveShares): partial 299,821
liquidationCall: full 310,468
liquidationCall: partial 310,186
permitReserve + repay (multicall) 166,029
permitReserve + supply (multicall) 146,862
permitReserve + supply + enable collateral (multicall) 160,573
repay: full 126,094
repay: partial 130,983
setUserPositionManagerWithSig: disable 44,846
setUserPositionManagerWithSig: enable 68,875
supply + enable collateral (multicall) 140,624
supply: 0 borrows, collateral disabled 123,679
supply: 0 borrows, collateral enabled 106,601
supply: second action, same reserve 106,579
updateUserDynamicConfig: 1 collateral 73,694
updateUserDynamicConfig: 2 collaterals 88,551
updateUserRiskPremium: 1 borrow 94,804
updateUserRiskPremium: 2 borrows 104,619
usingAsCollateral: 0 borrows, enable 58,915
usingAsCollateral: 1 borrow, disable 105,072
usingAsCollateral: 1 borrow, enable 41,803
usingAsCollateral: 2 borrows, disable 126,055
usingAsCollateral: 2 borrows, enable 41,815
withdraw: 0 borrows, full 128,910
withdraw: 0 borrows, partial 133,473
withdraw: 1 borrow, partial 161,036
withdraw: 2 borrows, partial 174,214
withdraw: non collateral 106,544
snapshots/Spoke.Operations.json
borrow: first 261,721
borrow: second action, same reserve 204,693
liquidationCall (receiveShares): full 333,666
liquidationCall (receiveShares): partial 333,384
liquidationCall: full 344,031
liquidationCall: partial 343,749
permitReserve + repay (multicall) 163,273
permitReserve + supply (multicall) 146,862
permitReserve + supply + enable collateral (multicall) 160,573
repay: full 120,256
repay: partial 139,545
setUserPositionManagerWithSig: disable 44,846
setUserPositionManagerWithSig: enable 68,875
supply + enable collateral (multicall) 140,624
supply: 0 borrows, collateral disabled 123,679
supply: 0 borrows, collateral enabled 106,601
supply: second action, same reserve 106,579
updateUserDynamicConfig: 1 collateral 73,694
updateUserDynamicConfig: 2 collaterals 88,551
updateUserRiskPremium: 1 borrow 151,080
updateUserRiskPremium: 2 borrows 204,276
usingAsCollateral: 0 borrows, enable 58,915
usingAsCollateral: 1 borrow, disable 161,348
usingAsCollateral: 1 borrow, enable 41,803
usingAsCollateral: 2 borrows, disable 233,712
usingAsCollateral: 2 borrows, enable 41,815
withdraw: 0 borrows, full 128,910
withdraw: 0 borrows, partial 133,473
withdraw: 1 borrow, partial 214,810
withdraw: 2 borrows, partial 259,272
withdraw: non collateral 106,544

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

🌈 Test Results
No files changed, compilation skipped

Ran 1 test for tests/unit/Spoke/Spoke.MultipleHub.SiloedBorrowing.t.sol:SpokeMultipleHubSiloedBorrowingTest
[PASS] test_siloed_borrowing() (gas: 667131)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 9.45ms (1.17ms CPU time)

Ran 1 test for tests/unit/Spoke/Spoke.AccrueInterest.Scenario.t.sol:SpokeAccrueInterestScenarioTest
[SKIP: pending rft] test_accrueInterest_fuzz_RPBorrowAndSkipTime_twoActions((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint40) (runs: 0, μ: 0, ~: 0)
Suite result: ok. 0 passed; 0 failed; 1 skipped; finished in 27.43ms (7.43ms CPU time)

Ran 2 tests for tests/unit/Spoke/Spoke.MultipleHub.t.sol:SpokeMultipleHubTest
[PASS] test_borrow_secondHub() (gas: 895549)
[PASS] test_borrow_thirdHub() (gas: 737841)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 26.92ms (3.67ms CPU time)

Ran 13 tests for tests/gas/Spoke.Operations.gas.t.sol:SpokeOperations_Gas_Tests
[PASS] test_borrow() (gas: 1335928)
[PASS] test_liquidation_full() (gas: 1891814)
[PASS] test_liquidation_partial() (gas: 1891523)
[PASS] test_liquidation_receiveShares_full() (gas: 1881508)
[PASS] test_liquidation_receiveShares_partial() (gas: 1881225)
[PASS] test_multicall_ops() (gas: 1410878)
[PASS] test_repay() (gas: 875638)
[PASS] test_setUserPositionManagerWithSig() (gas: 303733)
[PASS] test_supply() (gas: 542220)
[PASS] test_updateRiskPremium() (gas: 1327300)
[PASS] test_updateUserDynamicConfig() (gas: 581796)
[PASS] test_usingAsCollateral() (gas: 1481373)
[PASS] test_withdraw() (gas: 1962523)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 71.94ms (30.59ms CPU time)

Ran 13 tests for tests/gas/Spoke.Operations.gas.t.sol:SpokeOperations_ZeroRiskPremium_Gas_Tests
[PASS] test_borrow() (gas: 1096592)
[PASS] test_liquidation_full() (gas: 1754099)
[PASS] test_liquidation_partial() (gas: 1753808)
[PASS] test_liquidation_receiveShares_full() (gas: 1743793)
[PASS] test_liquidation_receiveShares_partial() (gas: 1743510)
[PASS] test_multicall_ops() (gas: 1327357)
[PASS] test_repay() (gas: 783166)
[PASS] test_setUserPositionManagerWithSig() (gas: 308181)
[PASS] test_supply() (gas: 544892)
[PASS] test_updateRiskPremium() (gas: 942460)
[PASS] test_updateUserDynamicConfig() (gas: 586244)
[PASS] test_usingAsCollateral() (gas: 1087205)
[PASS] test_withdraw() (gas: 1593456)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 60.69ms (25.89ms CPU time)

Ran 4 tests for tests/unit/Spoke/Spoke.PermitReserve.t.sol:SpokePermitReserveTest
[PASS] test_permitReserve() (gas: 89200)
[PASS] test_permitReserve_forwards_correct_call() (gas: 36410)
[PASS] test_permitReserve_ignores_permit_reverts() (gas: 25167)
[PASS] test_permitReserve_revertsWith_ReserveNotListedIn() (gas: 23207)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 20.36ms (1.02ms 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 989.85ms (989.63ms CPU time)

Ran 8 tests for tests/unit/misc/GatewayBase.t.sol:GatewayBaseTest
[PASS] test_constructor() (gas: 17646)
[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: 65281)
[PASS] test_renouncePositionManagerRole_revertsWith_InvalidAddress() (gas: 76695)
[PASS] test_renouncePositionManagerRole_revertsWith_OwnableUnauthorizedAccount() (gas: 76856)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 356.37ms (337.01ms CPU time)

Ran 5 tests for tests/gas/Gateways.Operations.gas.t.sol:NativeTokenGateway_Gas_Tests
[PASS] test_borrowNative() (gas: 921551)
[PASS] test_repayNative() (gas: 996068)
[PASS] test_supplyAndCollateralNative() (gas: 306548)
[PASS] test_supplyNative() (gas: 288339)
[PASS] test_withdrawNative() (gas: 511014)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 38.93ms (4.47ms CPU time)

Ran 17 tests for tests/unit/AaveOracle.t.sol:AaveOracleTest
[PASS] testDECIMALS() (gas: 8379)
[PASS] test_constructor() (gas: 440478)
[PASS] test_deploy_revertsWith_InvalidAddress() (gas: 38111)
[PASS] test_description() (gas: 12049)
[PASS] test_fuzz_constructor(uint8) (runs: 5000, μ: 444406, ~: 444725)
[PASS] test_getReservePrice() (gas: 47398)
[PASS] test_getReservePrice_revertsWith_InvalidPrice() (gas: 46691)
[PASS] test_getReservePrice_revertsWith_InvalidSource() (gas: 10998)
[PASS] test_getReservePrices() (gas: 79462)
[PASS] test_getReservePrices_revertsWith_InvalidSource() (gas: 49374)
[PASS] test_getReserveSource() (gas: 47628)
[PASS] test_setReserveSource() (gas: 44488)
[PASS] test_setReserveSource_revertsWith_InvalidPrice() (gas: 97705)
[PASS] test_setReserveSource_revertsWith_InvalidSource() (gas: 15349)
[PASS] test_setReserveSource_revertsWith_InvalidSourceDecimals() (gas: 15171)
[PASS] test_setReserveSource_revertsWith_OnlySpoke() (gas: 10984)
[PASS] test_spoke() (gas: 10559)
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 1.90s (1.88s CPU time)

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

[PASS] test_getLiquidationBonus_fuzz_configured(uint256,uint256,uint16,uint64) (runs: 5000, μ: 93738, ~: 94119)
[PASS] test_getLiquidationBonus_fuzz_notConfigured(uint256,uint256) (runs: 5000, μ: 71394, ~: 71631)
[PASS] test_getLiquidationBonus_notConfigured() (gas: 72663)
Logs:
  Bound result 2
  Bound result 1000000000000000000

[PASS] test_premiumRayGetters() (gas: 1548116)
[PASS] test_protocol_getters() (gas: 284228)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 2.26s (3.24s CPU time)

Ran 4 tests for tests/unit/Spoke/Liquidations/Spoke.LiquidationCall.Dust.t.sol:SpokeLiquidationCallDustTest
[PASS] test_collateralDust_min_debtToTarget() (gas: 7486417)
[PASS] test_debtToCover_exceeds_collateralValue() (gas: 7478997)
[PASS] test_dustColl_allowed() (gas: 7345147)
[PASS] test_dustDebt_allowed() (gas: 7474833)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 45.70ms (20.05ms CPU time)

Ran 7 tests for tests/unit/Spoke/Spoke.Repay.EdgeCases.t.sol:SpokeRepayEdgeCaseTest
[PASS] test_fuzz_repay_effect_on_ex_rates(uint256,uint256) (runs: 5000, μ: 695311, ~: 695153)
[PASS] test_repay_less_than_share() (gas: 584163)
[PASS] test_repay_only_base_debt_interest() (gas: 757312)
[PASS] test_repay_only_base_debt_no_premium() (gas: 641179)
[PASS] test_repay_supply_ex_rate_decr() (gas: 1483810)
[PASS] test_repay_supply_ex_rate_decr_skip_time() (gas: 1481138)
[PASS] test_repay_zero_shares_nonzero_premium_debt() (gas: 761319)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 15.94s (15.92s CPU time)

Ran 12 tests for tests/unit/AccessManagerEnumerable.t.sol:AccessManagerEnumerableTest
[PASS] test_getRoleMembers_fuzz(uint256,uint256) (runs: 5000, μ: 1975184, ~: 1974081)
[PASS] test_getRoleTargetFunctions_fuzz(uint256,uint256) (runs: 5000, μ: 1220314, ~: 1219429)
[PASS] test_grantRole() (gas: 305864)
[PASS] test_grantRole_fuzz(uint64,uint256) (runs: 5000, μ: 912451, ~: 911838)
[PASS] test_revokeRole() (gas: 310019)
[PASS] test_setRoleAdmin_fuzz_trackRoles_multipleRoles(uint256) (runs: 5000, μ: 893525, ~: 862226)
[PASS] test_setRoleAdmin_trackRoles() (gas: 138593)
[PASS] test_setRoleGuardian_trackRoles() (gas: 253212)
[PASS] test_setTargetFunctionRole() (gas: 373311)
[PASS] test_setTargetFunctionRole_multipleTargets() (gas: 974620)
[PASS] test_setTargetFunctionRole_skipAddToAdminRole() (gas: 32075)
[PASS] test_setTargetFunctionRole_withReplace() (gas: 511199)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 16.38s (23.02s CPU time)

Ran 8 tests for tests/gas/Gateways.Operations.gas.t.sol:SignatureGateway_Gas_Tests
[PASS] test_borrowWithSig() (gas: 754973)
[PASS] test_repayWithSig() (gas: 991660)
[PASS] test_setSelfAsUserPositionManagerWithSig() (gas: 208951)
[PASS] test_setUsingAsCollateralWithSig() (gas: 296234)
[PASS] test_supplyWithSig() (gas: 468497)
[PASS] test_updateUserDynamicConfigWithSig() (gas: 145397)
[PASS] test_updateUserRiskPremiumWithSig() (gas: 143046)
[PASS] test_withdrawWithSig() (gas: 418488)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 44.07ms (8.17ms CPU time)

Ran 6 tests for tests/unit/Hub/Hub.Access.t.sol:HubAccessTest
[PASS] test_change_authority() (gas: 2312566)
[PASS] test_change_role_responsibility() (gas: 123122)
[PASS] test_hub_access_manager_exposure() (gas: 12684)
[PASS] test_hub_admin_access() (gas: 1205062)
[PASS] test_migrate_role_responsibility() (gas: 792606)
[PASS] test_setInterestRateData_access() (gas: 103546)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 23.25ms (3.91ms CPU time)

Ran 19 tests for tests/unit/Hub/Hub.Add.t.sol:HubAddTest
[PASS] test_add_AddCapReachedButNotExceeded_rounding() (gas: 674997)
[PASS] test_add_fuzz_AddCapReachedButNotExceeded(uint40) (runs: 5000, μ: 160182, ~: 160147)
[PASS] test_add_fuzz_multi_asset_multi_spoke(uint256,uint256,uint256) (runs: 5000, μ: 330224, ~: 330441)
[PASS] test_add_fuzz_revertsWith_AddCapExceeded(uint40) (runs: 5000, μ: 112997, ~: 112962)
[PASS] test_add_fuzz_revertsWith_AddCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 274501, ~: 274376)
[PASS] test_add_fuzz_revertsWith_InvalidShares_due_to_index(uint256,uint256,uint256) (runs: 5000, μ: 229997, ~: 230208)
[PASS] test_add_fuzz_single_asset(uint256,address,uint256) (runs: 5000, μ: 345539, ~: 345452)
[PASS] test_add_fuzz_single_spoke_multi_add(uint256,uint256) (runs: 5000, μ: 822153, ~: 822213)
[PASS] test_add_multi_add_minimal_shares() (gas: 328544)
[PASS] test_add_revertsWith_AmountDowncastOverflow() (gas: 368149)
[PASS] test_add_revertsWith_InsufficientTransferred() (gas: 64867)
[PASS] test_add_revertsWith_InvalidAmount() (gas: 13475)
[PASS] test_add_revertsWith_InvalidShares() (gas: 230124)
[PASS] test_add_revertsWith_SharesDowncastOverflow() (gas: 228043)
[PASS] test_add_revertsWith_SpokeNotActive() (gas: 98590)
[PASS] test_add_revertsWith_SpokePaused() (gas: 98707)
[PASS] test_add_single_asset() (gas: 333479)
Logs:
  Bound result 2
  Bound result 100000000000000000000

[PASS] test_add_with_increased_index() (gas: 308110)
[PASS] test_add_with_increased_index_with_premium() (gas: 688370)
Suite result: ok. 19 passed; 0 failed; 0 skipped; finished in 46.29s (46.27s CPU time)

Ran 36 tests for tests/unit/Hub/Hub.Config.t.sol:HubConfigTest
[PASS] test_addAsset_fuzz(address,uint8,address) (runs: 5000, μ: 916151, ~: 916184)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_feeReceiver(address,uint8,address) (runs: 5000, μ: 46609, ~: 46938)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_irStrategy(address,uint8,address) (runs: 5000, μ: 46640, ~: 46969)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAddress_underlying(uint8,address,address) (runs: 5000, μ: 37590, ~: 37590)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals(address,uint8,address,address) (runs: 5000, μ: 47156, ~: 46949)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals_tooLow(address,uint8,address,address) (runs: 5000, μ: 47408, ~: 47648)
[PASS] test_addAsset_fuzz_reverts_InvalidIrData(address,uint8,address,address) (runs: 5000, μ: 40982, ~: 36219)
[PASS] test_addAsset_revertsWith_BlockTimestampDowncastOverflow() (gas: 767690)
[PASS] test_addAsset_revertsWith_DrawnRateDowncastOverflow() (gas: 764636)
[PASS] test_addAsset_reverts_UnderlyingAlreadyListed() (gas: 47752)
[PASS] test_addSpoke_fuzz(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 125865, ~: 125918)
[PASS] test_addSpoke_fuzz_revertsWith_AssetNotListed(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 34744, ~: 34731)
[PASS] test_addSpoke_fuzz_revertsWith_InvalidAddress_spoke(uint256,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 33334, ~: 33387)
[PASS] test_addSpoke_revertsWith_SpokeAlreadyListed() (gas: 38876)
[PASS] test_hub_deploy_revertsWith_InvalidAddress() (gas: 47579)
[PASS] test_hub_max_riskPremium() (gas: 8570)
[PASS] test_updateAssetConfig_NewFeeReceiver_noFees() (gas: 731780)
[PASS] test_updateAssetConfig_NewFeeReceiver_revertsWith_SpokeNotActive_noFees() (gas: 625973)
[PASS] test_updateAssetConfig_UseExistingSpokeAndListedAsFeeReceiver_revertsWith_SpokeAlreadyListed() (gas: 72068)
[PASS] test_updateAssetConfig_fuzz(uint256,(address,uint16,address,address)) (runs: 5000, μ: 269251, ~: 269552)
[PASS] test_updateAssetConfig_fuzz_FromZeroLiquidityFee(uint256,uint16) (runs: 5000, μ: 823123, ~: 823071)
[PASS] test_updateAssetConfig_fuzz_LiquidityFee(uint256,uint16) (runs: 5000, μ: 725278, ~: 725226)
[PASS] test_updateAssetConfig_fuzz_NewFeeReceiver(uint256) (runs: 5000, μ: 831443, ~: 831564)
[PASS] test_updateAssetConfig_fuzz_NewInterestRateStrategy(uint256) (runs: 5000, μ: 1208196, ~: 1208317)
[PASS] test_updateAssetConfig_fuzz_ReuseFeeReceiver_revertsWith_SpokeAlreadyListed(uint256) (runs: 5000, μ: 883689, ~: 883810)
[PASS] test_updateAssetConfig_fuzz_Scenario(uint256) (runs: 5000, μ: 682861, ~: 682913)
[PASS] test_updateAssetConfig_fuzz_UseExistingSpokeAsFeeReceiver_revertsWith_SpokeAlreadyListed(uint256) (runs: 5000, μ: 71740, ~: 71740)
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidInterestRateStrategy(uint256) (runs: 5000, μ: 59943, ~: 59995)
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidLiquidityFee(uint256,(address,uint16,address,address)) (runs: 5000, μ: 41407, ~: 41307)
[PASS] test_updateAssetConfig_fuzz_revertsWith_InvalidReinvestmentController() (gas: 490561)
[PASS] test_updateAssetConfig_fuzz_revertsWith_calculateInterestRateReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 202670, ~: 202951)
[PASS] test_updateAssetConfig_fuzz_revertsWith_setInterestRateDataReverts(uint256,(address,uint16,address,address)) (runs: 5000, μ: 65521, ~: 65421)
[PASS] test_updateAssetConfig_oldFeeReceiver_flags() (gas: 844758)
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, μ: 58476, ~: 58537)
[PASS] test_updateSpokeConfig_fuzz_revertsWith_SpokeNotListed(uint256,address,(uint40,uint40,uint24,bool,bool)) (runs: 5000, μ: 40444, ~: 40504)
[PASS] test_updateSpokeConfig_revertsWith_AssetNotListed() (gas: 29356)
Suite result: ok. 36 passed; 0 failed; 0 skipped; finished in 97.31s (97.29s CPU time)

Ran 16 tests for tests/unit/Hub/Hub.Draw.t.sol:HubDrawTest
[PASS] test_draw_DifferentSpokes() (gas: 362336)
[PASS] test_draw_fuzz_IncreasedBorrowRate(uint256,uint256) (runs: 5000, μ: 704773, ~: 704809)
[PASS] test_draw_fuzz_amounts_same_block(uint256,uint256) (runs: 5000, μ: 289000, ~: 288910)
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded(uint40) (runs: 5000, μ: 81416, ~: 81382)
[PASS] test_draw_fuzz_revertsWith_DrawCapExceeded_due_to_interest(uint40,uint256,uint256) (runs: 5000, μ: 293867, ~: 294131)
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity(uint256,uint256) (runs: 5000, μ: 34070, ~: 33863)
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_draw(uint256) (runs: 5000, μ: 175323, ~: 175045)
[PASS] test_draw_fuzz_revertsWith_InsufficientLiquidity_due_to_remove(uint256) (runs: 5000, μ: 136211, ~: 136013)
[PASS] test_draw_fuzz_revertsWith_InvalidAddress(uint256) (runs: 5000, μ: 15757, ~: 15757)
[PASS] test_draw_revertsWith_DrawCapExceeded_due_to_deficit() (gas: 274491)
[PASS] test_draw_revertsWith_InsufficientLiquidity() (gas: 28097)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_draw() (gas: 171620)
[PASS] test_draw_revertsWith_InsufficientLiquidity_due_to_remove() (gas: 133323)
[PASS] test_draw_revertsWith_InvalidAmount() (gas: 15877)
[PASS] test_draw_revertsWith_SpokeNotActive() (gas: 59712)
[PASS] test_draw_revertsWith_SpokePaused() (gas: 59785)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 24.49s (24.47s CPU time)

Ran 7 tests for tests/unit/Spoke/Spoke.AccrueInterest.t.sol:SpokeAccrueInterestTest
[PASS] test_accrueInterest_NoActionTaken() (gas: 132063)
[PASS] test_accrueInterest_NoInterest_NoDebt(uint40) (runs: 5000, μ: 638508, ~: 638347)
[PASS] test_accrueInterest_NoInterest_OnlySupply(uint40) (runs: 5000, μ: 252256, ~: 252281)
[PASS] test_accrueInterest_TenPercentRp(uint256,uint40) (runs: 5000, μ: 584314, ~: 584803)
[PASS] test_accrueInterest_fuzz_BorrowAmountAndSkipTime(uint256,uint40) (runs: 5000, μ: 541910, ~: 542197)
[PASS] test_accrueInterest_fuzz_RPBorrowAndSkipTime((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint40) (runs: 5000, μ: 3862629, ~: 3879702)
[PASS] test_accrueInterest_fuzz_RatesRPBorrowAndSkipTime((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256),(uint96,uint96,uint96,uint96),uint40) (runs: 5000, μ: 3930660, ~: 3946698)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 196.90s (290.31s CPU time)

Ran 6 tests for tests/unit/Hub/Hub.EliminateDeficit.t.sol:HubEliminateDeficitTest
[PASS] test_eliminateDeficit(uint256) (runs: 5000, μ: 656628, ~: 656628)
[PASS] test_eliminateDeficit_allowSpokePaused() (gas: 429180)
[PASS] test_eliminateDeficit_fuzz_revertsWith_ArithmeticUnderflow_CallerSpokeNoFunds(uint256) (runs: 5000, μ: 343306, ~: 343306)
[PASS] test_eliminateDeficit_fuzz_revertsWith_callerSpokeNotActive(address) (runs: 5000, μ: 28908, ~: 28908)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountNoDeficit() (gas: 20068)
[PASS] test_eliminateDeficit_revertsWith_InvalidAmount_ZeroAmountWithDeficit() (gas: 340316)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 16.57s (16.55s CPU time)

Ran 5 tests for tests/unit/Hub/Hub.MintFeeShares.t.sol:HubMintFeeSharesTest
[PASS] test_mintFeeShares() (gas: 312892)
[PASS] test_mintFeeShares_noFees() (gas: 370166)
[PASS] test_mintFeeShares_noShares() (gas: 301138)
[PASS] test_mintFeeShares_revertsWith_AccessManagedUnauthorized() (gas: 25025)
[PASS] test_mintFeeShares_revertsWith_SpokeNotActive() (gas: 245875)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 23.17ms (4.10ms 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, μ: 24544, ~: 24690)
[PASS] test_calculateInterestRate_RightToKinkPoint(uint256) (runs: 5000, μ: 25645, ~: 25690)
[PASS] test_calculateInterestRate_ZeroDebtZeroLiquidity() (gas: 18944)
Logs:
  Bound result 0

[PASS] test_calculateInterestRate_fuzz_ZeroDebt(uint256) (runs: 5000, μ: 19186, ~: 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 185.75s (185.93s CPU time)

Ran 9 tests for tests/gas/Hub.Operations.gas.t.sol:HubOperations_Gas_Tests
[PASS] test_add() (gas: 273543)
[PASS] test_deficit() (gas: 1181116)
[PASS] test_draw() (gas: 423925)
[PASS] test_mintFeeShares() (gas: 506169)
[PASS] test_payFee_transferShares() (gas: 975173)
[PASS] test_refreshPremium() (gas: 636225)
[PASS] test_remove() (gas: 314977)
[PASS] test_restore() (gas: 891658)
[PASS] test_restore_with_transfer() (gas: 892326)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 40.61ms (7.46ms 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, μ: 540238, ~: 540423)
[PASS] test_accrueLiquidityFee_fuzz_maxLiquidityFee_with_premium_multiple_users(uint256,uint256,uint256,uint256,uint256) (runs: 5000, μ: 791588, ~: 791636)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_spoke() (gas: 647619185)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_multi_user() (gas: 260580011)
[PASS] test_accrueLiquidityFee_maxLiquidityFee_with_premium() (gas: 540591)
Logs:
  Bound result 500000000000000000000
  Bound result 5000
  Bound result 34560000
  Bound result 2

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

Ran 6 tests for tests/unit/Hub/Hub.PayFee.t.sol:HubPayFeeTest
[PASS] test_payFee_fuzz(uint256,uint256) (runs: 5000, μ: 707706, ~: 707842)
[PASS] test_payFee_fuzz_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 708178, ~: 708441)
[PASS] test_payFee_revertsWith_InvalidShares() (gas: 20137)
[PASS] test_payFee_revertsWith_SpokeNotActive() (gas: 59678)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded() (gas: 138907)
[PASS] test_payFee_revertsWith_underflow_added_shares_exceeded_with_interest() (gas: 652789)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 24.98s (37.46s CPU time)

Ran 7 tests for tests/unit/Spoke/Spoke.AccrueLiquidityFee.t.sol:SpokeAccrueLiquidityFeeTest
[PASS] test_accrueLiquidityFee() (gas: 880876)
[PASS] test_accrueLiquidityFee_NoActionTaken() (gas: 120065)
[PASS] test_accrueLiquidityFee_NoInterest_OnlySupply(uint40) (runs: 5000, μ: 247276, ~: 247256)
[PASS] test_accrueLiquidityFee_exact() (gas: 887419)
[PASS] test_accrueLiquidityFee_fuzz_BorrowAmountAndSkipTime(uint256,uint40) (runs: 5000, μ: 957974, ~: 980335)
[PASS] test_accrueLiquidityFee_maxLiquidityFee() (gas: 546465)
[PASS] test_accrueLiquidityFee_setUsingAsCollateral() (gas: 900263)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 21.03s (38.53s CPU time)

Ran 10 tests for tests/unit/Hub/Hub.Reclaim.t.sol:HubReclaimTest
[PASS] test_reclaim() (gas: 680694)
Logs:
  Bound result 1000000000000000000000
  Bound result 500000000000000000000
  Bound result 200000000000000000000

[PASS] test_reclaim_fullAmount() (gas: 661472)
[PASS] test_reclaim_fuzz(uint256,uint256,uint256) (runs: 5000, μ: 682492, ~: 681692)
[PASS] test_reclaim_multipleSweepsAndReclaims() (gas: 789768)
[PASS] test_reclaim_revertsWith_AssetNotListed() (gas: 12439)
[PASS] test_reclaim_revertsWith_InvalidAmount_zero() (gas: 93115)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController(address) (runs: 5000, μ: 93980, ~: 93980)
[PASS] test_reclaim_revertsWith_OnlyReinvestmentController_init() (gas: 40003)
[PASS] test_reclaim_revertsWith_underflow_exceedsSwept() (gas: 98578)
[PASS] test_reclaim_revertsWith_underflow_exceedsSwept_afterSweep() (gas: 461593)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 14.87s (16.49s CPU time)

Ran 3 tests for tests/unit/Hub/Hub.Rescue.t.sol:HubRescueTest
[PASS] test_cannot_rescue_liquidity_fee_reverts_with_InsufficientTransferred() (gas: 279900)
[PASS] test_rescue_fuzz_with_interest(uint256,uint256) (runs: 5000, μ: 526153, ~: 526142)
[PASS] test_rescue_scenario_fuzz(uint256) (runs: 5000, μ: 462920, ~: 462720)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 19.15s (19.13s CPU time)

Ran 23 tests for tests/unit/Hub/Hub.Restore.t.sol:HubRestoreTest
[PASS] test_restore_full_amount_with_interest() (gas: 366762)
Logs:
  Bound result 1000000000000000000000
  Bound result 500000000000000000000
  Bound result 31536000

[PASS] test_restore_full_amount_with_interest_and_premium() (gas: 677110)
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, μ: 368054, ~: 368161)
[PASS] test_restore_fuzz_full_amount_with_interest_and_premium(uint256,uint256,uint256,uint256) (runs: 5000, μ: 666985, ~: 679061)
[PASS] test_restore_fuzz_revertsWith_SurplusDrawnRestored_with_interest(uint256,uint256,uint256) (runs: 5000, μ: 247915, ~: 249163)
[PASS] test_restore_fuzz_revertsWith_SurplusDrawnRestored_with_interest_and_premium(uint256,uint256,uint256,uint256) (runs: 5000, μ: 639382, ~: 639598)
[PASS] test_restore_one_share_delta_increase_revertsWith_InvalidPremiumChange() (gas: 214389)
[PASS] test_restore_partial_drawn() (gas: 330394)
[PASS] test_restore_partial_same_block() (gas: 326180)
[PASS] test_restore_premiumDeltas_twoWeiIncrease_realizedDelta() (gas: 236094)
[PASS] test_restore_revertsWith_InsufficientTransferred() (gas: 258359)
[PASS] test_restore_revertsWith_InvalidAmount_zero() (gas: 53333)
[PASS] test_restore_revertsWith_InvalidPremiumChange_premiumIncrease() (gas: 221541)
[PASS] test_restore_revertsWith_InvalidPremiumChange_premiumSharesIncrease() (gas: 221585)
[PASS] test_restore_revertsWith_SpokeNotActive_whenPaused() (gas: 165841)
[PASS] test_restore_revertsWith_SpokePaused() (gas: 93304)
[PASS] test_restore_revertsWith_SurplusDrawnRestored() (gas: 364671)
[PASS] test_restore_revertsWith_SurplusDrawnRestored_with_interest() (gas: 247739)
Logs:
  Bound result 100000000000000000000
  Bound result 50000000000000000000
  Bound result 15768000

[PASS] test_restore_revertsWith_SurplusDrawnRestored_with_interest_and_premium() (gas: 637670)
Logs:
  Bound result 100000000000000000000
  Bound result 50000000000000000000
  Bound result 31536000
  Bound result 1

[PASS] test_restore_revertsWith_SurplusPremiumRayRestored() (gas: 534140)
[PASS] test_restore_revertsWith_underflow_offsetIncrease() (gas: 232781)
[PASS] test_restore_tooMuchDrawn_revertsWith_SurplusDrawnRestored() (gas: 221898)
[PASS] test_restore_when_asset_frozen() (gas: 428118)
Suite result: ok. 23 passed; 0 failed; 0 skipped; finished in 19.72s (19.70s CPU time)

Ran 1 test for tests/unit/Hub/Hub.Rounding.t.sol:HubRoundingTest
[PASS] test_sharePriceWithMultipleDonations() (gas: 679058780)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 3.29s (3.27s CPU time)

Ran 8 tests for tests/unit/Spoke/Spoke.Repay.Scenario.t.sol:SpokeRepayScenarioTest
[PASS] test_fuzz_repay_borrow_twice_repay_twice((uint256,uint256,uint256,uint40),(uint256,uint256,uint256,uint40)) (runs: 5000, μ: 1212640, ~: 1217723)
[PASS] test_fuzz_repay_multiple_users_repay_same_reserve((uint256,uint256,uint256,uint256,uint256,uint256,address),(uint256,uint256,uint256,uint256,uint256,uint256,address),(uint256,uint256,uint256,uint256,uint256,uint256,address),uint256) (runs: 5000, μ: 2024429, ~: 1995006)
[PASS] test_repay_fuzz_multiple_users_multiple_assets(((uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),address),((uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),address),((uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),address),uint40) (runs: 5000, μ: 5994971, ~: 5995300)
[PASS] test_repay_fuzz_two_users_multiple_assets(((uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),address),((uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256),address),uint40) (runs: 5000, μ: 4249338, ~: 4249570)
[PASS] test_repay_partial_then_max() (gas: 683221)
[PASS] test_repay_round_trip_borrow_repay(uint256,uint256,uint40,address,uint256) (runs: 5000, μ: 867502, ~: 870510)
[PASS] test_repay_round_trip_repay_borrow(uint256,uint256,uint256,uint40,address,uint256) (runs: 5000, μ: 952738, ~: 962372)
[PASS] test_repay_two_users_repay_same_reserve((uint256,uint256,uint256,uint256,uint256,uint256,address),(uint256,uint256,uint256,uint256,uint256,uint256,address),uint256) (runs: 5000, μ: 1461414, ~: 1491358)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 311.54s (311.52s CPU time)

Ran 2 tests for tests/unit/Spoke/Spoke.Repay.Validation.t.sol:SpokeRepayValidationTest
[PASS] test_repay_revertsWith_ReserveNotListed() (gas: 21908)
[PASS] test_repay_revertsWith_ReservePaused() (gas: 64778)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 20.00ms (380.55µs CPU time)

Ran 4 tests for tests/unit/Hub/Hub.Skim.t.sol:HubSkimTest
[PASS] test_skimAdd_fuzz_donationAfterAdd(uint256,uint256,uint256) (runs: 5000, μ: 228306, ~: 228298)
[PASS] test_skimAdd_fuzz_donationBeforeAdd(uint256,uint256,uint256) (runs: 5000, μ: 228360, ~: 228352)
[PASS] test_skimAdd_fuzz_wrongSpokeTransfer(uint256,uint256,uint256) (runs: 5000, μ: 217210, ~: 217154)
[PASS] test_skimRestore_fuzz_liquidityDonation(uint256,uint256,uint256) (runs: 5000, μ: 276287, ~: 277893)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 26.90s (26.88s CPU time)

Ran 8 tests for tests/unit/Hub/Hub.Sweep.t.sol:HubSweepTest
[PASS] test_sweep() (gas: 486373)
Logs:
  Bound result 1000000000000000000000
  Bound result 1000000000000000000000

[PASS] test_sweep_does_not_impact_utilization(uint256,uint256) (runs: 5000, μ: 635272, ~: 636683)
[PASS] test_sweep_fuzz(uint256,uint256) (runs: 5000, μ: 486883, ~: 486892)
[PASS] test_sweep_revertsWith_AssetNotListed() (gas: 12406)
[PASS] test_sweep_revertsWith_InsufficientLiquidity() (gas: 222313)
[PASS] test_sweep_revertsWith_InvalidAmount() (gas: 104209)
[PASS] test_sweep_revertsWith_OnlyReinvestmentController(address) (runs: 5000, μ: 94702, ~: 94702)
[PASS] test_sweep_revertsWith_OnlyReinvestmentController_init() (gas: 40016)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 18.69s (18.68s CPU time)

Ran 7 tests for tests/unit/Hub/Hub.TransferShares.t.sol:HubTransferSharesTest
[PASS] test_transferShares() (gas: 188879)
Logs:
  Bound result 1000000000000000000000
  Bound result 1000000000000000000000

[PASS] test_transferShares_fuzz(uint256,uint256) (runs: 5000, μ: 192242, ~: 192464)
[PASS] test_transferShares_fuzz_revertsWith_underflow_spoke_added_shares_exceeded(uint256) (runs: 5000, μ: 151667, ~: 151383)
[PASS] test_transferShares_revertsWith_AddCapExceeded() (gas: 194958)
[PASS] test_transferShares_revertsWith_SpokeNotActive() (gas: 176511)
[PASS] test_transferShares_revertsWith_SpokePaused() (gas: 178870)
[PASS] test_transferShares_zeroShares_revertsWith_InvalidShares() (gas: 22457)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 7.34s (7.32s CPU time)

Ran 6 tests for tests/unit/Hub/HubAccrueInterest.t.sol:HubAccrueInterestTest
[PASS] test_accrueInterest_NoActionTaken() (gas: 43656)
[PASS] test_accrueInterest_NoInterest_NoDebt(uint40) (runs: 5000, μ: 401946, ~: 401854)
[PASS] test_accrueInterest_NoInterest_OnlyAdd(uint40) (runs: 5000, μ: 210914, ~: 210858)
[PASS] test_accrueInterest_fuzz_BorrowAmountAndElapsed(uint256,uint40) (runs: 5000, μ: 276620, ~: 276266)
[PASS] test_accrueInterest_fuzz_BorrowAmountRateAndElapsed(uint256,uint256,uint40) (runs: 5000, μ: 402350, ~: 402132)
[PASS] test_accrueInterest_fuzz_BorrowAndWait(uint40) (runs: 5000, μ: 275375, ~: 275283)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 26.83s (26.81s CPU time)

Ran 12 tests for tests/unit/Hub/Hub.RefreshPremium.t.sol:HubRefreshPremiumTest
[PASS] test_refreshPremium_emitsEvent() (gas: 259376)
[PASS] test_refreshPremium_fuzz_positiveDeltas(uint256,int256,int256) (runs: 5000, μ: 467693, ~: 472137)
[PASS] test_refreshPremium_fuzz_withAccrual(uint256,uint256,uint256,uint256) (runs: 5000, μ: 535406, ~: 542271)
[PASS] test_refreshPremium_maxRiskPremiumThreshold() (gas: 896046)
[PASS] test_refreshPremium_negativeDeltas(uint256) (runs: 5000, μ: 461083, ~: 461095)
[PASS] test_refreshPremium_negativeDeltas_withAccrual(uint256) (runs: 5000, μ: 533765, ~: 533995)
[PASS] test_refreshPremium_pausedSpokesAllowed() (gas: 120453)
[PASS] test_refreshPremium_revertsWith_InvalidPremiumChange_NonZeroRestoredPremiumRay() (gas: 856323)
[PASS] test_refreshPremium_revertsWith_InvalidPremiumChange_RiskPremiumThresholdExceeded_DecreasingPremium() (gas: 874204)
[PASS] test_refreshPremium_revertsWith_SpokeNotActive() (gas: 57758)
[PASS] test_refreshPremium_riskPremiumThreshold() (gas: 921454)
[PASS] test_refreshPremium_spokePremiumUpdateIsContained() (gas: 710313)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 144.53s (155.69s CPU time)

Ran 15 tests for tests/unit/Hub/Hub.Remove.t.sol:HubRemoveTest
[PASS] test_remove() (gas: 210665)
Logs:
  Bound result 2
  Bound result 100000000000000000000

[PASS] test_remove_all_with_interest() (gas: 377919)
[PASS] test_remove_fuzz(uint256,uint256) (runs: 5000, μ: 209218, ~: 209034)
[PASS] test_remove_fuzz_all_liquidity_with_interest(uint256,uint256) (runs: 5000, μ: 429851, ~: 430159)
[PASS] test_remove_fuzz_multi_spoke(uint256,uint256) (runs: 5000, μ: 293879, ~: 294021)
[PASS] test_remove_fuzz_multi_spoke_with_interest(uint256,uint256,uint256,uint256) (runs: 5000, μ: 433368, ~: 433926)
[PASS] test_remove_revertsWith_InsufficientLiquidity() (gas: 160467)
[PASS] test_remove_revertsWith_InsufficientLiquidity_exceeding_added_amount() (gas: 148158)
[PASS] test_remove_revertsWith_InsufficientLiquidity_zero_added() (gas: 20745)
[PASS] test_remove_revertsWith_InvalidAddress() (gas: 15718)
[PASS] test_remove_revertsWith_InvalidAmount() (gas: 17819)
[PASS] test_remove_revertsWith_SpokeNotActive() (gas: 59802)
[PASS] test_remove_revertsWith_SpokePaused() (gas: 59908)
[PASS] test_remove_revertsWith_underflow_exceeding_added_amount() (gas: 188116)
[PASS] test_remove_revertsWtih_underflow_one_extra_wei() (gas: 372890)
Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 32.52s (57.48s 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, μ: 968789, ~: 969359)
[PASS] test_addAsset_fuzz_revertsWith_InvalidAssetDecimals(bool,address,uint8,address,uint256,address) (runs: 5000, μ: 57695, ~: 57625)
[PASS] test_addAsset_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 31174, ~: 31175)
[PASS] test_addAsset_revertsWith_InvalidAddress_irStrategy() (gas: 50891)
[PASS] test_addAsset_revertsWith_InvalidAddress_underlying() (gas: 50790)
[PASS] test_addAsset_revertsWith_InvalidLiquidityFee() (gas: 872500)
[PASS] test_addAsset_reverts_invalidIrData() (gas: 46921)
[PASS] test_addSpoke() (gas: 126299)
[PASS] test_addSpokeToAssets() (gas: 222721)
[PASS] test_addSpokeToAssets_revertsWith_MismatchedConfigs() (gas: 24780)
[PASS] test_addSpokeToAssets_revertsWith_OwnableUnauthorizedAccount() (gas: 17127)
[PASS] test_addSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 16904)
[PASS] test_deactivateAsset() (gas: 158797)
[PASS] test_deactivateAsset_revertsWith_OwnableUnauthorizedAccount() (gas: 17944)
[PASS] test_deactivateSpoke() (gas: 156391)
[PASS] test_deactivateSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 18038)
[PASS] test_freezeAsset() (gas: 233430)
[PASS] test_freezeAsset_revertsWith_OwnableUnauthorizedAccount() (gas: 18007)
[PASS] test_freezeSpoke() (gas: 249608)
[PASS] test_freezeSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 18016)
[PASS] test_pauseAsset() (gas: 158785)
[PASS] test_pauseAsset_revertsWith_OwnableUnauthorizedAccount() (gas: 17964)
[PASS] test_pauseSpoke() (gas: 156360)
[PASS] test_pauseSpoke_revertsWith_OwnableUnauthorizedAccount() (gas: 18015)
[PASS] test_updateFeeConfig_Scenario() (gas: 335983)
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, μ: 185978, ~: 186266)
[PASS] test_updateFeeConfig_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 17770, ~: 17771)
[PASS] test_updateFeeConfig_revertsWith_InvalidAddress_spoke() (gas: 50132)
[PASS] test_updateFeeConfig_revertsWith_InvalidLiquidityFee() (gas: 52271)
[PASS] test_updateFeeReceiver_Scenario() (gas: 214649)
[PASS] test_updateFeeReceiver_WithdrawFromOldSpoke() (gas: 1041450)
[PASS] test_updateFeeReceiver_correctAccruals() (gas: 1076758)
[PASS] test_updateFeeReceiver_fuzz(address) (runs: 5000, μ: 180041, ~: 180041)
[PASS] test_updateFeeReceiver_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 17291, ~: 17292)
[PASS] test_updateFeeReceiver_revertsWith_InvalidAddress_spoke() (gas: 54713)
[PASS] test_updateFeeReceiver_revertsWith_SpokeAlreadyListed() (gas: 86292)
[PASS] test_updateInterestRateData() (gas: 74045)
[PASS] test_updateInterestRateData_revertsWith_OwnableUnauthorizedAccount() (gas: 19194)
[PASS] test_updateInterestRateStrategy() (gas: 93835)
[PASS] test_updateInterestRateStrategy_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 28676, ~: 28677)
[PASS] test_updateInterestRateStrategy_revertsWith_InterestRateStrategyReverts() (gas: 76679)
[PASS] test_updateInterestRateStrategy_revertsWith_InvalidAddress_irStrategy() (gas: 66356)
[PASS] test_updateInterestRateStrategy_revertsWith_InvalidInterestRateStrategy() (gas: 66872)
[PASS] test_updateLiquidityFee_fuzz(uint256,uint16) (runs: 5000, μ: 90587, ~: 92231)
[PASS] test_updateLiquidityFee_revertsWith_InvalidLiquidityFee() (gas: 54744)
[PASS] test_updateLiquidityFee_revertsWith_OwnableUnauthorizedAccount() (gas: 16698)
[PASS] test_updateReinvestmentController() (gas: 101789)
[PASS] test_updateReinvestmentController_fuzz_revertsWith_OwnableUnauthorizedAccount(address) (runs: 5000, μ: 17290, ~: 17291)
[PASS] test_updateSpokeActive() (gas: 84308)
[PASS] test_updateSpokeActive_revertsWith_OwnableUnauthorizedAccount() (gas: 20241)
[PASS] test_updateSpokeCaps() (gas: 64461)
[PASS] test_updateSpokeCaps_revertsWith_OwnableUnauthorizedAccount() (gas: 20238)
[PASS] test_updateSpokeDrawCap() (gas: 64292)
[PASS] test_updateSpokeDrawCap_revertsWith_OwnableUnauthorizedAccount() (gas: 20179)
[PASS] test_updateSpokePaused() (gas: 87332)
[PASS] test_updateSpokePaused_revertsWith_OwnableUnauthorizedAccount() (gas: 20308)
[PASS] test_updateSpokeRiskPremiumThreshold() (gas: 64234)
[PASS] test_updateSpokeRiskPremiumThreshold_revertsWith_OwnableUnauthorizedAccount() (gas: 20246)
[PASS] test_updateSpokeSupplyCap() (gas: 64238)
[PASS] test_updateSpokeSupplyCap_revertsWith_OwnableUnauthorizedAccount() (gas: 20213)
Suite result: ok. 60 passed; 0 failed; 0 skipped; finished in 10.29s (10.26s 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, μ: 2114431, ~: 2124617)
[PASS] test_borrow_fuzz_single_spoke_multi_reserves(uint256,uint256,uint256,uint256) (runs: 5000, μ: 2237200, ~: 2245356)
[PASS] test_borrow_fuzz_single_spoke_multi_reserves_multi_user(uint256,uint256,uint256,uint256) (runs: 5000, μ: 2667806, ~: 2676499)
[PASS] test_borrow_fuzz_skip_borrow(uint256,uint256,uint256) (runs: 5000, μ: 1043523, ~: 1043568)
[PASS] test_borrow_skip_borrow() (gas: 1042473)
Logs:
  Bound result 10000000000000000000
  Bound result 20000000000000000000
  Bound result 31536000

[PASS] test_userAccountData_does_not_include_zero_cf_collateral() (gas: 1165085)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 165.20s (165.18s 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, μ: 107292, ~: 107313)
[PASS] test_borrow_fuzz_revertsWith_DrawCapExceeded_due_to_interest(uint256) (runs: 5000, μ: 685131, ~: 685361)
[PASS] test_borrow_fuzz_revertsWith_InsufficientLiquidity(uint256,uint256) (runs: 5000, μ: 296684, ~: 296456)
[PASS] test_borrow_fuzz_revertsWith_InvalidAmount(uint256) (runs: 5000, μ: 32473, ~: 32526)
[PASS] test_borrow_fuzz_revertsWith_ReserveFrozen(uint256,uint256) (runs: 5000, μ: 71459, ~: 71248)
[PASS] test_borrow_fuzz_revertsWith_ReserveNotBorrowable(uint256,uint256) (runs: 5000, μ: 71579, ~: 71368)
[PASS] test_borrow_fuzz_revertsWith_ReserveNotListed(uint256,uint256) (runs: 5000, μ: 26135, ~: 25872)
[PASS] test_borrow_fuzz_revertsWith_ReservePaused(uint256,uint256) (runs: 5000, μ: 71411, ~: 71200)
[PASS] test_borrow_revertsWith_InsufficientLiquidity() (gas: 296323)
Logs:
  Bound result 10000000000000000000

[PASS] test_borrow_revertsWith_InvalidAmount() (gas: 34159)
Logs:
  Bound result 2

[PASS] test_borrow_revertsWith_ReserveFrozen() (gas: 72854)
Logs:
  Bound result 2
  Bound result 1

[PASS] test_borrow_revertsWith_ReserveNotBorrowable() (gas: 72950)
Logs:
  Bound result 2
  Bound result 1

[PASS] test_borrow_revertsWith_ReserveNotListed() (gas: 27200)
Logs:
  Bound result 1

[PASS] test_borrow_revertsWith_ReservePaused() (gas: 72848)
Logs:
  Bound result 2
  Bound result 1

Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 14.69s (14.67s CPU time)

Ran 2 tests for tests/unit/Spoke/Spoke.Borrow.t.sol:SpokeBorrowTest
[PASS] test_borrow() (gas: 1075331)
[PASS] test_borrow_fuzz_amounts(uint256,uint256) (runs: 5000, μ: 1087203, ~: 1087283)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 26.64s (26.62s CPU time)

Ran 24 tests for tests/unit/Spoke/Spoke.Config.t.sol:SpokeConfigTest
[PASS] test_addReserve() (gas: 397190)
[PASS] test_addReserve_fuzz_revertsWith_AssetNotListed() (gas: 245927)
[PASS] test_addReserve_revertsWith_InvalidAddress_hub() (gas: 6051962)
[PASS] test_addReserve_revertsWith_InvalidAddress_oracle() (gas: 6089164)
[PASS] test_addReserve_revertsWith_InvalidAssetId() (gas: 33462)
[PASS] test_addReserve_revertsWith_ReserveExists() (gas: 376350)
[PASS] test_spoke_deploy() (gas: 4984849)
[PASS] test_spoke_deploy_revertsWith_InvalidOracleDecimals() (gas: 46503)
[PASS] test_spoke_deploy_reverts_on_InvalidConstructorInput() (gas: 43925)
[PASS] test_updateLiquidationConfig_fuzz_liqBonusConfig((uint128,uint64,uint16)) (runs: 5000, μ: 51963, ~: 52027)
[PASS] test_updateLiquidationConfig_fuzz_revertsWith_InvalidLiquidationConfig_healthFactorForMaxBonus((uint128,uint64,uint16)) (runs: 5000, μ: 37731, ~: 37967)
[PASS] test_updateLiquidationConfig_fuzz_revertsWith_InvalidLiquidationConfig_liquidationBonusFactor((uint128,uint64,uint16)) (runs: 5000, μ: 37423, ~: 37177)
[PASS] test_updateLiquidationConfig_fuzz_targetHealthFactor(uint128) (runs: 5000, μ: 46788, ~: 47088)
[PASS] test_updateLiquidationConfig_liqBonusConfig() (gas: 50986)
Logs:
  Bound result 900000000000000000
  Bound result 1000
  Bound result 1000000000000000000

[PASS] test_updateLiquidationConfig_revertsWith_InvalidLiquidationConfig_healthFactorForMaxBonus() (gas: 36480)
Logs:
  Bound result 1000000000000000000
  Bound result 1000
  Bound result 1000000000000000000

[PASS] test_updateLiquidationConfig_revertsWith_InvalidLiquidationConfig_liquidationBonusFactor() (gas: 36274)
Logs:
  Bound result 900000000000000000
  Bound result 10001
  Bound result 1000000000000000000

[PASS] test_updateLiquidationConfig_targetHealthFactor() (gas: 46393)
Logs:
  Bound result 1000000000000000001

[PASS] test_updateReserveConfig() (gas: 57104)
[PASS] test_updateReserveConfig_fuzz((uint24,bool,bool,bool,bool,bool)) (runs: 5000, μ: 58292, ~: 58135)
[PASS] test_updateReserveConfig_revertsWith_InvalidCollateralRisk() (gas: 40029)
[PASS] test_updateReserveConfig_revertsWith_ReserveNotListed() (gas: 36480)
[PASS] test_updateReservePriceSource() (gas: 240153)
[PASS] test_updateReservePriceSource_revertsWith_AccessManagedUnauthorized(address) (runs: 5000, μ: 31126, ~: 31126)
[PASS] test_updateReservePriceSource_revertsWith_ReserveNotListed() (gas: 34366)
Suite result: ok. 24 passed; 0 failed; 0 skipped; finished in 3.83s (3.81s CPU time)

Ran 16 tests for tests/unit/Spoke/Spoke.Repay.t.sol:SpokeRepayTest
[PASS] test_fuzz_amounts_repay_only_premium(uint256,uint256,uint40) (runs: 5000, μ: 872440, ~: 874621)
[PASS] test_fuzz_repay_amounts_only_interest(uint256,uint256,uint40) (runs: 5000, μ: 881149, ~: 886107)
[PASS] test_fuzz_repay_only_premium(uint256,uint40) (runs: 5000, μ: 754146, ~: 754343)
[PASS] test_fuzz_repay_same_block_fuzz_amounts(uint256,uint256) (runs: 5000, μ: 881797, ~: 892400)
[PASS] test_fuzz_repay_x_y_shares(uint256,uint40) (runs: 5000, μ: 618602, ~: 618745)
[PASS] test_repay() (gas: 697293)
[PASS] test_repay_all_with_accruals() (gas: 424974)
[PASS] test_repay_fuzz_amountsAndWait(uint256,uint256,uint40) (runs: 5000, μ: 924329, ~: 926502)
[PASS] test_repay_fuzz_amounts_base_debt(uint256,uint256,uint40) (runs: 5000, μ: 929007, ~: 940992)
[PASS] test_repay_fuzz_amounts_base_debt_no_premium(uint256,uint256,uint40) (runs: 5000, μ: 806497, ~: 816217)
[PASS] test_repay_fuzz_revertsWith_ERC20InsufficientBalance(uint256) (runs: 5000, μ: 556078, ~: 556175)
[PASS] test_repay_max() (gas: 598456)
[PASS] test_repay_multiple_reserves_fuzz_amountsAndWait(uint256,uint256,uint256,uint256,uint256,uint40) (runs: 5000, μ: 3302851, ~: 3307981)
[PASS] test_repay_only_interest() (gas: 719339)
[PASS] test_repay_revertsWith_ERC20InsufficientAllowance() (gas: 558434)
[PASS] test_repay_same_block() (gas: 677155)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 191.57s (191.55s CPU time)

Ran 9 tests for tests/unit/libraries/KeyValueList.t.sol:KeyValueListTest
[PASS] test_add_unique() (gas: 325391)
[PASS] test_fuzz_add(uint256,uint256) (runs: 5000, μ: 200295, ~: 201361)
[PASS] test_fuzz_add_unique(uint256,uint256) (runs: 5000, μ: 265977, ~: 271836)
[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, μ: 204925, ~: 185180)
[PASS] test_fuzz_sortByKey(uint256[]) (runs: 5000, μ: 464291, ~: 453703)
[PASS] test_fuzz_sortByKey_length(uint256) (runs: 5000, μ: 232060, ~: 241359)
[PASS] test_fuzz_sortByKey_with_collision(uint256[]) (runs: 5000, μ: 547879, ~: 538861)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 71.49s (71.49s CPU time)

Ran 10 tests for tests/unit/Spoke/Spoke.DynamicConfig.Triggers.t.sol:SpokeDynamicConfigTriggersTest
[PASS] test_borrow_triggers_dynamicConfigUpdate() (gas: 1317147)
[PASS] test_liquidate_does_not_trigger_dynamicConfigUpdate() (gas: 1594472)
[PASS] test_repay_does_not_trigger_dynamicConfigUpdate() (gas: 893660)
[PASS] test_supply_does_not_trigger_dynamicConfigUpdate() (gas: 1069711)
[PASS] test_updateUserDynamicConfig_doesHFCheck() (gas: 791187)
[PASS] test_updateUserDynamicConfig_reverts_when_not_authorized(address) (runs: 5000, μ: 1214915, ~: 1214917)
[PASS] test_updateUserDynamicConfig_triggers_dynamicConfigUpdate() (gas: 701436)
[PASS] test_updateUserDynamicConfig_updatesRP() (gas: 1283587)
[PASS] test_usingAsCollateral_triggers_dynamicConfigUpdate() (gas: 1337677)
[PASS] test_withdraw_triggers_dynamicConfigUpdate() (gas: 1357325)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 26.86s (26.84s 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, μ: 30639, ~: 30638)
[PASS] test_calculateDebtToLiquidate_fuzz_AmountAdjustedDueToDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 32370, ~: 32395)
[PASS] test_calculateDebtToLiquidate_fuzz_ImpossibleToAdjustForDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 34486, ~: 34398)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 3.27s (3.25s 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, μ: 23059, ~: 23016)
[PASS] test_calculateDebtToTargetHealthFactor_NoPrecisionLoss() (gas: 25208)
[PASS] test_calculateDebtToTargetHealthFactor_PrecisionLoss() (gas: 15209)
[PASS] test_calculateDebtToTargetHealthFactor_UnitPrice() (gas: 25141)
[PASS] test_calculateDebtToTargetHealthFactor_fuzz_NoRevert((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 20120, ~: 20077)
[PASS] test_calculateDebtToTargetHealthFactor_fuzz_revertsWith_DivisionByZero_ZeroAssetPrice((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 22819, ~: 22776)
[PASS] test_calculateDebtToTargetHealthFactor_revertsWith_ArithmeticError_TargetHealthFactorLessThanHealthFactor((uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 22902, ~: 22859)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 2.70s (2.68s CPU time)

Ran 16 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.EvaluateDeficit.t.sol:LiquidationLogicEvaluateDeficitTest
[PASS] test_evaluateDeficit_CRE_SCCM_DRE_BRCM() (gas: 9012)
[PASS] test_evaluateDeficit_CRE_SCCM_DRE_BRCO() (gas: 8980)
[PASS] test_evaluateDeficit_CRE_SCCM_DRN_BRCM() (gas: 9001)
[PASS] test_evaluateDeficit_CRE_SCCM_DRN_BRCO() (gas: 8968)
[PASS] test_evaluateDeficit_CRE_SCCO_DRE_BRCM() (gas: 8994)
[PASS] test_evaluateDeficit_CRE_SCCO_DRE_BRCO() (gas: 9061)
[PASS] test_evaluateDeficit_CRE_SCCO_DRN_BRCM() (gas: 9026)
[PASS] test_evaluateDeficit_CRE_SCCO_DRN_BRCO() (gas: 9014)
[PASS] test_evaluateDeficit_CRN_SCCM_DRE_BRCM() (gas: 9014)
[PASS] test_evaluateDeficit_CRN_SCCM_DRE_BRCO() (gas: 9003)
[PASS] test_evaluateDeficit_CRN_SCCM_DRN_BRCM() (gas: 8937)
[PASS] test_evaluateDeficit_CRN_SCCM_DRN_BRCO() (gas: 8970)
[PASS] test_evaluateDeficit_CRN_SCCO_DRE_BRCM() (gas: 8947)
[PASS] test_evaluateDeficit_CRN_SCCO_DRE_BRCO() (gas: 9004)
[PASS] test_evaluateDeficit_CRN_SCCO_DRN_BRCM() (gas: 8955)
[PASS] test_evaluateDeficit_CRN_SCCO_DRN_BRCO() (gas: 9033)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 20.71ms (1.05ms CPU time)

Ran 21 tests for tests/unit/Spoke/Spoke.DynamicConfig.t.sol:SpokeDynamicConfigTest
[PASS] test_addDynamicReserveConfig() (gas: 80458)
[PASS] test_addDynamicReserveConfig_fuzz_revertsWith_InvalidCollateralFactorAndMaxLiquidationBonus_incompatible(uint16,uint32) (runs: 5000, μ: 47199, ~: 47371)
[PASS] test_addDynamicReserveConfig_once() (gas: 521068)
[PASS] test_addDynamicReserveConfig_revertsWith_AccessManagedUnauthorized(address) (runs: 5000, μ: 44504, ~: 44504)
[PASS] test_addDynamicReserveConfig_revertsWith_InvalidCollateralFactorAndMaxLiquidationBonus_collateralFactor() (gas: 58724)
[PASS] test_addDynamicReserveConfig_revertsWith_InvalidCollateralFactorAndMaxLiquidationBonus_liquidationBonus() (gas: 41321)
[PASS] test_addDynamicReserveConfig_revertsWith_InvalidLiquidationFee() (gas: 41784)
[PASS] test_addDynamicReserveConfig_revertsWith_MaximumDynamicConfigKeyReached() (gas: 44375)
[PASS] test_addDynamicReserveConfig_revertsWith_ReserveNotListed() (gas: 28943)
[PASS] test_fuzz_addDynamicReserveConfig_spaced_dup_updates(bytes32) (runs: 5000, μ: 141885, ~: 141885)
[PASS] test_fuzz_addDynamicReserveConfig_trailing_order(bytes32) (runs: 5000, μ: 135957, ~: 135957)
[PASS] test_offboardReserve_existing_borrows_remain_unaffected() (gas: 1137597)
[PASS] test_updateDynamicReserveConfig() (gas: 1739770)
[PASS] test_updateDynamicReserveConfig_fuzz_revertsWith_InvalidCollateralFactorAndMaxLiquidationBonus(uint16,uint32) (runs: 5000, μ: 58033, ~: 58205)
[PASS] test_updateDynamicReserveConfig_revertsWith_AccessManagedUnauthorized(address) (runs: 5000, μ: 44483, ~: 44483)
[PASS] test_updateDynamicReserveConfig_revertsWith_ConfigKeyUninitialized() (gas: 50000)
[PASS] test_updateDynamicReserveConfig_revertsWith_InvalidCollateralFactor() (gas: 51154)
[PASS] test_updateDynamicReserveConfig_revertsWith_InvalidCollateralFactorAndMaxLiquidationBonus_collateralFactor() (gas: 51929)
[PASS] test_updateDynamicReserveConfig_revertsWith_InvalidCollateralFactorAndMaxLiquidationBonus_liquidationBonus() (gas: 52088)
[PASS] test_updateDynamicReserveConfig_revertsWith_InvalidLiquidationFee() (gas: 52615)
[PASS] test_updateDynamicReserveConfig_revertsWith_ReserveNotListed() (gas: 29255)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 8.81s (8.79s CPU time)

Ran 5 tests for tests/gas/Spoke.Getters.gas.t.sol:SpokeGetters_Gas_Tests
[PASS] test_getUserAccountData() (gas: 22583)
[PASS] test_getUserAccountData_oneSupplies() (gas: 283401)
[PASS] test_getUserAccountData_twoSupplies() (gas: 518556)
[PASS] test_getUserAccountData_twoSupplies_oneBorrows() (gas: 1042914)
[PASS] test_getUserAccountData_twoSupplies_twoBorrows() (gas: 1604916)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 39.61ms (5.68ms CPU time)

Ran 5 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateCollateral.t.sol:LiquidationLogicLiquidateCollateralTest
[PASS] test_liquidateCollateral_fuzz(uint256,uint256) (runs: 5000, μ: 268322, ~: 269280)
[PASS] test_liquidateCollateral_fuzz_CollateralToLiquidatorIsZero(uint256) (runs: 5000, μ: 110216, ~: 110942)
[PASS] test_liquidateCollateral_fuzz_receiveShares_sharesToLiquidator(uint256,uint256) (runs: 5000, μ: 754699, ~: 755973)
[PASS] test_liquidateCollateral_fuzz_revertsWith_ArithmeticUnderflow(uint256,uint256) (runs: 5000, μ: 100455, ~: 100270)
[PASS] test_liquidateCollateral_receiveShares_sharesToLiquidatorIsZero() (gas: 741483)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 13.14s (13.12s CPU time)

Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateDebt.t.sol:LiquidationLogicLiquidateDebtTest
[PASS] test_liquidateDebt_fuzz(uint256) (runs: 5000, μ: 232952, ~: 232952)
[PASS] test_liquidateDebt_revertsWith_ArithmeticUnderflow() (gas: 97214)
[PASS] test_liquidateDebt_revertsWith_InsufficientAllowance() (gas: 124353)
[PASS] test_liquidateDebt_revertsWith_InsufficientBalance() (gas: 182249)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 3.09s (3.07s CPU time)

Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidateUser.t.sol:LiquidationLogicLiquidateUserTest
[PASS] test_liquidateUser() (gas: 368104)
[PASS] test_liquidateUser_revertsWith_InvalidDebtToCover() (gas: 76753)
[PASS] test_liquidateUser_revertsWith_MustNotLeaveDust_Collateral() (gas: 110465)
[PASS] test_liquidateUser_revertsWith_MustNotLeaveDust_Debt() (gas: 119743)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 25.69ms (1.40ms 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, μ: 1049582, ~: 1049726)
[PASS] test_borrow_fuzz_rounding_effect_inflated_ex_rate(uint256,uint256,uint256) (runs: 5000, μ: 1417482, ~: 1417595)
[PASS] test_borrow_fuzz_rounding_effect_shares(uint256,uint256) (runs: 5000, μ: 1083252, ~: 1083022)
[PASS] test_borrow_rounding_effect_multiple_actions() (gas: 1146265)
[PASS] test_borrow_rounding_effect_shares() (gas: 1082237)
Logs:
  Bound result 5000000000000000000
  Bound result 94608000

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

Ran 8 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationAmounts.t.sol:LiquidationLogicLiquidationAmountsTest
[PASS] test_calculateLiquidationAmounts_EnoughCollateral() (gas: 15487)
[PASS] test_calculateLiquidationAmounts_InsufficientCollateral() (gas: 15739)
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_CollateralDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 56984, ~: 56825)
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_NoCollateralDust((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 55993, ~: 55972)
[PASS] test_calculateLiquidationAmounts_fuzz_EnoughCollateral_NoDebtLeft((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 72604, ~: 72495)
[PASS] test_calculateLiquidationAmounts_fuzz_InsufficientCollateral((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 59649, ~: 59509)
[PASS] test_calculateLiquidationAmounts_fuzz_revertsWith_MustNotLeaveDust_Collateral((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 56375, ~: 56155)
[PASS] test_calculateLiquidationAmounts_fuzz_revertsWith_MustNotLeaveDust_Debt((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256)) (runs: 5000, μ: 69137, ~: 69096)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 17.42s (17.40s CPU time)

Ran 4 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.LiquidationBonus.t.sol:LiquidationLogicLiquidationBonusTest
[PASS] test_calculateLiquidationBonus_MinBonusDueToRounding() (gas: 9317)
[PASS] test_calculateLiquidationBonus_PartialBonus() (gas: 9338)
[PASS] test_calculateLiquidationBonus_fuzz_ConstantBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 17322, ~: 17135)
[PASS] test_calculateLiquidationBonus_fuzz_MaxBonus(uint256,uint256,uint256,uint256) (runs: 5000, μ: 19609, ~: 19420)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 954.60ms (930.61ms CPU time)

Ran 12 tests for tests/unit/libraries/LiquidationLogic/LiquidationLogic.ValidateLiquidationCall.t.sol:LiquidationLogicValidateLiquidationCallTest
[PASS] test_validateLiquidationCall() (gas: 26157)
[PASS] test_validateLiquidationCall_revertsWith_CannotReceiveShares() (gas: 262562)
[PASS] test_validateLiquidationCall_revertsWith_CollateralCannotBeLiquidated() (gas: 46049)
[PASS] test_validateLiquidationCall_revertsWith_HealthFactorNotBelowThreshold() (gas: 32053)
[PASS] test_validateLiquidationCall_revertsWith_InvalidDebtToCover() (gas: 27026)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotBorrowed() (gas: 27145)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotEnabledAsCollateral_NotUsingAsCollateral() (gas: 27266)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotEnabledAsCollateral_ZeroCollateralFactor() (gas: 27282)
[PASS] test_validateLiquidationCall_revertsWith_ReserveNotSupplied() (gas: 27112)
[PASS] test_validateLiquidationCall_revertsWith_ReservePaused_CollateralPaused() (gas: 32175)
[PASS] test_validateLiquidationCall_revertsWith_ReservePaused_DebtPaused() (gas: 32175)
[PASS] test_validateLiquidationCall_revertsWith_SelfLiquidation() (gas: 33938)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 21.98ms (1.57ms CPU time)

Ran 26 tests for tests/unit/MathUtils.t.sol:MathUtilsTest
[PASS] test_add_edge_cases() (gas: 4854)
[PASS] test_add_negative_operand(uint256,int256) (runs: 5000, μ: 9258, ~: 9012)
[PASS] test_add_positive_operand(uint256,int256) (runs: 5000, μ: 4015, ~: 4010)
[PASS] test_calculateLinearInterest() (gas: 4467)
[PASS] test_calculateLinearInterest_add_edge() (gas: 5043)
[PASS] test_calculateLinearInterest_edge_cases() (gas: 16815)
Logs:
  Bound result 0
  Bound result 1
  Bound result 864000000
  Bound result 864000000

[PASS] test_calculateLinearInterest_reverts_on_past_timestamp(uint40) (runs: 5000, μ: 7702, ~: 7550)
[PASS] test_constants() (gas: 3167)
[PASS] test_fuzz_calculateLinearInterest(uint96,uint40,uint256) (runs: 5000, μ: 8753, ~: 8996)
[PASS] test_fuzz_mulDivDown(uint256,uint256,uint256) (runs: 5000, μ: 3577, ~: 3634)
[PASS] test_fuzz_mulDivUp(uint256,uint256,uint256) (runs: 5000, μ: 3660, ~: 3781)
[PASS] test_min(uint256,uint256) (runs: 5000, μ: 3338, ~: 3339)
[PASS] test_mulDivDown_NoRemainder() (gas: 3302)
[PASS] test_mulDivDown_RevertOnDivByZero() (gas: 3147)
[PASS] test_mulDivDown_RevertOnOverflow() (gas: 3181)
[PASS] test_mulDivDown_WithRemainder() (gas: 3236)
[PASS] test_mulDivDown_ZeroAOrB() (gas: 3768)
[PASS] test_mulDivUp_NoRemainder() (gas: 3306)
[PASS] test_mulDivUp_RevertOnDivByZero() (gas: 3102)
[PASS] test_mulDivUp_RevertOnOverflow() (gas: 3160)
[PASS] test_mulDivUp_WithRemainder() (gas: 3305)
[PASS] test_mulDivUp_ZeroAOrB() (gas: 3884)
[PASS] test_signedSub(uint256,uint256) (runs: 5000, μ: 8715, ~: 8661)
[PASS] test_uncheckedAdd(uint256,uint256) (runs: 5000, μ: 3416, ~: 3408)
[PASS] test_uncheckedExp(uint256,uint256) (runs: 5000, μ: 12056, ~: 9378)
[PASS] test_uncheckedSub(uint256,uint256) (runs: 5000, μ: 3435, ~: 3518)
Suite result: ok. 26 passed; 0 failed; 0 skipped; finished in 1.67s (1.66s CPU time)

Ran 32 tests for tests/unit/misc/NativeTokenGateway.t.sol:NativeTokenGatewayTest
[PASS] test_borrowNative() (gas: 665929)
Logs:
  Bound result 5000000000000000000

[PASS] test_borrowNative_fuzz(uint256) (runs: 5000, μ: 665161, ~: 666238)
[PASS] test_borrowNative_revertsWith_InvalidAmount() (gas: 32207)
[PASS] test_borrowNative_revertsWith_NotNativeWrappedAsset() (gas: 32290)
[PASS] test_borrowNative_revertsWith_SpokeNotRegistered() (gas: 25298)
[PASS] test_constructor() (gas: 1051071)
[PASS] test_constructor_revertsWith_InvalidAddress() (gas: 65404)
[PASS] test_fallback_revertsWith_UnsupportedAction() (gas: 17852)
[PASS] test_receive_revertsWith_UnsupportedAction() (gas: 17647)
[PASS] test_repayNative() (gas: 753323)
Logs:
  Bound result 5000000000000000000

[PASS] test_repayNative_excessAmount() (gas: 665289)
[PASS] test_repayNative_fuzz(uint256) (runs: 5000, μ: 748086, ~: 753761)
[PASS] test_repayNative_fuzz_withInterest(uint256,uint256) (runs: 5000, μ: 676013, ~: 671443)
[PASS] test_repayNative_revertsWith_InvalidAmount() (gas: 32565)
[PASS] test_repayNative_revertsWith_NativeAmountMismatch() (gas: 30659)
[PASS] test_repayNative_revertsWith_NotNativeWrappedAsset() (gas: 39262)
[PASS] test_repayNative_revertsWith_SpokeNotRegistered() (gas: 39286)
[PASS] test_supplyAndCollateralNative() (gas: 331966)
Logs:
  Bound result 100000000000000000000

[PASS] test_supplyAndCollateralNative_fuzz(uint256) (runs: 5000, μ: 332254, ~: 331972)
[PASS] test_supplyNative() (gas: 304356)
Logs:
  Bound result 100000000000000000000

[PASS] test_supplyNative_fuzz(uint256) (runs: 5000, μ: 304710, ~: 304428)
[PASS] test_supplyNative_revertsWith_InvalidAmount() (gas: 32530)
[PASS] test_supplyNative_revertsWith_NativeAmountMismatch() (gas: 30390)
[PASS] test_supplyNative_revertsWith_NotNativeWrappedAsset() (gas: 39225)
[PASS] test_supplyNative_revertsWith_SpokeNotRegistered() (gas: 39197)
[PASS] test_withdrawNative() (gas: 330531)
Logs:
  Bound result 100000000000000000000

[PASS] test_withdrawNative_fuzz(uint256) (runs: 5000, μ: 330020, ~: 330581)
[PASS] test_withdrawNative_fuzz_allBalance(uint256) (runs: 5000, μ: 268734, ~: 268536)
[PASS] test_withdrawNative_fuzz_allBalanceWithInterest(uint256,uint256) (runs: 5000, μ: 620320, ~: 620316)
[PASS] test_withdrawNative_revertsWith_InvalidAmount() (gas: 32293)
[PASS] test_withdrawNative_revertsWith_NotNativeWrappedAsset() (gas: 32245)
[PASS] test_withdrawNative_revertsWith_SpokeNotRegistered() (gas: 25408)
Suite result: ok. 32 passed; 0 failed; 0 skipped; finished in 63.35s (63.32s CPU time)

Ran 3 tests for tests/unit/NoncesKeyed.t.sol:NoncesKeyedTest
[PASS] test_useCheckedNonce_monotonic(bytes32) (runs: 5000, μ: 13319, ~: 13319)
[PASS] test_useCheckedNonce_revertsWith_InvalidAccountNonce(bytes32) (runs:...*[Comment body truncated]*

Comment on lines +125 to +128
/// @dev Tracks all role identifiers when a new role is created.
function _trackRole(uint64 roleId) internal {
_rolesSet.add(uint256(roleId));
}
Copy link
Member

Choose a reason for hiding this comment

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

feel like we don't need the abstraction now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since we need this action in multiple overrides, I like to keep the abstraction + @dev comment

Copy link
Member

Choose a reason for hiding this comment

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

feels a bit unnecesary to me as well, given that is only 1 line
but no strong opinion


/// @inheritdoc IAccessManagerEnumerable
function getRoles(uint256 start, uint256 end) external view returns (uint64[] memory) {
uint256[] memory listedRoles = _rolesSet.values(start, end);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we not just return _rolesSet.values(start, end)?

Copy link
Contributor

Choose a reason for hiding this comment

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

if yes, do we need this fn anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

roleIds are uint64 everywhere else, so I think better to return in the same uint64 format here


/// @dev Override AccessManager `_grantRole` function to track role members.
function _grantRole(
uint64 roleId,
Copy link
Member

Choose a reason for hiding this comment

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

what if roleId is ADMIN_ROLE or PUBLIC_ROLE? No need to track ig

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will track the ADMIN_ROLE, and it's members, since the constructor does _grantRole(ADMIN_ROLE, initialAdmin, 0, 0)
The PUBLIC_ROLE is not track indeed, which is okay since by naming it's public, so defined by default and accepts all members.


/// @dev Override AccessManager `_setRoleAdmin` function to track created roles.
function _setRoleAdmin(uint64 roleId, uint64 admin) internal override {
_trackRole(roleId);
Copy link
Member

@miguelmtzinf miguelmtzinf Dec 18, 2025

Choose a reason for hiding this comment

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

ok, but we do not know which role is the admin role of a given role.
same for guardian

Copy link
Contributor Author

@Kogaroshi Kogaroshi Dec 18, 2025

Choose a reason for hiding this comment

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

struct Role {
// Members of the role.
mapping(address user => Access access) members;
// Admin who can grant or revoke permissions.
uint64 admin;
// Guardian who can cancel operations targeting functions that need this role.
uint64 guardian;
// Delay in which the role takes effect after being granted.
Time.Delay grantDelay;
}

=> can fetch with :
function getRoleAdmin(uint64 roleId) public view virtual returns (uint64) {

function getRoleGuardian(uint64 roleId) public view virtual returns (uint64) {

@Kogaroshi Kogaroshi changed the base branch from main to dev December 19, 2025 08:09

/// @inheritdoc IAccessManagerEnumerable
function getRole(uint256 index) external view returns (uint64) {
return uint64(_rolesSet.at(index));
Copy link
Contributor

Choose a reason for hiding this comment

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

should we do safecast here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the RoleId that is returned here is always passed as uint64 before being added in the Set, so I don't see a scenario were we can overflow the uint64 when fetching it back.
Kind of like we did with getRoleTargetFunction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants