From f0e26a68bb08c8b3b4a4ecf990055cc67e60c9c2 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 24 Jul 2024 23:30:49 +0900 Subject: [PATCH] fix: update tooling to support virtual balance and new ir (#34) --- .gitignore | 2 + bun.lockb | Bin 90020 -> 91091 bytes package.json | 4 +- tests/mocks/AaveV3TestListing.sol | 2 +- .../AaveV3ConfigEngineTest.t.sol | 10 +- tests/utils/DiffUtils.sol | 2 +- tests/utils/ProtocolV3TestBase.sol | 92 +++++++++++------- 7 files changed, 71 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index c199a61c..92845bde 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ out/ .env .env.bk .assets + +# artifacts reports/ diffs/ downloads/ diff --git a/bun.lockb b/bun.lockb index 512e8aff5322b3c89dec763ded71ada5f5d0ecf5..471ed8580a4fd2c7f70ff7b2a474769a9baa45ce 100755 GIT binary patch delta 17025 zcmeHud0bUh*Z)q&Di*N7#VmI`0J?XWQGadfeGH8VNn2McK)~>c+W$~R7*fX99bloeB z_A*x9k<;p}p&%55AngdbsV-bxVcAQyn!L#|Ns3spWA(gpd? z(FN)KuF4Xb&{5tF_9Ynxt@}L6H-L}MM!ElD={H4Jx9nF?%OB|J!}P`J_@SA zN#QsYsRONIR$^>|&-k&)8kf)->G#6T39=oeCuCw)Rz{Xj;-s#qO!ZyW@~=Qh|0pC` zUkGbO^j{F45<6}zM%o0u(#TU{vwf1r#U?ZG#^Cp%NDcX*kOnptk{TL={1%WqFi`Ty zN(VvkfNX`kp{hN1#DNb+!YVp?uumLOy$W@n7+pPMK+ISYap3Tz;$;aZrZ z4kTk@x*(VvDIHHkE7Z_rSWcEES<(}HCX5%RVw5z%OkS+>%GZXYbrXWIk>m4X$BnaO z=LlLW8!&7d-dJiSBS|p1D#MG-%CaQo3Bpp8(6@L25>fTG0cN{CL$}8D?9f($RTvYUmO;br25cQHQ>&JO@c;S<+Jyvn)B;r=dss z3t>CSi@emz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t5_gwhkUm$p^~bCU*EXK{LUBUT<3MzzpQ zJA>7}_2kDc9+f+xN%)U;f^E`lC-kWu)=HgRaNF%kaV`|pl_s|v2a;n0D+$JDNk=AhbV%;Y1`CrPTmM3YJ)TatOqMaK%*eU%>{oC*6 zKtXl>N>ruSJ9qCZ9~~CF_o5_Jar#DS6IK0-=MF_N=0H27_9laUG03~+g>sEbuTa%Z zJI&UeExFk0+44b9pnU)nS}Zk&-$JzGZ5sy$?8vyEv3kcMeNDi)Wt9F`gnVbKS4*Cxz)>1E2b<+;W9o6Bd=v(@z4+?%#0Tfu2w1M>06L$G4*NyFe-?q-V z4|-|RWg3HaB=2mIqx-S?w?6)$pdH$4P^Eqln|`h6L&;jn*NC>YQ+|onUkeVN&QCum zoRch2(Er*@8f|2*ZrU+H9)9_vKl_A#P|!{u+B!ux z+{5Ob`cTqR!i##4-W(&P)?k79t})Ug$cl$u@HY*vd{^mw4S2!Tjrp@uDb|hkX?mcM z@+2skw(a$o9XhT#1x{<~+K}<-j>)kX&x2P5Up=75^wieTHNT*LMu^L6lzMc_@|_Xh6V>Ghxl7kk}M%6izOw%5)$g4niA}v?B_2<)ntcR(gJrD z!Az3boi&tZxYG-RC-atida%mY2!{}9pa;vg!h({1^Gxpfz57Nj_K^=NL(gk>qqfY^ fjvC)>?#k9wl$KbSmo;AfL!=@f6koBh-`W2IvSYf4 diff --git a/package.json b/package.json index 1ce81992..c151c49a 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "prettier-plugin-solidity": "^1.1.1" }, "dependencies": { - "@bgd-labs/aave-cli": "^0.7.2", - "catapulta-verify": "^1.0.6-b4e4af767ca0ef6644d50aeca57aae1a560fe40d.0" + "@bgd-labs/aave-cli": "^0.16.2", + "catapulta-verify": "^1.1.1" } } diff --git a/tests/mocks/AaveV3TestListing.sol b/tests/mocks/AaveV3TestListing.sol index 2e783855..30751b34 100644 --- a/tests/mocks/AaveV3TestListing.sol +++ b/tests/mocks/AaveV3TestListing.sol @@ -5,7 +5,7 @@ import 'aave-v3-periphery/contracts/v3-config-engine/AaveV3Payload.sol'; import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; import {MockAggregator} from 'aave-v3-core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {MarketReport} from 'src/deployments/interfaces/IMarketReportTypes.sol'; +import {MarketReport} from '../../src/deployments/interfaces/IMarketReportTypes.sol'; /** * @dev Smart contract for token listing, for testing purposes diff --git a/tests/periphery/v3-config-engine/AaveV3ConfigEngineTest.t.sol b/tests/periphery/v3-config-engine/AaveV3ConfigEngineTest.t.sol index 0454771d..e73843f7 100644 --- a/tests/periphery/v3-config-engine/AaveV3ConfigEngineTest.t.sol +++ b/tests/periphery/v3-config-engine/AaveV3ConfigEngineTest.t.sol @@ -100,7 +100,10 @@ contract AaveV3ConfigEngineTest is TestnetProcedures, ProtocolV3TestBase { supplyCap: 85_000, borrowCap: 60_000, debtCeiling: 0, - eModeCategory: 0 + eModeCategory: 0, + virtualAccActive: true, + virtualBalance: 0, + aTokenUnderlyingBalance: 0 }); _validateReserveConfig(expectedAssetConfig, allConfigsAfter); @@ -200,7 +203,10 @@ contract AaveV3ConfigEngineTest is TestnetProcedures, ProtocolV3TestBase { supplyCap: 85_000, borrowCap: 60_000, debtCeiling: 0, - eModeCategory: 0 + eModeCategory: 0, + virtualAccActive: true, + virtualBalance: 0, + aTokenUnderlyingBalance: 0 }); _validateReserveConfig(expectedAssetConfig, allConfigsAfter); diff --git a/tests/utils/DiffUtils.sol b/tests/utils/DiffUtils.sol index 6ed13480..a5e7577d 100644 --- a/tests/utils/DiffUtils.sol +++ b/tests/utils/DiffUtils.sol @@ -22,7 +22,7 @@ contract DiffUtils is Test { string[] memory inputs = new string[](7); inputs[0] = 'npx'; - inputs[1] = '@bgd-labs/aave-cli@^0.7.2'; + inputs[1] = '@bgd-labs/aave-cli@^0.16.2'; inputs[2] = 'diff-snapshots'; inputs[3] = beforePath; inputs[4] = afterPath; diff --git a/tests/utils/ProtocolV3TestBase.sol b/tests/utils/ProtocolV3TestBase.sol index efe4b083..faf3436e 100644 --- a/tests/utils/ProtocolV3TestBase.sol +++ b/tests/utils/ProtocolV3TestBase.sol @@ -103,6 +103,9 @@ struct ReserveConfig { uint256 borrowCap; uint256 debtCeiling; uint256 eModeCategory; + bool virtualAccActive; + uint256 virtualBalance; + uint256 aTokenUnderlyingBalance; } struct LocalVars { @@ -187,42 +190,43 @@ contract ProtocolV3TestBase is DiffUtils { // keys for json stringification string memory strategiesKey = 'stategies'; string memory content = '{}'; + vm.serializeJson(strategiesKey, '{}'); - address[] memory usedStrategies = new address[](configs.length); for (uint256 i = 0; i < configs.length; i++) { - if (!_isInAddressArray(usedStrategies, configs[i].interestRateStrategy)) { - usedStrategies[i] = configs[i].interestRateStrategy; - IDefaultInterestRateStrategyV2 strategy = IDefaultInterestRateStrategyV2( - configs[i].interestRateStrategy - ); - string memory key = vm.toString(address(strategy)); - vm.serializeString( - key, - 'baseVariableBorrowRate', - vm.toString(strategy.getBaseVariableBorrowRate(configs[i].underlying)) - ); - vm.serializeString( - key, - 'variableRateSlope1', - vm.toString(strategy.getVariableRateSlope1(configs[i].underlying)) - ); - vm.serializeString( - key, - 'variableRateSlope2', - vm.toString(strategy.getVariableRateSlope2(configs[i].underlying)) - ); - vm.serializeString( - key, - 'maxVariableBorrowRate', - vm.toString(strategy.getMaxVariableBorrowRate(configs[i].underlying)) - ); - string memory object = vm.serializeString( - key, - 'optimalUsageRatio', - vm.toString(strategy.getOptimalUsageRatio(configs[i].underlying)) - ); - content = vm.serializeString(strategiesKey, key, object); - } + address asset = configs[i].underlying; + string memory key = vm.toString(asset); + vm.serializeJson(key, '{}'); + vm.serializeString(key, 'address', vm.toString(configs[i].interestRateStrategy)); + IDefaultInterestRateStrategyV2 strategy = IDefaultInterestRateStrategyV2( + configs[i].interestRateStrategy + ); + vm.serializeString( + key, + 'baseVariableBorrowRate', + vm.toString(strategy.getBaseVariableBorrowRate(asset)) + ); + vm.serializeString( + key, + 'variableRateSlope1', + vm.toString(strategy.getVariableRateSlope1(asset)) + ); + vm.serializeString( + key, + 'variableRateSlope2', + vm.toString(strategy.getVariableRateSlope2(asset)) + ); + vm.serializeString( + key, + 'maxVariableBorrowRate', + vm.toString(strategy.getMaxVariableBorrowRate(asset)) + ); + string memory object = vm.serializeString( + key, + 'optimalUsageRatio', + vm.toString(strategy.getOptimalUsageRatio(asset)) + ); + + content = vm.serializeString(strategiesKey, key, object); } string memory output = vm.serializeString('root', 'strategies', content); vm.writeJson(output, path); @@ -327,6 +331,11 @@ contract ProtocolV3TestBase is DiffUtils { } catch {} } } + + vm.serializeBool(key, 'virtualAccountingActive', config.virtualAccActive); + vm.serializeUint(key, 'virtualBalance', config.virtualBalance); + vm.serializeUint(key, 'aTokenUnderlyingBalance', config.aTokenUnderlyingBalance); + string memory out = vm.serializeUint( key, 'oracleLatestAnswer', @@ -450,6 +459,16 @@ contract ProtocolV3TestBase is DiffUtils { localConfig.isFlashloanable = configuration.getFlashLoanEnabled(); + // 3.1 configurations + localConfig.virtualAccActive = configuration.getIsVirtualAccActive(); + + if (localConfig.virtualAccActive) { + localConfig.virtualBalance = pool.getVirtualUnderlyingBalance(reserve.tokenAddress); + localConfig.aTokenUnderlyingBalance = IERC20Detailed(reserve.tokenAddress).balanceOf( + localConfig.aToken + ); + } + return localConfig; } @@ -481,7 +500,10 @@ contract ProtocolV3TestBase is DiffUtils { supplyCap: config.supplyCap, borrowCap: config.borrowCap, debtCeiling: config.debtCeiling, - eModeCategory: config.eModeCategory + eModeCategory: config.eModeCategory, + virtualAccActive: config.virtualAccActive, + virtualBalance: config.virtualBalance, + aTokenUnderlyingBalance: config.aTokenUnderlyingBalance }); }