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

More OZ logic on stata #7

Merged
merged 17 commits into from
Aug 16, 2024
Merged

More OZ logic on stata #7

merged 17 commits into from
Aug 16, 2024

Conversation

kyzia551
Copy link

@kyzia551 kyzia551 commented Aug 12, 2024

I tried to reduce the number of logical brunches, and reuse oz.

Also:

  • previewDeposit and previewWithdraw were not overloading OZ due to the wrong rounding used
    _deposit and _redeem was not overloading OZ
  • I ditched referralCode to make everything simpler
  • added depositATokens and withdrawATokens, instead of our overloads, to make it more understandable what is what
  • added missing initializers, and defined underlying as $.asset of 4626
  • changed msg.sender to _msgSender everywhere for consystency with OZ
  • removed local computation of _getNormalizedIncome
  • switched to rate() and asset() usage everywhere

TODO:

  • didn’t manage to play with storage, but will try tomorrow
  • migrate to getConfiguration + getVO, instead of getReserveData

@kyzia551 kyzia551 requested review from sakulstra and eboadom August 12, 2024 15:17
Copy link

github-actions bot commented Aug 12, 2024

Foundry report

forge 0.2.0 (62def0d 2024-08-16T00:20:50.128464357Z)
Build log
Compiling 400 files with Solc 0.8.20
Solc 0.8.20 finished in 102.04s
Compiler run successful with warnings:
Warning (2519): This declaration shadows an existing declaration.
   --> tests/periphery/static-a-token/ERC20AaveLMUpgradable.t.sol:398:34:
    |
