Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pool Steward (#1) #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: pool Steward (#1) #14

wants to merge 3 commits into from

Conversation

sakulstra
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Feb 24, 2025

🔮 Coverage report
File Line Coverage Function Coverage Branch Coverage
src/finance/PoolExposureSteward.sol ${\color{green}100\%}$
$58 / 58$
${\color{green}100\%}$
$17 / 17$
${\color{orange}88.89\%}$
$8 / 9$
src/maintenance/ClinicSteward.sol ${\color{orange}93.44\%}$
$57 / 61$
69, 87, 88, 127
${\color{orange}91.67\%}$
$11 / 12$
ClinicSteward.renewAllowance
${\color{orange}85.71\%}$
$6 / 7$

Copy link

github-actions bot commented Feb 24, 2025

♻️ Forge Gas Snapshots

🔕 Unchanged
Path Value
snapshots/ClinicSteward.json
function batchLiquidate: with 0 users 88,346
function batchLiquidate: with 1 user 556,909
function batchLiquidate: with 2 users 886,551
function batchLiquidate: with 3 users 1,104,291
function batchLiquidate: with 4 users 1,322,043
function batchLiquidate: with 5 users 1,645,670
function batchLiquidate: with 6 users 1,863,422
function batchRepayBadDebt: with 0 users 64,367
function batchRepayBadDebt: with 1 user 221,408
function batchRepayBadDebt: with 2 users 283,879
function batchRepayBadDebt: with 3 users 346,349
function batchRepayBadDebt: with 4 users 408,820
function batchRepayBadDebt: with 5 users 471,291
function batchRepayBadDebt: with 6 users 533,762
function getBadDebtAmount: with 0 users 12,821
function getBadDebtAmount: with 1 user 38,631
function getBadDebtAmount: with 2 users 51,389
function getBadDebtAmount: with 4 users 76,907
function getBadDebtAmount: with 5 users 89,666
function getBadDebtAmount: with 6 users 102,425
function getDebtAmount: with 0 users 12,844
function getDebtAmount: with 1 user 34,314
function getDebtAmount: with 2 users 51,389
function getDebtAmount: with 4 users 59,569
function getDebtAmount: with 5 users 67,987
function getDebtAmount: with 6 users 76,406

Copy link

github-actions bot commented Feb 24, 2025

Forge Build Sizes

Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
AaveV3Avalanche ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
AaveV3AvalancheAssets ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
AaveV3AvalancheEModes ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
AaveV3AvalancheExternalLibraries ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
Address ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
ChainHelpers ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
ChainIds ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
ClinicSteward ↓0% (-25) 6,379 ↑0% (+30) 7,863 ↑0% (+25) 18,197 ↓0% (-30) 41,289
ConfiguratorInputTypes ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
Create2Utils ↓25% (-41) 121 ↓19% (-40) 172 ↑0% (+41) 24,455 ↑0% (+40) 48,980
Create2UtilsZkSync ↓28% (-41) 104 ↓21% (-40) 155 ↑0% (+41) 24,472 ↑0% (+40) 48,997
DataTypes ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
Errors ↓0% (-18) 4,653 ↓0% (-17) 4,706 ↑0% (+18) 19,923 ↑0% (+17) 44,446
GovV3Helpers ↑4% (+84) 2,468 ↑3% (+85) 2,521 ↓0% (-84) 22,108 ↓0% (-85) 46,631
GovV3StorageHelpers ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Arbitrum ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Avalanche ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3BNB ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Base ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Ethereum ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Gnosis ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Linea ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Metis ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Optimism ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Polygon ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3PolygonZkEvm ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Scroll ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3Sonic ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
GovernanceV3ZkSync ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
IpfsUtils ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
MiscEthereum ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
PayloadsControllerUtils ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
ProxyHelpers ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
ReserveConfiguration ↓24% (-41) 128 ↓18% (-40) 179 ↑0% (+41) 24,448 ↑0% (+40) 48,973
SafeERC20 ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
StorageHelpers ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
TestNetChainIds ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
UserConfiguration ↓48% (-41) 44 ↓30% (-41) 94 ↑0% (+41) 24,532 ↑0% (+41) 49,058
AaveSwapper 4,282 4,556 20,294 44,596
AaveV2Ethereum 44 94 24,532 49,058
AaveV2EthereumAMM 44 94 24,532 49,058
AaveV2EthereumAMMAssets 44 94 24,532 49,058
AaveV2EthereumAssets 44 94 24,532 49,058
AaveV3Arbitrum 44 94 24,532 49,058
AaveV3ArbitrumAssets 44 94 24,532 49,058
AaveV3ArbitrumEModes 44 94 24,532 49,058
AaveV3ArbitrumExternalLibraries 44 94 24,532 49,058
AaveV3BNB 44 94 24,532 49,058
AaveV3BNBAssets 44 94 24,532 49,058
AaveV3BNBEModes 44 94 24,532 49,058
AaveV3BNBExternalLibraries 44 94 24,532 49,058
AaveV3Base 44 94 24,532 49,058
AaveV3BaseAssets 44 94 24,532 49,058
AaveV3BaseEModes 44 94 24,532 49,058
AaveV3BaseExternalLibraries 44 94 24,532 49,058
AaveV3Ethereum 44 94 24,532 49,058
AaveV3EthereumAssets 44 94 24,532 49,058
AaveV3EthereumEModes 44 94 24,532 49,058
AaveV3EthereumEtherFi 44 94 24,532 49,058
AaveV3EthereumEtherFiAssets 44 94 24,532 49,058
AaveV3EthereumEtherFiEModes 44 94 24,532 49,058
AaveV3EthereumEtherFiExternalLibraries 44 94 24,532 49,058
AaveV3EthereumExternalLibraries 44 94 24,532 49,058
AaveV3EthereumLido 44 94 24,532 49,058
AaveV3EthereumLidoAssets 44 94 24,532 49,058
AaveV3EthereumLidoEModes 44 94 24,532 49,058
AaveV3EthereumLidoExternalLibraries 44 94 24,532 49,058
AaveV3Gnosis 44 94 24,532 49,058
AaveV3GnosisAssets 44 94 24,532 49,058
AaveV3GnosisEModes 44 94 24,532 49,058
AaveV3GnosisExternalLibraries 44 94 24,532 49,058
AaveV3Linea 44 94 24,532 49,058
AaveV3LineaAssets 44 94 24,532 49,058
AaveV3LineaEModes 44 94 24,532 49,058
AaveV3LineaExternalLibraries 44 94 24,532 49,058
AaveV3Metis 44 94 24,532 49,058
AaveV3MetisAssets 44 94 24,532 49,058
AaveV3MetisEModes 44 94 24,532 49,058
AaveV3MetisExternalLibraries 44 94 24,532 49,058
AaveV3Optimism 44 94 24,532 49,058
AaveV3OptimismAssets 44 94 24,532 49,058
AaveV3OptimismEModes 44 94 24,532 49,058
AaveV3OptimismExternalLibraries 44 94 24,532 49,058
AaveV3Polygon 44 94 24,532 49,058
AaveV3PolygonAssets 44 94 24,532 49,058
AaveV3PolygonEModes 44 94 24,532 49,058
AaveV3PolygonExternalLibraries 44 94 24,532 49,058
AaveV3Scroll 44 94 24,532 49,058
AaveV3ScrollAssets 44 94 24,532 49,058
AaveV3ScrollEModes 44 94 24,532 49,058
AaveV3ScrollExternalLibraries 44 94 24,532 49,058
AaveV3ZkSync 44 94 24,532 49,058
AaveV3ZkSyncAssets 44 94 24,532 49,058
AaveV3ZkSyncEModes 44 94 24,532 49,058
AaveV3ZkSyncExternalLibraries 44 94 24,532 49,058
CollectorUtils 44 94 24,532 49,058
DeploymentLibrary 44 94 24,532 49,058
PoolExposureSteward 6,399 7,567 18,177 41,585

Copy link

github-actions bot commented Feb 24, 2025

🌈 Test Results
No files changed, compilation skipped

Ran 3 tests for tests/finance/PoolExposureSteward.t.sol:Function_approvePool
[PASS] test_revertsIf_invalidZeroAddress() (gas: 11425)
[PASS] test_revertsIf_notOwner() (gas: 14148)
[PASS] test_success() (gas: 62311)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 228.29ms (738.27µs CPU time)

Ran 1 test for tests/finance/PoolExposureSteward.t.sol:Function_maxRescue
[PASS] test_maxRescue() (gas: 191012)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 264.14ms (34.60ms CPU time)

Ran 3 tests for tests/finance/PoolExposureSteward.t.sol:Function_revokePool
[PASS] test_revertsIf_invalidZeroAddress() (gas: 13658)
[PASS] test_revertsIf_notOwner() (gas: 14170)
[PASS] test_success() (gas: 18891)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 265.69ms (278.37µs CPU time)

Ran 28 tests for tests/gas/maintenance/ClinicSteward.gas.t.sol:ClinicStewardGasTest
[PASS] test_batchLiquidate_five_users() (gas: 1779526)
[PASS] test_batchLiquidate_four_users() (gas: 1454854)
[PASS] test_batchLiquidate_one_user() (gas: 689224)
[PASS] test_batchLiquidate_six_users() (gas: 1998345)
[PASS] test_batchLiquidate_three_users() (gas: 1236012)
[PASS] test_batchLiquidate_two_users() (gas: 1017108)
[PASS] test_batchLiquidate_zero_users() (gas: 233851)
[PASS] test_batchRepayBadDebt_five_users() (gas: 600812)
[PASS] test_batchRepayBadDebt_four_users() (gas: 537984)
[PASS] test_batchRepayBadDebt_one_user() (gas: 358870)
[PASS] test_batchRepayBadDebt_six_users() (gas: 663574)
[PASS] test_batchRepayBadDebt_three_users() (gas: 475159)
[PASS] test_batchRepayBadDebt_two_users() (gas: 412970)
[PASS] test_batchRepayBadDebt_zero_users() (gas: 213911)
[PASS] test_getBadDebtAmount_five_users() (gas: 108435)
[PASS] test_getBadDebtAmount_four_users() (gas: 94389)
[PASS] test_getBadDebtAmount_one_user() (gas: 52233)
[PASS] test_getBadDebtAmount_six_users() (gas: 122546)
[PASS] test_getBadDebtAmount_three_users() (gas: 80367)
[PASS] test_getBadDebtAmount_two_users() (gas: 66341)
[PASS] test_getBadDebtAmount_zero_users() (gas: 23131)
[PASS] test_getDebtAmount_five_users() (gas: 89824)
[PASS] test_getDebtAmount_four_users() (gas: 79484)
[PASS] test_getDebtAmount_one_user() (gas: 48537)
[PASS] test_getDebtAmount_six_users() (gas: 100095)
[PASS] test_getDebtAmount_three_users() (gas: 69147)
[PASS] test_getDebtAmount_two_users() (gas: 66311)
[PASS] test_getDebtAmount_zero_users() (gas: 23121)
Suite result: ok. 28 passed; 0 failed; 0 skipped; finished in 430.72ms (113.89ms CPU time)

Ran 3 tests for tests/finance/PoolExposureSteward.t.sol:Function_migrateBetweenV3
[PASS] test_revertsIf_notOwnerOrGuardian() (gas: 16612)
[PASS] test_revertsIf_zeroAmount() (gas: 27284)
[PASS] test_success() (gas: 411117)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 230.59ms (5.16ms CPU time)

Ran 3 tests for tests/finance/PoolExposureSteward.t.sol:Function_depositV3
[PASS] test_revertsIf_notOwnerOrGuardian() (gas: 16443)
[PASS] test_revertsIf_zeroAmount() (gas: 16066)
[PASS] test_success() (gas: 201747)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 310.81ms (2.74ms CPU time)

Ran 3 tests for tests/finance/PoolExposureSteward.t.sol:Function_withdrawV2
[PASS] test_revertsIf_notOwnerOrGuardian() (gas: 16421)
[PASS] test_revertsIf_zeroAmount() (gas: 44712)
[PASS] test_success() (gas: 309104)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 276.51ms (5.20ms CPU time)

Ran 5 tests for tests/finance/PoolExposureSteward.t.sol:Function_migrateV2toV3
[PASS] test_revertsIf_invalidV2Pool() (gas: 17384)
[PASS] test_revertsIf_invalidV3Pool() (gas: 19691)
[PASS] test_revertsIf_notOwnerOrGuardian() (gas: 16689)
[PASS] test_revertsIf_zeroAmount() (gas: 47239)
[PASS] test_success() (gas: 468148)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 241.42ms (8.70ms CPU time)

Ran 3 tests for tests/finance/PoolExposureSteward.t.sol:Function_emergencyTokenTransfer
[PASS] test_rescueEth() (gas: 25938)
[PASS] test_successful_governanceCaller() (gas: 209069)
[PASS] test_successful_permissionless() (gas: 208402)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 197.19ms (3.58ms CPU time)

Ran 3 tests for tests/finance/PoolExposureSteward.t.sol:Function_withdrawV3
[PASS] test_revertsIf_notOwnerOrGuardian() (gas: 16465)
[PASS] test_revertsIf_zeroAmount() (gas: 26856)
[PASS] test_success() (gas: 260212)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 195.46ms (7.26ms CPU time)

Ran 12 tests for tests/maintenance/ClinicSteward.t.sol:ClinicStewardTest
[PASS] test_batchLiquidate() (gas: 1954267)
[PASS] test_batchLiquidateUseAToken() (gas: 2132166)
[PASS] test_batchRepayBadDebt() (gas: 679372)
[PASS] test_batchRepayBadDebtUseAToken() (gas: 563953)
[PASS] test_getBadDebtAmount() (gas: 142241)
[PASS] test_getDebtAmount() (gas: 119866)
[PASS] test_maxRescue() (gas: 185467)
[PASS] test_rescueEth() (gas: 28324)
[PASS] test_rescueToken() (gas: 198445)
[PASS] test_reverts_batchLiquidate_caller_not_cleaner(address) (runs: 256, μ: 36653, ~: 36653)
[PASS] test_reverts_batchRepayBadDebt_caller_not_cleaner(address) (runs: 256, μ: 34415, ~: 34415)
[PASS] test_userHasSomeCollateral_returns_zero() (gas: 66409)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 346.42ms (131.57ms CPU time)

Ran 11 test suites in 783.43ms (2.99s CPU time): 67 tests passed, 0 failed, 0 skipped (67 total tests)

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