From 0f48b5529b2697aaca3079552ab499cf9b0631dc Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 9 Dec 2022 17:10:26 +0100 Subject: [PATCH 1/9] fix: add core as library --- .gitmodules | 4 + lib/aave-v3-core | 1 + lib/forge-std | 2 +- remappings.txt | 6 + scripts/config.ts | 4 +- scripts/generator_v3.ts | 4 +- src/AaveV3.sol | 2312 +--------------------------------- src/AaveV3Arbitrum.sol | 6 +- src/AaveV3ArbitrumGoerli.sol | 6 +- src/AaveV3Avalanche.sol | 6 +- src/AaveV3Fantom.sol | 6 +- src/AaveV3FantomTestnet.sol | 6 +- src/AaveV3Fuji.sol | 6 +- src/AaveV3Goerli.sol | 6 +- src/AaveV3Harmony.sol | 6 +- src/AaveV3Mumbai.sol | 6 +- src/AaveV3Optimism.sol | 6 +- src/AaveV3OptimismGoerli.sol | 6 +- src/AaveV3Polygon.sol | 6 +- 19 files changed, 61 insertions(+), 2344 deletions(-) create mode 160000 lib/aave-v3-core create mode 100644 remappings.txt diff --git a/.gitmodules b/.gitmodules index 7566009c..cf27d744 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,7 @@ [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 + branch = fix/738-soften-datatypes-sol-version diff --git a/lib/aave-v3-core b/lib/aave-v3-core new file mode 160000 index 00000000..3b4ea336 --- /dev/null +++ b/lib/aave-v3-core @@ -0,0 +1 @@ +Subproject commit 3b4ea336204b3e1996663e49aeb9d4f7df96c9c2 diff --git a/lib/forge-std b/lib/forge-std index bb14eb04..cd7d533f 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit bb14eb04f63febf3613fdfcdd5d7a2db9063b3e5 +Subproject commit cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653 diff --git a/remappings.txt b/remappings.txt new file mode 100644 index 00000000..61be81df --- /dev/null +++ b/remappings.txt @@ -0,0 +1,6 @@ +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/ diff --git a/scripts/config.ts b/scripts/config.ts index 4d705de3..2dca82c8 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -22,14 +22,14 @@ export enum ChainId { const RPC_PROVIDERS = { [ChainId.mainnet]: "https://rpc.flashbots.net", [ChainId.goerli]: "https://eth-goerli.public.blastapi.io", - [ChainId.mumbai]: "https://polygon-mumbai.g.alchemy.com/v2/demo", + [ChainId.mumbai]: "https://polygon-testnet.public.blastapi.io", [ChainId.polygon]: "https://polygon-rpc.com", [ChainId.fuji]: "https://api.avax-test.network/ext/bc/C/rpc", [ChainId.avalanche]: "https://api.avax.network/ext/bc/C/rpc", [ChainId.arbitrum_one]: "https://arb1.arbitrum.io/rpc", [ChainId.arbitrum_goerli]: "https://goerli-rollup.arbitrum.io/rpc", [ChainId.harmony]: "https://api.s0.t.hmny.io", - [ChainId.optimism]: "https://opt-mainnet.g.alchemy.com/v2/demo", + [ChainId.optimism]: "https://1rpc.io/op", [ChainId.optimism_goerli]: "https://goerli.optimism.io", [ChainId.fantom]: "https://rpc.ftm.tools", [ChainId.fantom_testnet]: "https://rpc.ankr.com/fantom_testnet", diff --git a/scripts/generator_v3.ts b/scripts/generator_v3.ts index cb5f1ac3..2e6cb0ef 100644 --- a/scripts/generator_v3.ts +++ b/scripts/generator_v3.ts @@ -128,7 +128,7 @@ export async function generatePoolV3(pool: Pool): Promise { // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; - import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; + import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library ${pool.name} { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -145,7 +145,7 @@ export async function generatePoolV3(pool: Pool): Promise { IAaveOracle internal constant ORACLE = IAaveOracle(${oracle}); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = IAaveProtocolDataProvider(${poolDataProvider}); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = IPoolDataProvider(${poolDataProvider}); IACLManager internal constant ACL_MANAGER = IACLManager(${aclManager}); diff --git a/src/AaveV3.sol b/src/AaveV3.sol index d8f1ff6b..fdd22226 100644 --- a/src/AaveV3.sol +++ b/src/AaveV3.sol @@ -1,2309 +1,15 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0; -library DataTypes { - struct ReserveData { - //stores the reserve configuration - ReserveConfigurationMap configuration; - //the liquidity index. Expressed in ray - uint128 liquidityIndex; - //the current supply rate. Expressed in ray - uint128 currentLiquidityRate; - //variable borrow index. Expressed in ray - uint128 variableBorrowIndex; - //the current variable borrow rate. Expressed in ray - uint128 currentVariableBorrowRate; - //the current stable borrow rate. Expressed in ray - uint128 currentStableBorrowRate; - //timestamp of last update - uint40 lastUpdateTimestamp; - //the id of the reserve. Represents the position in the list of the active reserves - uint16 id; - //aToken address - address aTokenAddress; - //stableDebtToken address - address stableDebtTokenAddress; - //variableDebtToken address - address variableDebtTokenAddress; - //address of the interest rate strategy - address interestRateStrategyAddress; - //the current treasury balance, scaled - uint128 accruedToTreasury; - //the outstanding unbacked aTokens minted through the bridging feature - uint128 unbacked; - //the outstanding debt borrowed against this asset in isolation mode - uint128 isolationModeTotalDebt; - } - - struct ReserveConfigurationMap { - //bit 0-15: LTV - //bit 16-31: Liq. threshold - //bit 32-47: Liq. bonus - //bit 48-55: Decimals - //bit 56: reserve is active - //bit 57: reserve is frozen - //bit 58: borrowing is enabled - //bit 59: stable rate borrowing enabled - //bit 60: asset is paused - //bit 61: borrowing in isolation mode is enabled - //bit 62-63: reserved - //bit 64-79: reserve factor - //bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap - //bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap - //bit 152-167 liquidation protocol fee - //bit 168-175 eMode category - //bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled - //bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals - //bit 252-255 unused - - uint256 data; - } - - struct UserConfigurationMap { - /** - * @dev Bitmap of the users collaterals and borrows. It is divided in pairs of bits, one pair per asset. - * The first bit indicates if an asset is used as collateral by the user, the second whether an - * asset is borrowed by the user. - */ - uint256 data; - } - - struct EModeCategory { - // each eMode category has a custom ltv and liquidation threshold - uint16 ltv; - uint16 liquidationThreshold; - uint16 liquidationBonus; - // each eMode category may or may not have a custom oracle to override the individual assets price oracles - address priceSource; - string label; - } - - enum InterestRateMode { - NONE, - STABLE, - VARIABLE - } - - struct ReserveCache { - uint256 currScaledVariableDebt; - uint256 nextScaledVariableDebt; - uint256 currPrincipalStableDebt; - uint256 currAvgStableBorrowRate; - uint256 currTotalStableDebt; - uint256 nextAvgStableBorrowRate; - uint256 nextTotalStableDebt; - uint256 currLiquidityIndex; - uint256 nextLiquidityIndex; - uint256 currVariableBorrowIndex; - uint256 nextVariableBorrowIndex; - uint256 currLiquidityRate; - uint256 currVariableBorrowRate; - uint256 reserveFactor; - ReserveConfigurationMap reserveConfiguration; - address aTokenAddress; - address stableDebtTokenAddress; - address variableDebtTokenAddress; - uint40 reserveLastUpdateTimestamp; - uint40 stableDebtLastUpdateTimestamp; - } - - struct ExecuteLiquidationCallParams { - uint256 reservesCount; - uint256 debtToCover; - address collateralAsset; - address debtAsset; - address user; - bool receiveAToken; - address priceOracle; - uint8 userEModeCategory; - address priceOracleSentinel; - } - - struct ExecuteSupplyParams { - address asset; - uint256 amount; - address onBehalfOf; - uint16 referralCode; - } - - struct ExecuteBorrowParams { - address asset; - address user; - address onBehalfOf; - uint256 amount; - InterestRateMode interestRateMode; - uint16 referralCode; - bool releaseUnderlying; - uint256 maxStableRateBorrowSizePercent; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; - address priceOracleSentinel; - } - - struct ExecuteRepayParams { - address asset; - uint256 amount; - InterestRateMode interestRateMode; - address onBehalfOf; - bool useATokens; - } - - struct ExecuteWithdrawParams { - address asset; - uint256 amount; - address to; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; - } - - struct ExecuteSetUserEModeParams { - uint256 reservesCount; - address oracle; - uint8 categoryId; - } - - struct FinalizeTransferParams { - address asset; - address from; - address to; - uint256 amount; - uint256 balanceFromBefore; - uint256 balanceToBefore; - uint256 reservesCount; - address oracle; - uint8 fromEModeCategory; - } - - struct FlashloanParams { - address receiverAddress; - address[] assets; - uint256[] amounts; - uint256[] interestRateModes; - address onBehalfOf; - bytes params; - uint16 referralCode; - uint256 flashLoanPremiumToProtocol; - uint256 flashLoanPremiumTotal; - uint256 maxStableRateBorrowSizePercent; - uint256 reservesCount; - address addressesProvider; - uint8 userEModeCategory; - bool isAuthorizedFlashBorrower; - } - - struct FlashloanSimpleParams { - address receiverAddress; - address asset; - uint256 amount; - bytes params; - uint16 referralCode; - uint256 flashLoanPremiumToProtocol; - uint256 flashLoanPremiumTotal; - } - - struct FlashLoanRepaymentParams { - uint256 amount; - uint256 totalPremium; - uint256 flashLoanPremiumToProtocol; - address asset; - address receiverAddress; - uint16 referralCode; - } - - struct CalculateUserAccountDataParams { - UserConfigurationMap userConfig; - uint256 reservesCount; - address user; - address oracle; - uint8 userEModeCategory; - } - - struct ValidateBorrowParams { - ReserveCache reserveCache; - UserConfigurationMap userConfig; - address asset; - address userAddress; - uint256 amount; - InterestRateMode interestRateMode; - uint256 maxStableLoanPercent; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; - address priceOracleSentinel; - bool isolationModeActive; - address isolationModeCollateralAddress; - uint256 isolationModeDebtCeiling; - } - - struct ValidateLiquidationCallParams { - ReserveCache debtReserveCache; - uint256 totalDebt; - uint256 healthFactor; - address priceOracleSentinel; - } - - struct CalculateInterestRatesParams { - uint256 unbacked; - uint256 liquidityAdded; - uint256 liquidityTaken; - uint256 totalStableDebt; - uint256 totalVariableDebt; - uint256 averageStableBorrowRate; - uint256 reserveFactor; - address reserve; - address aToken; - } - - struct InitReserveParams { - address asset; - address aTokenAddress; - address stableDebtAddress; - address variableDebtAddress; - address interestRateStrategyAddress; - uint16 reservesCount; - uint16 maxNumberReserves; - } -} - -library ConfiguratorInputTypes { - struct InitReserveInput { - address aTokenImpl; - address stableDebtTokenImpl; - address variableDebtTokenImpl; - uint8 underlyingAssetDecimals; - address interestRateStrategyAddress; - address underlyingAsset; - address treasury; - address incentivesController; - string aTokenName; - string aTokenSymbol; - string variableDebtTokenName; - string variableDebtTokenSymbol; - string stableDebtTokenName; - string stableDebtTokenSymbol; - bytes params; - } - - struct UpdateATokenInput { - address asset; - address treasury; - address incentivesController; - string name; - string symbol; - address implementation; - bytes params; - } - - struct UpdateDebtTokenInput { - address asset; - address incentivesController; - string name; - string symbol; - address implementation; - bytes params; - } -} - -interface IPoolAddressesProvider { - /** - * @dev Emitted when the market identifier is updated. - * @param oldMarketId The old id of the market - * @param newMarketId The new id of the market - */ - event MarketIdSet(string indexed oldMarketId, string indexed newMarketId); - - /** - * @dev Emitted when the pool is updated. - * @param oldAddress The old address of the Pool - * @param newAddress The new address of the Pool - */ - event PoolUpdated(address indexed oldAddress, address indexed newAddress); - - /** - * @dev Emitted when the pool configurator is updated. - * @param oldAddress The old address of the PoolConfigurator - * @param newAddress The new address of the PoolConfigurator - */ - event PoolConfiguratorUpdated( - address indexed oldAddress, - address indexed newAddress - ); - - /** - * @dev Emitted when the price oracle is updated. - * @param oldAddress The old address of the PriceOracle - * @param newAddress The new address of the PriceOracle - */ - event PriceOracleUpdated( - address indexed oldAddress, - address indexed newAddress - ); - - /** - * @dev Emitted when the ACL manager is updated. - * @param oldAddress The old address of the ACLManager - * @param newAddress The new address of the ACLManager - */ - event ACLManagerUpdated( - address indexed oldAddress, - address indexed newAddress - ); - - /** - * @dev Emitted when the ACL admin is updated. - * @param oldAddress The old address of the ACLAdmin - * @param newAddress The new address of the ACLAdmin - */ - event ACLAdminUpdated(address indexed oldAddress, address indexed newAddress); - - /** - * @dev Emitted when the price oracle sentinel is updated. - * @param oldAddress The old address of the PriceOracleSentinel - * @param newAddress The new address of the PriceOracleSentinel - */ - event PriceOracleSentinelUpdated( - address indexed oldAddress, - address indexed newAddress - ); - - /** - * @dev Emitted when the pool data provider is updated. - * @param oldAddress The old address of the PoolDataProvider - * @param newAddress The new address of the PoolDataProvider - */ - event PoolDataProviderUpdated( - address indexed oldAddress, - address indexed newAddress - ); - - /** - * @dev Emitted when a new proxy is created. - * @param id The identifier of the proxy - * @param proxyAddress The address of the created proxy contract - * @param implementationAddress The address of the implementation contract - */ - event ProxyCreated( - bytes32 indexed id, - address indexed proxyAddress, - address indexed implementationAddress - ); - - /** - * @dev Emitted when a new non-proxied contract address is registered. - * @param id The identifier of the contract - * @param oldAddress The address of the old contract - * @param newAddress The address of the new contract - */ - event AddressSet( - bytes32 indexed id, - address indexed oldAddress, - address indexed newAddress - ); - - /** - * @dev Emitted when the implementation of the proxy registered with id is updated - * @param id The identifier of the contract - * @param proxyAddress The address of the proxy contract - * @param oldImplementationAddress The address of the old implementation contract - * @param newImplementationAddress The address of the new implementation contract - */ - event AddressSetAsProxy( - bytes32 indexed id, - address indexed proxyAddress, - address oldImplementationAddress, - address indexed newImplementationAddress - ); - - /** - * @notice Returns the id of the Aave market to which this contract points to. - * @return The market id - **/ - function getMarketId() external view returns (string memory); - - /** - * @notice Associates an id with a specific PoolAddressesProvider. - * @dev This can be used to create an onchain registry of PoolAddressesProviders to - * identify and validate multiple Aave markets. - * @param newMarketId The market id - */ - function setMarketId(string calldata newMarketId) external; - - /** - * @notice Returns an address by its identifier. - * @dev The returned address might be an EOA or a contract, potentially proxied - * @dev It returns ZERO if there is no registered address with the given id - * @param id The id - * @return The address of the registered for the specified id - */ - function getAddress(bytes32 id) external view returns (address); - - /** - * @notice General function to update the implementation of a proxy registered with - * certain `id`. If there is no proxy registered, it will instantiate one and - * set as implementation the `newImplementationAddress`. - * @dev IMPORTANT Use this function carefully, only for ids that don't have an explicit - * setter function, in order to avoid unexpected consequences - * @param id The id - * @param newImplementationAddress The address of the new implementation - */ - function setAddressAsProxy(bytes32 id, address newImplementationAddress) - external; - - /** - * @notice Sets an address for an id replacing the address saved in the addresses map. - * @dev IMPORTANT Use this function carefully, as it will do a hard replacement - * @param id The id - * @param newAddress The address to set - */ - function setAddress(bytes32 id, address newAddress) external; - - /** - * @notice Returns the address of the Pool proxy. - * @return The Pool proxy address - **/ - function getPool() external view returns (address); - - /** - * @notice Updates the implementation of the Pool, or creates a proxy - * setting the new `pool` implementation when the function is called for the first time. - * @param newPoolImpl The new Pool implementation - **/ - function setPoolImpl(address newPoolImpl) external; - - /** - * @notice Returns the address of the PoolConfigurator proxy. - * @return The PoolConfigurator proxy address - **/ - function getPoolConfigurator() external view returns (address); - - /** - * @notice Updates the implementation of the PoolConfigurator, or creates a proxy - * setting the new `PoolConfigurator` implementation when the function is called for the first time. - * @param newPoolConfiguratorImpl The new PoolConfigurator implementation - **/ - function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external; - - /** - * @notice Returns the address of the price oracle. - * @return The address of the PriceOracle - */ - function getPriceOracle() external view returns (address); - - /** - * @notice Updates the address of the price oracle. - * @param newPriceOracle The address of the new PriceOracle - */ - function setPriceOracle(address newPriceOracle) external; - - /** - * @notice Returns the address of the ACL manager. - * @return The address of the ACLManager - */ - function getACLManager() external view returns (address); - - /** - * @notice Updates the address of the ACL manager. - * @param newAclManager The address of the new ACLManager - **/ - function setACLManager(address newAclManager) external; - - /** - * @notice Returns the address of the ACL admin. - * @return The address of the ACL admin - */ - function getACLAdmin() external view returns (address); - - /** - * @notice Updates the address of the ACL admin. - * @param newAclAdmin The address of the new ACL admin - */ - function setACLAdmin(address newAclAdmin) external; - - /** - * @notice Returns the address of the price oracle sentinel. - * @return The address of the PriceOracleSentinel - */ - function getPriceOracleSentinel() external view returns (address); - - /** - * @notice Updates the address of the price oracle sentinel. - * @param newPriceOracleSentinel The address of the new PriceOracleSentinel - **/ - function setPriceOracleSentinel(address newPriceOracleSentinel) external; - - /** - * @notice Returns the address of the data provider. - * @return The address of the DataProvider - */ - function getPoolDataProvider() external view returns (address); - - /** - * @notice Updates the address of the data provider. - * @param newDataProvider The address of the new DataProvider - **/ - function setPoolDataProvider(address newDataProvider) external; -} - -interface IPool { - /** - * @dev Emitted on mintUnbacked() - * @param reserve The address of the underlying asset of the reserve - * @param user The address initiating the supply - * @param onBehalfOf The beneficiary of the supplied assets, receiving the aTokens - * @param amount The amount of supplied assets - * @param referralCode The referral code used - **/ - event MintUnbacked( - address indexed reserve, - address user, - address indexed onBehalfOf, - uint256 amount, - uint16 indexed referralCode - ); - - /** - * @dev Emitted on backUnbacked() - * @param reserve The address of the underlying asset of the reserve - * @param backer The address paying for the backing - * @param amount The amount added as backing - * @param fee The amount paid in fees - **/ - event BackUnbacked( - address indexed reserve, - address indexed backer, - uint256 amount, - uint256 fee - ); - - /** - * @dev Emitted on supply() - * @param reserve The address of the underlying asset of the reserve - * @param user The address initiating the supply - * @param onBehalfOf The beneficiary of the supply, receiving the aTokens - * @param amount The amount supplied - * @param referralCode The referral code used - **/ - event Supply( - address indexed reserve, - address user, - address indexed onBehalfOf, - uint256 amount, - uint16 indexed referralCode - ); - - /** - * @dev Emitted on withdraw() - * @param reserve The address of the underlying asset being withdrawn - * @param user The address initiating the withdrawal, owner of aTokens - * @param to The address that will receive the underlying - * @param amount The amount to be withdrawn - **/ - event Withdraw( - address indexed reserve, - address indexed user, - address indexed to, - uint256 amount - ); - - /** - * @dev Emitted on borrow() and flashLoan() when debt needs to be opened - * @param reserve The address of the underlying asset being borrowed - * @param user The address of the user initiating the borrow(), receiving the funds on borrow() or just - * initiator of the transaction on flashLoan() - * @param onBehalfOf The address that will be getting the debt - * @param amount The amount borrowed out - * @param interestRateMode The rate mode: 1 for Stable, 2 for Variable - * @param borrowRate The numeric rate at which the user has borrowed, expressed in ray - * @param referralCode The referral code used - **/ - event Borrow( - address indexed reserve, - address user, - address indexed onBehalfOf, - uint256 amount, - DataTypes.InterestRateMode interestRateMode, - uint256 borrowRate, - uint16 indexed referralCode - ); - - /** - * @dev Emitted on repay() - * @param reserve The address of the underlying asset of the reserve - * @param user The beneficiary of the repayment, getting his debt reduced - * @param repayer The address of the user initiating the repay(), providing the funds - * @param amount The amount repaid - * @param useATokens True if the repayment is done using aTokens, `false` if done with underlying asset directly - **/ - event Repay( - address indexed reserve, - address indexed user, - address indexed repayer, - uint256 amount, - bool useATokens - ); - - /** - * @dev Emitted on swapBorrowRateMode() - * @param reserve The address of the underlying asset of the reserve - * @param user The address of the user swapping his rate mode - * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable - **/ - event SwapBorrowRateMode( - address indexed reserve, - address indexed user, - DataTypes.InterestRateMode interestRateMode - ); - - /** - * @dev Emitted on borrow(), repay() and liquidationCall() when using isolated assets - * @param asset The address of the underlying asset of the reserve - * @param totalDebt The total isolation mode debt for the reserve - */ - event IsolationModeTotalDebtUpdated(address indexed asset, uint256 totalDebt); - - /** - * @dev Emitted when the user selects a certain asset category for eMode - * @param user The address of the user - * @param categoryId The category id - **/ - event UserEModeSet(address indexed user, uint8 categoryId); - - /** - * @dev Emitted on setUserUseReserveAsCollateral() - * @param reserve The address of the underlying asset of the reserve - * @param user The address of the user enabling the usage as collateral - **/ - event ReserveUsedAsCollateralEnabled( - address indexed reserve, - address indexed user - ); - - /** - * @dev Emitted on setUserUseReserveAsCollateral() - * @param reserve The address of the underlying asset of the reserve - * @param user The address of the user enabling the usage as collateral - **/ - event ReserveUsedAsCollateralDisabled( - address indexed reserve, - address indexed user - ); - - /** - * @dev Emitted on rebalanceStableBorrowRate() - * @param reserve The address of the underlying asset of the reserve - * @param user The address of the user for which the rebalance has been executed - **/ - event RebalanceStableBorrowRate( - address indexed reserve, - address indexed user - ); - - /** - * @dev Emitted on flashLoan() - * @param target The address of the flash loan receiver contract - * @param initiator The address initiating the flash loan - * @param asset The address of the asset being flash borrowed - * @param amount The amount flash borrowed - * @param interestRateMode The flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt - * @param premium The fee flash borrowed - * @param referralCode The referral code used - **/ - event FlashLoan( - address indexed target, - address initiator, - address indexed asset, - uint256 amount, - DataTypes.InterestRateMode interestRateMode, - uint256 premium, - uint16 indexed referralCode - ); - - /** - * @dev Emitted when a borrower is liquidated. - * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation - * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation - * @param user The address of the borrower getting liquidated - * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover - * @param liquidatedCollateralAmount The amount of collateral received by the liquidator - * @param liquidator The address of the liquidator - * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants - * to receive the underlying collateral asset directly - **/ - event LiquidationCall( - address indexed collateralAsset, - address indexed debtAsset, - address indexed user, - uint256 debtToCover, - uint256 liquidatedCollateralAmount, - address liquidator, - bool receiveAToken - ); - - /** - * @dev Emitted when the state of a reserve is updated. - * @param reserve The address of the underlying asset of the reserve - * @param liquidityRate The next liquidity rate - * @param stableBorrowRate The next stable borrow rate - * @param variableBorrowRate The next variable borrow rate - * @param liquidityIndex The next liquidity index - * @param variableBorrowIndex The next variable borrow index - **/ - event ReserveDataUpdated( - address indexed reserve, - uint256 liquidityRate, - uint256 stableBorrowRate, - uint256 variableBorrowRate, - uint256 liquidityIndex, - uint256 variableBorrowIndex - ); - - /** - * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest. - * @param reserve The address of the reserve - * @param amountMinted The amount minted to the treasury - **/ - event MintedToTreasury(address indexed reserve, uint256 amountMinted); - - /** - * @dev Mints an `amount` of aTokens to the `onBehalfOf` - * @param asset The address of the underlying asset to mint - * @param amount The amount to mint - * @param onBehalfOf The address that will receive the aTokens - * @param referralCode Code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - **/ - function mintUnbacked( - address asset, - uint256 amount, - address onBehalfOf, - uint16 referralCode - ) external; - - /** - * @dev Back the current unbacked underlying with `amount` and pay `fee`. - * @param asset The address of the underlying asset to back - * @param amount The amount to back - * @param fee The amount paid in fees - **/ - function backUnbacked( - address asset, - uint256 amount, - uint256 fee - ) external; - - /** - * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens. - * - E.g. User supplies 100 USDC and gets in return 100 aUSDC - * @param asset The address of the underlying asset to supply - * @param amount The amount to be supplied - * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user - * wants to receive them on his own wallet, or a different address if the beneficiary of aTokens - * is a different wallet - * @param referralCode Code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - **/ - function supply( - address asset, - uint256 amount, - address onBehalfOf, - uint16 referralCode - ) external; - - /** - * @notice Supply with transfer approval of asset to be supplied done via permit function - * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713 - * @param asset The address of the underlying asset to supply - * @param amount The amount to be supplied - * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user - * wants to receive them on his own wallet, or a different address if the beneficiary of aTokens - * is a different wallet - * @param deadline The deadline timestamp that the permit is valid - * @param referralCode Code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - * @param permitV The V parameter of ERC712 permit sig - * @param permitR The R parameter of ERC712 permit sig - * @param permitS The S parameter of ERC712 permit sig - **/ - function supplyWithPermit( - address asset, - uint256 amount, - address onBehalfOf, - uint16 referralCode, - uint256 deadline, - uint8 permitV, - bytes32 permitR, - bytes32 permitS - ) external; - - /** - * @notice Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned - * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC - * @param asset The address of the underlying asset to withdraw - * @param amount The underlying amount to be withdrawn - * - Send the value type(uint256).max in order to withdraw the whole aToken balance - * @param to The address that will receive the underlying, same as msg.sender if the user - * wants to receive it on his own wallet, or a different address if the beneficiary is a - * different wallet - * @return The final amount withdrawn - **/ - function withdraw( - address asset, - uint256 amount, - address to - ) external returns (uint256); - - /** - * @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower - * already supplied enough collateral, or he was given enough allowance by a credit delegator on the - * corresponding debt token (StableDebtToken or VariableDebtToken) - * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet - * and 100 stable/variable debt tokens, depending on the `interestRateMode` - * @param asset The address of the underlying asset to borrow - * @param amount The amount to be borrowed - * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself - * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator - * if he has been given credit delegation allowance - **/ - function borrow( - address asset, - uint256 amount, - uint256 interestRateMode, - uint16 referralCode, - address onBehalfOf - ) external; - - /** - * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned - * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` - * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable - * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the - * user calling the function if he wants to reduce/remove his own debt, or the address of any other - * other borrower whose debt should be removed - * @return The final amount repaid - **/ - function repay( - address asset, - uint256 amount, - uint256 interestRateMode, - address onBehalfOf - ) external returns (uint256); - - /** - * @notice Repay with transfer approval of asset to be repaid done via permit function - * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713 - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` - * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable - * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the - * user calling the function if he wants to reduce/remove his own debt, or the address of any other - * other borrower whose debt should be removed - * @param deadline The deadline timestamp that the permit is valid - * @param permitV The V parameter of ERC712 permit sig - * @param permitR The R parameter of ERC712 permit sig - * @param permitS The S parameter of ERC712 permit sig - * @return The final amount repaid - **/ - function repayWithPermit( - address asset, - uint256 amount, - uint256 interestRateMode, - address onBehalfOf, - uint256 deadline, - uint8 permitV, - bytes32 permitR, - bytes32 permitS - ) external returns (uint256); - - /** - * @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the - * equivalent debt tokens - * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens - * @dev Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken - * balance is not enough to cover the whole debt - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` - * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable - * @return The final amount repaid - **/ - function repayWithATokens( - address asset, - uint256 amount, - uint256 interestRateMode - ) external returns (uint256); - - /** - * @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa - * @param asset The address of the underlying asset borrowed - * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable - **/ - function swapBorrowRateMode(address asset, uint256 interestRateMode) external; - - /** - * @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve. - * - Users can be rebalanced if the following conditions are satisfied: - * 1. Usage ratio is above 95% - * 2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too - * much has been borrowed at a stable rate and suppliers are not earning enough - * @param asset The address of the underlying asset borrowed - * @param user The address of the user to be rebalanced - **/ - function rebalanceStableBorrowRate(address asset, address user) external; - - /** - * @notice Allows suppliers to enable/disable a specific supplied asset as collateral - * @param asset The address of the underlying asset supplied - * @param useAsCollateral True if the user wants to use the supply as collateral, false otherwise - **/ - function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) - external; - - /** - * @notice Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1 - * - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives - * a proportionally amount of the `collateralAsset` plus a bonus to cover market risk - * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation - * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation - * @param user The address of the borrower getting liquidated - * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover - * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants - * to receive the underlying collateral asset directly - **/ - function liquidationCall( - address collateralAsset, - address debtAsset, - address user, - uint256 debtToCover, - bool receiveAToken - ) external; - - /** - * @notice Allows smartcontracts to access the liquidity of the pool within one transaction, - * as long as the amount taken plus a fee is returned. - * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept - * into consideration. For further details please visit https://developers.aave.com - * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanReceiver interface - * @param assets The addresses of the assets being flash-borrowed - * @param amounts The amounts of the assets being flash-borrowed - * @param interestRateModes Types of the debt to open if the flash loan is not returned: - * 0 -> Don't open any debt, just revert if funds can't be transferred from the receiver - * 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address - * 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address - * @param onBehalfOf The address that will receive the debt in the case of using on `modes` 1 or 2 - * @param params Variadic packed params to pass to the receiver as extra information - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - **/ - function flashLoan( - address receiverAddress, - address[] calldata assets, - uint256[] calldata amounts, - uint256[] calldata interestRateModes, - address onBehalfOf, - bytes calldata params, - uint16 referralCode - ) external; - - /** - * @notice Allows smartcontracts to access the liquidity of the pool within one transaction, - * as long as the amount taken plus a fee is returned. - * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept - * into consideration. For further details please visit https://developers.aave.com - * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanSimpleReceiver interface - * @param asset The address of the asset being flash-borrowed - * @param amount The amount of the asset being flash-borrowed - * @param params Variadic packed params to pass to the receiver as extra information - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - **/ - function flashLoanSimple( - address receiverAddress, - address asset, - uint256 amount, - bytes calldata params, - uint16 referralCode - ) external; - - /** - * @notice Returns the user account data across all the reserves - * @param user The address of the user - * @return totalCollateralBase The total collateral of the user in the base currency used by the price feed - * @return totalDebtBase The total debt of the user in the base currency used by the price feed - * @return availableBorrowsBase The borrowing power left of the user in the base currency used by the price feed - * @return currentLiquidationThreshold The liquidation threshold of the user - * @return ltv The loan to value of The user - * @return healthFactor The current health factor of the user - **/ - function getUserAccountData(address user) - external - view - returns ( - uint256 totalCollateralBase, - uint256 totalDebtBase, - uint256 availableBorrowsBase, - uint256 currentLiquidationThreshold, - uint256 ltv, - uint256 healthFactor - ); - - /** - * @notice Initializes a reserve, activating it, assigning an aToken and debt tokens and an - * interest rate strategy - * @dev Only callable by the PoolConfigurator contract - * @param asset The address of the underlying asset of the reserve - * @param aTokenAddress The address of the aToken that will be assigned to the reserve - * @param stableDebtAddress The address of the StableDebtToken that will be assigned to the reserve - * @param variableDebtAddress The address of the VariableDebtToken that will be assigned to the reserve - * @param interestRateStrategyAddress The address of the interest rate strategy contract - **/ - function initReserve( - address asset, - address aTokenAddress, - address stableDebtAddress, - address variableDebtAddress, - address interestRateStrategyAddress - ) external; - - /** - * @notice Drop a reserve - * @dev Only callable by the PoolConfigurator contract - * @param asset The address of the underlying asset of the reserve - **/ - function dropReserve(address asset) external; - - /** - * @notice Updates the address of the interest rate strategy contract - * @dev Only callable by the PoolConfigurator contract - * @param asset The address of the underlying asset of the reserve - * @param rateStrategyAddress The address of the interest rate strategy contract - **/ - function setReserveInterestRateStrategyAddress( - address asset, - address rateStrategyAddress - ) external; - - /** - * @notice Sets the configuration bitmap of the reserve as a whole - * @dev Only callable by the PoolConfigurator contract - * @param asset The address of the underlying asset of the reserve - * @param configuration The new configuration bitmap - **/ - function setConfiguration( - address asset, - DataTypes.ReserveConfigurationMap calldata configuration - ) external; - - /** - * @notice Returns the configuration of the reserve - * @param asset The address of the underlying asset of the reserve - * @return The configuration of the reserve - **/ - function getConfiguration(address asset) - external - view - returns (DataTypes.ReserveConfigurationMap memory); - - /** - * @notice Returns the configuration of the user across all the reserves - * @param user The user address - * @return The configuration of the user - **/ - function getUserConfiguration(address user) - external - view - returns (DataTypes.UserConfigurationMap memory); - - /** - * @notice Returns the normalized income normalized income of the reserve - * @param asset The address of the underlying asset of the reserve - * @return The reserve's normalized income - */ - function getReserveNormalizedIncome(address asset) - external - view - returns (uint256); - - /** - * @notice Returns the normalized variable debt per unit of asset - * @param asset The address of the underlying asset of the reserve - * @return The reserve normalized variable debt - */ - function getReserveNormalizedVariableDebt(address asset) - external - view - returns (uint256); - - /** - * @notice Returns the state and configuration of the reserve - * @param asset The address of the underlying asset of the reserve - * @return The state and configuration data of the reserve - **/ - function getReserveData(address asset) - external - view - returns (DataTypes.ReserveData memory); - - /** - * @notice Validates and finalizes an aToken transfer - * @dev Only callable by the overlying aToken of the `asset` - * @param asset The address of the underlying asset of the aToken - * @param from The user from which the aTokens are transferred - * @param to The user receiving the aTokens - * @param amount The amount being transferred/withdrawn - * @param balanceFromBefore The aToken balance of the `from` user before the transfer - * @param balanceToBefore The aToken balance of the `to` user before the transfer - */ - function finalizeTransfer( - address asset, - address from, - address to, - uint256 amount, - uint256 balanceFromBefore, - uint256 balanceToBefore - ) external; - - /** - * @notice Returns the list of the underlying assets of all the initialized reserves - * @dev It does not include dropped reserves - * @return The addresses of the underlying assets of the initialized reserves - **/ - function getReservesList() external view returns (address[] memory); - - /** - * @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct - * @param id The id of the reserve as stored in the DataTypes.ReserveData struct - * @return The address of the reserve associated with id - **/ - function getReserveAddressById(uint16 id) external view returns (address); - - /** - * @notice Returns the PoolAddressesProvider connected to this contract - * @return The address of the PoolAddressesProvider - **/ - function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider); - - /** - * @notice Updates the protocol fee on the bridging - * @param bridgeProtocolFee The part of the premium sent to the protocol treasury - */ - function updateBridgeProtocolFee(uint256 bridgeProtocolFee) external; - - /** - * @notice Updates flash loan premiums. Flash loan premium consists of two parts: - * - A part is sent to aToken holders as extra, one time accumulated interest - * - A part is collected by the protocol treasury - * @dev The total premium is calculated on the total borrowed amount - * @dev The premium to protocol is calculated on the total premium, being a percentage of `flashLoanPremiumTotal` - * @dev Only callable by the PoolConfigurator contract - * @param flashLoanPremiumTotal The total premium, expressed in bps - * @param flashLoanPremiumToProtocol The part of the premium sent to the protocol treasury, expressed in bps - */ - function updateFlashloanPremiums( - uint128 flashLoanPremiumTotal, - uint128 flashLoanPremiumToProtocol - ) external; - - /** - * @notice Configures a new category for the eMode. - * @dev In eMode, the protocol allows very high borrowing power to borrow assets of the same category. - * The category 0 is reserved as it's the default for volatile assets - * @param id The id of the category - * @param config The configuration of the category - */ - function configureEModeCategory( - uint8 id, - DataTypes.EModeCategory memory config - ) external; - - /** - * @notice Returns the data of an eMode category - * @param id The id of the category - * @return The configuration data of the category - */ - function getEModeCategoryData(uint8 id) - external - view - returns (DataTypes.EModeCategory memory); - - /** - * @notice Allows a user to use the protocol in eMode - * @param categoryId The id of the category - */ - function setUserEMode(uint8 categoryId) external; - - /** - * @notice Returns the eMode the user is using - * @param user The address of the user - * @return The eMode id - */ - function getUserEMode(address user) external view returns (uint256); - - /** - * @notice Resets the isolation mode total debt of the given asset to zero - * @dev It requires the given asset has zero debt ceiling - * @param asset The address of the underlying asset to reset the isolationModeTotalDebt - */ - function resetIsolationModeTotalDebt(address asset) external; - - /** - * @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate - * @return The percentage of available liquidity to borrow, expressed in bps - */ - function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() - external - view - returns (uint256); - - /** - * @notice Returns the total fee on flash loans - * @return The total fee on flashloans - */ - function FLASHLOAN_PREMIUM_TOTAL() external view returns (uint128); - - /** - * @notice Returns the part of the bridge fees sent to protocol - * @return The bridge fee sent to the protocol treasury - */ - function BRIDGE_PROTOCOL_FEE() external view returns (uint256); - - /** - * @notice Returns the part of the flashloan fees sent to protocol - * @return The flashloan fee sent to the protocol treasury - */ - function FLASHLOAN_PREMIUM_TO_PROTOCOL() external view returns (uint128); - - /** - * @notice Returns the maximum number of reserves supported to be listed in this Pool - * @return The maximum number of reserves supported - */ - function MAX_NUMBER_RESERVES() external view returns (uint16); - - /** - * @notice Mints the assets accrued through the reserve factor to the treasury in the form of aTokens - * @param assets The list of reserves for which the minting needs to be executed - **/ - function mintToTreasury(address[] calldata assets) external; - - /** - * @notice Rescue and transfer tokens locked in this contract - * @param token The address of the token - * @param to The address of the recipient - * @param amount The amount of token to transfer - */ - function rescueTokens( - address token, - address to, - uint256 amount - ) external; - - /** - * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens. - * - E.g. User supplies 100 USDC and gets in return 100 aUSDC - * @dev Deprecated: Use the `supply` function instead - * @param asset The address of the underlying asset to supply - * @param amount The amount to be supplied - * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user - * wants to receive them on his own wallet, or a different address if the beneficiary of aTokens - * is a different wallet - * @param referralCode Code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - **/ - function deposit( - address asset, - uint256 amount, - address onBehalfOf, - uint16 referralCode - ) external; -} - -interface IPoolConfigurator { - /** - * @dev Emitted when a reserve is initialized. - * @param asset The address of the underlying asset of the reserve - * @param aToken The address of the associated aToken contract - * @param stableDebtToken The address of the associated stable rate debt token - * @param variableDebtToken The address of the associated variable rate debt token - * @param interestRateStrategyAddress The address of the interest rate strategy for the reserve - **/ - event ReserveInitialized( - address indexed asset, - address indexed aToken, - address stableDebtToken, - address variableDebtToken, - address interestRateStrategyAddress - ); - - /** - * @dev Emitted when borrowing is enabled or disabled on a reserve. - * @param asset The address of the underlying asset of the reserve - * @param enabled True if borrowing is enabled, false otherwise - **/ - event ReserveBorrowing(address indexed asset, bool enabled); - - /** - * @dev Emitted when the collateralization risk parameters for the specified asset are updated. - * @param asset The address of the underlying asset of the reserve - * @param ltv The loan to value of the asset when used as collateral - * @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized - * @param liquidationBonus The bonus liquidators receive to liquidate this asset - **/ - event CollateralConfigurationChanged( - address indexed asset, - uint256 ltv, - uint256 liquidationThreshold, - uint256 liquidationBonus - ); - - /** - * @dev Emitted when stable rate borrowing is enabled or disabled on a reserve - * @param asset The address of the underlying asset of the reserve - * @param enabled True if stable rate borrowing is enabled, false otherwise - **/ - event ReserveStableRateBorrowing(address indexed asset, bool enabled); - - /** - * @dev Emitted when a reserve is activated or deactivated - * @param asset The address of the underlying asset of the reserve - * @param active True if reserve is active, false otherwise - **/ - event ReserveActive(address indexed asset, bool active); - - /** - * @dev Emitted when a reserve is frozen or unfrozen - * @param asset The address of the underlying asset of the reserve - * @param frozen True if reserve is frozen, false otherwise - **/ - event ReserveFrozen(address indexed asset, bool frozen); - - /** - * @dev Emitted when a reserve is paused or unpaused - * @param asset The address of the underlying asset of the reserve - * @param paused True if reserve is paused, false otherwise - **/ - event ReservePaused(address indexed asset, bool paused); - - /** - * @dev Emitted when a reserve is dropped. - * @param asset The address of the underlying asset of the reserve - **/ - event ReserveDropped(address indexed asset); - - /** - * @dev Emitted when a reserve factor is updated. - * @param asset The address of the underlying asset of the reserve - * @param oldReserveFactor The old reserve factor, expressed in bps - * @param newReserveFactor The new reserve factor, expressed in bps - **/ - event ReserveFactorChanged( - address indexed asset, - uint256 oldReserveFactor, - uint256 newReserveFactor - ); - - /** - * @dev Emitted when the borrow cap of a reserve is updated. - * @param asset The address of the underlying asset of the reserve - * @param oldBorrowCap The old borrow cap - * @param newBorrowCap The new borrow cap - **/ - event BorrowCapChanged( - address indexed asset, - uint256 oldBorrowCap, - uint256 newBorrowCap - ); - - /** - * @dev Emitted when the supply cap of a reserve is updated. - * @param asset The address of the underlying asset of the reserve - * @param oldSupplyCap The old supply cap - * @param newSupplyCap The new supply cap - **/ - event SupplyCapChanged( - address indexed asset, - uint256 oldSupplyCap, - uint256 newSupplyCap - ); - - /** - * @dev Emitted when the liquidation protocol fee of a reserve is updated. - * @param asset The address of the underlying asset of the reserve - * @param oldFee The old liquidation protocol fee, expressed in bps - * @param newFee The new liquidation protocol fee, expressed in bps - **/ - event LiquidationProtocolFeeChanged( - address indexed asset, - uint256 oldFee, - uint256 newFee - ); - - /** - * @dev Emitted when the unbacked mint cap of a reserve is updated. - * @param asset The address of the underlying asset of the reserve - * @param oldUnbackedMintCap The old unbacked mint cap - * @param newUnbackedMintCap The new unbacked mint cap - */ - event UnbackedMintCapChanged( - address indexed asset, - uint256 oldUnbackedMintCap, - uint256 newUnbackedMintCap - ); - - /** - * @dev Emitted when the category of an asset in eMode is changed. - * @param asset The address of the underlying asset of the reserve - * @param oldCategoryId The old eMode asset category - * @param newCategoryId The new eMode asset category - **/ - event EModeAssetCategoryChanged( - address indexed asset, - uint8 oldCategoryId, - uint8 newCategoryId - ); - - /** - * @dev Emitted when a new eMode category is added. - * @param categoryId The new eMode category id - * @param ltv The ltv for the asset category in eMode - * @param liquidationThreshold The liquidationThreshold for the asset category in eMode - * @param liquidationBonus The liquidationBonus for the asset category in eMode - * @param oracle The optional address of the price oracle specific for this category - * @param label A human readable identifier for the category - **/ - event EModeCategoryAdded( - uint8 indexed categoryId, - uint256 ltv, - uint256 liquidationThreshold, - uint256 liquidationBonus, - address oracle, - string label - ); - - /** - * @dev Emitted when a reserve interest strategy contract is updated. - * @param asset The address of the underlying asset of the reserve - * @param oldStrategy The address of the old interest strategy contract - * @param newStrategy The address of the new interest strategy contract - **/ - event ReserveInterestRateStrategyChanged( - address indexed asset, - address oldStrategy, - address newStrategy - ); - - /** - * @dev Emitted when an aToken implementation is upgraded. - * @param asset The address of the underlying asset of the reserve - * @param proxy The aToken proxy address - * @param implementation The new aToken implementation - **/ - event ATokenUpgraded( - address indexed asset, - address indexed proxy, - address indexed implementation - ); - - /** - * @dev Emitted when the implementation of a stable debt token is upgraded. - * @param asset The address of the underlying asset of the reserve - * @param proxy The stable debt token proxy address - * @param implementation The new aToken implementation - **/ - event StableDebtTokenUpgraded( - address indexed asset, - address indexed proxy, - address indexed implementation - ); - - /** - * @dev Emitted when the implementation of a variable debt token is upgraded. - * @param asset The address of the underlying asset of the reserve - * @param proxy The variable debt token proxy address - * @param implementation The new aToken implementation - **/ - event VariableDebtTokenUpgraded( - address indexed asset, - address indexed proxy, - address indexed implementation - ); - - /** - * @dev Emitted when the debt ceiling of an asset is set. - * @param asset The address of the underlying asset of the reserve - * @param oldDebtCeiling The old debt ceiling - * @param newDebtCeiling The new debt ceiling - **/ - event DebtCeilingChanged( - address indexed asset, - uint256 oldDebtCeiling, - uint256 newDebtCeiling - ); - - /** - * @dev Emitted when the the siloed borrowing state for an asset is changed. - * @param asset The address of the underlying asset of the reserve - * @param oldState The old siloed borrowing state - * @param newState The new siloed borrowing state - **/ - event SiloedBorrowingChanged( - address indexed asset, - bool oldState, - bool newState - ); - - /** - * @dev Emitted when the bridge protocol fee is updated. - * @param oldBridgeProtocolFee The old protocol fee, expressed in bps - * @param newBridgeProtocolFee The new protocol fee, expressed in bps - */ - event BridgeProtocolFeeUpdated( - uint256 oldBridgeProtocolFee, - uint256 newBridgeProtocolFee - ); - - /** - * @dev Emitted when the total premium on flashloans is updated. - * @param oldFlashloanPremiumTotal The old premium, expressed in bps - * @param newFlashloanPremiumTotal The new premium, expressed in bps - **/ - event FlashloanPremiumTotalUpdated( - uint128 oldFlashloanPremiumTotal, - uint128 newFlashloanPremiumTotal - ); - - /** - * @dev Emitted when the part of the premium that goes to protocol is updated. - * @param oldFlashloanPremiumToProtocol The old premium, expressed in bps - * @param newFlashloanPremiumToProtocol The new premium, expressed in bps - **/ - event FlashloanPremiumToProtocolUpdated( - uint128 oldFlashloanPremiumToProtocol, - uint128 newFlashloanPremiumToProtocol - ); - - /** - * @dev Emitted when the reserve is set as borrowable/non borrowable in isolation mode. - * @param asset The address of the underlying asset of the reserve - * @param borrowable True if the reserve is borrowable in isolation, false otherwise - **/ - event BorrowableInIsolationChanged(address asset, bool borrowable); - - /** - * @notice Initializes multiple reserves. - * @param input The array of initialization parameters - **/ - function initReserves( - ConfiguratorInputTypes.InitReserveInput[] calldata input - ) external; - - /** - * @dev Updates the aToken implementation for the reserve. - * @param input The aToken update parameters - **/ - function updateAToken(ConfiguratorInputTypes.UpdateATokenInput calldata input) - external; - - /** - * @notice Updates the stable debt token implementation for the reserve. - * @param input The stableDebtToken update parameters - **/ - function updateStableDebtToken( - ConfiguratorInputTypes.UpdateDebtTokenInput calldata input - ) external; - - /** - * @notice Updates the variable debt token implementation for the asset. - * @param input The variableDebtToken update parameters - **/ - function updateVariableDebtToken( - ConfiguratorInputTypes.UpdateDebtTokenInput calldata input - ) external; - - /** - * @notice Configures borrowing on a reserve. - * @dev Can only be disabled (set to false) if stable borrowing is disabled - * @param asset The address of the underlying asset of the reserve - * @param enabled True if borrowing needs to be enabled, false otherwise - **/ - function setReserveBorrowing(address asset, bool enabled) external; - - /** - * @notice Configures the reserve collateralization parameters. - * @dev All the values are expressed in bps. A value of 10000, results in 100.00% - * @dev The `liquidationBonus` is always above 100%. A value of 105% means the liquidator will receive a 5% bonus - * @param asset The address of the underlying asset of the reserve - * @param ltv The loan to value of the asset when used as collateral - * @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized - * @param liquidationBonus The bonus liquidators receive to liquidate this asset - **/ - function configureReserveAsCollateral( - address asset, - uint256 ltv, - uint256 liquidationThreshold, - uint256 liquidationBonus - ) external; - - /** - * @notice Enable or disable stable rate borrowing on a reserve. - * @dev Can only be enabled (set to true) if borrowing is enabled - * @param asset The address of the underlying asset of the reserve - * @param enabled True if stable rate borrowing needs to be enabled, false otherwise - **/ - function setReserveStableRateBorrowing(address asset, bool enabled) external; - - /** - * @notice Activate or deactivate a reserve - * @param asset The address of the underlying asset of the reserve - * @param active True if the reserve needs to be active, false otherwise - **/ - function setReserveActive(address asset, bool active) external; - - /** - * @notice Freeze or unfreeze a reserve. A frozen reserve doesn't allow any new supply, borrow - * or rate swap but allows repayments, liquidations, rate rebalances and withdrawals. - * @param asset The address of the underlying asset of the reserve - * @param freeze True if the reserve needs to be frozen, false otherwise - **/ - function setReserveFreeze(address asset, bool freeze) external; - - /** - * @notice Sets the borrowable in isolation flag for the reserve. - * @dev When this flag is set to true, the asset will be borrowable against isolated collaterals and the - * borrowed amount will be accumulated in the isolated collateral's total debt exposure - * @dev Only assets of the same family (e.g. USD stablecoins) should be borrowable in isolation mode to keep - * consistency in the debt ceiling calculations - * @param asset The address of the underlying asset of the reserve - * @param borrowable True if the asset should be borrowable in isolation, false otherwise - **/ - function setBorrowableInIsolation(address asset, bool borrowable) external; - - /** - * @notice Pauses a reserve. A paused reserve does not allow any interaction (supply, borrow, repay, - * swap interest rate, liquidate, atoken transfers). - * @param asset The address of the underlying asset of the reserve - * @param paused True if pausing the reserve, false if unpausing - **/ - function setReservePause(address asset, bool paused) external; - - /** - * @notice Updates the reserve factor of a reserve. - * @param asset The address of the underlying asset of the reserve - * @param newReserveFactor The new reserve factor of the reserve - **/ - function setReserveFactor(address asset, uint256 newReserveFactor) external; - - /** - * @notice Sets the interest rate strategy of a reserve. - * @param asset The address of the underlying asset of the reserve - * @param newRateStrategyAddress The address of the new interest strategy contract - **/ - function setReserveInterestRateStrategyAddress( - address asset, - address newRateStrategyAddress - ) external; - - /** - * @notice Pauses or unpauses all the protocol reserves. In the paused state all the protocol interactions - * are suspended. - * @param paused True if protocol needs to be paused, false otherwise - **/ - function setPoolPause(bool paused) external; - - /** - * @notice Updates the borrow cap of a reserve. - * @param asset The address of the underlying asset of the reserve - * @param newBorrowCap The new borrow cap of the reserve - **/ - function setBorrowCap(address asset, uint256 newBorrowCap) external; - - /** - * @notice Updates the supply cap of a reserve. - * @param asset The address of the underlying asset of the reserve - * @param newSupplyCap The new supply cap of the reserve - **/ - function setSupplyCap(address asset, uint256 newSupplyCap) external; - - /** - * @notice Updates the liquidation protocol fee of reserve. - * @param asset The address of the underlying asset of the reserve - * @param newFee The new liquidation protocol fee of the reserve, expressed in bps - **/ - function setLiquidationProtocolFee(address asset, uint256 newFee) external; - - /** - * @notice Updates the unbacked mint cap of reserve. - * @param asset The address of the underlying asset of the reserve - * @param newUnbackedMintCap The new unbacked mint cap of the reserve - **/ - function setUnbackedMintCap(address asset, uint256 newUnbackedMintCap) - external; - - /** - * @notice Assign an efficiency mode (eMode) category to asset. - * @param asset The address of the underlying asset of the reserve - * @param newCategoryId The new category id of the asset - **/ - function setAssetEModeCategory(address asset, uint8 newCategoryId) external; - - /** - * @notice Adds a new efficiency mode (eMode) category. - * @dev If zero is provided as oracle address, the default asset oracles will be used to compute the overall debt and - * overcollateralization of the users using this category. - * @dev The new ltv and liquidation threshold must be greater than the base - * ltvs and liquidation thresholds of all assets within the eMode category - * @param categoryId The id of the category to be configured - * @param ltv The ltv associated with the category - * @param liquidationThreshold The liquidation threshold associated with the category - * @param liquidationBonus The liquidation bonus associated with the category - * @param oracle The oracle associated with the category - * @param label A label identifying the category - **/ - function setEModeCategory( - uint8 categoryId, - uint16 ltv, - uint16 liquidationThreshold, - uint16 liquidationBonus, - address oracle, - string calldata label - ) external; - - /** - * @notice Drops a reserve entirely. - * @param asset The address of the reserve to drop - **/ - function dropReserve(address asset) external; - - /** - * @notice Updates the bridge fee collected by the protocol reserves. - * @param newBridgeProtocolFee The part of the fee sent to the protocol treasury, expressed in bps - */ - function updateBridgeProtocolFee(uint256 newBridgeProtocolFee) external; - - /** - * @notice Updates the total flash loan premium. - * Total flash loan premium consists of two parts: - * - A part is sent to aToken holders as extra balance - * - A part is collected by the protocol reserves - * @dev Expressed in bps - * @dev The premium is calculated on the total amount borrowed - * @param newFlashloanPremiumTotal The total flashloan premium - */ - function updateFlashloanPremiumTotal(uint128 newFlashloanPremiumTotal) - external; - - /** - * @notice Updates the flash loan premium collected by protocol reserves - * @dev Expressed in bps - * @dev The premium to protocol is calculated on the total flashloan premium - * @param newFlashloanPremiumToProtocol The part of the flashloan premium sent to the protocol treasury - */ - function updateFlashloanPremiumToProtocol( - uint128 newFlashloanPremiumToProtocol - ) external; - - /** - * @notice Sets the debt ceiling for an asset. - * @param newDebtCeiling The new debt ceiling - */ - function setDebtCeiling(address asset, uint256 newDebtCeiling) external; - - /** - * @notice Sets siloed borrowing for an asset - * @param siloed The new siloed borrowing state - */ - function setSiloedBorrowing(address asset, bool siloed) external; -} - -interface IPriceOracleGetter { - /** - * @notice Returns the base currency address - * @dev Address 0x0 is reserved for USD as base currency. - * @return Returns the base currency address. - **/ - function BASE_CURRENCY() external view returns (address); - - /** - * @notice Returns the base currency unit - * @dev 1 ether for ETH, 1e8 for USD. - * @return Returns the base currency unit. - **/ - function BASE_CURRENCY_UNIT() external view returns (uint256); - - /** - * @notice Returns the asset price in the base currency - * @param asset The address of the asset - * @return The price of the asset - **/ - function getAssetPrice(address asset) external view returns (uint256); -} - -interface IAaveOracle is IPriceOracleGetter { - /** - * @dev Emitted after the base currency is set - * @param baseCurrency The base currency of used for price quotes - * @param baseCurrencyUnit The unit of the base currency - */ - event BaseCurrencySet(address indexed baseCurrency, uint256 baseCurrencyUnit); - - /** - * @dev Emitted after the price source of an asset is updated - * @param asset The address of the asset - * @param source The price source of the asset - */ - event AssetSourceUpdated(address indexed asset, address indexed source); - - /** - * @dev Emitted after the address of fallback oracle is updated - * @param fallbackOracle The address of the fallback oracle - */ - event FallbackOracleUpdated(address indexed fallbackOracle); - - /** - * @notice Returns the PoolAddressesProvider - * @return The address of the PoolAddressesProvider contract - */ - function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider); - - /** - * @notice Sets or replaces price sources of assets - * @param assets The addresses of the assets - * @param sources The addresses of the price sources - */ - function setAssetSources( - address[] calldata assets, - address[] calldata sources - ) external; - - /** - * @notice Sets the fallback oracle - * @param fallbackOracle The address of the fallback oracle - */ - function setFallbackOracle(address fallbackOracle) external; - - /** - * @notice Returns a list of prices from a list of assets addresses - * @param assets The list of assets addresses - * @return The prices of the given assets - */ - function getAssetsPrices(address[] calldata assets) - external - view - returns (uint256[] memory); - - /** - * @notice Returns the address of the source for an asset address - * @param asset The address of the asset - * @return The address of the source - */ - function getSourceOfAsset(address asset) external view returns (address); - - /** - * @notice Returns the address of the fallback oracle - * @return The address of the fallback oracle - */ - function getFallbackOracle() external view returns (address); -} - -struct TokenData { - string symbol; - address tokenAddress; -} - -// TODO: add better documentation -interface IAaveProtocolDataProvider { - function getAllReservesTokens() external view returns (TokenData[] memory); - - function getAllATokens() external view returns (TokenData[] memory); - - function getReserveConfigurationData(address asset) - external - view - returns ( - uint256 decimals, - uint256 ltv, - uint256 liquidationThreshold, - uint256 liquidationBonus, - uint256 reserveFactor, - bool usageAsCollateralEnabled, - bool borrowingEnabled, - bool stableBorrowRateEnabled, - bool isActive, - bool isFrozen - ); - - function getReserveEModeCategory(address asset) - external - view - returns (uint256); - - function getReserveCaps(address asset) - external - view - returns (uint256 borrowCap, uint256 supplyCap); - - function getPaused(address asset) external view returns (bool isPaused); - - function getSiloedBorrowing(address asset) external view returns (bool); - - function getLiquidationProtocolFee(address asset) - external - view - returns (uint256); - - function getUnbackedMintCap(address asset) external view returns (uint256); - - function getDebtCeiling(address asset) external view returns (uint256); - - function getDebtCeilingDecimals() external pure returns (uint256); - - /** - * @notice Returns the reserve data - * @param asset The address of the underlying asset of the reserve - * @return unbacked The amount of unbacked tokens - * @return accruedToTreasuryScaled The scaled amount of tokens accrued to treasury that is to be minted - * @return totalAToken The total supply of the aToken - * @return totalStableDebt The total stable debt of the reserve - * @return totalVariableDebt The total variable debt of the reserve - * @return liquidityRate The liquidity rate of the reserve - * @return variableBorrowRate The variable borrow rate of the reserve - * @return stableBorrowRate The stable borrow rate of the reserve - * @return averageStableBorrowRate The average stable borrow rate of the reserve - * @return liquidityIndex The liquidity index of the reserve - * @return variableBorrowIndex The variable borrow index of the reserve - * @return lastUpdateTimestamp The timestamp of the last update of the reserve - **/ - function getReserveData(address asset) - external - view - returns ( - uint256 unbacked, - uint256 accruedToTreasuryScaled, - uint256 totalAToken, - uint256 totalStableDebt, - uint256 totalVariableDebt, - uint256 liquidityRate, - uint256 variableBorrowRate, - uint256 stableBorrowRate, - uint256 averageStableBorrowRate, - uint256 liquidityIndex, - uint256 variableBorrowIndex, - uint40 lastUpdateTimestamp - ); - - /** - * @notice Returns the total supply of aTokens for a given asset - * @param asset The address of the underlying asset of the reserve - * @return The total supply of the aToken - **/ - function getATokenTotalSupply(address asset) external view returns (uint256); - - /** - * @notice Returns the total debt for a given asset - * @param asset The address of the underlying asset of the reserve - * @return The total debt for asset - **/ - function getTotalDebt(address asset) external view returns (uint256); - - function getUserReserveData(address asset, address user) - external - view - returns ( - uint256 currentATokenBalance, - uint256 currentStableDebt, - uint256 currentVariableDebt, - uint256 principalStableDebt, - uint256 scaledVariableDebt, - uint256 stableBorrowRate, - uint256 liquidityRate, - uint40 stableRateLastUpdated, - bool usageAsCollateralEnabled - ); - - function getReserveTokensAddresses(address asset) - external - view - returns ( - address aTokenAddress, - address stableDebtTokenAddress, - address variableDebtTokenAddress - ); - - function getInterestRateStrategyAddress(address asset) - external - view - returns (address irStrategyAddress); -} - -/** - * @title IACLManager - * @author Aave - * @notice Defines the basic interface for the ACL Manager - **/ -interface IACLManager { - /** - * @notice Returns the contract address of the PoolAddressesProvider - * @return The address of the PoolAddressesProvider - */ - function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider); - - /** - * @notice Returns the identifier of the PoolAdmin role - * @return The id of the PoolAdmin role - */ - function POOL_ADMIN_ROLE() external view returns (bytes32); - - /** - * @notice Returns the identifier of the EmergencyAdmin role - * @return The id of the EmergencyAdmin role - */ - function EMERGENCY_ADMIN_ROLE() external view returns (bytes32); - - /** - * @notice Returns the identifier of the RiskAdmin role - * @return The id of the RiskAdmin role - */ - function RISK_ADMIN_ROLE() external view returns (bytes32); - - /** - * @notice Returns the identifier of the FlashBorrower role - * @return The id of the FlashBorrower role - */ - function FLASH_BORROWER_ROLE() external view returns (bytes32); - - /** - * @notice Returns the identifier of the Bridge role - * @return The id of the Bridge role - */ - function BRIDGE_ROLE() external view returns (bytes32); - - /** - * @notice Returns the identifier of the AssetListingAdmin role - * @return The id of the AssetListingAdmin role - */ - function ASSET_LISTING_ADMIN_ROLE() external view returns (bytes32); - - /** - * @notice Set the role as admin of a specific role. - * @dev By default the admin role for all roles is `DEFAULT_ADMIN_ROLE`. - * @param role The role to be managed by the admin role - * @param adminRole The admin role - */ - function setRoleAdmin(bytes32 role, bytes32 adminRole) external; - - /** - * @notice Adds a new admin as PoolAdmin - * @param admin The address of the new admin - */ - function addPoolAdmin(address admin) external; - - /** - * @notice Removes an admin as PoolAdmin - * @param admin The address of the admin to remove - */ - function removePoolAdmin(address admin) external; - - /** - * @notice Returns true if the address is PoolAdmin, false otherwise - * @param admin The address to check - * @return True if the given address is PoolAdmin, false otherwise - */ - function isPoolAdmin(address admin) external view returns (bool); - - /** - * @notice Adds a new admin as EmergencyAdmin - * @param admin The address of the new admin - */ - function addEmergencyAdmin(address admin) external; - - /** - * @notice Removes an admin as EmergencyAdmin - * @param admin The address of the admin to remove - */ - function removeEmergencyAdmin(address admin) external; - - /** - * @notice Returns true if the address is EmergencyAdmin, false otherwise - * @param admin The address to check - * @return True if the given address is EmergencyAdmin, false otherwise - */ - function isEmergencyAdmin(address admin) external view returns (bool); - - /** - * @notice Adds a new admin as RiskAdmin - * @param admin The address of the new admin - */ - function addRiskAdmin(address admin) external; - - /** - * @notice Removes an admin as RiskAdmin - * @param admin The address of the admin to remove - */ - function removeRiskAdmin(address admin) external; - - /** - * @notice Returns true if the address is RiskAdmin, false otherwise - * @param admin The address to check - * @return True if the given address is RiskAdmin, false otherwise - */ - function isRiskAdmin(address admin) external view returns (bool); - - /** - * @notice Adds a new address as FlashBorrower - * @param borrower The address of the new FlashBorrower - */ - function addFlashBorrower(address borrower) external; - - /** - * @notice Removes an admin as FlashBorrower - * @param borrower The address of the FlashBorrower to remove - */ - function removeFlashBorrower(address borrower) external; - - /** - * @notice Returns true if the address is FlashBorrower, false otherwise - * @param borrower The address to check - * @return True if the given address is FlashBorrower, false otherwise - */ - function isFlashBorrower(address borrower) external view returns (bool); - - /** - * @notice Adds a new address as Bridge - * @param bridge The address of the new Bridge - */ - function addBridge(address bridge) external; - - /** - * @notice Removes an address as Bridge - * @param bridge The address of the bridge to remove - */ - function removeBridge(address bridge) external; - - /** - * @notice Returns true if the address is Bridge, false otherwise - * @param bridge The address to check - * @return True if the given address is Bridge, false otherwise - */ - function isBridge(address bridge) external view returns (bool); - - /** - * @notice Adds a new admin as AssetListingAdmin - * @param admin The address of the new admin - */ - function addAssetListingAdmin(address admin) external; - - /** - * @notice Removes an admin as AssetListingAdmin - * @param admin The address of the admin to remove - */ - function removeAssetListingAdmin(address admin) external; - - /** - * @notice Returns true if the address is AssetListingAdmin, false otherwise - * @param admin The address to check - * @return True if the given address is AssetListingAdmin, false otherwise - */ - function isAssetListingAdmin(address admin) external view returns (bool); - - /** - * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` - * - * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite - * {RoleAdminChanged} not being emitted signaling this. - * - * _Available since v3.1._ - */ - event RoleAdminChanged( - bytes32 indexed role, - bytes32 indexed previousAdminRole, - bytes32 indexed newAdminRole - ); - - /** - * @dev Emitted when `account` is granted `role`. - * - * `sender` is the account that originated the contract call, an admin role - * bearer except when using {AccessControl-_setupRole}. - */ - event RoleGranted( - bytes32 indexed role, - address indexed account, - address indexed sender - ); - - // Parent Access Control Interface - /** - * @dev Emitted when `account` is revoked `role`. - * - * `sender` is the account that originated the contract call: - * - if using `revokeRole`, it is the admin role bearer - * - if using `renounceRole`, it is the role bearer (i.e. `account`) - */ - event RoleRevoked( - bytes32 indexed role, - address indexed account, - address indexed sender - ); - - /** - * @dev Returns `true` if `account` has been granted `role`. - */ - function hasRole(bytes32 role, address account) external view returns (bool); - - /** - * @dev Returns the admin role that controls `role`. See {grantRole} and - * {revokeRole}. - * - * To change a role's admin, use {AccessControl-_setRoleAdmin}. - */ - function getRoleAdmin(bytes32 role) external view returns (bytes32); - - /** - * @dev Grants `role` to `account`. - * - * If `account` had not been already granted `role`, emits a {RoleGranted} - * event. - * - * Requirements: - * - * - the caller must have ``role``'s admin role. - */ - function grantRole(bytes32 role, address account) external; - - /** - * @dev Revokes `role` from `account`. - * - * If `account` had been granted `role`, emits a {RoleRevoked} event. - * - * Requirements: - * - * - the caller must have ``role``'s admin role. - */ - function revokeRole(bytes32 role, address account) external; - - /** - * @dev Revokes `role` from the calling account. - * - * Roles are often managed via {grantRole} and {revokeRole}: this function's - * purpose is to provide a mechanism for accounts to lose their privileges - * if they are compromised (such as when a trusted device is misplaced). - * - * If the calling account had been granted `role`, emits a {RoleRevoked} - * event. - * - * Requirements: - * - * - the caller must be `account`. - */ - function renounceRole(bytes32 role, address account) external; -} +import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {ConfiguratorInputTypes} from 'aave-v3-core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol'; +import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.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} from 'aave-v3-core/contracts/interfaces/IACLManager.sol'; +import {IPoolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol'; interface IInterestRateStrategy { /** diff --git a/src/AaveV3Arbitrum.sol b/src/AaveV3Arbitrum.sol index b0db44bc..682faf3f 100644 --- a/src/AaveV3Arbitrum.sol +++ b/src/AaveV3Arbitrum.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Arbitrum { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Arbitrum { IAaveOracle internal constant ORACLE = IAaveOracle(0xb56c2F0B653B2e0b10C9b928C8580Ac5Df02C7C7); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); IACLManager internal constant ACL_MANAGER = IACLManager(0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B); diff --git a/src/AaveV3ArbitrumGoerli.sol b/src/AaveV3ArbitrumGoerli.sol index 398358ee..52f20333 100644 --- a/src/AaveV3ArbitrumGoerli.sol +++ b/src/AaveV3ArbitrumGoerli.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3ArbitrumGoerli { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3ArbitrumGoerli { IAaveOracle internal constant ORACLE = IAaveOracle(0x86b4D2636EC473AC4A5dD83Fc2BEDa98845249A7); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0xce3Aa85237C075d2102b7B35079d305307D745C8); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0xce3Aa85237C075d2102b7B35079d305307D745C8); IACLManager internal constant ACL_MANAGER = IACLManager(0xe8599F3cc5D38a9aD6F3684cd5CEa72f10Dbc383); diff --git a/src/AaveV3Avalanche.sol b/src/AaveV3Avalanche.sol index da033886..4ca52401 100644 --- a/src/AaveV3Avalanche.sol +++ b/src/AaveV3Avalanche.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Avalanche { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Avalanche { IAaveOracle internal constant ORACLE = IAaveOracle(0xEBd36016B3eD09D4693Ed4251c67Bd858c3c7C9C); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); IACLManager internal constant ACL_MANAGER = IACLManager(0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B); diff --git a/src/AaveV3Fantom.sol b/src/AaveV3Fantom.sol index 0efcf7f3..d7d8b28c 100644 --- a/src/AaveV3Fantom.sol +++ b/src/AaveV3Fantom.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Fantom { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Fantom { IAaveOracle internal constant ORACLE = IAaveOracle(0xfd6f3c1845604C8AE6c6E402ad17fb9885160754); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); IACLManager internal constant ACL_MANAGER = IACLManager(0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B); diff --git a/src/AaveV3FantomTestnet.sol b/src/AaveV3FantomTestnet.sol index 692739cf..77338257 100644 --- a/src/AaveV3FantomTestnet.sol +++ b/src/AaveV3FantomTestnet.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3FantomTestnet { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3FantomTestnet { IAaveOracle internal constant ORACLE = IAaveOracle(0xA840C768f7143495790eC8dc2D5f32B71B6Dc113); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0xCbAcff915f2d10727844ab0f2A4D9768954981e4); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0xCbAcff915f2d10727844ab0f2A4D9768954981e4); IACLManager internal constant ACL_MANAGER = IACLManager(0x94f154aba287b3024fb32386463FC52d488bb09B); diff --git a/src/AaveV3Fuji.sol b/src/AaveV3Fuji.sol index 4d602663..b8b5b050 100644 --- a/src/AaveV3Fuji.sol +++ b/src/AaveV3Fuji.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Fuji { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Fuji { IAaveOracle internal constant ORACLE = IAaveOracle(0xAc6D153BF94aFBdC296e72163735B0f94581F736); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x8e0988b28f9CdDe0134A206dfF94111578498C63); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x8e0988b28f9CdDe0134A206dfF94111578498C63); IACLManager internal constant ACL_MANAGER = IACLManager(0xAa6Fd640173bcA58e5a5CC373531F9038eF3F9e1); diff --git a/src/AaveV3Goerli.sol b/src/AaveV3Goerli.sol index de0f71b5..4ee0f0d9 100644 --- a/src/AaveV3Goerli.sol +++ b/src/AaveV3Goerli.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Goerli { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Goerli { IAaveOracle internal constant ORACLE = IAaveOracle(0x5bed0810073cc9f0DacF73C648202249E87eF6cB); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x9BE876c6DC42215B00d7efe892E2691C3bc35d10); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x9BE876c6DC42215B00d7efe892E2691C3bc35d10); IACLManager internal constant ACL_MANAGER = IACLManager(0x4c952A81A72A6BA2919a658feff1e7F023e4aadc); diff --git a/src/AaveV3Harmony.sol b/src/AaveV3Harmony.sol index 5f78cb67..6892139b 100644 --- a/src/AaveV3Harmony.sol +++ b/src/AaveV3Harmony.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Harmony { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Harmony { IAaveOracle internal constant ORACLE = IAaveOracle(0x3C90887Ede8D65ccb2777A5d577beAb2548280AD); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); IACLManager internal constant ACL_MANAGER = IACLManager(0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B); diff --git a/src/AaveV3Mumbai.sol b/src/AaveV3Mumbai.sol index 9ba6cd18..43efc504 100644 --- a/src/AaveV3Mumbai.sol +++ b/src/AaveV3Mumbai.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Mumbai { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Mumbai { IAaveOracle internal constant ORACLE = IAaveOracle(0x520D14AE678b41067f029Ad770E2870F85E76588); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x8f57153F18b7273f9A814b93b31Cb3f9b035e7C2); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x8f57153F18b7273f9A814b93b31Cb3f9b035e7C2); IACLManager internal constant ACL_MANAGER = IACLManager(0x6437b6E14D7ECa1Fa9854df92eB067253D5f683A); diff --git a/src/AaveV3Optimism.sol b/src/AaveV3Optimism.sol index 1ba2cc0f..62fe6c51 100644 --- a/src/AaveV3Optimism.sol +++ b/src/AaveV3Optimism.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Optimism { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Optimism { IAaveOracle internal constant ORACLE = IAaveOracle(0xD81eb3728a631871a7eBBaD631b5f424909f0c77); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); IACLManager internal constant ACL_MANAGER = IACLManager(0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B); diff --git a/src/AaveV3OptimismGoerli.sol b/src/AaveV3OptimismGoerli.sol index 629cf58a..1dc8da3b 100644 --- a/src/AaveV3OptimismGoerli.sol +++ b/src/AaveV3OptimismGoerli.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3OptimismGoerli { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3OptimismGoerli { IAaveOracle internal constant ORACLE = IAaveOracle(0x171Af9229972716f28DBB04DBFC712F05B45B021); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x42BdE9c98B80e83F1B051B4bb11812aDa314213a); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x42BdE9c98B80e83F1B051B4bb11812aDa314213a); IACLManager internal constant ACL_MANAGER = IACLManager(0x9B14C2DEe92CE731da32bf861Ca4Fb2202662248); diff --git a/src/AaveV3Polygon.sol b/src/AaveV3Polygon.sol index 86f123e6..b51e346b 100644 --- a/src/AaveV3Polygon.sol +++ b/src/AaveV3Polygon.sol @@ -2,7 +2,7 @@ // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; -import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IAaveProtocolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; library AaveV3Polygon { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -17,8 +17,8 @@ library AaveV3Polygon { IAaveOracle internal constant ORACLE = IAaveOracle(0xb023e699F5a33916Ea823A16485e259257cA8Bd1); - IAaveProtocolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = - IAaveProtocolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); IACLManager internal constant ACL_MANAGER = IACLManager(0xa72636CbcAa8F5FF95B2cc47F3CDEe83F3294a0B); From d1d5fcb45af546612f907e1baad9544484175d4a Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 14 Dec 2022 13:28:20 +0100 Subject: [PATCH 2/9] fix: removed custom interface for rate strategy in favor of aave-v3-core --- .gitmodules | 2 +- lib/aave-v3-core | 2 +- src/AaveV3.sol | 106 +---------------------------------------------- 3 files changed, 4 insertions(+), 106 deletions(-) diff --git a/.gitmodules b/.gitmodules index cf27d744..52e28b23 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,4 +5,4 @@ [submodule "lib/aave-v3-core"] path = lib/aave-v3-core url = https://github.com/aave/aave-v3-core - branch = fix/738-soften-datatypes-sol-version + branch = feat/3.0.1 diff --git a/lib/aave-v3-core b/lib/aave-v3-core index 3b4ea336..a00dda8f 160000 --- a/lib/aave-v3-core +++ b/lib/aave-v3-core @@ -1 +1 @@ -Subproject commit 3b4ea336204b3e1996663e49aeb9d4f7df96c9c2 +Subproject commit a00dda8faf464f6b0d338cf7e902e5931e0edbea diff --git a/src/AaveV3.sol b/src/AaveV3.sol index fdd22226..fec1179d 100644 --- a/src/AaveV3.sol +++ b/src/AaveV3.sol @@ -10,110 +10,8 @@ import {IPriceOracleGetter} from 'aave-v3-core/contracts/interfaces/IPriceOracle import {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol'; import {IACLManager} from 'aave-v3-core/contracts/interfaces/IACLManager.sol'; import {IPoolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol'; - -interface IInterestRateStrategy { - /** - * @dev This constant represents the usage ratio at which the pool aims to obtain most competitive borrow rates. - * Expressed in ray - */ - function OPTIMAL_USAGE_RATIO() external view returns (uint256); - - /** - * @dev This constant represents the optimal stable debt to total debt ratio of the reserve. - * Expressed in ray - */ - function OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO() external view returns (uint256); - - /** - * @dev This constant represents the excess usage ratio above the optimal. It's always equal to - * 1-optimal usage ratio. Added as a constant here for gas optimizations. - * Expressed in ray - */ - function MAX_EXCESS_USAGE_RATIO() external view returns (uint256); - - /** - * @dev This constant represents the excess stable debt ratio above the optimal. It's always equal to - * 1-optimal stable to total debt ratio. Added as a constant here for gas optimizations. - * Expressed in ray - */ - function MAX_EXCESS_STABLE_TO_TOTAL_DEBT_RATIO() - external - view - returns (uint256); - - function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider); - - /** - * @notice Returns the variable rate slope below optimal usage ratio - * @dev Its the variable rate when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO - * @return The variable rate slope - */ - function getVariableRateSlope1() external view returns (uint256); - - /** - * @notice Returns the variable rate slope above optimal usage ratio - * @dev Its the variable rate when usage ratio > OPTIMAL_USAGE_RATIO - * @return The variable rate slope - */ - function getVariableRateSlope2() external view returns (uint256); - - /** - * @notice Returns the stable rate slope below optimal usage ratio - * @dev Its the stable rate when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO - * @return The stable rate slope - */ - function getStableRateSlope1() external view returns (uint256); - - /** - * @notice Returns the stable rate slope above optimal usage ratio - * @dev Its the variable rate when usage ratio > OPTIMAL_USAGE_RATIO - * @return The stable rate slope - */ - function getStableRateSlope2() external view returns (uint256); - - /** - * @notice Returns the stable rate excess offset - * @dev An additional premium applied to the stable when stable debt > OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO - * @return The stable rate excess offset - */ - function getStableRateExcessOffset() external view returns (uint256); - - /** - * @notice Returns the base stable borrow rate - * @return The base stable borrow rate - */ - function getBaseStableBorrowRate() external view returns (uint256); - - /** - * @notice Returns the base variable borrow rate - * @return The base variable borrow rate, expressed in ray - */ - function getBaseVariableBorrowRate() external view returns (uint256); - - /** - * @notice Returns the maximum variable borrow rate - * @return The maximum variable borrow rate, expressed in ray - */ - function getMaxVariableBorrowRate() external view returns (uint256); - - /** - * @notice Calculates the interest rates depending on the reserve's state and configurations - * @param params The parameters needed to calculate interest rates - * @return liquidityRate The liquidity rate expressed in rays - * @return stableBorrowRate The stable borrow rate expressed in rays - * @return variableBorrowRate The variable borrow rate expressed in rays - */ - function calculateInterestRates( - DataTypes.CalculateInterestRatesParams memory params - ) - external - view - returns ( - uint256, - uint256, - uint256 - ); -} +import {IDefaultInterestRateStrategy} from "aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategy.sol"; +import {IReserveInterestRateStrategy} from "aave-v3-core/contracts/interfaces/IReserveInterestRateStrategy.sol"; /** * @title ICollector From 0972d64b3d0ef54bc852a082964bf58ec5ecba62 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 21 Dec 2022 14:39:27 +0100 Subject: [PATCH 3/9] =?UTF-8?q?fix:=20adds=20v3=20ethereum=20protocol=20ad?= =?UTF-8?q?dresses.=20adds=20patch=20to=20take=20into=20acc=E2=80=A6=20(#4?= =?UTF-8?q?9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: adds v3 ethereum protocol addresses. adds patch to take into account pools that have no reserves * fix: added extra addresses * fix: added extra addresses for v3 ethereum * fix: correct checksummed addresses --- scripts/config.ts | 19 ++- scripts/generator_v2.ts | 5 +- scripts/generator_v3.ts | 240 +++++++++++++++++++++++------------ scripts/helpers.ts | 12 ++ src/AaveAddressBook.sol | 1 + src/AaveV2Avalanche.sol | 7 + src/AaveV2Ethereum.sol | 7 + src/AaveV2EthereumAMM.sol | 7 + src/AaveV2Fuji.sol | 5 + src/AaveV2Goerli.sol | 5 + src/AaveV2Mumbai.sol | 5 + src/AaveV2Polygon.sol | 7 + src/AaveV3Arbitrum.sol | 7 + src/AaveV3ArbitrumGoerli.sol | 5 + src/AaveV3Avalanche.sol | 7 + src/AaveV3Ethereum.sol | 45 +++++++ src/AaveV3Fantom.sol | 7 + src/AaveV3FantomTestnet.sol | 5 + src/AaveV3Fuji.sol | 5 + src/AaveV3Goerli.sol | 5 + src/AaveV3Harmony.sol | 3 + src/AaveV3Mumbai.sol | 5 + src/AaveV3Optimism.sol | 7 + src/AaveV3OptimismGoerli.sol | 5 + src/AaveV3Polygon.sol | 7 + src/ts/AaveAddressBook.ts | 1 + src/ts/AaveV3Ethereum.ts | 24 ++++ src/ts/AaveV3Fantom.ts | 2 +- 28 files changed, 374 insertions(+), 86 deletions(-) create mode 100644 src/AaveV3Ethereum.sol create mode 100644 src/ts/AaveV3Ethereum.ts diff --git a/scripts/config.ts b/scripts/config.ts index 2dca82c8..51444ea2 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -244,7 +244,7 @@ export const pools: Pool[] = [ version: 3, additionalAddresses: { WETH_GATEWAY: "0x1DcDA4de2Bf6c7AD9a34788D22aE6b7d55016e1f", - SWAP_COLLATERAL_ADAPTER: "0xe387c6053ce8ec9f8c3fa5ce085af73114a695d3", + SWAP_COLLATERAL_ADAPTER: "0xE387c6053CE8EC9f8C3fa5cE085Af73114a695d3", REPAY_WITH_COLLATERAL_ADAPTER: "0x1408401B2A7E28cB747b3e258D0831Fc926bAC51", }, @@ -289,6 +289,23 @@ export const pools: Pool[] = [ FAUCET: "0xC52eA1F19C22E5a3725105BC0cf4988614e84D98", }, }, + { + name: "AaveV3Ethereum", + chainId: ChainId.mainnet, + addressProvider: "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e", + version: 3, + additionalAddresses: { + WETH_GATEWAY: "0x694d4cFdaeE639239df949b6E24Ff8576A00d1f2", + EMISSION_MANAGER: "0xcAA448c8066f741C3137cEa9758dF3fB377CBF4E", + COLLECTOR_CONTROLLER: "0x3d569673dAa0575c936c7c67c4E6AedA69CC630C", + COLLECTOR: "0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c", + DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1: "0x801934c604aBA0C8C46454c67F88A4a45a766a91", + DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_1: "0x2688a209086Ae56e7b3598Ec68A0Cba3B965CD06", + DEFAULT_A_TOKEN_IMPL_REV_1: "0xca21517bac12053E7fD6C326EDF89C5cc60d813f", + DEFAULT_INCENTIVES_CONTROLLER: "0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb" + + }, + }, ].map((m) => ({ ...m, // fix checksum diff --git a/scripts/generator_v2.ts b/scripts/generator_v2.ts index 8bae1543..8693cc86 100644 --- a/scripts/generator_v2.ts +++ b/scripts/generator_v2.ts @@ -6,7 +6,7 @@ import lendingPoolV2ABI from "./abi/lending_pool_v2_abi.json"; import aTokenV2ABI from "./abi/aToken_v2_abi.json"; import collectorV2ABI from "./abi/collector_v2_abi.json"; import prettier from "prettier"; -import { generateAdditionalAddresses } from "./helpers"; +import {generateAdditionalAddresses, generateAdditionalAddressesSol} from "./helpers"; export interface PoolV2WithAddresses extends Pool { lendingPool: string; @@ -106,6 +106,9 @@ export async function generatePoolV2(pool: Pool): Promise { address internal constant COLLECTOR = ${collector}; address internal constant COLLECTOR_CONTROLLER = ${collectorController}; + + ${generateAdditionalAddressesSol(pool)} + }\r\n`; fs.writeFileSync( `./src/${pool.name}.sol`, diff --git a/scripts/generator_v3.ts b/scripts/generator_v3.ts index 2e6cb0ef..5c5fe2ef 100644 --- a/scripts/generator_v3.ts +++ b/scripts/generator_v3.ts @@ -11,7 +11,7 @@ import rewardsControllerABI from "./abi/rewardsController_v3_abi.json"; import prettier from "prettier"; import { bytes32toAddress, - generateAdditionalAddresses, + generateAdditionalAddresses, generateAdditionalAddressesSol, getImplementationStorageSlot, sleep, } from "./helpers"; @@ -51,80 +51,84 @@ export async function generatePoolV3(pool: Pool): Promise { pool.provider ); const reserves: string[] = await lendingPoolContract.getReservesList(); - const data = await lendingPoolContract.getReserveData(reserves[0]); - - /** - * While the reserve treasury address is per token in most cases it will be the same address, so for the sake of the address-book we assume it always is. - */ - const aTokenContract = new ethers.Contract( - data.aTokenAddress, - aTokenV3ABI, - pool.provider - ); + if (reserves.length > 0) { + const data = await lendingPoolContract.getReserveData(reserves[0]); + + /** + * While the reserve treasury address is per token in most cases it will be the same address, so for the sake of the address-book we assume it always is. + */ + const aTokenContract = new ethers.Contract( + data.aTokenAddress, + aTokenV3ABI, + pool.provider + ); - const collector = await aTokenContract.RESERVE_TREASURY_ADDRESS(); + const collector = await aTokenContract.RESERVE_TREASURY_ADDRESS(); - const defaultIncentivesController = - await aTokenContract.getIncentivesController(); + const defaultIncentivesController = + await aTokenContract.getIncentivesController(); - const defaultATokenImplementation = bytes32toAddress( - await getImplementationStorageSlot(pool.provider, data.aTokenAddress) - ); - - const aTokenRevision = await aTokenContract.ATOKEN_REVISION(); + const defaultATokenImplementation = bytes32toAddress( + await getImplementationStorageSlot(pool.provider, data.aTokenAddress) + ); - await sleep(1000); + const aTokenRevision = await aTokenContract.ATOKEN_REVISION(); - const defaultVariableDebtTokenImplementation = bytes32toAddress( - await getImplementationStorageSlot( - pool.provider, - data.variableDebtTokenAddress - ) - ); + await sleep(1000); - const variableDebtTokenRevision = await new ethers.Contract( - data.variableDebtTokenAddress, - variableDebtTokenV3ABI, - pool.provider - ).DEBT_TOKEN_REVISION(); + const defaultVariableDebtTokenImplementation = bytes32toAddress( + await getImplementationStorageSlot( + pool.provider, + data.variableDebtTokenAddress + ) + ); - const defaultStableDebtTokenImplementation = bytes32toAddress( - await getImplementationStorageSlot( - pool.provider, - data.stableDebtTokenAddress - ) - ); + const variableDebtTokenRevision = await new ethers.Contract( + data.variableDebtTokenAddress, + variableDebtTokenV3ABI, + pool.provider + ).DEBT_TOKEN_REVISION(); - const stableDebtTokenRevision = await new ethers.Contract( - data.stableDebtTokenAddress, - stableDebtTokenV3ABI, - pool.provider - ).DEBT_TOKEN_REVISION(); + const defaultStableDebtTokenImplementation = bytes32toAddress( + await getImplementationStorageSlot( + pool.provider, + data.stableDebtTokenAddress + ) + ); - const collectorContract = new ethers.Contract( - collector, - collectorV3ABI, - pool.provider - ); + const stableDebtTokenRevision = await new ethers.Contract( + data.stableDebtTokenAddress, + stableDebtTokenV3ABI, + pool.provider + ).DEBT_TOKEN_REVISION(); - let emissionManager = "0x0000000000000000000000000000000000000000"; - try { - const incentivesControllerContract = await new ethers.Contract( - defaultIncentivesController, - rewardsControllerABI, + const collectorContract = new ethers.Contract( + collector, + collectorV3ABI, pool.provider ); - emissionManager = await incentivesControllerContract.getEmissionManager(); - } catch (e) { - console.log( - `old version of incentives controller deployed on ${pool.name}` - ); - } - const collectorController = await collectorContract.getFundsAdmin(); - console.timeEnd(pool.name); + let emissionManager = "0x0000000000000000000000000000000000000000"; + try { + const incentivesControllerContract = await new ethers.Contract( + defaultIncentivesController, + rewardsControllerABI, + pool.provider + ); + emissionManager = await incentivesControllerContract.getEmissionManager(); + } catch (e) { + console.log( + `old version of incentives controller deployed on ${pool.name}` + ); + } + + const collectorController = await collectorContract.getFundsAdmin(); + + + console.timeEnd(pool.name); - const templateV3 = `// SPDX-License-Identifier: MIT + + const templateV3 = `// SPDX-License-Identifier: MIT // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; @@ -164,13 +168,16 @@ export async function generatePoolV3(pool: Pool): Promise { address internal constant DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_${stableDebtTokenRevision} = ${defaultStableDebtTokenImplementation}; address internal constant EMISSION_MANAGER = ${emissionManager}; + + ${generateAdditionalAddressesSol(pool)} + }\r\n`; - fs.writeFileSync( - `./src/${pool.name}.sol`, - prettier.format(templateV3, { filepath: `./src/${pool.name}.sol` }) - ); + fs.writeFileSync( + `./src/${pool.name}.sol`, + prettier.format(templateV3, {filepath: `./src/${pool.name}.sol`}) + ); - const templateV3Js = `// AUTOGENERATED - DON'T MANUALLY CHANGE + const templateV3Js = `// AUTOGENERATED - DON'T MANUALLY CHANGE export const POOL_ADDRESSES_PROVIDER = "${addressProvider}"; export const POOL = "${poolAddress}"; export const POOL_CONFIGURATOR = "${poolConfigurator}"; @@ -187,24 +194,91 @@ export const DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_${stableDebtTokenRevision} = "${ export const CHAIN_ID = ${pool.chainId}; export const EMISSION_MANAGER = "${emissionManager}"; ${generateAdditionalAddresses(pool)}`; - fs.writeFileSync( - `./src/ts/${pool.name}.ts`, - prettier.format(templateV3Js, { - filepath: `./src/ts/${pool.name}.ts`, - }) - ); + fs.writeFileSync( + `./src/ts/${pool.name}.ts`, + prettier.format(templateV3Js, { + filepath: `./src/ts/${pool.name}.ts`, + }) + ); + + return { + pool: poolAddress, + poolConfigurator, + oracle, + aclAdmin, + aclManager, + poolDataProvider, + collectorController, + collector, + ...pool, + }; + } else { + console.timeEnd(pool.name); + + const templateV3 = `// SPDX-License-Identifier: MIT + // AUTOGENERATED - DON'T MANUALLY CHANGE + pragma solidity >=0.6.0; + + import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; + + library ${pool.name} { + IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = + IPoolAddressesProvider( + ${addressProvider} + ); + + IPool internal constant POOL = + IPool(${poolAddress}); + + IPoolConfigurator internal constant POOL_CONFIGURATOR = + IPoolConfigurator(${poolConfigurator}); + + IAaveOracle internal constant ORACLE = + IAaveOracle(${oracle}); + + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = IPoolDataProvider(${poolDataProvider}); + + IACLManager internal constant ACL_MANAGER = IACLManager(${aclManager}); - return { - pool: poolAddress, - poolConfigurator, - oracle, - aclAdmin, - aclManager, - poolDataProvider, - collectorController, - collector, - ...pool, - }; + address internal constant ACL_ADMIN = ${aclAdmin}; + + ${generateAdditionalAddressesSol(pool)} + + }\r\n`; + fs.writeFileSync( + `./src/${pool.name}.sol`, + prettier.format(templateV3, {filepath: `./src/${pool.name}.sol`}) + ); + + const templateV3Js = `// AUTOGENERATED - DON'T MANUALLY CHANGE +export const POOL_ADDRESSES_PROVIDER = "${addressProvider}"; +export const POOL = "${poolAddress}"; +export const POOL_CONFIGURATOR = "${poolConfigurator}"; +export const ORACLE = "${oracle}"; +export const AAVE_PROTOCOL_DATA_PROVIDER = "${poolDataProvider}"; +export const ACL_MANAGER = "${aclManager}"; +export const ACL_ADMIN = "${aclAdmin}"; +export const CHAIN_ID = ${pool.chainId}; +${generateAdditionalAddresses(pool)}`; + fs.writeFileSync( + `./src/ts/${pool.name}.ts`, + prettier.format(templateV3Js, { + filepath: `./src/ts/${pool.name}.ts`, + }) + ); + + return { + pool: poolAddress, + poolConfigurator, + oracle, + aclAdmin, + aclManager, + poolDataProvider, + collectorController: '', + collector: '', + ...pool, + }; + } } catch (error: any) { throw new Error( JSON.stringify({ message: error.message, pool, stack: error.stack }) diff --git a/scripts/helpers.ts b/scripts/helpers.ts index 60ea46ac..c3287a23 100644 --- a/scripts/helpers.ts +++ b/scripts/helpers.ts @@ -27,6 +27,18 @@ export const generateAdditionalAddresses = (pool: Pool): string => { return ""; }; +export const generateAdditionalAddressesSol = (pool: Pool): string => { + if (pool.additionalAddresses) { + return Object.keys(pool.additionalAddresses).reduce((acc, key) => { + acc += `address internal constant ${key} = ${ + pool.additionalAddresses![key as keyof typeof pool.additionalAddresses] + };\r\n`; + return acc; + }, ""); + } + return ""; +}; + export async function sleep(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)); } diff --git a/src/AaveAddressBook.sol b/src/AaveAddressBook.sol index 05c40398..2829e637 100644 --- a/src/AaveAddressBook.sol +++ b/src/AaveAddressBook.sol @@ -21,6 +21,7 @@ import {AaveV3Fantom} from "./AaveV3Fantom.sol"; import {AaveV3Harmony} from "./AaveV3Harmony.sol"; import {AaveV3Optimism} from "./AaveV3Optimism.sol"; import {AaveV3OptimismGoerli} from "./AaveV3OptimismGoerli.sol"; +import {AaveV3Ethereum} from "./AaveV3Ethereum.sol"; import {AaveGovernanceV2, IGovernanceStrategy} from "./AaveGovernanceV2.sol"; import {IAaveEcosystemReserveController, AaveMisc} from "./AaveMisc.sol"; diff --git a/src/AaveV2Avalanche.sol b/src/AaveV2Avalanche.sol index 87782efd..fee85d5c 100644 --- a/src/AaveV2Avalanche.sol +++ b/src/AaveV2Avalanche.sol @@ -32,4 +32,11 @@ library AaveV2Avalanche { 0x467b92aF281d14cB6809913AD016a607b5ba8A36; address internal constant COLLECTOR_CONTROLLER = address(0); + + address internal constant WETH_GATEWAY = + 0xC27d4dBefc2C0CE57916a699971b58a3BD9C7d5b; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0x2EcF2a2e74B19Aab2a62312167aFF4B78E93B6C5; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x935b362EE3E1f342cc48118C528AAbee5118F6e6; } diff --git a/src/AaveV2Ethereum.sol b/src/AaveV2Ethereum.sol index a43d918a..64f82067 100644 --- a/src/AaveV2Ethereum.sol +++ b/src/AaveV2Ethereum.sol @@ -33,4 +33,11 @@ library AaveV2Ethereum { address internal constant COLLECTOR_CONTROLLER = 0x3d569673dAa0575c936c7c67c4E6AedA69CC630C; + + address internal constant WETH_GATEWAY = + 0xEFFC18fC3b7eb8E676dac549E0c693ad50D1Ce31; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x80Aca0C645fEdABaa20fd2Bf0Daf57885A309FE6; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0x135896DE8421be2ec868E0b811006171D9df802A; } diff --git a/src/AaveV2EthereumAMM.sol b/src/AaveV2EthereumAMM.sol index fcf3733c..a625c6a1 100644 --- a/src/AaveV2EthereumAMM.sol +++ b/src/AaveV2EthereumAMM.sol @@ -33,4 +33,11 @@ library AaveV2EthereumAMM { address internal constant COLLECTOR_CONTROLLER = 0x3d569673dAa0575c936c7c67c4E6AedA69CC630C; + + address internal constant WETH_GATEWAY = + 0x1C4a4e31231F71Fc34867D034a9E68f6fC798249; + address internal constant WALLET_BALANCE_PROVIDER = + 0x8E8dAd5409E0263a51C0aB5055dA66Be28cFF922; + address internal constant UI_POOL_DATA_PROVIDER = + 0x30375522F67a6308630d49A694ca1491fA2D3BC6; } diff --git a/src/AaveV2Fuji.sol b/src/AaveV2Fuji.sol index 95f2b39d..2e361800 100644 --- a/src/AaveV2Fuji.sol +++ b/src/AaveV2Fuji.sol @@ -32,4 +32,9 @@ library AaveV2Fuji { 0xB45F5C501A22288dfdb897e5f73E189597e09288; address internal constant COLLECTOR_CONTROLLER = address(0); + + address internal constant WETH_GATEWAY = + 0x1648C14DbB6ccdd5846969cE23DeEC4C66a03335; + address internal constant FAUCET = + 0x90E5BAc5A98fff59617080848959f44eACB4Cd7B; } diff --git a/src/AaveV2Goerli.sol b/src/AaveV2Goerli.sol index 06029bfa..da83a64e 100644 --- a/src/AaveV2Goerli.sol +++ b/src/AaveV2Goerli.sol @@ -32,4 +32,9 @@ library AaveV2Goerli { 0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c; address internal constant COLLECTOR_CONTROLLER = address(0); + + address internal constant WETH_GATEWAY = + 0x3bd3a20Ac9Ff1dda1D99C0dFCE6D65C4960B3627; + address internal constant FAUCET = + 0x681860075529352da2C94082Eb66c59dF958e89C; } diff --git a/src/AaveV2Mumbai.sol b/src/AaveV2Mumbai.sol index 4cc6c46c..512535d3 100644 --- a/src/AaveV2Mumbai.sol +++ b/src/AaveV2Mumbai.sol @@ -32,4 +32,9 @@ library AaveV2Mumbai { 0x943E44157dC0302a5CEb172374d1749018a00994; address internal constant COLLECTOR_CONTROLLER = address(0); + + address internal constant WETH_GATEWAY = + 0xee9eE614Ad26963bEc1Bec0D2c92879ae1F209fA; + address internal constant FAUCET = + 0x0b3C23243106A69449e79C14c58BB49E358f9B10; } diff --git a/src/AaveV2Polygon.sol b/src/AaveV2Polygon.sol index e88bae77..73c46101 100644 --- a/src/AaveV2Polygon.sol +++ b/src/AaveV2Polygon.sol @@ -33,4 +33,11 @@ library AaveV2Polygon { address internal constant COLLECTOR_CONTROLLER = 0xDB89487A449274478e984665b8692AfC67459deF; + + address internal constant WETH_GATEWAY = + 0xAeBF56223F044a73A513FAD7E148A9075227eD9b; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0x35784a624D4FfBC3594f4d16fA3801FeF063241c; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0xE84cF064a0a65290Ae5673b500699f3753063936; } diff --git a/src/AaveV3Arbitrum.sol b/src/AaveV3Arbitrum.sol index 682faf3f..e566b355 100644 --- a/src/AaveV3Arbitrum.sol +++ b/src/AaveV3Arbitrum.sol @@ -46,4 +46,11 @@ library AaveV3Arbitrum { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0xB5Ee21786D28c5Ba61661550879475976B707099; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0xAE9f94BD98eC2831a1330e0418bE0fDb5C95C2B9; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x32FdC26aFFA1eB331263Bcdd59F2e46eCbCC2E24; } diff --git a/src/AaveV3ArbitrumGoerli.sol b/src/AaveV3ArbitrumGoerli.sol index 52f20333..cc25600d 100644 --- a/src/AaveV3ArbitrumGoerli.sol +++ b/src/AaveV3ArbitrumGoerli.sol @@ -46,4 +46,9 @@ library AaveV3ArbitrumGoerli { address internal constant EMISSION_MANAGER = 0xb023e699F5a33916Ea823A16485e259257cA8Bd1; + + address internal constant WETH_GATEWAY = + 0xBCca2fc5F30A65cE2155d739364f3fc8F57E6999; + address internal constant FAUCET = + 0x98256500C9f1CE77e4C925b7bbF1588515E34422; } diff --git a/src/AaveV3Avalanche.sol b/src/AaveV3Avalanche.sol index 4ca52401..8a08c08b 100644 --- a/src/AaveV3Avalanche.sol +++ b/src/AaveV3Avalanche.sol @@ -46,4 +46,11 @@ library AaveV3Avalanche { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0x6F143FE2F7B02424ad3CaD1593D6f36c0Aab69d7; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x8a743090e9759E758d15a4CFd18408fb6332c625; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0xF7fC20D9D1D8DFE55F5F2c3180272a5747dD327F; } diff --git a/src/AaveV3Ethereum.sol b/src/AaveV3Ethereum.sol new file mode 100644 index 00000000..1136315c --- /dev/null +++ b/src/AaveV3Ethereum.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: MIT +// AUTOGENERATED - DON'T MANUALLY CHANGE +pragma solidity >=0.6.0; + +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; + +library AaveV3Ethereum { + IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = + IPoolAddressesProvider(0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e); + + IPool internal constant POOL = + IPool(0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2); + + IPoolConfigurator internal constant POOL_CONFIGURATOR = + IPoolConfigurator(0x64b761D848206f447Fe2dd461b0c635Ec39EbB27); + + IAaveOracle internal constant ORACLE = + IAaveOracle(0x54586bE62E3c3580375aE3723C145253060Ca0C2); + + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x7B4EB56E7CD4b454BA8ff71E4518426369a138a3); + + IACLManager internal constant ACL_MANAGER = + IACLManager(0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0); + + address internal constant ACL_ADMIN = + 0xEE56e2B3D491590B5b31738cC34d5232F378a8D5; + + address internal constant WETH_GATEWAY = + 0x694d4cFdaeE639239df949b6E24Ff8576A00d1f2; + address internal constant EMISSION_MANAGER = + 0xcAA448c8066f741C3137cEa9758dF3fB377CBF4E; + address internal constant COLLECTOR_CONTROLLER = + 0x3d569673dAa0575c936c7c67c4E6AedA69CC630C; + address internal constant COLLECTOR = + 0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c; + address internal constant DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1 = + 0x801934c604aBA0C8C46454c67F88A4a45a766a91; + address internal constant DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_1 = + 0x2688a209086Ae56e7b3598Ec68A0Cba3B965CD06; + address internal constant DEFAULT_A_TOKEN_IMPL_REV_1 = + 0xca21517bac12053E7fD6C326EDF89C5cc60d813f; + address internal constant DEFAULT_INCENTIVES_CONTROLLER = + 0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb; +} diff --git a/src/AaveV3Fantom.sol b/src/AaveV3Fantom.sol index d7d8b28c..dc0d2c1d 100644 --- a/src/AaveV3Fantom.sol +++ b/src/AaveV3Fantom.sol @@ -46,4 +46,11 @@ library AaveV3Fantom { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0x1DcDA4de2Bf6c7AD9a34788D22aE6b7d55016e1f; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0xE387c6053CE8EC9f8C3fa5cE085Af73114a695d3; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x1408401B2A7E28cB747b3e258D0831Fc926bAC51; } diff --git a/src/AaveV3FantomTestnet.sol b/src/AaveV3FantomTestnet.sol index 77338257..67c442f5 100644 --- a/src/AaveV3FantomTestnet.sol +++ b/src/AaveV3FantomTestnet.sol @@ -46,4 +46,9 @@ library AaveV3FantomTestnet { address internal constant EMISSION_MANAGER = 0x0000000000000000000000000000000000000000; + + address internal constant WETH_GATEWAY = + 0x87770f04Bbece8092d777860907798138825f303; + address internal constant FAUCET = + 0x02D538e56A729C535F83b2DA20Ddf9AD7281FE6c; } diff --git a/src/AaveV3Fuji.sol b/src/AaveV3Fuji.sol index b8b5b050..9b10bc18 100644 --- a/src/AaveV3Fuji.sol +++ b/src/AaveV3Fuji.sol @@ -46,4 +46,9 @@ library AaveV3Fuji { address internal constant EMISSION_MANAGER = 0x0000000000000000000000000000000000000000; + + address internal constant WETH_GATEWAY = + 0x8f57153F18b7273f9A814b93b31Cb3f9b035e7C2; + address internal constant FAUCET = + 0x127277bF2F5fA186bfC6b3a0ca00baefB5472d3a; } diff --git a/src/AaveV3Goerli.sol b/src/AaveV3Goerli.sol index 4ee0f0d9..f0f1bb1b 100644 --- a/src/AaveV3Goerli.sol +++ b/src/AaveV3Goerli.sol @@ -46,4 +46,9 @@ library AaveV3Goerli { address internal constant EMISSION_MANAGER = 0xefF40A6d9De203A8806F4F62D86d5C4c5856965E; + + address internal constant WETH_GATEWAY = + 0xd5B55D3Ed89FDa19124ceB5baB620328287b915d; + address internal constant FAUCET = + 0x1ca525Cd5Cb77DB5Fa9cBbA02A0824e283469DBe; } diff --git a/src/AaveV3Harmony.sol b/src/AaveV3Harmony.sol index 6892139b..e8f68cb4 100644 --- a/src/AaveV3Harmony.sol +++ b/src/AaveV3Harmony.sol @@ -46,4 +46,7 @@ library AaveV3Harmony { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0xE387c6053CE8EC9f8C3fa5cE085Af73114a695d3; } diff --git a/src/AaveV3Mumbai.sol b/src/AaveV3Mumbai.sol index 43efc504..f769c4e5 100644 --- a/src/AaveV3Mumbai.sol +++ b/src/AaveV3Mumbai.sol @@ -46,4 +46,9 @@ library AaveV3Mumbai { address internal constant EMISSION_MANAGER = 0x0000000000000000000000000000000000000000; + + address internal constant WETH_GATEWAY = + 0x2a58E9bbb5434FdA7FF78051a4B82cb0EF669C17; + address internal constant FAUCET = + 0xc1eB89DA925cc2Ae8B36818d26E12DDF8F8601b0; } diff --git a/src/AaveV3Optimism.sol b/src/AaveV3Optimism.sol index 62fe6c51..4ae7a0f1 100644 --- a/src/AaveV3Optimism.sol +++ b/src/AaveV3Optimism.sol @@ -46,4 +46,11 @@ library AaveV3Optimism { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0x76D3030728e52DEB8848d5613aBaDE88441cbc59; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0xC7524B08101dBe695d7ad671a332760b5d967Cbd; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x70371a494f73A8Df658C5cd29E2C1601787e1009; } diff --git a/src/AaveV3OptimismGoerli.sol b/src/AaveV3OptimismGoerli.sol index 1dc8da3b..9d73814f 100644 --- a/src/AaveV3OptimismGoerli.sol +++ b/src/AaveV3OptimismGoerli.sol @@ -46,4 +46,9 @@ library AaveV3OptimismGoerli { address internal constant EMISSION_MANAGER = 0x46382F2A0E5BF6cbBa72821DFfe3b1CB9630C6E6; + + address internal constant WETH_GATEWAY = + 0x6f7f2440006221F893c587b88f01afc42B6F8d2e; + address internal constant FAUCET = + 0xC52eA1F19C22E5a3725105BC0cf4988614e84D98; } diff --git a/src/AaveV3Polygon.sol b/src/AaveV3Polygon.sol index b51e346b..163d67d2 100644 --- a/src/AaveV3Polygon.sol +++ b/src/AaveV3Polygon.sol @@ -46,4 +46,11 @@ library AaveV3Polygon { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0x1e4b7A6b903680eab0c5dAbcb8fD429cD2a9598c; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0xA125561fca253f19eA93970534Bb0364ea74187a; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0x301F221bc732907E2da2dbBFaA8F8F6847c170c3; } diff --git a/src/ts/AaveAddressBook.ts b/src/ts/AaveAddressBook.ts index 41c1df53..fccc6813 100644 --- a/src/ts/AaveAddressBook.ts +++ b/src/ts/AaveAddressBook.ts @@ -21,3 +21,4 @@ export * as AaveV3Fantom from "./AaveV3Fantom"; export * as AaveV3Harmony from "./AaveV3Harmony"; export * as AaveV3Optimism from "./AaveV3Optimism"; export * as AaveV3OptimismGoerli from "./AaveV3OptimismGoerli"; +export * as AaveV3Ethereum from "./AaveV3Ethereum"; diff --git a/src/ts/AaveV3Ethereum.ts b/src/ts/AaveV3Ethereum.ts new file mode 100644 index 00000000..3d59855d --- /dev/null +++ b/src/ts/AaveV3Ethereum.ts @@ -0,0 +1,24 @@ +// AUTOGENERATED - DON'T MANUALLY CHANGE +export const POOL_ADDRESSES_PROVIDER = + "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e"; +export const POOL = "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2"; +export const POOL_CONFIGURATOR = "0x64b761D848206f447Fe2dd461b0c635Ec39EbB27"; +export const ORACLE = "0x54586bE62E3c3580375aE3723C145253060Ca0C2"; +export const AAVE_PROTOCOL_DATA_PROVIDER = + "0x7B4EB56E7CD4b454BA8ff71E4518426369a138a3"; +export const ACL_MANAGER = "0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0"; +export const ACL_ADMIN = "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5"; +export const CHAIN_ID = 1; +export const WETH_GATEWAY = "0x694d4cFdaeE639239df949b6E24Ff8576A00d1f2"; +export const EMISSION_MANAGER = "0xcAA448c8066f741C3137cEa9758dF3fB377CBF4E"; +export const COLLECTOR_CONTROLLER = + "0x3d569673dAa0575c936c7c67c4E6AedA69CC630C"; +export const COLLECTOR = "0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c"; +export const DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1 = + "0x801934c604aBA0C8C46454c67F88A4a45a766a91"; +export const DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_1 = + "0x2688a209086Ae56e7b3598Ec68A0Cba3B965CD06"; +export const DEFAULT_A_TOKEN_IMPL_REV_1 = + "0xca21517bac12053E7fD6C326EDF89C5cc60d813f"; +export const DEFAULT_INCENTIVES_CONTROLLER = + "0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb"; diff --git a/src/ts/AaveV3Fantom.ts b/src/ts/AaveV3Fantom.ts index 297f31dc..b0faf698 100644 --- a/src/ts/AaveV3Fantom.ts +++ b/src/ts/AaveV3Fantom.ts @@ -23,6 +23,6 @@ export const CHAIN_ID = 250; export const EMISSION_MANAGER = "0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73"; export const WETH_GATEWAY = "0x1DcDA4de2Bf6c7AD9a34788D22aE6b7d55016e1f"; export const SWAP_COLLATERAL_ADAPTER = - "0xe387c6053ce8ec9f8c3fa5ce085af73114a695d3"; + "0xE387c6053CE8EC9f8C3fa5cE085Af73114a695d3"; export const REPAY_WITH_COLLATERAL_ADAPTER = "0x1408401B2A7E28cB747b3e258D0831Fc926bAC51"; From 255522d262aae1f0f8f10f4e2c2978ad5e95d942 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 21 Dec 2022 15:09:00 +0100 Subject: [PATCH 4/9] fix: added draft --- scripts/config.ts | 2 +- src/AaveAddressBook.sol | 2 +- src/{AaveV3Ethereum.sol => AaveV3EthereumDraft.sol} | 2 +- src/ts/AaveAddressBook.ts | 2 +- src/ts/{AaveV3Ethereum.ts => AaveV3EthereumDraft.ts} | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename src/{AaveV3Ethereum.sol => AaveV3EthereumDraft.sol} (98%) rename src/ts/{AaveV3Ethereum.ts => AaveV3EthereumDraft.ts} (100%) diff --git a/scripts/config.ts b/scripts/config.ts index 51444ea2..6317719f 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -290,7 +290,7 @@ export const pools: Pool[] = [ }, }, { - name: "AaveV3Ethereum", + name: "AaveV3EthereumDraft", chainId: ChainId.mainnet, addressProvider: "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e", version: 3, diff --git a/src/AaveAddressBook.sol b/src/AaveAddressBook.sol index 2829e637..484b353b 100644 --- a/src/AaveAddressBook.sol +++ b/src/AaveAddressBook.sol @@ -21,7 +21,7 @@ import {AaveV3Fantom} from "./AaveV3Fantom.sol"; import {AaveV3Harmony} from "./AaveV3Harmony.sol"; import {AaveV3Optimism} from "./AaveV3Optimism.sol"; import {AaveV3OptimismGoerli} from "./AaveV3OptimismGoerli.sol"; -import {AaveV3Ethereum} from "./AaveV3Ethereum.sol"; +import {AaveV3EthereumDraft} from "./AaveV3EthereumDraft.sol"; import {AaveGovernanceV2, IGovernanceStrategy} from "./AaveGovernanceV2.sol"; import {IAaveEcosystemReserveController, AaveMisc} from "./AaveMisc.sol"; diff --git a/src/AaveV3Ethereum.sol b/src/AaveV3EthereumDraft.sol similarity index 98% rename from src/AaveV3Ethereum.sol rename to src/AaveV3EthereumDraft.sol index 1136315c..9ff03e0a 100644 --- a/src/AaveV3Ethereum.sol +++ b/src/AaveV3EthereumDraft.sol @@ -4,7 +4,7 @@ pragma solidity >=0.6.0; import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; -library AaveV3Ethereum { +library AaveV3EthereumDraft { IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = IPoolAddressesProvider(0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e); diff --git a/src/ts/AaveAddressBook.ts b/src/ts/AaveAddressBook.ts index fccc6813..e0588aad 100644 --- a/src/ts/AaveAddressBook.ts +++ b/src/ts/AaveAddressBook.ts @@ -21,4 +21,4 @@ export * as AaveV3Fantom from "./AaveV3Fantom"; export * as AaveV3Harmony from "./AaveV3Harmony"; export * as AaveV3Optimism from "./AaveV3Optimism"; export * as AaveV3OptimismGoerli from "./AaveV3OptimismGoerli"; -export * as AaveV3Ethereum from "./AaveV3Ethereum"; +export * as AaveV3EthereumDraft from "./AaveV3EthereumDraft"; diff --git a/src/ts/AaveV3Ethereum.ts b/src/ts/AaveV3EthereumDraft.ts similarity index 100% rename from src/ts/AaveV3Ethereum.ts rename to src/ts/AaveV3EthereumDraft.ts From 410b82007af7029d15cb462dfc0f883f1b6b1197 Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 22 Dec 2022 11:03:08 +0100 Subject: [PATCH 5/9] fix: added castings and struct for backwards compatibility --- src/AaveV3.sol | 7 +++++++ src/test/AaveV3Avalanche.t.sol | 1 + 2 files changed, 8 insertions(+) diff --git a/src/AaveV3.sol b/src/AaveV3.sol index fec1179d..cc3b299d 100644 --- a/src/AaveV3.sol +++ b/src/AaveV3.sol @@ -12,6 +12,13 @@ import {IACLManager} 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 {IDefaultInterestRateStrategy as IInterestRateStrategy} from "aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategy.sol"; +import {IPoolDataProvider as IAaveProtocolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol'; + +struct TokenData { + string symbol; + address tokenAddress; +} /** * @title ICollector diff --git a/src/test/AaveV3Avalanche.t.sol b/src/test/AaveV3Avalanche.t.sol index 78b8bfcd..c96ee1ab 100644 --- a/src/test/AaveV3Avalanche.t.sol +++ b/src/test/AaveV3Avalanche.t.sol @@ -3,6 +3,7 @@ pragma solidity >=0.6.0; import 'forge-std/Test.sol'; import {AaveV3Avalanche} from '../AaveAddressBook.sol'; +import {IInterestRateStrategy, IAaveProtocolDataProvider, IPoolDataProvider, IDefaultInterestRateStrategy} from '../AaveV3.sol'; contract AaveAddressBookTest is Test { function setUp() public {} From 06638f07e24ef9cebee10b92be00e34fbea18076 Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 22 Dec 2022 11:09:28 +0100 Subject: [PATCH 6/9] forge install: aave-v3-core v1.16.2 --- .gitmodules | 2 +- lib/aave-v3-core | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 52e28b23..18d45d3d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,4 +5,4 @@ [submodule "lib/aave-v3-core"] path = lib/aave-v3-core url = https://github.com/aave/aave-v3-core - branch = feat/3.0.1 + branch = v1.16.2 diff --git a/lib/aave-v3-core b/lib/aave-v3-core index a00dda8f..287ec28f 160000 --- a/lib/aave-v3-core +++ b/lib/aave-v3-core @@ -1 +1 @@ -Subproject commit a00dda8faf464f6b0d338cf7e902e5931e0edbea +Subproject commit 287ec28f38b6ed5feb8a89c4e207e35559f79a4c From e6d724242cb764a2922b5b83320a266ea5136387 Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 22 Dec 2022 11:14:58 +0100 Subject: [PATCH 7/9] fix: updated lib and toml --- .gitmodules | 2 +- foundry.toml | 3 +++ lib/aave-v3-core | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 18d45d3d..52e28b23 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,4 +5,4 @@ [submodule "lib/aave-v3-core"] path = lib/aave-v3-core url = https://github.com/aave/aave-v3-core - branch = v1.16.2 + branch = feat/3.0.1 diff --git a/foundry.toml b/foundry.toml index 1876b208..978c5c85 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,3 +6,6 @@ ffi = false optimizer = true optimizer_runs = 1000000 verbosity = 1 +remappings = [ + '@aave/core-v3/=lib/aave-v3-core/' +] diff --git a/lib/aave-v3-core b/lib/aave-v3-core index 287ec28f..b34d6a44 160000 --- a/lib/aave-v3-core +++ b/lib/aave-v3-core @@ -1 +1 @@ -Subproject commit 287ec28f38b6ed5feb8a89c4e207e35559f79a4c +Subproject commit b34d6a445e92bfe54e53565a029bfbed12d85516 From af06372fcd67215e0923da75f6c0a034fdde6080 Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 22 Dec 2022 12:07:58 +0100 Subject: [PATCH 8/9] fix: removed TokenData as its not usable --- src/AaveV3.sol | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/AaveV3.sol b/src/AaveV3.sol index cc3b299d..3d175678 100644 --- a/src/AaveV3.sol +++ b/src/AaveV3.sol @@ -15,11 +15,6 @@ import {IReserveInterestRateStrategy} from "aave-v3-core/contracts/interfaces/IR import {IDefaultInterestRateStrategy as IInterestRateStrategy} from "aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategy.sol"; import {IPoolDataProvider as IAaveProtocolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol'; -struct TokenData { - string symbol; - address tokenAddress; -} - /** * @title ICollector * @notice Defines the interface of the Collector contract From 570f0836a61097c81fed08b67dc4b2781e75aabe Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 22 Dec 2022 12:59:46 +0100 Subject: [PATCH 9/9] fix: removed unneeded remapping --- foundry.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/foundry.toml b/foundry.toml index 978c5c85..1876b208 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,6 +6,3 @@ ffi = false optimizer = true optimizer_runs = 1000000 verbosity = 1 -remappings = [ - '@aave/core-v3/=lib/aave-v3-core/' -]