398 |   function _fund(uint256 amount, address user) internal {
    |                                  ^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> tests/periphery/static-a-token/ERC20AaveLMUpgradable.t.sol:57:3:
   |
57 |   address public user;
   |   ^^^^^^^^^^^^^^^^^^^

Warning (2519): This declaration shadows an existing declaration.
   --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:457:44:
    |
457 |   function _fundUnderlying(uint256 assets, address user) internal {
    |                                            ^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:31:3:
   |
31 |   address public user;
   |   ^^^^^^^^^^^^^^^^^^^

Warning (2519): This declaration shadows an existing declaration.
   --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:461:40:
    |
461 |   function _fundAToken(uint256 assets, address user) internal {
    |                                        ^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:31:3:
   |
31 |   address public user;
   |   ^^^^^^^^^^^^^^^^^^^

Warning (2519): This declaration shadows an existing declaration.
   --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:469:38:
    |
469 |   function _fund4626(uint256 assets, address user) internal returns (uint256) {
    |                                      ^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:31:3:
   |
31 |   address public user;
   |   ^^^^^^^^^^^^^^^^^^^

Warning (2519): This declaration shadows an existing declaration.
  --> tests/periphery/static-a-token/TestBase.sol:78:44:
   |
78 |   function _fundUnderlying(uint256 assets, address user) internal {
   |                                            ^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> tests/periphery/static-a-token/TestBase.sol:20:3:
   |
20 |   address public user;
   |   ^^^^^^^^^^^^^^^^^^^

Warning (2519): This declaration shadows an existing declaration.
  --> tests/periphery/static-a-token/TestBase.sol:82:40:
   |
82 |   function _fundAToken(uint256 assets, address user) internal {
   |                                        ^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> tests/periphery/static-a-token/TestBase.sol:20:3:
   |
20 |   address public user;
   |   ^^^^^^^^^^^^^^^^^^^

Warning (2519): This declaration shadows an existing declaration.
  --> tests/periphery/static-a-token/TestBase.sol:90:38:
   |
90 |   function _fund4626(uint256 assets, address user) internal returns (uint256) {
   |                                      ^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> tests/periphery/static-a-token/TestBase.sol:20:3:
   |
20 |   address public user;
   |   ^^^^^^^^^^^^^^^^^^^

Warning (5740): Unreachable code.
  --> src/periphery/contracts/dependencies/openzeppelin/ReentrancyGuard.sol:61:5:
   |
61 |     _status = _NOT_ENTERED;
   |     ^^^^^^^^^^^^^^^^^^^^^^

Warning (2072): Unused local variable.
   --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:334:5:
    |
334 |     uint256 assetsUsedForMinting = erc4626Upgradeable.mint(shares + 1, receiver);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning (2072): Unused local variable.
   --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:403:5:
    |
403 |     uint256 shares = _fund4626(assets, user);
    |     ^^^^^^^^^^^^^^

Warning (2018): Function state mutability can be restricted to pure
  --> tests/periphery/static-a-token/ERC20AaveLMUpgradable.t.sol:88:3:
   |
88 |   function test_2701() external view {
   |   ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to pure
  --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:49:3:
   |
49 |   function test_2701() external view {
   |   ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to pure
   --> tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol:451:3:
    |
451 |   function _setupTestEnv(uint256 amount) internal returns (TestEnv memory) {
    |   ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> tests/periphery/static-a-token/StataTokenV2Pausable.t.sol:10:3:
   |
10 |   function test_canPause() external {
   |   ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> tests/periphery/static-a-token/StataTokenV2Pausable.t.sol:14:3:
   |
14 |   function test_canPause_shouldReturnFalse(address actor) external {
   |   ^ (Relevant source part starts here and spans across multiple lines).
Test success 🌈
No files changed, compilation skipped

Ran 20 tests for tests/core/ACLManager.t.sol:ACLManagerTest
[PASS] testDefaultAdminRoleAfterDeploy() (gas: 20708)
[PASS] test_defaultAdmin_grantAdminRole_FlashBorrowAdmin() (gas: 65534)
[PASS] test_defaultAdmin_grants_AssetsListingRole() (gas: 37606)
[PASS] test_defaultAdmin_grants_BridgeRole() (gas: 37672)
[PASS] test_defaultAdmin_grants_EmergencyAdminRole() (gas: 37619)
[PASS] test_defaultAdmin_grants_PoolAdminRole() (gas: 37739)
[PASS] test_defaultAdmin_grants_RiskRole() (gas: 37736)
[PASS] test_defaultAdmin_remove_AssetsListingRole() (gas: 29463)
[PASS] test_defaultAdmin_remove_BridgeRole() (gas: 29552)
[PASS] test_defaultAdmin_remove_EmergencyAdminRole() (gas: 29447)
[PASS] test_defaultAdmin_remove_PoolAdminRole() (gas: 29568)
[PASS] test_defaultAdmin_remove_RiskRole() (gas: 29453)
[PASS] test_flashBorrowAdmin_grantRole_FlashBorrowRole() (gas: 91952)
[PASS] test_flashBorrowAdmin_removeRole_FlashBorrowRole() (gas: 76488)
[PASS] test_remove_riskAdmin() (gas: 29463)
[PASS] test_revert_anyUser_grantAdminRole_FlashBorrowAdmin() (gas: 73208)
[PASS] test_revert_deploy_ACLADMIN_zeroAddress() (gas: 1501493)
[PASS] test_reverts_defaultAdmin_notRoleAdmin_addRole_FlashBorrowRole() (gas: 99205)
[PASS] test_reverts_defaultAdmin_notRoleAdmin_revokeRole_FlashBorrowRole() (gas: 125600)
[PASS] test_reverts_notAdmin_grantRole_FlashBorrow() (gas: 115771)
Suite result: ok. 20 passed; 0 failed; 0 skipped; finished in 8.75ms (2.32ms CPU time)

Ran 1 test for tests/template/BaseTest.t.sol:BaseTest
[PASS] test_default() (gas: 261764)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 44.40ms (438.62µs CPU time)

Ran 17 tests for tests/core/ATokenEdgeCases.t.sol:ATokenEdgeCasesTests
[PASS] testApprove() (gas: 45139)
[PASS] testApproveMax() (gas: 45244)
[PASS] testApproveWithZeroAddressSpender() (gas: 42177)
[PASS] testCheckGetters() (gas: 272011)
[PASS] testDecreaseAllowance() (gas: 53103)
[PASS] testIncreaseAllowance() (gas: 53147)
[PASS] testIncreaseAllowanceFromZero() (gas: 48450)
[PASS] testMintToTreasury_amount_zero() (gas: 15809)
[PASS] testTransferFromZeroAmount() (gas: 129573)
[PASS] test_burn_zeroAddress() (gas: 266604)
[PASS] test_mintToZeroAddress() (gas: 82322)
[PASS] test_poolAdmin_setIncentivesController() (gas: 35873)
[PASS] test_revert_notAdmin_setIncentivesController() (gas: 40453)
[PASS] test_reverts_burnAmountScaledZero() (gas: 19463)
[PASS] test_reverts_mintAmountScaledZero() (gas: 19608)
[PASS] test_transferFrom_zeroAddress_origin() (gas: 129385)
[PASS] test_transfer_amount_MAX_UINT_128() (gas: 16482)
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 40.70ms (3.21ms CPU time)

Ran 12 tests for tests/core/BridgeLogic.t.sol:BridgeLogicTests
[PASS] test_backUnbacked_but_unbacked_is_zero_with_fee() (gas: 202439)
[PASS] test_backUnbacked_but_unbacked_is_zero_with_only_fee() (gas: 202497)
[PASS] test_backUnbacked_but_unbacked_is_zero_without_fee() (gas: 167843)
[PASS] test_backUnbacked_onlyFee() (gas: 373138)
[PASS] test_backUnbacked_withFee() (gas: 373317)
[PASS] test_backUnbacked_withoutFee() (gas: 350616)
[PASS] test_multiple_backUnbacked() (gas: 659167)
[PASS] test_multiple_unbackedMint_with_cap() (gas: 500712)
[PASS] test_revert_multiple_unbackedMint_with_cap() (gas: 441275)
[PASS] test_revert_unathorized_unbackedMint() (gas: 30658)
[PASS] test_revert_unbackedMint_zero_cap() (gas: 99159)
[PASS] test_unbackedMint_with_cap() (gas: 279527)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 48.04ms (12.78ms CPU time)

Ran 8 tests for tests/core/ATokenEvents.t.sol:ATokenEventsTests
[PASS] test_atoken_burnEvents_fullBalance() (gas: 588447)
[PASS] test_atoken_burnEvents_multipleWithdrawals_withInterests() (gas: 681872)
[PASS] test_atoken_burnEvents_singleWithdraw_WithInterests() (gas: 599062)
[PASS] test_atoken_burnEvents_singleWithdraw_noInterests() (gas: 266921)
[PASS] test_atoken_burnEvents_withdrawAmountLessThanInterests() (gas: 601910)
[PASS] test_atoken_mintEvents_firstSupply() (gas: 259742)
[PASS] test_atoken_mintEvents_supplyAfterBorrow() (gas: 657714)
[PASS] test_mintToTreasury_events() (gas: 90235)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 45.72ms (10.05ms CPU time)

Ran 13 tests for tests/DeploymentsGasLimits.t.sol:DeploymentsGasLimits
[PASS] test0AaveV3SetupDeployment() (gas: 4827163)
[PASS] test10ConfigEngineDeployment() (gas: 7154681)
[PASS] test11StaticATokenDeployment() (gas: 7073739)
[PASS] test1AaveV3GettersBatch1Deployment() (gas: 7540833)
[PASS] test2AaveV3GettersBatch2Deployment() (gas: 2296630)
[PASS] test3AaveV3PoolDeployment() (gas: 9057735)
[PASS] test4AaveV3L2PoolDeployment() (gas: 9349045)
[PASS] test5PeripheralsRelease() (gas: 7001175)
[PASS] test6MiscDeployment() (gas: 1429036)
[PASS] test7ParaswapDeployment() (gas: 5988177)
[PASS] test8SetupMarket() (gas: 2783895)
[PASS] test9TokensMarket() (gas: 5138969)
[PASS] testCheckInitCodeSizeBatches() (gas: 1060055)
Logs:
  AaveV3SetupBatch 26315
  AaveV3L2PoolBatch 46144
  AaveV3PoolBatch 44694
  AaveV3PeripheryBatch 38221
  AaveV3MiscBatch 7213
  AaveV3ParaswapBatch 33014
  AaveV3GettersBatchOne 37558
  AaveV3GettersBatchTwo 12045
  AaveV3TokensBatch 27018
  AaveV3HelpersBatchOne 36589
  AaveV3HelpersBatchTwo 33401

Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 23.65ms (7.35ms CPU time)

Ran 4 tests for tests/core/ATokenModifiers.t.sol:ATokenModifiersTests
[PASS] test_revert_notAdmin_burn() (gas: 17111)
[PASS] test_revert_notAdmin_mint() (gas: 17206)
[PASS] test_revert_notAdmin_transferOnLiquidation() (gas: 17237)
[PASS] test_revert_notAdmin_transferUnderlyingTo() (gas: 17041)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 45.02ms (265.07µs CPU time)

Ran 9 tests for tests/core/ATokenPermit.t.sol:ATokenPermitTests
[PASS] testCheckDomainSeparator() (gas: 26218)
[PASS] test_cancelPermit() (gas: 100932)
[PASS] test_chain_fork_calculateDomainSeparator() (gas: 33005)
[PASS] test_revert_submitPermit_0_expiration() (gas: 46822)
[PASS] test_revert_submitPermit_invalid_expiration_previosCurrentBlock() (gas: 47304)
[PASS] test_revert_submitPermit_invalid_nonce() (gas: 55218)
[PASS] test_revert_submitPermit_invalid_owner() (gas: 46650)
[PASS] test_revert_submitPermit_invalid_signature() (gas: 55076)
[PASS] test_submitPermit() (gas: 94416)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 41.33ms (3.93ms CPU time)

Ran 3 tests for tests/core/ATokenRepay.t.sol:ATokenRepayTests
[PASS] test_repay_allDebt() (gas: 290914)
[PASS] test_repay_partialDebt() (gas: 290917)
[PASS] test_revert_repay_withoutFunds() (gas: 196882)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 36.89ms (1.84ms CPU time)

Ran 3 tests for tests/core/ATokenRescueTokens.sol:ATokenRescueTokensTests
[PASS] test_rescueTokens() (gas: 78031)
[PASS] test_reverts_rescueTokens_CALLER_NOT_POOL_ADMIN() (gas: 70952)
[PASS] test_reverts_rescueTokens_UNDERLYING_CANNOT_BE_RESCUED() (gas: 71677)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 36.55ms (565.55µs CPU time)

Ran 11 tests for tests/core/ATokenTransfers.t.sol:ATokenTransferTests
[PASS] test_atoken_alice_transfer_all_to_bob() (gas: 162110)
[PASS] test_atoken_alice_transfer_to_bob() (gas: 250607)
[PASS] test_atoken_alice_transfer_to_bob_zero() (gas: 172866)
[PASS] test_atoken_alice_transfer_to_carol_accrues_interests() (gas: 248700)
[PASS] test_atoken_alice_transfer_to_herself() (gas: 81603)
[PASS] test_atoken_alice_transfer_to_herself_zero() (gas: 81646)
[PASS] test_atoken_multiple_transfers() (gas: 201449)
[PASS] test_atoken_transfer_sets_enabled_as_collateral(uint64,uint256) (runs: 1000, μ: 403957, ~: 408111)
[PASS] test_atoken_transfer_some_collateral_from_bob_borrower_to_alice() (gas: 565515)
[PASS] test_atoken_transfer_to_bob_them_bob_borrows() (gas: 419711)
[PASS] test_reverts_atoken_transfer_all_collateral_from_bob_borrower_to_alice() (gas: 420541)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 1.09s (1.05s CPU time)

Ran 12 tests for tests/core/AaveOracle.t.sol:AaveOracleTest
[PASS] testAddSingleSource() (gas: 949431)
[PASS] testAssetZeroPriceAndZeroFallbackPrice() (gas: 1091028)
[PASS] testAssetZeroPriceNonZeroFallback() (gas: 1110979)
[PASS] testAssetZeroPriceWithoutFallback() (gas: 933561)
[PASS] testEmptySource() (gas: 837983)
[PASS] testGetBaseCurrencyPrice() (gas: 12326)
[PASS] testGetPriceViaFallbackOracle() (gas: 1014076)
[PASS] testUpdateFallbackOracle() (gas: 181042)
[PASS] testUpdateSingleSource() (gas: 128174)
[PASS] testUpdateSourceBaseCurrency() (gas: 139662)
[PASS] test_revert_setAssetSources_inconsistentParams() (gas: 834379)
[PASS] test_revert_setAssetSources_wrongCaller() (gas: 24662)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 38.29ms (2.40ms CPU time)

Ran 3 tests for tests/AaveV3BatchDeployment.t.sol:AaveV3BatchDeployment
[PASS] testAaveV3BatchDeploy() (gas: 59466400)
[PASS] testAaveV3BatchDeploymentCheck() (gas: 69699381)
[PASS] testAaveV3L2BatchDeploymentCheck() (gas: 71670201)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 89.57ms (84.27ms CPU time)

Ran 12 tests for tests/AaveV3BatchTests.t.sol:AaveV3BatchTests
[PASS] test0AaveV3SetupDeployment() (gas: 4827250)
[PASS] test10StaticATokenDeployment() (gas: 7073722)
[PASS] test1AaveV3GettersDeployment() (gas: 8958323)
[PASS] test2AaveV3PoolDeployment() (gas: 9057769)
[PASS] test3AaveV3L2PoolDeployment() (gas: 9349122)
[PASS] test4PeripheralsRelease() (gas: 7001197)
[PASS] test5MiscDeployment() (gas: 989047)
[PASS] test6ParaswapRelease() (gas: 5988154)
[PASS] test7SetupMarket() (gas: 2759384)
[PASS] test8TokensMarket() (gas: 5138777)
[PASS] test9ConfigEngineDeployment() (gas: 7154747)
[PASS] testAaveV3FullBatchOrchestration() (gas: 59463936)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 24.59ms (13.24ms CPU time)
2024-08-16T12:56:37.064744Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineAssetEModeUpdate.json", "./reports/postTestEngineAssetEModeUpdate.json", "-o", "./diffs/preTestEngineAssetEModeUpdate_postTestEngineAssetEModeUpdate.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineAssetEModeUpdate_postTestEngineAssetEModeUpdate.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineAssetEModeUpdate_postTestEngineAssetEModeUpdate.md'
}

Node.js v18.20.4
"

Ran 13 tests for tests/core/Pool.Supply.t.sol:PoolSupplyTests
[PASS] test_deprecated_deposit() (gas: 253040)
[PASS] test_first_supply() (gas: 253041)
[PASS] test_first_supply_on_behalf() (gas: 255088)
[PASS] test_reverts_supply_cap() (gas: 116474)
[PASS] test_reverts_supply_invalidAmount() (gas: 58838)
[PASS] test_reverts_supply_reserveFrozen() (gas: 128681)
[PASS] test_reverts_supply_reserveInactive() (gas: 140066)
[PASS] test_reverts_supply_reservePaused() (gas: 99478)
[PASS] test_reverts_supply_to_aToken() (gas: 61373)
[PASS] test_supplyWithPermit(uint128,uint128,uint128) (runs: 1000, μ: 435083, ~: 435131)
[PASS] test_supplyWithPermit_not_failing_if_permit_was_used(uint128,uint128,uint128) (runs: 1000, μ: 435326, ~: 435338)
[PASS] test_supplyWithPermit_should_revert_if_permit_is_less_then_supply_amount(uint128,uint128) (runs: 1000, μ: 298321, ~: 298321)
[PASS] test_supply_after_collateral_enabled() (gas: 302895)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 4.59s (4.56s CPU time)

Ran 11 tests for tests/core/Pool.Withdraw.t.sol:PoolWithdrawTests
[PASS] test_Reverts_withdraw_transferred_funds() (gas: 578305)
[PASS] test_full_withdraw() (gas: 248506)
[PASS] test_full_withdraw_to() (gas: 254035)
[PASS] test_partial_withdraw() (gas: 245010)
[PASS] test_reverts_withdraw_hf_lt_lqt() (gas: 711735)
[PASS] test_reverts_withdraw_invalidAmount() (gas: 261419)
[PASS] test_reverts_withdraw_invalidBalance() (gas: 263488)
[PASS] test_reverts_withdraw_reserveInactive() (gas: 219952)
[PASS] test_reverts_withdraw_reservePaused() (gas: 301069)
[PASS] test_reverts_withdraw_to_atoken() (gas: 261260)
[PASS] test_withdraw_not_enabled_as_collateral() (gas: 261883)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 103.30ms (19.87ms CPU time)

Ran 37 tests for tests/core/Pool.t.sol:PoolTests
[PASS] test_dropReserve() (gas: 114537)
[PASS] test_getBorrowLogic() (gas: 13654)
[PASS] test_getBridgeLogic() (gas: 13696)
[PASS] test_getEModeLogic() (gas: 13631)
[PASS] test_getFlashLoanLogic() (gas: 13633)
[PASS] test_getLiquidationLogic() (gas: 13700)
[PASS] test_getPoolLogic() (gas: 13741)
[PASS] test_getSupplyLogic() (gas: 13631)
[PASS] test_getVirtualUnderlyingBalance() (gas: 260739)
[PASS] test_getters_getUserAccountData() (gas: 626508)
[PASS] test_mintToTreasury() (gas: 728042)
[PASS] test_mintToTreasury_skip_invalid_addresses() (gas: 732752)
[PASS] test_noop_setUserUseReserveAsCollateral_true_when_already_is_activated() (gas: 306941)
[PASS] test_pool_defaultValues() (gas: 4645956)
[PASS] test_rescueTokens(uint256) (runs: 1000, μ: 81903, ~: 82196)
[PASS] test_resetIsolationModeTotalDebt() (gas: 755357)
[PASS] test_reverts_initReserve_not_poolConfigurator(address) (runs: 1000, μ: 25654, ~: 25654)
[PASS] test_reverts_modifiers_not_poolConfigurator(address) (runs: 1000, μ: 128313, ~: 128313)
[PASS] test_reverts_new_Pool_invalidAddressesProvider() (gas: 4634770)
[PASS] test_reverts_setReserveInterestRateStrategyAddress_AssetNotListed(address,address) (runs: 1000, μ: 40900, ~: 40900)
[PASS] test_reverts_setReserveInterestRateStrategyAddress_ZeroAssetAddress(address) (runs: 1000, μ: 22786, ~: 22786)
[PASS] test_reverts_setUserEmode_0_bad_hf() (gas: 978186)
[PASS] test_reverts_setUserUseReserveAsCollateral_false_hf_lower_lqt() (gas: 628342)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_ltv_zero() (gas: 313069)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_reserve_inactive() (gas: 232562)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_reserve_paused() (gas: 307917)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_user_balance_zero() (gas: 82802)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_user_isolation_mode() (gas: 817959)
[PASS] test_setLiquidationGracePeriod(uint40) (runs: 1000, μ: 36979, ~: 37061)
[PASS] test_setLiquidationGracePeriod_assetNotListed(uint40) (runs: 1000, μ: 27155, ~: 27155)
[PASS] test_setReserveInterestRateStrategyAddress() (gas: 960881)
[PASS] test_setUserEmode() (gas: 215689)
[PASS] test_setUserEmode_twice() (gas: 338428)
[PASS] test_setUserEmode_twice_inconsistent_category() (gas: 959077)
[PASS] test_setUserUseReserveAsCollateral_false() (gas: 252486)
[PASS] test_setUserUseReserveAsCollateral_true() (gas: 292016)
[PASS] test_updateBridgeProtocolFee() (gas: 254)
Suite result: ok. 37 passed; 0 failed; 0 skipped; finished in 1.22s (1.16s CPU time)

Ran 22 tests for tests/core/PoolAddressesProvider.t.sol:PoolAddressesProviderTests
[PASS] test_PoolDataProvider_changeContract() (gas: 1504472)
[PASS] test_getter_getMarketId() (gas: 1466843)
[PASS] test_new_PoolAddressesProvider() (gas: 1476100)
[PASS] test_reverts_setAddressAsProxy_notAuth() (gas: 1480293)
[PASS] test_reverts_setAddress_noAuth() (gas: 1485491)
[PASS] test_reverts_setters_notOwner() (gas: 1483161)
[PASS] test_setACLManager_changeContract() (gas: 3077524)
[PASS] test_setACLManager_setACLAdmin() (gas: 2295674)
[PASS] test_setAddress() (gas: 1494352)
[PASS] test_setAddressAsProxy_new_proxy() (gas: 2064791)
[PASS] test_setAddressAsProxy_upgrade_proxy() (gas: 2178805)
[PASS] test_setAddress_updateAddress() (gas: 1503510)
[PASS] test_setPoolConfiguratorImpl() (gas: 6249957)
[PASS] test_setPoolConfiguratorImpl_upgrade() (gas: 10927746)
[PASS] test_setPoolDataProvider() (gas: 1494875)
[PASS] test_setPoolImpl() (gas: 6570854)
[PASS] test_setPoolImpl_upgrade() (gas: 11226411)
[PASS] test_setPriceOracle() (gas: 1495032)
[PASS] test_setPriceOracleSentinel() (gas: 1494903)
[PASS] test_setPriceOracleSentinel_changeContract() (gas: 1504549)
[PASS] test_setPriceOracle_changeContract() (gas: 1504810)
[PASS] test_setter_setMarketId() (gas: 1478048)
Suite result: ok. 22 passed; 0 failed; 0 skipped; finished in 43.26ms (8.20ms CPU time)

Ran 49 tests for tests/core/L2Pool.t.sol:L2PoolTests
[PASS] test_dropReserve() (gas: 114572)
[PASS] test_getBorrowLogic() (gas: 13655)
[PASS] test_getBridgeLogic() (gas: 13697)
[PASS] test_getEModeLogic() (gas: 13632)
[PASS] test_getFlashLoanLogic() (gas: 13653)
[PASS] test_getLiquidationLogic() (gas: 13742)
[PASS] test_getPoolLogic() (gas: 13675)
[PASS] test_getSupplyLogic() (gas: 13654)
[PASS] test_getVirtualUnderlyingBalance() (gas: 260689)
[PASS] test_getters_getUserAccountData() (gas: 626618)
[PASS] test_l2_borrow() (gas: 447898)
[PASS] test_l2_liquidationCall() (gas: 1168902)
[PASS] test_l2_partial_withdraw() (gas: 320233)
[PASS] test_l2_rebalance_borrow() (gas: 101580)
[PASS] test_l2_repay() (gas: 481288)
[PASS] test_l2_repay_atokens() (gas: 488580)
[PASS] test_l2_repay_permit(uint128,uint128,uint128,uint128,uint128) (runs: 1000, μ: 661384, ~: 652285)
[PASS] test_l2_set_user_collateral() (gas: 276801)
[PASS] test_l2_supply() (gas: 258148)
[PASS] test_l2_supply_permit(uint128,uint128) (runs: 1000, μ: 432605, ~: 432608)
[PASS] test_l2_swap_borrow_rate() (gas: 644421)
[PASS] test_l2_withdraw() (gas: 253558)
[PASS] test_mintToTreasury() (gas: 728548)
[PASS] test_mintToTreasury_skip_invalid_addresses() (gas: 733214)
[PASS] test_noop_setUserUseReserveAsCollateral_true_when_already_is_activated() (gas: 307178)
[PASS] test_pool_defaultValues() (gas: 4645967)
[PASS] test_rescueTokens(uint256) (runs: 1000, μ: 81957, ~: 82239)
[PASS] test_resetIsolationModeTotalDebt() (gas: 756024)
[PASS] test_reverts_initReserve_not_poolConfigurator(address) (runs: 1000, μ: 25675, ~: 25675)
[PASS] test_reverts_modifiers_not_poolConfigurator(address) (runs: 1000, μ: 128514, ~: 128514)
[PASS] test_reverts_new_Pool_invalidAddressesProvider() (gas: 4634792)
[PASS] test_reverts_setReserveInterestRateStrategyAddress_AssetNotListed(address,address) (runs: 1000, μ: 40790, ~: 40790)
[PASS] test_reverts_setReserveInterestRateStrategyAddress_ZeroAssetAddress(address) (runs: 1000, μ: 22787, ~: 22787)
[PASS] test_reverts_setUserEmode_0_bad_hf() (gas: 978028)
[PASS] test_reverts_setUserUseReserveAsCollateral_false_hf_lower_lqt() (gas: 628494)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_ltv_zero() (gas: 313187)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_reserve_inactive() (gas: 232527)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_reserve_paused() (gas: 308035)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_user_balance_zero() (gas: 82911)
[PASS] test_reverts_setUserUseReserveAsCollateral_true_user_isolation_mode() (gas: 818106)
[PASS] test_setLiquidationGracePeriod(uint40) (runs: 1000, μ: 36908, ~: 36995)
[PASS] test_setLiquidationGracePeriod_assetNotListed(uint40) (runs: 1000, μ: 27155, ~: 27155)
[PASS] test_setReserveInterestRateStrategyAddress() (gas: 960902)
[PASS] test_setUserEmode() (gas: 215577)
[PASS] test_setUserEmode_twice() (gas: 338048)
[PASS] test_setUserEmode_twice_inconsistent_category() (gas: 958893)
[PASS] test_setUserUseReserveAsCollateral_false() (gas: 252529)
[PASS] test_setUserUseReserveAsCollateral_true() (gas: 292167)
[PASS] test_updateBridgeProtocolFee() (gas: 188)
Suite result: ok. 49 passed; 0 failed; 0 skipped; finished in 6.25s (6.21s CPU time)

Ran 5 tests for tests/core/MathUtils.t.sol:MathUtilsTests
[PASS] test_calculateCompoundInterest_1() (gas: 10358)
[PASS] test_calculateCompoundInterest_2() (gas: 10355)
[PASS] test_calculateCompoundInterest_edge() (gas: 9177)
[PASS] test_calculateLinearInterest() (gas: 9220)
[PASS] test_constants() (gas: 8338)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 1.33ms (175.98µs CPU time)
2024-08-16T12:56:39.326202Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineBorrowNoChange.json", "./reports/postTestEngineBorrowNoChange.json", "-o", "./diffs/preTestEngineBorrowNoChange_postTestEngineBorrowNoChange.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineBorrowNoChange_postTestEngineBorrowNoChange.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineBorrowNoChange_postTestEngineBorrowNoChange.md'
}

Node.js v18.20.4
"

Ran 22 tests for tests/periphery/ParaswapAdapters.t.sol:ParaswapAdaptersTest
[PASS] test_batchClaimToCollector() (gas: 90089)
[PASS] test_batchGetClaimable() (gas: 49436)
[PASS] test_claimToCollector() (gas: 90743)
[PASS] test_getClaimable() (gas: 46540)
[PASS] test_getters() (gas: 13875)
[PASS] test_rescueTokens() (gas: 203738)
[PASS] test_reverts_offset_out_of_range_swap_liquidity_permit_flashloan() (gas: 775714)
[PASS] test_reverts_swapAndDeposit_offset() (gas: 849979)
[PASS] test_reverts_swapAndRepay_offset_out_of_range() (gas: 961322)
[PASS] test_reverts_withdrawAndSwap_offset_out_of_range() (gas: 829848)
[PASS] test_swapAndDeposit() (gas: 934908)
[PASS] test_swapAndDeposit_permit() (gas: 982014)
[PASS] test_swapAndRepay() (gas: 1042300)
[PASS] test_swapAndRepay_flashloan() (gas: 1134714)
[PASS] test_swapAndRepay_flashloan_permit() (gas: 1177385)
[PASS] test_swapAndRepay_no_collateral_leftovers() (gas: 1114821)
[PASS] test_swapAndRepay_permit() (gas: 1089249)
[PASS] test_swap_liquidity_flashloan() (gas: 1048896)
[PASS] test_swap_liquidity_permit_flashloan() (gas: 1091524)
[PASS] test_withdrawAndSwap() (gas: 848860)
[PASS] test_withdrawAndSwap_permit() (gas: 892069)
[PASS] test_withdrawSwapAdapter_reverts_flashloan() (gas: 557729)
Suite result: ok. 22 passed; 0 failed; 0 skipped; finished in 118.81ms (53.78ms CPU time)

Ran 5 tests for tests/core/PercentageMath.t.sol:PercentageMathTests
[PASS] test_constants() (gas: 10180)
[PASS] test_percentDiv() (gas: 11166)
[PASS] test_percentDiv_fuzz(uint256,uint256) (runs: 1000, μ: 10600, ~: 10695)
[PASS] test_percentMul() (gas: 11173)
[PASS] test_percentMul_fuzz(uint256,uint256) (runs: 1000, μ: 10647, ~: 11227)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 136.48ms (135.29ms CPU time)

Ran 33 tests for tests/core/Pool.Borrow.t.sol:PoolBorrowTests
[PASS] test_borrow_variable_in_isolation() (gas: 592498)
[PASS] test_rebalance_borrow_rate() (gas: 84398)
[PASS] test_reverts_borrow_cap() (gas: 318112)
[PASS] test_reverts_borrow_collateral_balance_zero() (gas: 92890)
[PASS] test_reverts_borrow_collateral_can_not_cover() (gas: 336311)
[PASS] test_reverts_borrow_debt_ceiling() (gas: 688501)
[PASS] test_reverts_borrow_debt_ceiling_exceeded() (gas: 418932)
[PASS] test_reverts_borrow_hf_lt_1() (gas: 591271)
[PASS] test_reverts_borrow_inconsistent_emode_category() (gas: 462837)
[PASS] test_reverts_borrow_invalidAmount() (gas: 76172)
[PASS] test_reverts_borrow_invalid_rate() (gas: 317989)
[PASS] test_reverts_borrow_not_borrowable_isolation() (gas: 400922)
[PASS] test_reverts_borrow_reserveFrozen() (gas: 144260)
[PASS] test_reverts_borrow_reserveInactive() (gas: 155556)
[PASS] test_reverts_borrow_reservePaused() (gas: 115038)
[PASS] test_reverts_borrow_sentinel_oracle_down() (gas: 330239)
[PASS] test_reverts_borrow_sioled_borrowing_violation() (gas: 748357)
[PASS] test_reverts_borrow_stable_amount_gt_max_loan_size_stable() (gas: 334687)
[PASS] test_reverts_borrow_stable_borrow_not_enabled() (gas: 379832)
[PASS] test_reverts_borrow_stable_collateral_same_borrow() (gas: 249484)
[PASS] test_reverts_rebalance_borrow_rate_conditions_not_met() (gas: 464513)
[PASS] test_reverts_rebalance_borrow_rate_reserve_inactive() (gas: 139215)
[PASS] test_reverts_rebalance_borrow_rate_reserve_paused() (gas: 98620)
[PASS] test_reverts_swap_borrow_rate_reserve_inactive() (gas: 144598)
[PASS] test_reverts_swap_borrow_rate_reserve_invalid_rate_mode() (gas: 63724)
[PASS] test_reverts_swap_borrow_rate_reserve_paused() (gas: 106135)
[PASS] test_reverts_swap_borrow_rate_reserve_stable_no_debt() (gas: 63625)
[PASS] test_reverts_swap_borrow_rate_reserve_variable_no_debt() (gas: 63675)
[PASS] test_reverts_variable_borrow_transferred_funds() (gas: 405185)
[PASS] test_stable_borrow() (gas: 341630)
[PASS] test_swap_borrow_rate_from_variable_to_stable() (gas: 467307)
[PASS] test_swap_borrow_rate_reserve_frozen() (gas: 537006)
[PASS] test_variable_borrow() (gas: 362645)
Suite result: ok. 33 passed; 0 failed; 0 skipped; finished in 100.48ms (29.97ms CPU time)

Ran 16 tests for tests/core/Pool.FlashLoans.t.sol:PoolFlashLoansTests
[PASS] test_flashloan() (gas: 228617)
[PASS] test_flashloan_borrow() (gas: 553799)
[PASS] test_flashloan_multiple() (gas: 351527)
[PASS] test_flashloan_simple() (gas: 192192)
[PASS] test_flashloan_simple_2() (gas: 192192)
[PASS] test_reverts_flashLoan_invalid_return() (gas: 173503)
[PASS] test_reverts_flashLoan_reserve_inactive() (gas: 142251)
[PASS] test_reverts_flashLoan_reserve_not_flash_loan_enabled() (gas: 94775)
[PASS] test_reverts_flashLoan_reserve_paused() (gas: 91454)
[PASS] test_reverts_flashLoan_same_asset_more_then_once(uint8) (runs: 1000, μ: 169997, ~: 132207)
[PASS] test_reverts_flashLoan_simple_invalid_return() (gas: 144765)
[PASS] test_reverts_flashloan_simple_transferred_funds() (gas: 185276)
[PASS] test_reverts_flashloan_transferred_funds() (gas: 203241)
[PASS] test_reverts_flashloans_eoa() (gas: 101070)
[PASS] test_reverts_supply_flashloan_simple_transfer_withdraw() (gas: 881855)
[PASS] test_reverts_supply_flashloan_transfer_withdraw() (gas: 902101)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 1.12s (1.08s CPU time)
2024-08-16T12:56:41.562651Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineBorrow.json", "./reports/postTestEngineBorrow.json", "-o", "./diffs/preTestEngineBorrow_postTestEngineBorrow.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineBorrow_postTestEngineBorrow.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineBorrow_postTestEngineBorrow.md'
}

Node.js v18.20.4
"

Ran 26 tests for tests/core/PoolConfigurator.ACLModifiers.t.sol:PoolConfiguratorACLModifiersTest
[PASS] test_reverts_disableLiquidationGracePeriod_on_unauth(address,address) (runs: 1000, μ: 38752, ~: 38752)
[PASS] test_reverts_notAdmin_dropReserve(address) (runs: 1000, μ: 36183, ~: 36183)
[PASS] test_reverts_notAdmin_initReserves(address) (runs: 1000, μ: 39024, ~: 39024)
[PASS] test_reverts_notAdmin_setReserveActive(address) (runs: 1000, μ: 36355, ~: 36355)
[PASS] test_reverts_notAdmin_updateAToken(address) (runs: 1000, μ: 35290, ~: 35290)
[PASS] test_reverts_notAdmin_updateFlashLoanPremiumProtocol(address) (runs: 1000, μ: 34101, ~: 34101)
[PASS] test_reverts_notAdmin_updateFlashLoanPremiumTotal(address) (runs: 1000, μ: 34054, ~: 34054)
[PASS] test_reverts_notAdmin_updateStableDebtToken(address) (runs: 1000, μ: 35183, ~: 35183)
[PASS] test_reverts_notAdmin_updateVariableDebtToken(address) (runs: 1000, μ: 35182, ~: 35182)
[PASS] test_reverts_notRiskAdmin_configureReserveAsCollateral(address) (runs: 1000, μ: 38717, ~: 38717)
[PASS] test_reverts_notRiskAdmin_setAssetEModeCategory(address) (runs: 1000, μ: 38748, ~: 38748)
[PASS] test_reverts_notRiskAdmin_setBorrowCap(address) (runs: 1000, μ: 38730, ~: 38730)
[PASS] test_reverts_notRiskAdmin_setEModeCategory(address) (runs: 1000, μ: 39290, ~: 39290)
[PASS] test_reverts_notRiskAdmin_setReserveBorrowing(address) (runs: 1000, μ: 38682, ~: 38682)
[PASS] test_reverts_notRiskAdmin_setReserveFactor(address) (runs: 1000, μ: 38643, ~: 38643)
[PASS] test_reverts_notRiskAdmin_setReserveInterestRateData(address,address) (runs: 1000, μ: 39321, ~: 39321)
[PASS] test_reverts_notRiskAdmin_setReserveInterestRateStrategyAddress(address) (runs: 1000, μ: 39386, ~: 39386)
[PASS] test_reverts_notRiskAdmin_setReserveStableRateBorrowing(address) (runs: 1000, μ: 38770, ~: 38770)
[PASS] test_reverts_notRiskAdmin_setSupplyCap(address) (runs: 1000, μ: 38665, ~: 38665)
[PASS] test_reverts_notRiskOrPoolOrEmergencyAdmin_setReserveFreeze(address) (runs: 1000, μ: 43200, ~: 43200)
[PASS] test_reverts_setDebtCeiling(address) (runs: 1000, μ: 38687, ~: 38687)
[PASS] test_reverts_setPoolPause_noGracePeriod_unauth(address,bool) (runs: 1000, μ: 38702, ~: 38702)
[PASS] test_reverts_setPoolPause_unauth(address,bool,uint40) (runs: 1000, μ: 56412, ~: 56412)
[PASS] test_reverts_setReservePause_noGracePeriod_off_unauth(address,address,bool) (runs: 1000, μ: 38998, ~: 38998)
[PASS] test_reverts_setReservePause_off_unauth(address,address,bool,uint40) (runs: 1000, μ: 38987, ~: 38987)
[PASS] test_reverts_setReservePause_on_unauth(address,address,bool,uint40) (runs: 1000, μ: 39053, ~: 39053)
Suite result: ok. 26 passed; 0 failed; 0 skipped; finished in 3.38s (3.33s CPU time)

Ran 10 tests for tests/core/PoolConfigurator.borrowCaps.t.sol:PoolConfiguratorBorrowCapTests
[PASS] test_borrow_eq_cap() (gas: 332041)
[PASS] test_borrow_interests_reach_cap() (gas: 334103)
[PASS] test_borrow_lt_cap() (gas: 312997)
[PASS] test_default_borrowCap_zero() (gas: 27554)
[PASS] test_reverts_borrow_after_borrow_interests_reach_cap() (gas: 384883)
[PASS] test_reverts_borrow_gt_cap() (gas: 154121)
[PASS] test_reverts_setBorrowCap_gt_max_cap() (gas: 48745)
[PASS] test_reverts_unauthorized_setBorrowCap() (gas: 35582)
[PASS] test_setBorrowCap() (gas: 78888)
[PASS] test_setBorrowCap_them_setBorrowCap_zero() (gas: 333622)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 43.55ms (5.36ms CPU time)

Ran 16 tests for tests/core/PoolConfigurator.eMode.sol:PoolConfiguratorEModeConfigTests
[PASS] test_configureEmodeCategory() (gas: 137301)
[PASS] test_removeEModeCategoryFromAsset() (gas: 177968)
[PASS] test_reverts_configureEmodeCategory_bad_lq() (gas: 170150)
[PASS] test_reverts_configureEmodeCategory_bad_ltv() (gas: 170032)
[PASS] test_reverts_configureEmodeCategory_input_lt_lt_reserve_emode_lt() (gas: 167504)
[PASS] test_reverts_configureEmodeCategory_input_ltv_lt_reserve_emode_ltv() (gas: 175243)
[PASS] test_reverts_configureEmodeCategory_input_ltv_lt_reserve_emode_pendingLtv() (gas: 213939)
[PASS] test_reverts_setAssetEModeCategory_invalid() (gas: 139383)
[PASS] test_reverts_setEmodeCategory_lb_lte_percentageFactor() (gas: 59982)
[PASS] test_reverts_setEmodeCategory_liquidation_threshold_doesnt_match_bonus() (gas: 35964)
[PASS] test_reverts_setEmodeCategory_ltv_gt_liqThreshold() (gas: 34539)
[PASS] test_reverts_setEmodeCategory_zero_liqThreshold() (gas: 34412)
[PASS] test_reverts_setEmodeCategory_zero_ltv() (gas: 34325)
[PASS] test_setAssetEModeCategory() (gas: 164660)
[PASS] test_updateAssetEModeCategory() (gas: 257554)
[PASS] test_updateEModeCategory() (gas: 179075)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 45.06ms (7.32ms CPU time)
2024-08-16T12:56:43.441991Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineCaps.json", "./reports/postTestEngineCaps.json", "-o", "./diffs/preTestEngineCaps_postTestEngineCaps.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineCaps_postTestEngineCaps.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineCaps_postTestEngineCaps.md'
}

Node.js v18.20.4
"

Ran 5 tests for tests/core/PoolConfigurator.initReserves.t.sol:PoolConfiguratorInitReservesTest
[PASS] test_initReserves_multipleAssets() (gas: 12382418)
[PASS] test_initReserves_notEnoughDecimal(uint8) (runs: 1000, μ: 1000881, ~: 1000881)
[PASS] test_initReserves_singleAsset(bool) (runs: 1000, μ: 3167546, ~: 3167551)
[PASS] test_initReserves_zeroAssets() (gas: 62605)
[PASS] test_reverts_initReserves_maxAssets() (gas: 385967012)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 2.07s (2.04s CPU time)

Ran 4 tests for tests/core/PoolConfigurator.liquidationFee.t.sol:PoolConfiguratorLiquidationFeeTests
[PASS] test_revert_setLiquidationFee_gt_100() (gas: 59058)
[PASS] test_revert_setLiquidationFee_unauthorized() (gas: 58926)
[PASS] test_setLiquidationFee() (gas: 78487)
[PASS] test_setLiquidationFee_100() (gas: 78443)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 38.42ms (790.43µs CPU time)
2024-08-16T12:56:45.308394Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineCollateralEdgeBonus.json", "./reports/postTestEngineCollateralEdgeBonus.json", "-o", "./diffs/preTestEngineCollateralEdgeBonus_postTestEngineCollateralEdgeBonus.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineCollateralEdgeBonus_postTestEngineCollateralEdgeBonus.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineCollateralEdgeBonus_postTestEngineCollateralEdgeBonus.md'
}

Node.js v18.20.4
"

Ran 3 tests for tests/core/PoolConfigurator.pendingLTV.t.sol:PoolConfiguratorPendingLtvTests
[PASS] test_freezeReserve_ltvSetTo0() (gas: 107835)
[PASS] test_setLtv_ltvSetPendingLtvSet(uint256,uint256) (runs: 1000, μ: 143834, ~: 143834)
[PASS] test_unfreezeReserve_pendingSetToLtv() (gas: 109196)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 889.49ms (853.26ms CPU time)

Ran 46 tests for tests/core/PoolConfigurator.reserveRiskConfig.t.sol:PoolConfiguratorReserveRiskConfigs
[PASS] test_EmergencyAdminSetReserveFreeze_true() (gas: 137095)
[PASS] test_PoolAdminSetReserveFreeze_true() (gas: 101342)
[PASS] test_RiskAdminSetReserveFreeze_true() (gas: 130772)
[PASS] test_bridgeProtocolFee() (gas: 73038)
[PASS] test_disableLiquidationGracePeriod() (gas: 80653)
[PASS] test_dropReserve() (gas: 152340)
[PASS] test_enableBorrowing() (gas: 3170641)
[PASS] test_enableFlashBorrow() (gas: 3161563)
[PASS] test_enableStableBorrowing() (gas: 3183434)
[PASS] test_reverts_bridgeProtocolFee() (gas: 30233)
[PASS] test_reverts_dropReserve_notListed() (gas: 53487)
[PASS] test_reverts_dropReserve_supplyNotZero() (gas: 320380)
[PASS] test_reverts_dropReserve_variableDebtNotZero() (gas: 484167)
[PASS] test_reverts_dropReserve_zeroAddress() (gas: 47282)
[PASS] test_reverts_enableStableBorrowing_borrowNotEnabled() (gas: 3140635)
[PASS] test_reverts_setCollateralConfig_invalidParams() (gas: 3416227)
[PASS] test_reverts_setDebtCeiling_suppliers() (gas: 302885)
[PASS] test_reverts_setLiquidationProtocolFee_amount_gt_percentageFactor() (gas: 35631)
[PASS] test_reverts_setReserveActive_false_if_suppliers() (gas: 297670)
[PASS] test_reverts_setReserveFactor_gt_percentageFactor() (gas: 35650)
[PASS] test_reverts_setSiloedBorrowing_borrowers() (gas: 430561)
[PASS] test_reverts_updateFlashloanPremiumToProtocol() (gas: 30348)
[PASS] test_reverts_updateFlashloanPremiumTotal() (gas: 30369)
[PASS] test_setBorrowableInIsolation_false() (gas: 65055)
[PASS] test_setBorrowableInIsolation_true() (gas: 67890)
[PASS] test_setCollateralConfig() (gas: 3148173)
[PASS] test_setDebtCeiling() (gas: 121242)
[PASS] test_setDebtCeiling_suppliers_ltZero() (gas: 306163)
[PASS] test_setDebtCeiling_to_zero() (gas: 146169)
[PASS] test_setFrozenReserveFreeze_true_revert() (gas: 108200)
[PASS] test_setLiquidationGracePeriodAboveCap(uint40) (runs: 1000, μ: 34882, ~: 34882)
[PASS] test_setLiquidationGracePeriodPool(uint40) (runs: 1000, μ: 137667, ~: 140100)
[PASS] test_setLiquidationGracePeriodReserve(uint40) (runs: 1000, μ: 135342, ~: 135342)
[PASS] test_setLiquidationProtocolFee_amount_gt_percentageFactor() (gas: 74750)
[PASS] test_setPoolPause() (gas: 136648)
[PASS] test_setPoolPause_unpause() (gas: 192313)
[PASS] test_setReserveActive_false() (gas: 118364)
[PASS] test_setReserveActive_true() (gas: 69271)
[PASS] test_setReserveFactor() (gas: 1047332)
[PASS] test_setReserveFreeze_false() (gas: 100861)
[PASS] test_setReservePause_false() (gas: 68533)
[PASS] test_setReservePause_true() (gas: 71285)
[PASS] test_setSiloedBorrowing() (gas: 125923)
[PASS] test_setUnfrozenReserveFreeze_false_revert() (gas: 48795)
[PASS] test_updateFlashloanPremiumToProtocol() (gas: 58448)
[PASS] test_updateFlashloanPremiumTotal() (gas: 58386)
Suite result: ok. 46 passed; 0 failed; 0 skipped; finished in 1.40s (1.36s CPU time)

Ran 11 tests for tests/core/PoolConfigurator.supplyCaps.t.sol:PoolConfiguratorSupplyCapTests
[PASS] test_default_supplyCap_zero() (gas: 27532)
[PASS] test_multiple_setSupplyCap() (gas: 383991)
[PASS] test_reverts_interests_gt_cap_and_supply() (gas: 498440)
[PASS] test_reverts_setSupplyCap_gt_max_cap() (gas: 48724)
[PASS] test_reverts_supply_gt_cap() (gas: 135930)
[PASS] test_reverts_unauthorized_setSupplyCap() (gas: 35542)
[PASS] test_setSupplyCap() (gas: 78946)
[PASS] test_setSupplyCap_them_setBorrowCap_zero() (gas: 331238)
[PASS] test_supply_eq_cap() (gas: 312388)
[PASS] test_supply_interests_reach_cap() (gas: 455792)
[PASS] test_supply_lt_cap() (gas: 312389)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 42.89ms (5.69ms CPU time)

Ran 6 tests for tests/core/PoolConfigurator.upgradeabilty.t.sol:PoolConfiguratorUpgradeabilityTests
[PASS] test_getConfiguratorLogic() (gas: 13601)
[PASS] test_interestRateStrategy_update() (gas: 1965254)
[PASS] test_setReserveInterestRateStrategyAddress() (gas: 1081867)
[PASS] test_updateAToken() (gas: 2346693)
[PASS] test_updateStableDebtToken() (gas: 1243918)
[PASS] test_updateVariableDebtToken() (gas: 1732662)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 41.86ms (4.39ms CPU time)

Ran 3 tests for tests/core/PoolLogic.initReserves.edge.t.sol:PoolLogicInitReservesTests
[PASS] test_initReserves_return_false_after_dropped_reserve() (gas: 755300)
[PASS] test_reverts_initReserves_max() (gas: 222618)
[PASS] test_reverts_initReserves_reserveAlreadyAdded() (gas: 246207)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 37.51ms (693.10µs CPU time)

Ran 11 tests for tests/core/PriceOracleSentinel.t.sol:PriceOracleSentinelTest
[PASS] test_isBorrowAllowed_network_down() (gas: 27254)
[PASS] test_isBorrowAllowed_network_up_not_grace_period() (gas: 46960)
[PASS] test_isBorrowAllowed_true_network_up_grace_period_pass() (gas: 47013)
[PASS] test_isLiquidationAllowed_network_down() (gas: 27165)
[PASS] test_isLiquidationAllowed_network_up_not_grace_period() (gas: 46937)
[PASS] test_isLiquidationAllowed_true_network_up_grace_period_pass() (gas: 47034)
[PASS] test_new_PriceOracleSentinel() (gas: 432463)
[PASS] test_reverts_setGracePeriod_not_poolAdmin() (gas: 25864)
[PASS] test_reverts_setSequencerOracle_not_poolAdmin() (gas: 22767)
[PASS] test_setGracePeriod() (gas: 32524)
[PASS] test_setSequencerOracle() (gas: 24656)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 38.43ms (1.00ms CPU time)
2024-08-16T12:56:47.142705Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineCollateral.json", "./reports/postTestEngineCollateral.json", "-o", "./diffs/preTestEngineCollateral_postTestEngineCollateral.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineCollateral_postTestEngineCollateral.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineCollateral_postTestEngineCollateral.md'
}

Node.js v18.20.4
"
2024-08-16T12:56:48.972400Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineCollateralNoChange.json", "./reports/postTestEngineCollateralNoChange.json", "-o", "./diffs/preTestEngineCollateralNoChange_postTestEngineCollateralNoChange.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineCollateralNoChange_postTestEngineCollateralNoChange.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineCollateralNoChange_postTestEngineCollateralNoChange.md'
}

Node.js v18.20.4
"

Ran 16 tests for tests/periphery/static-a-token/ERC20AaveLMUpgradable.t.sol:ERC20AaveLMUpgradableTest
[PASS] test_2701() (gas: 3450)
[PASS] test_claimRewards(uint256,uint32,uint88,uint32) (runs: 1000, μ: 850972, ~: 815455)
[PASS] test_claimRewardsOnBehalfOf_self(uint256,uint32,uint88,uint32) (runs: 1000, μ: 851795, ~: 815759)
[PASS] test_claimRewardsOnBehalfOf_shouldRevertForInvalidClaimer(uint256,uint32,uint88,uint32) (runs: 1000, μ: 789812, ~: 791631)
[PASS] test_claimRewardsOnBehalfOf_validClaimer(uint256,uint32,uint88,uint32) (runs: 1000, μ: 884966, ~: 848183)
[PASS] test_claimRewardsToSelf(uint256,uint32,uint88,uint32) (runs: 1000, μ: 854260, ~: 815456)
[PASS] test_claimableRewards(uint256,uint32,uint88,uint32) (runs: 1000, μ: 790640, ~: 792434)
[PASS] test_collectAndUpdateRewards(uint256,uint32,uint88,uint32) (runs: 1000, μ: 835022, ~: 812067)
[PASS] test_correctAccountingForDelayedRegistration() (gas: 841205)
[PASS] test_getReferenceAsset() (gas: 12915)
[PASS] test_isRegisteredRewardToken() (gas: 651829)
[PASS] test_noRewardsInitialized() (gas: 39278)
[PASS] test_noopWhenNotInitialized() (gas: 53277)
[PASS] test_rewardTokens() (gas: 649991)
[PASS] test_transfer(uint256,uint32,uint88,uint32,address,uint256) (runs: 1000, μ: 863939, ~: 882515)
[PASS] test_transfer_toSelf(uint256,uint32,uint88,uint32) (runs: 1000, μ: 823162, ~: 816396)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 17.14s (17.09s CPU time)
2024-08-16T12:56:50.812502Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineEModeCategoryUpdate.json", "./reports/postTestEngineEModeCategoryUpdate.json", "-o", "./diffs/preTestEngineEModeCategoryUpdate_postTestEngineEModeCategoryUpdate.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineEModeCategoryUpdate_postTestEngineEModeCategoryUpdate.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineEModeCategoryUpdate_postTestEngineEModeCategoryUpdate.md'
}

Node.js v18.20.4
"
2024-08-16T12:56:52.824460Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineEModeCategoryNoChange.json", "./reports/postTestEngineEModeCategoryNoChange.json", "-o", "./diffs/preTestEngineEModeCategoryNoChange_postTestEngineEModeCategoryNoChange.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineEModeCategoryNoChange_postTestEngineEModeCategoryNoChange.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineEModeCategoryNoChange_postTestEngineEModeCategoryNoChange.md'
}

Node.js v18.20.4
"
2024-08-16T12:56:55.170017Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineListing.json", "./reports/postTestEngineListing.json", "-o", "./diffs/preTestEngineListing_postTestEngineListing.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineListing_postTestEngineListing.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineListing_postTestEngineListing.md'
}

Node.js v18.20.4
"
2024-08-16T12:56:57.116739Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineListingCustom.json", "./reports/postTestEngineListingCustom.json", "-o", "./diffs/preTestEngineListingCustom_postTestEngineListingCustom.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineListingCustom_postTestEngineListingCustom.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineListingCustom_postTestEngineListingCustom.md'
}

Node.js v18.20.4
"
2024-08-16T12:56:58.958325Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEnginePriceFeed.json", "./reports/postTestEnginePriceFeed.json", "-o", "./diffs/preTestEnginePriceFeed_postTestEnginePriceFeed.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEnginePriceFeed_postTestEnginePriceFeed.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEnginePriceFeed_postTestEnginePriceFeed.md'
}

