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: svr steward (#10) #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: svr steward (#10) #19

wants to merge 1 commit into from

Conversation

sakulstra
Copy link
Contributor

Steward for activating and deactivating svr oracles.

Steward for activating and deactivating svr oracles.
Copy link

github-actions bot commented Mar 5, 2025

🌈 Test Results
No files changed, compilation skipped

Ran 12 tests for tests/risk/SvrOracleSteward.t.sol:SvrOracleStewardBaseTest
[PASS] test_activateSvrOracle_shouldRevertIfNotConfig() (gas: 17929)
[PASS] test_activateSvroracle() (gas: 83682)
[PASS] test_activateSvroracle_shouldRevertIfDeviationExceeded() (gas: 77003)
[PASS] test_activateSvroracle_shouldRevertIfOracleChangedOutside() (gas: 51143)
[PASS] test_configureOracle() (gas: 66255)
[PASS] test_configureOracle_shouldRevertWithWrongOracle() (gas: 108723)
[PASS] test_disableSvrOracle() (gas: 93648)
[PASS] test_disableSvrOracle_shouldRevertIfNotConfig() (gas: 28725)
[PASS] test_disableSvrOracle_shouldRevertifOutsideOracleChange() (gas: 101104)
[PASS] test_ifNoGuardian_activateSvrOracle_shouldRevert() (gas: 13422)
[PASS] test_ifNoGuardian_disableSvrOracle_shouldRevert() (gas: 11155)
[PASS] test_ifNoOwner_configureOracle_shouldRevert() (gas: 11270)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 2.12s (1.85s CPU time)

Ran 28 tests for tests/gas/maintenance/ClinicSteward.gas.t.sol:ClinicStewardGasTest
[PASS] test_batchLiquidate_five_users() (gas: 1790961)
[PASS] test_batchLiquidate_four_users() (gas: 1466277)
[PASS] test_batchLiquidate_one_user() (gas: 700611)
[PASS] test_batchLiquidate_six_users() (gas: 2009858)
[PASS] test_batchLiquidate_three_users() (gas: 1247423)
[PASS] test_batchLiquidate_two_users() (gas: 1028507)
[PASS] test_batchLiquidate_zero_users() (gas: 256311)
[PASS] test_batchRepayBadDebt_five_users() (gas: 631701)
[PASS] test_batchRepayBadDebt_four_users() (gas: 568873)
[PASS] test_batchRepayBadDebt_one_user() (gas: 383617)
[PASS] test_batchRepayBadDebt_six_users() (gas: 694463)
[PASS] test_batchRepayBadDebt_three_users() (gas: 506048)
[PASS] test_batchRepayBadDebt_two_users() (gas: 443290)
[PASS] test_batchRepayBadDebt_zero_users() (gas: 236342)
[PASS] test_getBadDebtAmount_five_users() (gas: 108457)
[PASS] test_getBadDebtAmount_four_users() (gas: 94411)
[PASS] test_getBadDebtAmount_one_user() (gas: 52255)
[PASS] test_getBadDebtAmount_six_users() (gas: 122568)
[PASS] test_getBadDebtAmount_three_users() (gas: 80389)
[PASS] test_getBadDebtAmount_two_users() (gas: 66363)
[PASS] test_getBadDebtAmount_zero_users() (gas: 23218)
[PASS] test_getDebtAmount_five_users() (gas: 89846)
[PASS] test_getDebtAmount_four_users() (gas: 79506)
[PASS] test_getDebtAmount_one_user() (gas: 48559)
[PASS] test_getDebtAmount_six_users() (gas: 100140)
[PASS] test_getDebtAmount_three_users() (gas: 69169)
[PASS] test_getDebtAmount_two_users() (gas: 66333)
[PASS] test_getDebtAmount_zero_users() (gas: 23143)
Suite result: ok. 28 passed; 0 failed; 0 skipped; finished in 2.30s (115.11ms CPU time)

Ran 16 tests for tests/maintenance/ClinicSteward.t.sol:ClinicStewardTest
[PASS] test_batchLiquidate() (gas: 1974454)
[PASS] test_batchLiquidateUseAToken() (gas: 2155594)
[PASS] test_batchRepayBadDebt() (gas: 718983)
[PASS] test_batchRepayBadDebtUseAToken() (gas: 603389)
[PASS] test_getBadDebtAmount() (gas: 142263)
[PASS] test_getDebtAmount() (gas: 119888)
[PASS] test_maxRescue() (gas: 185526)
[PASS] test_rescueEth() (gas: 28299)
[PASS] test_rescueToken() (gas: 198558)
[PASS] test_reverts_batchLiquidate_caller_not_cleaner(address) (runs: 256, μ: 36728, ~: 36728)
[PASS] test_reverts_batchLiquidate_exceeded_pull_limit() (gas: 3912325)
[PASS] test_reverts_batchRepayBadDebt_caller_not_cleaner(address) (runs: 256, μ: 34579, ~: 34579)
[PASS] test_reverts_batchRepayBadDebt_exceeded_pull_limit() (gas: 2283956)
[PASS] test_reverts_setAvailableBudget_caller_not_admin(address) (runs: 256, μ: 15391, ~: 15391)
[PASS] test_setAvailableBudget() (gas: 24847)
[PASS] test_userHasSomeCollateral_returns_zero() (gas: 66453)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 3.23s (2.27s CPU time)

Ran 3 test suites in 3.23s (7.65s CPU time): 56 tests passed, 0 failed, 0 skipped (56 total tests)

Copy link

github-actions bot commented Mar 5, 2025

🔮 Coverage report
File Line Coverage Function Coverage Branch Coverage
src/maintenance/ClinicSteward.sol ${\color{orange}93.67\%}$
$74 / 79$
94, 115, 116, 156, 157
${\color{orange}93.33\%}$
$14 / 15$
ClinicSteward.renewAllowance
${\color{orange}87.5\%}$
$7 / 8$
src/risk/SvrOracleSteward.sol ${\color{green}100\%}$
$49 / 49$
${\color{green}100\%}$
$8 / 8$
${\color{red}71.43\%}$
$5 / 7$

Copy link

github-actions bot commented Mar 5, 2025

♻️ Forge Gas Snapshots

Path Value
snapshots/ClinicSteward.json
function batchLiquidate: with 0 users ↓3% (-3659) 113,948
function batchLiquidate: with 1 user ↓1% (-5228) 564,255
function batchLiquidate: with 2 users ↓1% (-6344) 892,794
function batchLiquidate: with 3 users ↓1% (-7460) 1,109,431
function batchLiquidate: with 4 users ↓1% (-8576) 1,326,080
function batchLiquidate: with 5 users ↓1% (-9692) 1,648,604
function batchLiquidate: with 6 users ↓1% (-10808) 1,865,253
function batchRepayBadDebt: with 0 users ↓3% (-2921) 90,716
function batchRepayBadDebt: with 1 user ↓2% (-4803) 248,681
function batchRepayBadDebt: with 2 users ↓2% (-6672) 309,283
function batchRepayBadDebt: with 3 users ↓2% (-8541) 369,884
function batchRepayBadDebt: with 4 users ↓2% (-10410) 430,486
function batchRepayBadDebt: with 5 users ↓2% (-12279) 491,088
function batchRepayBadDebt: with 6 users ↓3% (-14148) 551,690
function getBadDebtAmount: with 0 users ↓8% (-978) 11,865
function getBadDebtAmount: with 1 user ↓6% (-2355) 36,298
function getBadDebtAmount: with 2 users ↓7% (-3719) 47,692
function getBadDebtAmount: with 4 users ↓8% (-6447) 70,482
function getBadDebtAmount: with 5 users ↓9% (-7811) 81,877
function getBadDebtAmount: with 6 users ↓9% (-9175) 93,272
function getDebtAmount: with 0 users ↓8% (-978) 11,888
function getDebtAmount: with 1 user ↓5% (-1744) 32,592
function getDebtAmount: with 2 users ↓7% (-3719) 47,692
function getDebtAmount: with 4 users ↓7% (-4003) 55,588
function getDebtAmount: with 5 users ↓7% (-4756) 63,253
function getDebtAmount: with 6 users ↓7% (-5509) 70,919

Copy link

github-actions bot commented Mar 5, 2025

Forge Build Sizes

Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
DeploySvrOracleSteward_Lib 44 94 24,532 49,058
OracleMock 93 198 24,483 48,954
SvrOracleSteward 3,422 4,982 21,154 44,170
🔕 Unchanged
Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
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
AaveV3Avalanche 44 94 24,532 49,058
AaveV3AvalancheAssets 44 94 24,532 49,058
AaveV3AvalancheEModes 44 94 24,532 49,058
AaveV3AvalancheExternalLibraries 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
Address 44 94 24,532 49,058
ChainHelpers 44 94 24,532 49,058
ChainIds 44 94 24,532 49,058
ClinicSteward 7,344 9,207 17,232 39,945
ConfiguratorInputTypes 44 94 24,532 49,058
Create2Utils 121 172 24,455 48,980
Create2UtilsZkSync 104 155 24,472 48,997
DataTypes 44 94 24,532 49,058
DeploymentLibrary 44 94 24,532 49,058
Errors 4,653 4,706 19,923 44,446
GovV3Helpers 2,468 2,521 22,108 46,631
GovV3StorageHelpers 44 94 24,532 49,058
GovernanceV3Arbitrum 44 94 24,532 49,058
GovernanceV3Avalanche 44 94 24,532 49,058
GovernanceV3BNB 44 94 24,532 49,058
GovernanceV3Base 44 94 24,532 49,058
GovernanceV3Ethereum 44 94 24,532 49,058
GovernanceV3Gnosis 44 94 24,532 49,058
GovernanceV3Linea 44 94 24,532 49,058
GovernanceV3Metis 44 94 24,532 49,058
GovernanceV3Optimism 44 94 24,532 49,058
GovernanceV3Polygon 44 94 24,532 49,058
GovernanceV3PolygonZkEvm 44 94 24,532 49,058
GovernanceV3Scroll 44 94 24,532 49,058
GovernanceV3Sonic 44 94 24,532 49,058
GovernanceV3ZkSync 44 94 24,532 49,058
IpfsUtils 44 94 24,532 49,058
MiscEthereum 44 94 24,532 49,058
PayloadsControllerUtils 44 94 24,532 49,058
ProxyHelpers 44 94 24,532 49,058
ReserveConfiguration 128 179 24,448 48,973
SafeERC20 44 94 24,532 49,058
StorageHelpers 44 94 24,532 49,058
TestNetChainIds 44 94 24,532 49,058
UserConfiguration 44 94 24,532 49,058

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.

1 participant