Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to origin #476

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/aave-v3-core"]
path = lib/aave-v3-core
url = https://github.com/aave/aave-v3-core
[submodule "lib/aave-v3-periphery"]
path = lib/aave-v3-periphery
url = https://github.com/aave/aave-v3-periphery
[submodule "lib/aave-v3-origin"]
path = lib/aave-v3-origin
url = https://github.com/aave-dao/aave-v3-origin
1 change: 0 additions & 1 deletion lib/aave-v3-core
Submodule aave-v3-core deleted from 6070e8
1 change: 1 addition & 0 deletions lib/aave-v3-origin
Submodule aave-v3-origin added at 337506
1 change: 0 additions & 1 deletion lib/aave-v3-periphery
Submodule aave-v3-periphery deleted from 72fdcc
5 changes: 1 addition & 4 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
aave-v3-core/=lib/aave-v3-core/
aave-v3-periphery/=lib/aave-v3-periphery/
@aave/core-v3=lib/aave-v3-core/
@aave/periphery-v3=lib/aave-v3-periphery/
aave-v3-origin/=lib/aave-v3-origin/src/
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-core/contracts/protocol/libraries/types/DataTypes.sol';
import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol';
import {ConfiguratorInputTypes} from 'aave-v3-core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol';
import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol';
import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol';
import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol';
import {IPoolConfigurator} from 'aave-v3-core/contracts/interfaces/IPoolConfigurator.sol';
import {IPriceOracleGetter} from 'aave-v3-core/contracts/interfaces/IPriceOracleGetter.sol';
import {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol';
import {IACLManager as BasicIACLManager} from 'aave-v3-core/contracts/interfaces/IACLManager.sol';
import {IPoolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol';
import {IDefaultInterestRateStrategy} from 'aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategy.sol';
import {IReserveInterestRateStrategy} from 'aave-v3-core/contracts/interfaces/IReserveInterestRateStrategy.sol';
import {IPoolDataProvider as IAaveProtocolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol';
import {AggregatorInterface} from 'aave-v3-core/contracts/dependencies/chainlink/AggregatorInterface.sol';
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';

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-core/contracts/interfaces/ICreditDelegationToken.sol';
import {IERC20WithPermit} from 'aave-v3-core/contracts/interfaces/IERC20WithPermit.sol';
import {ICreditDelegationToken} from 'aave-v3-origin/core/contracts/interfaces/ICreditDelegationToken.sol';
import {IERC20WithPermit} from 'aave-v3-origin/core/contracts/interfaces/IERC20WithPermit.sol';

interface IMigrationHelper {
struct PermitInput {
Expand Down
2 changes: 1 addition & 1 deletion src/test/AaveV2Ethereum.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity >=0.6.0;
import 'forge-std/Test.sol';
import {AaveV2Ethereum} from '../AaveAddressBook.sol';
// import is unnecessary here, but needed somewhere in the project so we can infer the abi from build artifacts
import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol';
import {IERC20Detailed} from 'aave-v3-origin/core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol';

contract AaveAddressBookTest is Test {
function setUp() public {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/AaveV3Avalanche.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity >=0.6.0;

import 'forge-std/Test.sol';
import {AaveV3Avalanche} from '../AaveAddressBook.sol';
import {IAaveProtocolDataProvider, IPoolDataProvider, IDefaultInterestRateStrategy} from '../AaveV3.sol';
import {IAaveProtocolDataProvider, IPoolDataProvider} from '../AaveV3.sol';

contract AaveAddressBookTest is Test {
function setUp() public {}
Expand Down
128 changes: 27 additions & 101 deletions src/ts/abis/IDefaultInterestRateStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,7 @@
export const IDefaultInterestRateStrategy_ABI = [
{
type: 'function',
name: 'ADDRESSES_PROVIDER',
inputs: [],
outputs: [
{
name: '',
type: 'address',
internalType: 'contract IPoolAddressesProvider',
},
],
stateMutability: 'view',
},
{
type: 'function',
name: 'MAX_EXCESS_STABLE_TO_TOTAL_DEBT_RATIO',
name: 'EXCESS_UTILIZATION_RATE',
inputs: [],
outputs: [
{
Expand All @@ -28,7 +15,7 @@ export const IDefaultInterestRateStrategy_ABI = [
},
{
type: 'function',
name: 'MAX_EXCESS_USAGE_RATIO',
name: 'OPTIMAL_UTILIZATION_RATE',
inputs: [],
outputs: [
{
Expand All @@ -41,20 +28,20 @@ export const IDefaultInterestRateStrategy_ABI = [
},
{
type: 'function',
name: 'OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO',
name: 'addressesProvider',
inputs: [],
outputs: [
{
name: '',
type: 'uint256',
internalType: 'uint256',
type: 'address',
internalType: 'address',
},
],
stateMutability: 'view',
},
{
type: 'function',
name: 'OPTIMAL_USAGE_RATIO',
name: 'baseVariableBorrowRate',
inputs: [],
outputs: [
{
Expand All @@ -70,108 +57,47 @@ export const IDefaultInterestRateStrategy_ABI = [
name: 'calculateInterestRates',
inputs: [
{
name: 'params',
type: 'tuple',
internalType: 'struct DataTypes.CalculateInterestRatesParams',
components: [
{
name: 'unbacked',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'liquidityAdded',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'liquidityTaken',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'totalStableDebt',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'totalVariableDebt',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'averageStableBorrowRate',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'reserveFactor',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'reserve',
type: 'address',
internalType: 'address',
},
{
name: 'aToken',
type: 'address',
internalType: 'address',
},
],
name: 'reserve',
type: 'address',
internalType: 'address',
},
],
outputs: [
{
name: '',
name: 'availableLiquidity',
type: 'uint256',
internalType: 'uint256',
},
{
name: '',
name: 'totalStableDebt',
type: 'uint256',
internalType: 'uint256',
},
{
name: '',
name: 'totalVariableDebt',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'averageStableBorrowRate',
type: 'uint256',
internalType: 'uint256',
},
{
name: 'reserveFactor',
type: 'uint256',
internalType: 'uint256',
},
],
stateMutability: 'view',
},
{
type: 'function',
name: 'getBaseStableBorrowRate',
inputs: [],
outputs: [
{
name: '',
type: 'uint256',
internalType: 'uint256',
},
],
stateMutability: 'view',
},
{
type: 'function',
name: 'getBaseVariableBorrowRate',
inputs: [],
outputs: [
{
name: '',
type: 'uint256',
internalType: 'uint256',
},
],
stateMutability: 'view',
},
{
type: 'function',
name: 'getMaxVariableBorrowRate',
inputs: [],
outputs: [
{
name: '',
type: 'uint256',
Expand All @@ -182,7 +108,7 @@ export const IDefaultInterestRateStrategy_ABI = [
},
{
type: 'function',
name: 'getStableRateExcessOffset',
name: 'getMaxVariableBorrowRate',
inputs: [],
outputs: [
{
Expand All @@ -195,7 +121,7 @@ export const IDefaultInterestRateStrategy_ABI = [
},
{
type: 'function',
name: 'getStableRateSlope1',
name: 'stableRateSlope1',
inputs: [],
outputs: [
{
Expand All @@ -208,7 +134,7 @@ export const IDefaultInterestRateStrategy_ABI = [
},
{
type: 'function',
name: 'getStableRateSlope2',
name: 'stableRateSlope2',
inputs: [],
outputs: [
{
Expand All @@ -221,7 +147,7 @@ export const IDefaultInterestRateStrategy_ABI = [
},
{
type: 'function',
name: 'getVariableRateSlope1',
name: 'variableRateSlope1',
inputs: [],
outputs: [
{
Expand All @@ -234,7 +160,7 @@ export const IDefaultInterestRateStrategy_ABI = [
},
{
type: 'function',
name: 'getVariableRateSlope2',
name: 'variableRateSlope2',
inputs: [],
outputs: [
{
Expand Down
Loading
Loading