Node.js v18.20.4
"

Ran 21 tests for tests/core/Pool.Liquidations.t.sol:PoolLiquidationTests
[PASS] test_full_liquidate_atokens_multiple_variable_borrows() (gas: 1434391)
[PASS] test_full_liquidate_multiple_supplies_and_variable_borrows() (gas: 1639108)
[PASS] test_full_liquidate_multiple_variable_borrows() (gas: 1492052)
[PASS] test_liquidate_emode_position_with_emode_oracle() (gas: 1505579)
[PASS] test_liquidate_emode_position_without_emode_oracle() (gas: 1475714)
[PASS] test_liquidate_isolated_position() (gas: 1407983)
[PASS] test_liquidate_variable_borrow() (gas: 1532810)
[PASS] test_liquidate_variable_borrow_no_fee() (gas: 1241226)
[PASS] test_liquidate_variable_borrow_same_collateral_and_borrow() (gas: 1177091)
[PASS] test_liquidation_when_grace_period_disabled(uint40) (runs: 1000, μ: 1354112, ~: 1354112)
[PASS] test_liquidation_with_liquidation_grace_period_collateral_active(uint40) (runs: 1000, μ: 1562936, ~: 1575525)
[PASS] test_liquidation_with_liquidation_grace_period_debt_active(uint40) (runs: 1000, μ: 1563340, ~: 1573422)
[PASS] test_liquidation_with_liquidation_grace_period_debt_collateral_active(uint40) (runs: 1000, μ: 1580086, ~: 1590409)
[PASS] test_partial_liquidate_atokens_variable_borrow() (gas: 1350838)
[PASS] test_partial_liquidate_variable_borrow() (gas: 1302484)
[PASS] test_reverts_liquidation_collateral_not_active() (gas: 653759)
[PASS] test_reverts_liquidation_hf_gt_liquidation_threshold() (gas: 488300)
[PASS] test_reverts_liquidation_invalid_borrow() (gas: 634781)
[PASS] test_reverts_liquidation_oracle_sentinel_on() (gas: 335491)
[PASS] test_reverts_liquidation_reserveInactive() (gas: 167280)
[PASS] test_reverts_liquidation_reservePaused() (gas: 126847)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 18.46s (18.42s CPU time)
2024-08-16T12:57:01.101246Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^0.16.2", "diff-snapshots", "./reports/preTestEngineRates.json", "./reports/postTestEngineRates.json", "-o", "./diffs/preTestEngineRates_postTestEngineRates.md"] stderr="node:fs:596
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './diffs/preTestEngineRates_postTestEngineRates.md'
    at Object.openSync (node:fs:596:3)
    at Object.writeFileSync (node:fs:2322:35)
    at Command.<anonymous> (file:///home/runner/work/aave-v3-origin/aave-v3-origin/node_modules/@bgd-labs/aave-cli/dist/cli.js:870:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './diffs/preTestEngineRates_postTestEngineRates.md'
}

