Skip to content

Commit

Permalink
feat: v3.2.0 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Sep 24, 2024
1 parent 53d8509 commit 734d882
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lib/aave-v3-origin
Submodule aave-v3-origin updated 616 files
4 changes: 2 additions & 2 deletions scripts/configs/abis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
30 changes: 15 additions & 15 deletions src/AaveV3.sol
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/common/IMigrationHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/common/IOwnable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
22 changes: 11 additions & 11 deletions src/test/AaveV2Ethereum.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/test/AaveV2Misfits.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions src/test/AaveV3Avalanche.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 734d882

Please sign in to comment.