From 734d8829bb52de3f5e11979cae41e09e21393677 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 19 Sep 2024 15:49:30 +0200 Subject: [PATCH] feat: v3.2.0 upgrade --- .gitmodules | 1 + lib/aave-v3-origin | 2 +- scripts/configs/abis.ts | 4 ++-- src/AaveV3.sol | 30 +++++++++++++++--------------- src/common/IMigrationHelper.sol | 4 ++-- src/common/IOwnable.sol | 6 +++--- src/test/AaveV2Ethereum.t.sol | 22 +++++++++++----------- src/test/AaveV2Misfits.t.sol | 2 +- src/test/AaveV3Avalanche.t.sol | 16 ++++++++-------- 9 files changed, 44 insertions(+), 43 deletions(-) diff --git a/.gitmodules b/.gitmodules index b6fb91d2..6b7e25eb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "lib/aave-v3-origin"] path = lib/aave-v3-origin url = https://github.com/aave-dao/aave-v3-origin + branch = v3.2.0 diff --git a/lib/aave-v3-origin b/lib/aave-v3-origin index 3aad8ca1..be45428a 160000 --- a/lib/aave-v3-origin +++ b/lib/aave-v3-origin @@ -1 +1 @@ -Subproject commit 3aad8ca184159732e4b3d8c82cd56a8707a106a2 +Subproject commit be45428a4c927e2a0d73a3c89901a3ed4c207887 diff --git a/scripts/configs/abis.ts b/scripts/configs/abis.ts index c095ffb6..4873d05f 100644 --- a/scripts/configs/abis.ts +++ b/scripts/configs/abis.ts @@ -16,11 +16,11 @@ export const ABI_INTERFACES = [ 'IGovernancePowerStrategy', 'IDataWarehouse', 'IExecutorWithTimelock', - 'lib/aave-v3-origin/src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol:IERC20', + 'lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol:IERC20', 'IERC20Detailed', 'IAToken', 'IDefaultInterestRateStrategy', - 'lib/aave-v3-origin/src/core/contracts/interfaces/IAaveOracle.sol:IAaveOracle', + 'lib/aave-v3-origin/src/contracts/interfaces/IAaveOracle.sol:IAaveOracle', 'IExecutor', 'ICrossChainController', 'IWithGuardian', diff --git a/src/AaveV3.sol b/src/AaveV3.sol index a7669e09..a65486aa 100644 --- a/src/AaveV3.sol +++ b/src/AaveV3.sol @@ -1,21 +1,21 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0; -import {DataTypes} from 'aave-v3-origin/core/contracts/protocol/libraries/types/DataTypes.sol'; -import {Errors} from 'aave-v3-origin/core/contracts/protocol/libraries/helpers/Errors.sol'; -import {ConfiguratorInputTypes} from 'aave-v3-origin/core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol'; -import {IPoolAddressesProvider} from 'aave-v3-origin/core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IAToken} from 'aave-v3-origin/core/contracts/interfaces/IAToken.sol'; -import {IPool} from 'aave-v3-origin/core/contracts/interfaces/IPool.sol'; -import {IPoolConfigurator} from 'aave-v3-origin/core/contracts/interfaces/IPoolConfigurator.sol'; -import {IPriceOracleGetter} from 'aave-v3-origin/core/contracts/interfaces/IPriceOracleGetter.sol'; -import {IAaveOracle} from 'aave-v3-origin/core/contracts/interfaces/IAaveOracle.sol'; -import {IACLManager as BasicIACLManager} from 'aave-v3-origin/core/contracts/interfaces/IACLManager.sol'; -import {IPoolDataProvider} from 'aave-v3-origin/core/contracts/interfaces/IPoolDataProvider.sol'; -import {IDefaultInterestRateStrategyV2} from 'aave-v3-origin/core/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; -import {IReserveInterestRateStrategy} from 'aave-v3-origin/core/contracts/interfaces/IReserveInterestRateStrategy.sol'; -import {IPoolDataProvider as IAaveProtocolDataProvider} from 'aave-v3-origin/core/contracts/interfaces/IPoolDataProvider.sol'; -import {AggregatorInterface} from 'aave-v3-origin/core/contracts/dependencies/chainlink/AggregatorInterface.sol'; +import {DataTypes} from 'aave-v3-origin/contracts/protocol/libraries/types/DataTypes.sol'; +import {Errors} from 'aave-v3-origin/contracts/protocol/libraries/helpers/Errors.sol'; +import {ConfiguratorInputTypes} from 'aave-v3-origin/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol'; +import {IPoolAddressesProvider} from 'aave-v3-origin/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IAToken} from 'aave-v3-origin/contracts/interfaces/IAToken.sol'; +import {IPool} from 'aave-v3-origin/contracts/interfaces/IPool.sol'; +import {IPoolConfigurator} from 'aave-v3-origin/contracts/interfaces/IPoolConfigurator.sol'; +import {IPriceOracleGetter} from 'aave-v3-origin/contracts/interfaces/IPriceOracleGetter.sol'; +import {IAaveOracle} from 'aave-v3-origin/contracts/interfaces/IAaveOracle.sol'; +import {IACLManager as BasicIACLManager} from 'aave-v3-origin/contracts/interfaces/IACLManager.sol'; +import {IPoolDataProvider} from 'aave-v3-origin/contracts/interfaces/IPoolDataProvider.sol'; +import {IDefaultInterestRateStrategyV2} from 'aave-v3-origin/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; +import {IReserveInterestRateStrategy} from 'aave-v3-origin/contracts/interfaces/IReserveInterestRateStrategy.sol'; +import {IPoolDataProvider as IAaveProtocolDataProvider} from 'aave-v3-origin/contracts/interfaces/IPoolDataProvider.sol'; +import {AggregatorInterface} from 'aave-v3-origin/contracts/dependencies/chainlink/AggregatorInterface.sol'; interface IACLManager is BasicIACLManager { function hasRole(bytes32 role, address account) external view returns (bool); diff --git a/src/common/IMigrationHelper.sol b/src/common/IMigrationHelper.sol index b5e3961e..79cdc348 100644 --- a/src/common/IMigrationHelper.sol +++ b/src/common/IMigrationHelper.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import {IPool as IV3Pool} from '../AaveV3.sol'; import {ILendingPool as IV2Pool} from '../AaveV2.sol'; -import {ICreditDelegationToken} from 'aave-v3-origin/core/contracts/interfaces/ICreditDelegationToken.sol'; -import {IERC20WithPermit} from 'aave-v3-origin/core/contracts/interfaces/IERC20WithPermit.sol'; +import {ICreditDelegationToken} from 'aave-v3-origin/contracts/interfaces/ICreditDelegationToken.sol'; +import {IERC20WithPermit} from 'aave-v3-origin/contracts/interfaces/IERC20WithPermit.sol'; interface IMigrationHelper { struct PermitInput { diff --git a/src/common/IOwnable.sol b/src/common/IOwnable.sol index 82374953..11d2065d 100644 --- a/src/common/IOwnable.sol +++ b/src/common/IOwnable.sol @@ -7,7 +7,7 @@ interface IOwnable { /** * @dev Returns the address of the current owner. */ - function owner() external view virtual returns (address); + function owner() external view returns (address); /** * @dev Leaves the contract without owner. It will not be possible to call @@ -16,11 +16,11 @@ interface IOwnable { * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ - function renounceOwnership() external virtual; + function renounceOwnership() external; /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ - function transferOwnership(address newOwner) external virtual; + function transferOwnership(address newOwner) external; } diff --git a/src/test/AaveV2Ethereum.t.sol b/src/test/AaveV2Ethereum.t.sol index 92cd5829..50cf1add 100644 --- a/src/test/AaveV2Ethereum.t.sol +++ b/src/test/AaveV2Ethereum.t.sol @@ -4,52 +4,52 @@ pragma solidity >=0.6.0; import 'forge-std/Test.sol'; import {AaveV2Ethereum} from '../AaveAddressBook.sol'; // imports are unused but required so forge inspect can find the source code -import {IERC20Detailed} from 'aave-v3-origin/core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IERC20Detailed} from 'aave-v3-origin/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {IWithGuardian} from 'solidity-utils/contracts/access-control/interfaces/IWithGuardian.sol'; -import {IStataTokenFactory} from 'aave-v3-origin/periphery/contracts/static-a-token/interfaces/IStataTokenFactory.sol'; -import {IStataTokenV2} from 'aave-v3-origin/periphery/contracts/static-a-token/interfaces/IStataTokenV2.sol'; +import {IStataTokenFactory} from 'aave-v3-origin/contracts/extensions/static-a-token/interfaces/IStataTokenFactory.sol'; +import {IStataTokenV2} from 'aave-v3-origin/contracts/extensions/static-a-token/interfaces/IStataTokenV2.sol'; contract AaveAddressBookTest is Test { function setUp() public {} - function testPoolAddressProviderIsCorrect() public { + function testPoolAddressProviderIsCorrect() public pure { assertEq( address(AaveV2Ethereum.POOL_ADDRESSES_PROVIDER), address(0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5) ); } - function testPoolAddressIsCorrect() public { + function testPoolAddressIsCorrect() public pure { assertEq(address(AaveV2Ethereum.POOL), address(0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9)); } - function testPoolConfiguratorIsCorrect() public { + function testPoolConfiguratorIsCorrect() public pure { assertEq( address(AaveV2Ethereum.POOL_CONFIGURATOR), address(0x311Bb771e4F8952E6Da169b425E7e92d6Ac45756) ); } - function testOracleIsCorrect() public { + function testOracleIsCorrect() public pure { assertEq(address(AaveV2Ethereum.ORACLE), address(0xA50ba011c48153De246E5192C8f9258A2ba79Ca9)); } - function testAaveProtocolDataProviderIsCorrect() public { + function testAaveProtocolDataProviderIsCorrect() public pure { assertEq( address(AaveV2Ethereum.AAVE_PROTOCOL_DATA_PROVIDER), address(0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d) ); } - function testPoolAdminIsCorrect() public { + function testPoolAdminIsCorrect() public pure { assertEq(AaveV2Ethereum.POOL_ADMIN, address(0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A)); } - function testEmergencyAdminIsCorrect() public { + function testEmergencyAdminIsCorrect() public pure { assertEq(AaveV2Ethereum.EMERGENCY_ADMIN, address(0xCA76Ebd8617a03126B6FB84F9b1c1A0fB71C2633)); } - function testCollectorIsCorrect() public { + function testCollectorIsCorrect() public pure { assertEq( address(AaveV2Ethereum.COLLECTOR), address(0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c) diff --git a/src/test/AaveV2Misfits.t.sol b/src/test/AaveV2Misfits.t.sol index e98875d4..e509fd68 100644 --- a/src/test/AaveV2Misfits.t.sol +++ b/src/test/AaveV2Misfits.t.sol @@ -15,7 +15,7 @@ contract AaveAddressMisfitsTest is Test { * The arc is the only market where owner != POOL_ADMIN right now. * So this test ensures we actually use the pool admin. */ - function testArcPoolAdminIsCorrect() public { + function testArcPoolAdminIsCorrect() public pure { assertEq( address(AaveV2EthereumArc.POOL_ADMIN), address(0xAce1d11d836cb3F51Ef658FD4D353fFb3c301218) diff --git a/src/test/AaveV3Avalanche.t.sol b/src/test/AaveV3Avalanche.t.sol index 03057103..23772e78 100644 --- a/src/test/AaveV3Avalanche.t.sol +++ b/src/test/AaveV3Avalanche.t.sol @@ -8,47 +8,47 @@ import {IAaveProtocolDataProvider, IPoolDataProvider} from '../AaveV3.sol'; contract AaveAddressBookTest is Test { function setUp() public {} - function testPoolAddressProviderIsCorrect() public { + function testPoolAddressProviderIsCorrect() public pure { assertEq( address(AaveV3Avalanche.POOL_ADDRESSES_PROVIDER), address(0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb) ); } - function testPoolAddressIsCorrect() public { + function testPoolAddressIsCorrect() public pure { assertEq(address(AaveV3Avalanche.POOL), address(0x794a61358D6845594F94dc1DB02A252b5b4814aD)); } - function testPoolConfiguratorIsCorrect() public { + function testPoolConfiguratorIsCorrect() public pure { assertEq( address(AaveV3Avalanche.POOL_CONFIGURATOR), address(0x8145eddDf43f50276641b55bd3AD95944510021E) ); } - function testOracleIsCorrect() public { + function testOracleIsCorrect() public pure { assertEq(address(AaveV3Avalanche.ORACLE), address(0xEBd36016B3eD09D4693Ed4251c67Bd858c3c7C9C)); } - function testACLManagerIsCorrect() public { + function testACLManagerIsCorrect() public pure { assertEq( address(AaveV3Avalanche.ACL_MANAGER), address(0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B) ); } - function testACLAdminIsCorrect() public { + function testACLAdminIsCorrect() public pure { assertEq(AaveV3Avalanche.ACL_ADMIN, address(0x3C06dce358add17aAf230f2234bCCC4afd50d090)); } - function testCollectorIsCorrect() public { + function testCollectorIsCorrect() public pure { assertEq( address(AaveV3Avalanche.COLLECTOR), address(0x5ba7fd868c40c16f7aDfAe6CF87121E13FC2F7a0) ); } - function testEmissionManagerIsCorrect() public { + function testEmissionManagerIsCorrect() public pure { assertEq( address(AaveV3Avalanche.EMISSION_MANAGER), address(0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73)