Node.js v18.20.4
"

Ran 17 tests for tests/periphery/v3-config-engine/AaveV3ConfigEngineTest.t.sol:AaveV3ConfigEngineTest
[PASS] testAssetEModeUpdates() (gas: 4001489)
[PASS] testBorrowUpdatesNoChange() (gas: 3173866)
[PASS] testBorrowsUpdates() (gas: 3241778)
[PASS] testCapsUpdate() (gas: 3172356)
[PASS] testCollateralUpdateCorrectBonus() (gas: 3187976)
[PASS] testCollateralUpdateWrongBonus() (gas: 777514)
[PASS] testCollateralsUpdates() (gas: 3187442)
[PASS] testCollateralsUpdatesNoChange() (gas: 3166428)
[PASS] testEModeCategoryUpdates() (gas: 3227894)
[PASS] testEModeCategoryUpdatesNoChange() (gas: 3162887)
[PASS] testEModeCategoryUpdatesWrongBonus() (gas: 771548)
[PASS] testFailCollateralsUpdatesNoChange() (gas: 1900428)
[PASS] testFailEModeCategoryUpdatesNoChange() (gas: 788954)
[PASS] testListings() (gas: 7176795)
[PASS] testListingsCustom() (gas: 12060295)
[PASS] testPriceFeedsUpdates() (gas: 3249284)
[PASS] testRateStrategiesUpdates() (gas: 3241057)
Suite result: ok. 17 passed; 0 failed; 0 skipped; finished in 26.54s (26.50s CPU time)

Ran 1 test for tests/AaveV3PermissionsTest.t.sol:AaveV3PermissionsTest
[PASS] testCheckPermissions() (gas: 58445791)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 27.52ms (22.46ms CPU time)

Ran 7 tests for tests/core/AddressesProviderRegistry.t.sol:PoolAddressesProviderRegistryTest
[PASS] testAddAddressesProvider() (gas: 120670)
[PASS] testRemoveAddressesProvider() (gas: 97213)
[PASS] testRemoveMultipleAddressesProvider() (gas: 243012)
[PASS] test_addressesProviderAddedToRegistry() (gas: 16407)
[PASS] test_removesLastProvider() (gas: 32691)
[PASS] test_revert_registry_0() (gas: 15592)
[PASS] test_revert_removeNonExistingAddressesProvider() (gas: 27656)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 39.04ms (1.66ms CPU time)

Ran 9 tests for tests/periphery/EmissionsManager.t.sol:EmissionManagerTest
[PASS] test_configureAssets() (gas: 602198)
[PASS] test_new_EmissionManager() (gas: 776194)
[PASS] test_setClaimer() (gas: 51492)
[PASS] test_setDistributionEnd() (gas: 609489)
[PASS] test_setEmissionAdmin() (gas: 43028)
[PASS] test_setEmissionPerSecond() (gas: 616148)
[PASS] test_setRewardOracle() (gas: 692227)
[PASS] test_setRewardsController() (gas: 19100)
[PASS] test_setTransferStrategy() (gas: 896512)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 40.92ms (2.06ms CPU time)

Ran 6 tests for tests/core/InitializableImmutableAdminUpgradeabilityProxy.t.sol:InitializableImmutableAdminUpgradeabilityProxyTests
[PASS] test_proxy_fallback() (gas: 609072)
[PASS] test_proxy_upgradeTo() (gas: 631037)
[PASS] test_proxy_upgradeToAndCall() (gas: 636947)
[PASS] test_proxy_upgradeToAndCall_initialize() (gas: 606146)
[PASS] test_reverts_upgradeToAndCall_notAdmin() (gas: 612062)
[PASS] test_reverts_upgradeTo_notAdmin() (gas: 609855)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 3.01ms (1.63ms CPU time)

Ran 32 tests for tests/core/RateStrategy.t.sol:RateStrategyTests
[PASS] test_calculate_rates_100_percent_usage() (gas: 63823)
[PASS] test_calculate_rates_100_percent_usage_50_percent_stable_debt_50_percent_variable_debt_10_percent_avg_stable_rate() (gas: 63919)
[PASS] test_calculate_rates_80_bps_usage() (gas: 63932)
[PASS] test_calculate_rates_80_percent_usage() (gas: 108885)
[PASS] test_calculate_rates_80_percent_usage_and_50_percent_supply_usage_due_minted_tokens() (gas: 62185)
[PASS] test_calculate_rates_80_percent_usage_and_80_bps_supply_usage_due_minted_tokens() (gas: 62229)
[PASS] test_calculate_rates_above_op_usage(uint16,uint256,uint256,uint32,uint32,uint32,uint256) (runs: 1000, μ: 143286, ~: 143381)
[PASS] test_calculate_rates_below_op_usage(uint16,uint256,uint256,uint32,uint32,uint32,uint256) (runs: 1000, μ: 135757, ~: 135777)
[PASS] test_calculate_rates_below_op_usage_when_no_debt(uint16,uint256,uint32,uint32,uint32,uint256) (runs: 1000, μ: 91729, ~: 92147)
[PASS] test_calculate_rates_empty_reserve(uint16,uint32,uint32,uint32) (runs: 1000, μ: 57741, ~: 57741)
[PASS] test_calculate_rates_when_not_using_virtual_valance(uint16,uint256,uint32,uint32,uint32,uint256) (runs: 1000, μ: 84416, ~: 84954)
[PASS] test_calculate_rates_when_total_debt_0(uint16,uint256,uint32,uint32,uint32,uint256) (runs: 1000, μ: 84753, ~: 85350)
[PASS] test_fuzz_calculate_rates_80_percent_usage_added_and_virtual_equal(uint256) (runs: 1000, μ: 33870, ~: 33870)
[PASS] test_getInterestRateDataBps(uint16,uint32,uint32,uint32) (runs: 1000, μ: 53124, ~: 53124)
[PASS] test_getInterestRateDataRay(uint16,uint32,uint32,uint32) (runs: 1000, μ: 54037, ~: 54037)
[PASS] test_getMaxVariableBorrowRate(uint16,uint32,uint32,uint32) (runs: 1000, μ: 51619, ~: 51619)
[PASS] test_initialization() (gas: 14056)
[PASS] test_new_DefaultReserveInterestRateStrategy_wrong_provider() (gas: 42185)
[PASS] test_new_SetReserveInterestRateParams(uint16,uint32,uint32,uint32) (runs: 1000, μ: 65231, ~: 65231)
[PASS] test_new_SetReserveInterestRateParams_override_method(uint16,uint32,uint32,uint32) (runs: 1000, μ: 64604, ~: 64604)
[PASS] test_new_SetReserveInterestRateParams_override_method_when_not_configurator(uint16,uint32,uint32,uint32) (runs: 1000, μ: 21252, ~: 21252)
[PASS] test_new_SetReserveInterestRateParams_when_not_configurator(uint16,uint32,uint32,uint32) (runs: 1000, μ: 21917, ~: 21917)
[PASS] test_reverts_SetReserveInterestRateParams_when_gt_maxRate(uint16,uint32,uint32,uint32) (runs: 1000, μ: 25544, ~: 25544)
[PASS] test_reverts_SetReserveInterestRateParams_when_gt_maxRate_override_method(uint16,uint32,uint32,uint32) (runs: 1000, μ: 24911, ~: 24911)
[PASS] test_reverts_SetReserveInterestRateParams_when_gt_max_op(uint16,uint32,uint32,uint32) (runs: 1000, μ: 22631, ~: 22631)
[PASS] test_reverts_SetReserveInterestRateParams_when_gt_max_op_override_method(uint16,uint32,uint32,uint32) (runs: 1000, μ: 21997, ~: 21997)
[PASS] test_reverts_SetReserveInterestRateParams_when_lt_min_op(uint16,uint32,uint32,uint32) (runs: 1000, μ: 22636, ~: 22636)
[PASS] test_reverts_SetReserveInterestRateParams_when_lt_min_op_override_method(uint16,uint32,uint32,uint32) (runs: 1000, μ: 22001, ~: 22001)
[PASS] test_reverts_SetReserveInterestRateParams_when_reserve_0(uint16,uint32,uint32,uint32) (runs: 1000, μ: 19289, ~: 19289)
[PASS] test_reverts_SetReserveInterestRateParams_when_reserve_0_override_method(uint16,uint32,uint32,uint32) (runs: 1000, μ: 18585, ~: 18585)
[PASS] test_reverts_SetReserveInterestRateParams_when_slope1_gt_slope2(uint16,uint32,uint32,uint32) (runs: 1000, μ: 23928, ~: 23928)
[PASS] test_reverts_SetReserveInterestRateParams_when_slope1_gt_slope2_override_method(uint16,uint32,uint32,uint32) (runs: 1000, μ: 23927, ~: 23927)
Suite result: ok. 32 passed; 0 failed; 0 skipped; finished in 18.40s (18.36s CPU time)

Ran 2 tests for tests/core/RatesOverflow.t.sol:RatesOverflowCheckTests
[PASS] test_overflow_liquidity_rates() (gas: 97840)
[PASS] test_overflow_variable_rates() (gas: 433017)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 38.25ms (856.71µs CPU time)

Ran 19 tests for tests/periphery/RewardsController.t.sol:RewardsControllerTest
[PASS] test_accrueRewards() (gas: 952778)
[PASS] test_claimAllRewards() (gas: 903471)
[PASS] test_claimAllRewardsOnBehalf() (gas: 937197)
[PASS] test_claimAllRewardsToSelf() (gas: 903097)
[PASS] test_claimRewards() (gas: 900234)
[PASS] test_claimRewardsOnBehalf() (gas: 938790)
[PASS] test_claimRewardsToSelf() (gas: 899915)
[PASS] test_claimRewards_partial() (gas: 900507)
[PASS] test_claimRewards_zero() (gas: 640635)
[PASS] test_claimRewards_zero_with_rewards() (gas: 647487)
[PASS] test_configureAssets() (gas: 621605)
[PASS] test_initialize_no_op() (gas: 3736168)
[PASS] test_new_RewardsController() (gas: 3712512)
[PASS] test_reverts_initialize_twice() (gas: 3737756)
[PASS] test_setClaimer() (gas: 58290)
[PASS] test_setDistributionEnd() (gas: 637515)
[PASS] test_setEmissionPerSecond() (gas: 641682)
[PASS] test_setRewardOracle() (gas: 716252)
[PASS] test_setTransferStrategy_PullRewardsTransferStrategy() (gas: 921447)
Suite result: ok. 19 passed; 0 failed; 0 skipped; finished in 55.47ms (11.90ms CPU time)

Ran 1 test for tests/core/ScaledBalanceTokenBase.t.sol:ScaledBalanceTokenBaseEdgeTests
[PASS] test_scaled_balance_token_base_alice_transfer_to_bob_accrues_interests() (gas: 98875)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 34.87ms (207.30µs CPU time)

Ran 22 tests for tests/core/StableDebtToken.t.sol:StableDebtTokenEventsTests
[PASS] test_balanceOf() (gas: 15757)
[PASS] test_cancel_delegationWithSig() (gas: 101965)
[PASS] test_default_revision() (gas: 1098437)
[PASS] test_delegationWithSig() (gas: 95356)
[PASS] test_getAverageStableRate() (gas: 13475)
[PASS] test_getSupplyData() (gas: 15090)
[PASS] test_getTotalSupplyAndAvgRate() (gas: 14093)
[PASS] test_getTotalSupplyLastUpdated() (gas: 13592)
[PASS] test_getUserLastUpdated() (gas: 15926)
[PASS] test_getUserStableRate() (gas: 15852)
[PASS] test_initialize_StableDebtToken() (gas: 2253069)
[PASS] test_mint_stableDebt_caller_alice() (gas: 2257929)
[PASS] test_mint_stableDebt_caller_bob_onBehalf_alice() (gas: 2290889)
[PASS] test_new_StableDebtToken_implementation() (gas: 1112468)
[PASS] test_principalBalanceOf() (gas: 15788)
[PASS] test_reverts_bad_expiration_delegationWithSig() (gas: 34392)
[PASS] test_reverts_bad_nonce_delegationWithSig() (gas: 111271)
[PASS] test_reverts_initialize_pool_do_not_match() (gas: 2185777)
[PASS] test_reverts_initialize_twice() (gas: 3214693)
[PASS] test_reverts_operation_not_supported() (gas: 1141516)
[PASS] test_reverts_zero_address_delegationWithSig() (gas: 33655)
[PASS] test_totalSupply() (gas: 13586)
Suite result: ok. 22 passed; 0 failed; 0 skipped; finished in 46.21ms (7.84ms CPU time)

Ran 5 tests for tests/periphery/StakedTokenTransferStrategy.t.sol:StakedTokenTransferStrategyTest
[PASS] test_dropApproval() (gas: 19000)
[PASS] test_emergencyTransfer() (gas: 219104)
[PASS] test_getters() (gas:...*[Comment body truncated]*

using SafeCast for uint256;
using WadRayMath for uint256;
using RayMathExplicitRounding for uint256;

error StaticATokenLMInvalidZeroShares();
Copy link

@sakulstra sakulstra Aug 12, 2024

Choose a reason for hiding this comment

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

would remove the LM part of the error.
Probably we should just call it Stata everwhere we currently call it StaticATokenLM

Also should be on the interface imo.

Copy link
Author

Choose a reason for hiding this comment

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

Agree, will extract all base logic without LM to Stata4626

uint256 assets,
Math.Rounding rounding
) internal view virtual override returns (uint256) {
if (Math.unsignedRoundsUp(rounding)) return assets.rayDivRoundUp(rate());

Choose a reason for hiding this comment

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

why unsignedRoundsUp and not just Math.Rounding.Ceil == rounding

Copy link
Author

Choose a reason for hiding this comment

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

Because Math.Rounding factually has 2 roundings up, even if the second one is not used, but OZ does it that way. So it's mostly type protection

Choose a reason for hiding this comment

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

Idk would not do. Adds some gas and is clearly unnecessary

uint256 shares,
Math.Rounding rounding
) internal view virtual override returns (uint256) {
if (Math.unsignedRoundsUp(rounding)) return shares.rayMulRoundUp(rate());

Choose a reason for hiding this comment

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

same here. In the end should just be a bit more gas optimized to do single equation vs mod & equation

Copy link
Author

Choose a reason for hiding this comment

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

answered before

return currentSupply > supplyCap ? 0 : supplyCap - currentSupply;
}

///@inheritdoc IStaticATokenLM
function latestAnswer() external view returns (int256) {
return

Choose a reason for hiding this comment

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

honestly i don't like the refactoring.
In my eyes it makes the code less clean - logic is the same ofc, but imo is less sound.

Right now it reads as: price * interest / denominator. Which first look makes sense.
New version reads as: price ... converted to assets. Which first glance looks just weird.

Copy link
Author

Choose a reason for hiding this comment

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

I agree, but it reduces the logic duplication

Choose a reason for hiding this comment

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

Imo not all duplication is bad when it improves readability

* Separate Stata4626

* change to erc7201

* regenerated storage location

* change latestAnswer calculation logic

* DRAFT: Refactoring in extensions style

* add initializer

* remove unused params at __Stata4626_init

* remove RayMathExplicitRounding

* regenerated ERC20AaveLMStorageLocation

* add RAY constant

* remove IInitializableStata4626LM

* depositWithPermit

* disclamer on _update overload

* some descriptions cleanup

* change require to revert

* add comment to latestAnswer calc

* add comment to latestAnswer calc -1

* make ERC20AaveLMUpgradable abstract

* update license

* rename merger and 4626 contracts

* change Upgradable to Upgradeable

* move _disableInitializers into StataTokenV2

* rename IStata4626 to IERC4626StataToken

* rename init on ERC4626StataToken

* Changes on stata initializations, to follow more strict guidelines

* Changes to make stata more consistent with using ERC20 extensions

* Fix on function called on initialize of stata

* feat: improved tests

* fix: update test

* feat: add erc4626 tests

* fix: migrate some more tests

* fix: improve tests

* refactor: move to dedicated files

* feat: improve tests

* fix typo

* feat: add permit tests

* fix: linting

* feat: improved docs

* fix: typos

* fix: use internal function

---------

Co-authored-by: eboado <[email protected]>
Co-authored-by: sakulstra <[email protected]>
@sakulstra sakulstra changed the base branch from feat/use-oz to project-a August 16, 2024 12:38
@sakulstra sakulstra merged commit 63dc7f2 into project-a Aug 16, 2024
2 checks passed
@sakulstra sakulstra deleted the ref/more-oz-to-stata branch August 16, 2024 12:58
sakulstra added a commit that referenced this pull request Sep 19, 2024
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