|
{
|
|
"language": "Solidity",
|
|
"sources": {
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IACLManager.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\n\n/**\n * @title IACLManager\n * @author Aave\n * @notice Defines the basic interface for the ACL Manager\n */\ninterface IACLManager {\n /**\n * @notice Returns the contract address of the PoolAddressesProvider\n * @return The address of the PoolAddressesProvider\n */\n function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n /**\n * @notice Returns the identifier of the PoolAdmin role\n * @return The id of the PoolAdmin role\n */\n function POOL_ADMIN_ROLE() external view returns (bytes32);\n\n /**\n * @notice Returns the identifier of the EmergencyAdmin role\n * @return The id of the EmergencyAdmin role\n */\n function EMERGENCY_ADMIN_ROLE() external view returns (bytes32);\n\n /**\n * @notice Returns the identifier of the RiskAdmin role\n * @return The id of the RiskAdmin role\n */\n function RISK_ADMIN_ROLE() external view returns (bytes32);\n\n /**\n * @notice Returns the identifier of the FlashBorrower role\n * @return The id of the FlashBorrower role\n */\n function FLASH_BORROWER_ROLE() external view returns (bytes32);\n\n /**\n * @notice Returns the identifier of the Bridge role\n * @return The id of the Bridge role\n */\n function BRIDGE_ROLE() external view returns (bytes32);\n\n /**\n * @notice Returns the identifier of the AssetListingAdmin role\n * @return The id of the AssetListingAdmin role\n */\n function ASSET_LISTING_ADMIN_ROLE() external view returns (bytes32);\n\n /**\n * @notice Set the role as admin of a specific role.\n * @dev By default the admin role for all roles is `DEFAULT_ADMIN_ROLE`.\n * @param role The role to be managed by the admin role\n * @param adminRole The admin role\n */\n function setRoleAdmin(bytes32 role, bytes32 adminRole) external;\n\n /**\n * @notice Adds a new admin as PoolAdmin\n * @param admin The address of the new admin\n */\n function addPoolAdmin(address admin) external;\n\n /**\n * @notice Removes an admin as PoolAdmin\n * @param admin The address of the admin to remove\n */\n function removePoolAdmin(address admin) external;\n\n /**\n * @notice Returns true if the address is PoolAdmin, false otherwise\n * @param admin The address to check\n * @return True if the given address is PoolAdmin, false otherwise\n */\n function isPoolAdmin(address admin) external view returns (bool);\n\n /**\n * @notice Adds a new admin as EmergencyAdmin\n * @param admin The address of the new admin\n */\n function addEmergencyAdmin(address admin) external;\n\n /**\n * @notice Removes an admin as EmergencyAdmin\n * @param admin The address of the admin to remove\n */\n function removeEmergencyAdmin(address admin) external;\n\n /**\n * @notice Returns true if the address is EmergencyAdmin, false otherwise\n * @param admin The address to check\n * @return True if the given address is EmergencyAdmin, false otherwise\n */\n function isEmergencyAdmin(address admin) external view returns (bool);\n\n /**\n * @notice Adds a new admin as RiskAdmin\n * @param admin The address of the new admin\n */\n function addRiskAdmin(address admin) external;\n\n /**\n * @notice Removes an admin as RiskAdmin\n * @param admin The address of the admin to remove\n */\n function removeRiskAdmin(address admin) external;\n\n /**\n * @notice Returns true if the address is RiskAdmin, false otherwise\n * @param admin The address to check\n * @return True if the given address is RiskAdmin, false otherwise\n */\n function isRiskAdmin(address admin) external view returns (bool);\n\n /**\n * @notice Adds a new address as FlashBorrower\n * @param borrower The address of the new FlashBorrower\n */\n function addFlashBorrower(address borrower) external;\n\n /**\n * @notice Removes an address as FlashBorrower\n * @param borrower The address of the FlashBorrower to remove\n */\n function removeFlashBorrower(address borrower) external;\n\n /**\n * @notice Returns true if the address is FlashBorrower, false otherwise\n * @param borrower The address to check\n * @return True if the given address is FlashBorrower, false otherwise\n */\n function isFlashBorrower(address borrower) external view returns (bool);\n\n /**\n * @notice Adds a new address as Bridge\n * @param bridge The address of the new Bridge\n */\n function addBridge(address bridge) external;\n\n /**\n * @notice Removes an address as Bridge\n * @param bridge The address of the bridge to remove\n */\n function removeBridge(address bridge) external;\n\n /**\n * @notice Returns true if the address is Bridge, false otherwise\n * @param bridge The address to check\n * @return True if the given address is Bridge, false otherwise\n */\n function isBridge(address bridge) external view returns (bool);\n\n /**\n * @notice Adds a new admin as AssetListingAdmin\n * @param admin The address of the new admin\n */\n function addAssetListingAdmin(address admin) external;\n\n /**\n * @notice Removes an admin as AssetListingAdmin\n * @param admin The address of the admin to remove\n */\n function removeAssetListingAdmin(address admin) external;\n\n /**\n * @notice Returns true if the address is AssetListingAdmin, false otherwise\n * @param admin The address to check\n * @return True if the given address is AssetListingAdmin, false otherwise\n */\n function isAssetListingAdmin(address admin) external view returns (bool);\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IAaveOracle.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IPriceOracleGetter} from './IPriceOracleGetter.sol';\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\n\n/**\n * @title IAaveOracle\n * @author Aave\n * @notice Defines the basic interface for the Aave Oracle\n */\ninterface IAaveOracle is IPriceOracleGetter {\n /**\n * @dev Emitted after the base currency is set\n * @param baseCurrency The base currency of used for price quotes\n * @param baseCurrencyUnit The unit of the base currency\n */\n event BaseCurrencySet(address indexed baseCurrency, uint256 baseCurrencyUnit);\n\n /**\n * @dev Emitted after the price source of an asset is updated\n * @param asset The address of the asset\n * @param source The price source of the asset\n */\n event AssetSourceUpdated(address indexed asset, address indexed source);\n\n /**\n * @dev Emitted after the address of fallback oracle is updated\n * @param fallbackOracle The address of the fallback oracle\n */\n event FallbackOracleUpdated(address indexed fallbackOracle);\n\n /**\n * @notice Returns the PoolAddressesProvider\n * @return The address of the PoolAddressesProvider contract\n */\n function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n /**\n * @notice Sets or replaces price sources of assets\n * @param assets The addresses of the assets\n * @param sources The addresses of the price sources\n */\n function setAssetSources(address[] calldata assets, address[] calldata sources) external;\n\n /**\n * @notice Sets the fallback oracle\n * @param fallbackOracle The address of the fallback oracle\n */\n function setFallbackOracle(address fallbackOracle) external;\n\n /**\n * @notice Returns a list of prices from a list of assets addresses\n * @param assets The list of assets addresses\n * @return The prices of the given assets\n */\n function getAssetsPrices(address[] calldata assets) external view returns (uint256[] memory);\n\n /**\n * @notice Returns the address of the source for an asset address\n * @param asset The address of the asset\n * @return The address of the source\n */\n function getSourceOfAsset(address asset) external view returns (address);\n\n /**\n * @notice Returns the address of the fallback oracle\n * @return The address of the fallback oracle\n */\n function getFallbackOracle() external view returns (address);\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategy.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IReserveInterestRateStrategy} from './IReserveInterestRateStrategy.sol';\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\n\n/**\n * @title IDefaultInterestRateStrategy\n * @author Aave\n * @notice Defines the basic interface of the DefaultReserveInterestRateStrategy\n */\ninterface IDefaultInterestRateStrategy is IReserveInterestRateStrategy {\n /**\n * @notice Returns the usage ratio at which the pool aims to obtain most competitive borrow rates.\n * @return The optimal usage ratio, expressed in ray.\n */\n function OPTIMAL_USAGE_RATIO() external view returns (uint256);\n\n /**\n * @notice Returns the optimal stable to total debt ratio of the reserve.\n * @return The optimal stable to total debt ratio, expressed in ray.\n */\n function OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO() external view returns (uint256);\n\n /**\n * @notice Returns the excess usage ratio above the optimal.\n * @dev It's always equal to 1-optimal usage ratio (added as constant for gas optimizations)\n * @return The max excess usage ratio, expressed in ray.\n */\n function MAX_EXCESS_USAGE_RATIO() external view returns (uint256);\n\n /**\n * @notice Returns the excess stable debt ratio above the optimal.\n * @dev It's always equal to 1-optimal stable to total debt ratio (added as constant for gas optimizations)\n * @return The max excess stable to total debt ratio, expressed in ray.\n */\n function MAX_EXCESS_STABLE_TO_TOTAL_DEBT_RATIO() external view returns (uint256);\n\n /**\n * @notice Returns the address of the PoolAddressesProvider\n * @return The address of the PoolAddressesProvider contract\n */\n function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n /**\n * @notice Returns the variable rate slope below optimal usage ratio\n * @dev It's the variable rate when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO\n * @return The variable rate slope, expressed in ray\n */\n function getVariableRateSlope1() external view returns (uint256);\n\n /**\n * @notice Returns the variable rate slope above optimal usage ratio\n * @dev It's the variable rate when usage ratio > OPTIMAL_USAGE_RATIO\n * @return The variable rate slope, expressed in ray\n */\n function getVariableRateSlope2() external view returns (uint256);\n\n /**\n * @notice Returns the stable rate slope below optimal usage ratio\n * @dev It's the stable rate when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO\n * @return The stable rate slope, expressed in ray\n */\n function getStableRateSlope1() external view returns (uint256);\n\n /**\n * @notice Returns the stable rate slope above optimal usage ratio\n * @dev It's the variable rate when usage ratio > OPTIMAL_USAGE_RATIO\n * @return The stable rate slope, expressed in ray\n */\n function getStableRateSlope2() external view returns (uint256);\n\n /**\n * @notice Returns the stable rate excess offset\n * @dev It's an additional premium applied to the stable when stable debt > OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO\n * @return The stable rate excess offset, expressed in ray\n */\n function getStableRateExcessOffset() external view returns (uint256);\n\n /**\n * @notice Returns the base stable borrow rate\n * @return The base stable borrow rate, expressed in ray\n */\n function getBaseStableBorrowRate() external view returns (uint256);\n\n /**\n * @notice Returns the base variable borrow rate\n * @return The base variable borrow rate, expressed in ray\n */\n function getBaseVariableBorrowRate() external view returns (uint256);\n\n /**\n * @notice Returns the maximum variable borrow rate\n * @return The maximum variable borrow rate, expressed in ray\n */\n function getMaxVariableBorrowRate() external view returns (uint256);\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IPool.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\nimport {DataTypes} from '../protocol/libraries/types/DataTypes.sol';\n\n/**\n * @title IPool\n * @author Aave\n * @notice Defines the basic interface for an Aave Pool.\n */\ninterface IPool {\n /**\n * @dev Emitted on mintUnbacked()\n * @param reserve The address of the underlying asset of the reserve\n * @param user The address initiating the supply\n * @param onBehalfOf The beneficiary of the supplied assets, receiving the aTokens\n * @param amount The amount of supplied assets\n * @param referralCode The referral code used\n */\n event MintUnbacked(\n address indexed reserve,\n address user,\n address indexed onBehalfOf,\n uint256 amount,\n uint16 indexed referralCode\n );\n\n /**\n * @dev Emitted on backUnbacked()\n * @param reserve The address of the underlying asset of the reserve\n * @param backer The address paying for the backing\n * @param amount The amount added as backing\n * @param fee The amount paid in fees\n */\n event BackUnbacked(address indexed reserve, address indexed backer, uint256 amount, uint256 fee);\n\n /**\n * @dev Emitted on supply()\n * @param reserve The address of the underlying asset of the reserve\n * @param user The address initiating the supply\n * @param onBehalfOf The beneficiary of the supply, receiving the aTokens\n * @param amount The amount supplied\n * @param referralCode The referral code used\n */\n event Supply(\n address indexed reserve,\n address user,\n address indexed onBehalfOf,\n uint256 amount,\n uint16 indexed referralCode\n );\n\n /**\n * @dev Emitted on withdraw()\n * @param reserve The address of the underlying asset being withdrawn\n * @param user The address initiating the withdrawal, owner of aTokens\n * @param to The address that will receive the underlying\n * @param amount The amount to be withdrawn\n */\n event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount);\n\n /**\n * @dev Emitted on borrow() and flashLoan() when debt needs to be opened\n * @param reserve The address of the underlying asset being borrowed\n * @param user The address of the user initiating the borrow(), receiving the funds on borrow() or just\n * initiator of the transaction on flashLoan()\n * @param onBehalfOf The address that will be getting the debt\n * @param amount The amount borrowed out\n * @param interestRateMode The rate mode: 1 for Stable, 2 for Variable\n * @param borrowRate The numeric rate at which the user has borrowed, expressed in ray\n * @param referralCode The referral code used\n */\n event Borrow(\n address indexed reserve,\n address user,\n address indexed onBehalfOf,\n uint256 amount,\n DataTypes.InterestRateMode interestRateMode,\n uint256 borrowRate,\n uint16 indexed referralCode\n );\n\n /**\n * @dev Emitted on repay()\n * @param reserve The address of the underlying asset of the reserve\n * @param user The beneficiary of the repayment, getting his debt reduced\n * @param repayer The address of the user initiating the repay(), providing the funds\n * @param amount The amount repaid\n * @param useATokens True if the repayment is done using aTokens, `false` if done with underlying asset directly\n */\n event Repay(\n address indexed reserve,\n address indexed user,\n address indexed repayer,\n uint256 amount,\n bool useATokens\n );\n\n /**\n * @dev Emitted on swapBorrowRateMode()\n * @param reserve The address of the underlying asset of the reserve\n * @param user The address of the user swapping his rate mode\n * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable\n */\n event SwapBorrowRateMode(\n address indexed reserve,\n address indexed user,\n DataTypes.InterestRateMode interestRateMode\n );\n\n /**\n * @dev Emitted on borrow(), repay() and liquidationCall() when using isolated assets\n * @param asset The address of the underlying asset of the reserve\n * @param totalDebt The total isolation mode debt for the reserve\n */\n event IsolationModeTotalDebtUpdated(address indexed asset, uint256 totalDebt);\n\n /**\n * @dev Emitted when the user selects a certain asset category for eMode\n * @param user The address of the user\n * @param categoryId The category id\n */\n event UserEModeSet(address indexed user, uint8 categoryId);\n\n /**\n * @dev Emitted on setUserUseReserveAsCollateral()\n * @param reserve The address of the underlying asset of the reserve\n * @param user The address of the user enabling the usage as collateral\n */\n event ReserveUsedAsCollateralEnabled(address indexed reserve, address indexed user);\n\n /**\n * @dev Emitted on setUserUseReserveAsCollateral()\n * @param reserve The address of the underlying asset of the reserve\n * @param user The address of the user enabling the usage as collateral\n */\n event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user);\n\n /**\n * @dev Emitted on rebalanceStableBorrowRate()\n * @param reserve The address of the underlying asset of the reserve\n * @param user The address of the user for which the rebalance has been executed\n */\n event RebalanceStableBorrowRate(address indexed reserve, address indexed user);\n\n /**\n * @dev Emitted on flashLoan()\n * @param target The address of the flash loan receiver contract\n * @param initiator The address initiating the flash loan\n * @param asset The address of the asset being flash borrowed\n * @param amount The amount flash borrowed\n * @param interestRateMode The flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt\n * @param premium The fee flash borrowed\n * @param referralCode The referral code used\n */\n event FlashLoan(\n address indexed target,\n address initiator,\n address indexed asset,\n uint256 amount,\n DataTypes.InterestRateMode interestRateMode,\n uint256 premium,\n uint16 indexed referralCode\n );\n\n /**\n * @dev Emitted when a borrower is liquidated.\n * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation\n * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation\n * @param user The address of the borrower getting liquidated\n * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover\n * @param liquidatedCollateralAmount The amount of collateral received by the liquidator\n * @param liquidator The address of the liquidator\n * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants\n * to receive the underlying collateral asset directly\n */\n event LiquidationCall(\n address indexed collateralAsset,\n address indexed debtAsset,\n address indexed user,\n uint256 debtToCover,\n uint256 liquidatedCollateralAmount,\n address liquidator,\n bool receiveAToken\n );\n\n /**\n * @dev Emitted when the state of a reserve is updated.\n * @param reserve The address of the underlying asset of the reserve\n * @param liquidityRate The next liquidity rate\n * @param stableBorrowRate The next stable borrow rate\n * @param variableBorrowRate The next variable borrow rate\n * @param liquidityIndex The next liquidity index\n * @param variableBorrowIndex The next variable borrow index\n */\n event ReserveDataUpdated(\n address indexed reserve,\n uint256 liquidityRate,\n uint256 stableBorrowRate,\n uint256 variableBorrowRate,\n uint256 liquidityIndex,\n uint256 variableBorrowIndex\n );\n\n /**\n * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest.\n * @param reserve The address of the reserve\n * @param amountMinted The amount minted to the treasury\n */\n event MintedToTreasury(address indexed reserve, uint256 amountMinted);\n\n /**\n * @notice Mints an `amount` of aTokens to the `onBehalfOf`\n * @param asset The address of the underlying asset to mint\n * @param amount The amount to mint\n * @param onBehalfOf The address that will receive the aTokens\n * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n * 0 if the action is executed directly by the user, without any middle-man\n */\n function mintUnbacked(\n address asset,\n uint256 amount,\n address onBehalfOf,\n uint16 referralCode\n ) external;\n\n /**\n * @notice Back the current unbacked underlying with `amount` and pay `fee`.\n * @param asset The address of the underlying asset to back\n * @param amount The amount to back\n * @param fee The amount paid in fees\n * @return The backed amount\n */\n function backUnbacked(\n address asset,\n uint256 amount,\n uint256 fee\n ) external returns (uint256);\n\n /**\n * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.\n * - E.g. User supplies 100 USDC and gets in return 100 aUSDC\n * @param asset The address of the underlying asset to supply\n * @param amount The amount to be supplied\n * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user\n * wants to receive them on his own wallet, or a different address if the beneficiary of aTokens\n * is a different wallet\n * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n * 0 if the action is executed directly by the user, without any middle-man\n */\n function supply(\n address asset,\n uint256 amount,\n address onBehalfOf,\n uint16 referralCode\n ) external;\n\n /**\n * @notice Supply with transfer approval of asset to be supplied done via permit function\n * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713\n * @param asset The address of the underlying asset to supply\n * @param amount The amount to be supplied\n * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user\n * wants to receive them on his own wallet, or a different address if the beneficiary of aTokens\n * is a different wallet\n * @param deadline The deadline timestamp that the permit is valid\n * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n * 0 if the action is executed directly by the user, without any middle-man\n * @param permitV The V parameter of ERC712 permit sig\n * @param permitR The R parameter of ERC712 permit sig\n * @param permitS The S parameter of ERC712 permit sig\n */\n function supplyWithPermit(\n address asset,\n uint256 amount,\n address onBehalfOf,\n uint16 referralCode,\n uint256 deadline,\n uint8 permitV,\n bytes32 permitR,\n bytes32 permitS\n ) external;\n\n /**\n * @notice Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned\n * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC\n * @param asset The address of the underlying asset to withdraw\n * @param amount The underlying amount to be withdrawn\n * - Send the value type(uint256).max in order to withdraw the whole aToken balance\n * @param to The address that will receive the underlying, same as msg.sender if the user\n * wants to receive it on his own wallet, or a different address if the beneficiary is a\n * different wallet\n * @return The final amount withdrawn\n */\n function withdraw(\n address asset,\n uint256 amount,\n address to\n ) external returns (uint256);\n\n /**\n * @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower\n * already supplied enough collateral, or he was given enough allowance by a credit delegator on the\n * corresponding debt token (StableDebtToken or VariableDebtToken)\n * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet\n * and 100 stable/variable debt tokens, depending on the `interestRateMode`\n * @param asset The address of the underlying asset to borrow\n * @param amount The amount to be borrowed\n * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable\n * @param referralCode The code used to register the integrator originating the operation, for potential rewards.\n * 0 if the action is executed directly by the user, without any middle-man\n * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself\n * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator\n * if he has been given credit delegation allowance\n */\n function borrow(\n address asset,\n uint256 amount,\n uint256 interestRateMode,\n uint16 referralCode,\n address onBehalfOf\n ) external;\n\n /**\n * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned\n * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address\n * @param asset The address of the borrowed underlying asset previously borrowed\n * @param amount The amount to repay\n * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`\n * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable\n * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the\n * user calling the function if he wants to reduce/remove his own debt, or the address of any other\n * other borrower whose debt should be removed\n * @return The final amount repaid\n */\n function repay(\n address asset,\n uint256 amount,\n uint256 interestRateMode,\n address onBehalfOf\n ) external returns (uint256);\n\n /**\n * @notice Repay with transfer approval of asset to be repaid done via permit function\n * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713\n * @param asset The address of the borrowed underlying asset previously borrowed\n * @param amount The amount to repay\n * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`\n * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable\n * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the\n * user calling the function if he wants to reduce/remove his own debt, or the address of any other\n * other borrower whose debt should be removed\n * @param deadline The deadline timestamp that the permit is valid\n * @param permitV The V parameter of ERC712 permit sig\n * @param permitR The R parameter of ERC712 permit sig\n * @param permitS The S parameter of ERC712 permit sig\n * @return The final amount repaid\n */\n function repayWithPermit(\n address asset,\n uint256 amount,\n uint256 interestRateMode,\n address onBehalfOf,\n uint256 deadline,\n uint8 permitV,\n bytes32 permitR,\n bytes32 permitS\n ) external returns (uint256);\n\n /**\n * @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the\n * equivalent debt tokens\n * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens\n * @dev Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken\n * balance is not enough to cover the whole debt\n * @param asset The address of the borrowed underlying asset previously borrowed\n * @param amount The amount to repay\n * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`\n * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable\n * @return The final amount repaid\n */\n function repayWithATokens(\n address asset,\n uint256 amount,\n uint256 interestRateMode\n ) external returns (uint256);\n\n /**\n * @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa\n * @param asset The address of the underlying asset borrowed\n * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable\n */\n function swapBorrowRateMode(address asset, uint256 interestRateMode) external;\n\n /**\n * @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve.\n * - Users can be rebalanced if the following conditions are satisfied:\n * 1. Usage ratio is above 95%\n * 2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too\n * much has been borrowed at a stable rate and suppliers are not earning enough\n * @param asset The address of the underlying asset borrowed\n * @param user The address of the user to be rebalanced\n */\n function rebalanceStableBorrowRate(address asset, address user) external;\n\n /**\n * @notice Allows suppliers to enable/disable a specific supplied asset as collateral\n * @param asset The address of the underlying asset supplied\n * @param useAsCollateral True if the user wants to use the supply as collateral, false otherwise\n */\n function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external;\n\n /**\n * @notice Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1\n * - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives\n * a proportionally amount of the `collateralAsset` plus a bonus to cover market risk\n * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation\n * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation\n * @param user The address of the borrower getting liquidated\n * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover\n * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants\n * to receive the underlying collateral asset directly\n */\n function liquidationCall(\n address collateralAsset,\n address debtAsset,\n address user,\n uint256 debtToCover,\n bool receiveAToken\n ) external;\n\n /**\n * @notice Allows smartcontracts to access the liquidity of the pool within one transaction,\n * as long as the amount taken plus a fee is returned.\n * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept\n * into consideration. For further details please visit https://developers.aave.com\n * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanReceiver interface\n * @param assets The addresses of the assets being flash-borrowed\n * @param amounts The amounts of the assets being flash-borrowed\n * @param interestRateModes Types of the debt to open if the flash loan is not returned:\n * 0 -> Don't open any debt, just revert if funds can't be transferred from the receiver\n * 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address\n * 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address\n * @param onBehalfOf The address that will receive the debt in the case of using on `modes` 1 or 2\n * @param params Variadic packed params to pass to the receiver as extra information\n * @param referralCode The code used to register the integrator originating the operation, for potential rewards.\n * 0 if the action is executed directly by the user, without any middle-man\n */\n function flashLoan(\n address receiverAddress,\n address[] calldata assets,\n uint256[] calldata amounts,\n uint256[] calldata interestRateModes,\n address onBehalfOf,\n bytes calldata params,\n uint16 referralCode\n ) external;\n\n /**\n * @notice Allows smartcontracts to access the liquidity of the pool within one transaction,\n * as long as the amount taken plus a fee is returned.\n * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept\n * into consideration. For further details please visit https://developers.aave.com\n * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanSimpleReceiver interface\n * @param asset The address of the asset being flash-borrowed\n * @param amount The amount of the asset being flash-borrowed\n * @param params Variadic packed params to pass to the receiver as extra information\n * @param referralCode The code used to register the integrator originating the operation, for potential rewards.\n * 0 if the action is executed directly by the user, without any middle-man\n */\n function flashLoanSimple(\n address receiverAddress,\n address asset,\n uint256 amount,\n bytes calldata params,\n uint16 referralCode\n ) external;\n\n /**\n * @notice Returns the user account data across all the reserves\n * @param user The address of the user\n * @return totalCollateralBase The total collateral of the user in the base currency used by the price feed\n * @return totalDebtBase The total debt of the user in the base currency used by the price feed\n * @return availableBorrowsBase The borrowing power left of the user in the base currency used by the price feed\n * @return currentLiquidationThreshold The liquidation threshold of the user\n * @return ltv The loan to value of The user\n * @return healthFactor The current health factor of the user\n */\n function getUserAccountData(address user)\n external\n view\n returns (\n uint256 totalCollateralBase,\n uint256 totalDebtBase,\n uint256 availableBorrowsBase,\n uint256 currentLiquidationThreshold,\n uint256 ltv,\n uint256 healthFactor\n );\n\n /**\n * @notice Initializes a reserve, activating it, assigning an aToken and debt tokens and an\n * interest rate strategy\n * @dev Only callable by the PoolConfigurator contract\n * @param asset The address of the underlying asset of the reserve\n * @param aTokenAddress The address of the aToken that will be assigned to the reserve\n * @param stableDebtAddress The address of the StableDebtToken that will be assigned to the reserve\n * @param variableDebtAddress The address of the VariableDebtToken that will be assigned to the reserve\n * @param interestRateStrategyAddress The address of the interest rate strategy contract\n */\n function initReserve(\n address asset,\n address aTokenAddress,\n address stableDebtAddress,\n address variableDebtAddress,\n address interestRateStrategyAddress\n ) external;\n\n /**\n * @notice Drop a reserve\n * @dev Only callable by the PoolConfigurator contract\n * @param asset The address of the underlying asset of the reserve\n */\n function dropReserve(address asset) external;\n\n /**\n * @notice Updates the address of the interest rate strategy contract\n * @dev Only callable by the PoolConfigurator contract\n * @param asset The address of the underlying asset of the reserve\n * @param rateStrategyAddress The address of the interest rate strategy contract\n */\n function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress)\n external;\n\n /**\n * @notice Sets the configuration bitmap of the reserve as a whole\n * @dev Only callable by the PoolConfigurator contract\n * @param asset The address of the underlying asset of the reserve\n * @param configuration The new configuration bitmap\n */\n function setConfiguration(address asset, DataTypes.ReserveConfigurationMap calldata configuration)\n external;\n\n /**\n * @notice Returns the configuration of the reserve\n * @param asset The address of the underlying asset of the reserve\n * @return The configuration of the reserve\n */\n function getConfiguration(address asset)\n external\n view\n returns (DataTypes.ReserveConfigurationMap memory);\n\n /**\n * @notice Returns the configuration of the user across all the reserves\n * @param user The user address\n * @return The configuration of the user\n */\n function getUserConfiguration(address user)\n external\n view\n returns (DataTypes.UserConfigurationMap memory);\n\n /**\n * @notice Returns the normalized income of the reserve\n * @param asset The address of the underlying asset of the reserve\n * @return The reserve's normalized income\n */\n function getReserveNormalizedIncome(address asset) external view returns (uint256);\n\n /**\n * @notice Returns the normalized variable debt per unit of asset\n * @dev WARNING: This function is intended to be used primarily by the protocol itself to get a\n * \"dynamic\" variable index based on time, current stored index and virtual rate at the current\n * moment (approx. a borrower would get if opening a position). This means that is always used in\n * combination with variable debt supply/balances.\n * If using this function externally, consider that is possible to have an increasing normalized\n * variable debt that is not equivalent to how the variable debt index would be updated in storage\n * (e.g. only updates with non-zero variable debt supply)\n * @param asset The address of the underlying asset of the reserve\n * @return The reserve normalized variable debt\n */\n function getReserveNormalizedVariableDebt(address asset) external view returns (uint256);\n\n /**\n * @notice Returns the state and configuration of the reserve\n * @param asset The address of the underlying asset of the reserve\n * @return The state and configuration data of the reserve\n */\n function getReserveData(address asset) external view returns (DataTypes.ReserveData memory);\n\n /**\n * @notice Validates and finalizes an aToken transfer\n * @dev Only callable by the overlying aToken of the `asset`\n * @param asset The address of the underlying asset of the aToken\n * @param from The user from which the aTokens are transferred\n * @param to The user receiving the aTokens\n * @param amount The amount being transferred/withdrawn\n * @param balanceFromBefore The aToken balance of the `from` user before the transfer\n * @param balanceToBefore The aToken balance of the `to` user before the transfer\n */\n function finalizeTransfer(\n address asset,\n address from,\n address to,\n uint256 amount,\n uint256 balanceFromBefore,\n uint256 balanceToBefore\n ) external;\n\n /**\n * @notice Returns the list of the underlying assets of all the initialized reserves\n * @dev It does not include dropped reserves\n * @return The addresses of the underlying assets of the initialized reserves\n */\n function getReservesList() external view returns (address[] memory);\n\n /**\n * @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct\n * @param id The id of the reserve as stored in the DataTypes.ReserveData struct\n * @return The address of the reserve associated with id\n */\n function getReserveAddressById(uint16 id) external view returns (address);\n\n /**\n * @notice Returns the PoolAddressesProvider connected to this contract\n * @return The address of the PoolAddressesProvider\n */\n function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n /**\n * @notice Updates the protocol fee on the bridging\n * @param bridgeProtocolFee The part of the premium sent to the protocol treasury\n */\n function updateBridgeProtocolFee(uint256 bridgeProtocolFee) external;\n\n /**\n * @notice Updates flash loan premiums. Flash loan premium consists of two parts:\n * - A part is sent to aToken holders as extra, one time accumulated interest\n * - A part is collected by the protocol treasury\n * @dev The total premium is calculated on the total borrowed amount\n * @dev The premium to protocol is calculated on the total premium, being a percentage of `flashLoanPremiumTotal`\n * @dev Only callable by the PoolConfigurator contract\n * @param flashLoanPremiumTotal The total premium, expressed in bps\n * @param flashLoanPremiumToProtocol The part of the premium sent to the protocol treasury, expressed in bps\n */\n function updateFlashloanPremiums(\n uint128 flashLoanPremiumTotal,\n uint128 flashLoanPremiumToProtocol\n ) external;\n\n /**\n * @notice Configures a new category for the eMode.\n * @dev In eMode, the protocol allows very high borrowing power to borrow assets of the same category.\n * The category 0 is reserved as it's the default for volatile assets\n * @param id The id of the category\n * @param config The configuration of the category\n */\n function configureEModeCategory(uint8 id, DataTypes.EModeCategory memory config) external;\n\n /**\n * @notice Returns the data of an eMode category\n * @param id The id of the category\n * @return The configuration data of the category\n */\n function getEModeCategoryData(uint8 id) external view returns (DataTypes.EModeCategory memory);\n\n /**\n * @notice Allows a user to use the protocol in eMode\n * @param categoryId The id of the category\n */\n function setUserEMode(uint8 categoryId) external;\n\n /**\n * @notice Returns the eMode the user is using\n * @param user The address of the user\n * @return The eMode id\n */\n function getUserEMode(address user) external view returns (uint256);\n\n /**\n * @notice Resets the isolation mode total debt of the given asset to zero\n * @dev It requires the given asset has zero debt ceiling\n * @param asset The address of the underlying asset to reset the isolationModeTotalDebt\n */\n function resetIsolationModeTotalDebt(address asset) external;\n\n /**\n * @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate\n * @return The percentage of available liquidity to borrow, expressed in bps\n */\n function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256);\n\n /**\n * @notice Returns the total fee on flash loans\n * @return The total fee on flashloans\n */\n function FLASHLOAN_PREMIUM_TOTAL() external view returns (uint128);\n\n /**\n * @notice Returns the part of the bridge fees sent to protocol\n * @return The bridge fee sent to the protocol treasury\n */\n function BRIDGE_PROTOCOL_FEE() external view returns (uint256);\n\n /**\n * @notice Returns the part of the flashloan fees sent to protocol\n * @return The flashloan fee sent to the protocol treasury\n */\n function FLASHLOAN_PREMIUM_TO_PROTOCOL() external view returns (uint128);\n\n /**\n * @notice Returns the maximum number of reserves supported to be listed in this Pool\n * @return The maximum number of reserves supported\n */\n function MAX_NUMBER_RESERVES() external view returns (uint16);\n\n /**\n * @notice Mints the assets accrued through the reserve factor to the treasury in the form of aTokens\n * @param assets The list of reserves for which the minting needs to be executed\n */\n function mintToTreasury(address[] calldata assets) external;\n\n /**\n * @notice Rescue and transfer tokens locked in this contract\n * @param token The address of the token\n * @param to The address of the recipient\n * @param amount The amount of token to transfer\n */\n function rescueTokens(\n address token,\n address to,\n uint256 amount\n ) external;\n\n /**\n * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.\n * - E.g. User supplies 100 USDC and gets in return 100 aUSDC\n * @dev Deprecated: Use the `supply` function instead\n * @param asset The address of the underlying asset to supply\n * @param amount The amount to be supplied\n * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user\n * wants to receive them on his own wallet, or a different address if the beneficiary of aTokens\n * is a different wallet\n * @param referralCode Code used to register the integrator originating the operation, for potential rewards.\n * 0 if the action is executed directly by the user, without any middle-man\n */\n function deposit(\n address asset,\n uint256 amount,\n address onBehalfOf,\n uint16 referralCode\n ) external;\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\n/**\n * @title IPoolAddressesProvider\n * @author Aave\n * @notice Defines the basic interface for a Pool Addresses Provider.\n */\ninterface IPoolAddressesProvider {\n /**\n * @dev Emitted when the market identifier is updated.\n * @param oldMarketId The old id of the market\n * @param newMarketId The new id of the market\n */\n event MarketIdSet(string indexed oldMarketId, string indexed newMarketId);\n\n /**\n * @dev Emitted when the pool is updated.\n * @param oldAddress The old address of the Pool\n * @param newAddress The new address of the Pool\n */\n event PoolUpdated(address indexed oldAddress, address indexed newAddress);\n\n /**\n * @dev Emitted when the pool configurator is updated.\n * @param oldAddress The old address of the PoolConfigurator\n * @param newAddress The new address of the PoolConfigurator\n */\n event PoolConfiguratorUpdated(address indexed oldAddress, address indexed newAddress);\n\n /**\n * @dev Emitted when the price oracle is updated.\n * @param oldAddress The old address of the PriceOracle\n * @param newAddress The new address of the PriceOracle\n */\n event PriceOracleUpdated(address indexed oldAddress, address indexed newAddress);\n\n /**\n * @dev Emitted when the ACL manager is updated.\n * @param oldAddress The old address of the ACLManager\n * @param newAddress The new address of the ACLManager\n */\n event ACLManagerUpdated(address indexed oldAddress, address indexed newAddress);\n\n /**\n * @dev Emitted when the ACL admin is updated.\n * @param oldAddress The old address of the ACLAdmin\n * @param newAddress The new address of the ACLAdmin\n */\n event ACLAdminUpdated(address indexed oldAddress, address indexed newAddress);\n\n /**\n * @dev Emitted when the price oracle sentinel is updated.\n * @param oldAddress The old address of the PriceOracleSentinel\n * @param newAddress The new address of the PriceOracleSentinel\n */\n event PriceOracleSentinelUpdated(address indexed oldAddress, address indexed newAddress);\n\n /**\n * @dev Emitted when the pool data provider is updated.\n * @param oldAddress The old address of the PoolDataProvider\n * @param newAddress The new address of the PoolDataProvider\n */\n event PoolDataProviderUpdated(address indexed oldAddress, address indexed newAddress);\n\n /**\n * @dev Emitted when a new proxy is created.\n * @param id The identifier of the proxy\n * @param proxyAddress The address of the created proxy contract\n * @param implementationAddress The address of the implementation contract\n */\n event ProxyCreated(\n bytes32 indexed id,\n address indexed proxyAddress,\n address indexed implementationAddress\n );\n\n /**\n * @dev Emitted when a new non-proxied contract address is registered.\n * @param id The identifier of the contract\n * @param oldAddress The address of the old contract\n * @param newAddress The address of the new contract\n */\n event AddressSet(bytes32 indexed id, address indexed oldAddress, address indexed newAddress);\n\n /**\n * @dev Emitted when the implementation of the proxy registered with id is updated\n * @param id The identifier of the contract\n * @param proxyAddress The address of the proxy contract\n * @param oldImplementationAddress The address of the old implementation contract\n * @param newImplementationAddress The address of the new implementation contract\n */\n event AddressSetAsProxy(\n bytes32 indexed id,\n address indexed proxyAddress,\n address oldImplementationAddress,\n address indexed newImplementationAddress\n );\n\n /**\n * @notice Returns the id of the Aave market to which this contract points to.\n * @return The market id\n */\n function getMarketId() external view returns (string memory);\n\n /**\n * @notice Associates an id with a specific PoolAddressesProvider.\n * @dev This can be used to create an onchain registry of PoolAddressesProviders to\n * identify and validate multiple Aave markets.\n * @param newMarketId The market id\n */\n function setMarketId(string calldata newMarketId) external;\n\n /**\n * @notice Returns an address by its identifier.\n * @dev The returned address might be an EOA or a contract, potentially proxied\n * @dev It returns ZERO if there is no registered address with the given id\n * @param id The id\n * @return The address of the registered for the specified id\n */\n function getAddress(bytes32 id) external view returns (address);\n\n /**\n * @notice General function to update the implementation of a proxy registered with\n * certain `id`. If there is no proxy registered, it will instantiate one and\n * set as implementation the `newImplementationAddress`.\n * @dev IMPORTANT Use this function carefully, only for ids that don't have an explicit\n * setter function, in order to avoid unexpected consequences\n * @param id The id\n * @param newImplementationAddress The address of the new implementation\n */\n function setAddressAsProxy(bytes32 id, address newImplementationAddress) external;\n\n /**\n * @notice Sets an address for an id replacing the address saved in the addresses map.\n * @dev IMPORTANT Use this function carefully, as it will do a hard replacement\n * @param id The id\n * @param newAddress The address to set\n */\n function setAddress(bytes32 id, address newAddress) external;\n\n /**\n * @notice Returns the address of the Pool proxy.\n * @return The Pool proxy address\n */\n function getPool() external view returns (address);\n\n /**\n * @notice Updates the implementation of the Pool, or creates a proxy\n * setting the new `pool` implementation when the function is called for the first time.\n * @param newPoolImpl The new Pool implementation\n */\n function setPoolImpl(address newPoolImpl) external;\n\n /**\n * @notice Returns the address of the PoolConfigurator proxy.\n * @return The PoolConfigurator proxy address\n */\n function getPoolConfigurator() external view returns (address);\n\n /**\n * @notice Updates the implementation of the PoolConfigurator, or creates a proxy\n * setting the new `PoolConfigurator` implementation when the function is called for the first time.\n * @param newPoolConfiguratorImpl The new PoolConfigurator implementation\n */\n function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external;\n\n /**\n * @notice Returns the address of the price oracle.\n * @return The address of the PriceOracle\n */\n function getPriceOracle() external view returns (address);\n\n /**\n * @notice Updates the address of the price oracle.\n * @param newPriceOracle The address of the new PriceOracle\n */\n function setPriceOracle(address newPriceOracle) external;\n\n /**\n * @notice Returns the address of the ACL manager.\n * @return The address of the ACLManager\n */\n function getACLManager() external view returns (address);\n\n /**\n * @notice Updates the address of the ACL manager.\n * @param newAclManager The address of the new ACLManager\n */\n function setACLManager(address newAclManager) external;\n\n /**\n * @notice Returns the address of the ACL admin.\n * @return The address of the ACL admin\n */\n function getACLAdmin() external view returns (address);\n\n /**\n * @notice Updates the address of the ACL admin.\n * @param newAclAdmin The address of the new ACL admin\n */\n function setACLAdmin(address newAclAdmin) external;\n\n /**\n * @notice Returns the address of the price oracle sentinel.\n * @return The address of the PriceOracleSentinel\n */\n function getPriceOracleSentinel() external view returns (address);\n\n /**\n * @notice Updates the address of the price oracle sentinel.\n * @param newPriceOracleSentinel The address of the new PriceOracleSentinel\n */\n function setPriceOracleSentinel(address newPriceOracleSentinel) external;\n\n /**\n * @notice Returns the address of the data provider.\n * @return The address of the DataProvider\n */\n function getPoolDataProvider() external view returns (address);\n\n /**\n * @notice Updates the address of the data provider.\n * @param newDataProvider The address of the new DataProvider\n */\n function setPoolDataProvider(address newDataProvider) external;\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IPoolConfigurator.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {ConfiguratorInputTypes} from '../protocol/libraries/types/ConfiguratorInputTypes.sol';\n\n/**\n * @title IPoolConfigurator\n * @author Aave\n * @notice Defines the basic interface for a Pool configurator.\n */\ninterface IPoolConfigurator {\n /**\n * @dev Emitted when a reserve is initialized.\n * @param asset The address of the underlying asset of the reserve\n * @param aToken The address of the associated aToken contract\n * @param stableDebtToken The address of the associated stable rate debt token\n * @param variableDebtToken The address of the associated variable rate debt token\n * @param interestRateStrategyAddress The address of the interest rate strategy for the reserve\n */\n event ReserveInitialized(\n address indexed asset,\n address indexed aToken,\n address stableDebtToken,\n address variableDebtToken,\n address interestRateStrategyAddress\n );\n\n /**\n * @dev Emitted when borrowing is enabled or disabled on a reserve.\n * @param asset The address of the underlying asset of the reserve\n * @param enabled True if borrowing is enabled, false otherwise\n */\n event ReserveBorrowing(address indexed asset, bool enabled);\n\n /**\n * @dev Emitted when flashloans are enabled or disabled on a reserve.\n * @param asset The address of the underlying asset of the reserve\n * @param enabled True if flashloans are enabled, false otherwise\n */\n event ReserveFlashLoaning(address indexed asset, bool enabled);\n\n /**\n * @dev Emitted when the collateralization risk parameters for the specified asset are updated.\n * @param asset The address of the underlying asset of the reserve\n * @param ltv The loan to value of the asset when used as collateral\n * @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized\n * @param liquidationBonus The bonus liquidators receive to liquidate this asset\n */\n event CollateralConfigurationChanged(\n address indexed asset,\n uint256 ltv,\n uint256 liquidationThreshold,\n uint256 liquidationBonus\n );\n\n /**\n * @dev Emitted when stable rate borrowing is enabled or disabled on a reserve\n * @param asset The address of the underlying asset of the reserve\n * @param enabled True if stable rate borrowing is enabled, false otherwise\n */\n event ReserveStableRateBorrowing(address indexed asset, bool enabled);\n\n /**\n * @dev Emitted when a reserve is activated or deactivated\n * @param asset The address of the underlying asset of the reserve\n * @param active True if reserve is active, false otherwise\n */\n event ReserveActive(address indexed asset, bool active);\n\n /**\n * @dev Emitted when a reserve is frozen or unfrozen\n * @param asset The address of the underlying asset of the reserve\n * @param frozen True if reserve is frozen, false otherwise\n */\n event ReserveFrozen(address indexed asset, bool frozen);\n\n /**\n * @dev Emitted when a reserve is paused or unpaused\n * @param asset The address of the underlying asset of the reserve\n * @param paused True if reserve is paused, false otherwise\n */\n event ReservePaused(address indexed asset, bool paused);\n\n /**\n * @dev Emitted when a reserve is dropped.\n * @param asset The address of the underlying asset of the reserve\n */\n event ReserveDropped(address indexed asset);\n\n /**\n * @dev Emitted when a reserve factor is updated.\n * @param asset The address of the underlying asset of the reserve\n * @param oldReserveFactor The old reserve factor, expressed in bps\n * @param newReserveFactor The new reserve factor, expressed in bps\n */\n event ReserveFactorChanged(\n address indexed asset,\n uint256 oldReserveFactor,\n uint256 newReserveFactor\n );\n\n /**\n * @dev Emitted when the borrow cap of a reserve is updated.\n * @param asset The address of the underlying asset of the reserve\n * @param oldBorrowCap The old borrow cap\n * @param newBorrowCap The new borrow cap\n */\n event BorrowCapChanged(address indexed asset, uint256 oldBorrowCap, uint256 newBorrowCap);\n\n /**\n * @dev Emitted when the supply cap of a reserve is updated.\n * @param asset The address of the underlying asset of the reserve\n * @param oldSupplyCap The old supply cap\n * @param newSupplyCap The new supply cap\n */\n event SupplyCapChanged(address indexed asset, uint256 oldSupplyCap, uint256 newSupplyCap);\n\n /**\n * @dev Emitted when the liquidation protocol fee of a reserve is updated.\n * @param asset The address of the underlying asset of the reserve\n * @param oldFee The old liquidation protocol fee, expressed in bps\n * @param newFee The new liquidation protocol fee, expressed in bps\n */\n event LiquidationProtocolFeeChanged(address indexed asset, uint256 oldFee, uint256 newFee);\n\n /**\n * @dev Emitted when the unbacked mint cap of a reserve is updated.\n * @param asset The address of the underlying asset of the reserve\n * @param oldUnbackedMintCap The old unbacked mint cap\n * @param newUnbackedMintCap The new unbacked mint cap\n */\n event UnbackedMintCapChanged(\n address indexed asset,\n uint256 oldUnbackedMintCap,\n uint256 newUnbackedMintCap\n );\n\n /**\n * @dev Emitted when the category of an asset in eMode is changed.\n * @param asset The address of the underlying asset of the reserve\n * @param oldCategoryId The old eMode asset category\n * @param newCategoryId The new eMode asset category\n */\n event EModeAssetCategoryChanged(address indexed asset, uint8 oldCategoryId, uint8 newCategoryId);\n\n /**\n * @dev Emitted when a new eMode category is added.\n * @param categoryId The new eMode category id\n * @param ltv The ltv for the asset category in eMode\n * @param liquidationThreshold The liquidationThreshold for the asset category in eMode\n * @param liquidationBonus The liquidationBonus for the asset category in eMode\n * @param oracle The optional address of the price oracle specific for this category\n * @param label A human readable identifier for the category\n */\n event EModeCategoryAdded(\n uint8 indexed categoryId,\n uint256 ltv,\n uint256 liquidationThreshold,\n uint256 liquidationBonus,\n address oracle,\n string label\n );\n\n /**\n * @dev Emitted when a reserve interest strategy contract is updated.\n * @param asset The address of the underlying asset of the reserve\n * @param oldStrategy The address of the old interest strategy contract\n * @param newStrategy The address of the new interest strategy contract\n */\n event ReserveInterestRateStrategyChanged(\n address indexed asset,\n address oldStrategy,\n address newStrategy\n );\n\n /**\n * @dev Emitted when an aToken implementation is upgraded.\n * @param asset The address of the underlying asset of the reserve\n * @param proxy The aToken proxy address\n * @param implementation The new aToken implementation\n */\n event ATokenUpgraded(\n address indexed asset,\n address indexed proxy,\n address indexed implementation\n );\n\n /**\n * @dev Emitted when the implementation of a stable debt token is upgraded.\n * @param asset The address of the underlying asset of the reserve\n * @param proxy The stable debt token proxy address\n * @param implementation The new aToken implementation\n */\n event StableDebtTokenUpgraded(\n address indexed asset,\n address indexed proxy,\n address indexed implementation\n );\n\n /**\n * @dev Emitted when the implementation of a variable debt token is upgraded.\n * @param asset The address of the underlying asset of the reserve\n * @param proxy The variable debt token proxy address\n * @param implementation The new aToken implementation\n */\n event VariableDebtTokenUpgraded(\n address indexed asset,\n address indexed proxy,\n address indexed implementation\n );\n\n /**\n * @dev Emitted when the debt ceiling of an asset is set.\n * @param asset The address of the underlying asset of the reserve\n * @param oldDebtCeiling The old debt ceiling\n * @param newDebtCeiling The new debt ceiling\n */\n event DebtCeilingChanged(address indexed asset, uint256 oldDebtCeiling, uint256 newDebtCeiling);\n\n /**\n * @dev Emitted when the the siloed borrowing state for an asset is changed.\n * @param asset The address of the underlying asset of the reserve\n * @param oldState The old siloed borrowing state\n * @param newState The new siloed borrowing state\n */\n event SiloedBorrowingChanged(address indexed asset, bool oldState, bool newState);\n\n /**\n * @dev Emitted when the bridge protocol fee is updated.\n * @param oldBridgeProtocolFee The old protocol fee, expressed in bps\n * @param newBridgeProtocolFee The new protocol fee, expressed in bps\n */\n event BridgeProtocolFeeUpdated(uint256 oldBridgeProtocolFee, uint256 newBridgeProtocolFee);\n\n /**\n * @dev Emitted when the total premium on flashloans is updated.\n * @param oldFlashloanPremiumTotal The old premium, expressed in bps\n * @param newFlashloanPremiumTotal The new premium, expressed in bps\n */\n event FlashloanPremiumTotalUpdated(\n uint128 oldFlashloanPremiumTotal,\n uint128 newFlashloanPremiumTotal\n );\n\n /**\n * @dev Emitted when the part of the premium that goes to protocol is updated.\n * @param oldFlashloanPremiumToProtocol The old premium, expressed in bps\n * @param newFlashloanPremiumToProtocol The new premium, expressed in bps\n */\n event FlashloanPremiumToProtocolUpdated(\n uint128 oldFlashloanPremiumToProtocol,\n uint128 newFlashloanPremiumToProtocol\n );\n\n /**\n * @dev Emitted when the reserve is set as borrowable/non borrowable in isolation mode.\n * @param asset The address of the underlying asset of the reserve\n * @param borrowable True if the reserve is borrowable in isolation, false otherwise\n */\n event BorrowableInIsolationChanged(address asset, bool borrowable);\n\n /**\n * @notice Initializes multiple reserves.\n * @param input The array of initialization parameters\n */\n function initReserves(ConfiguratorInputTypes.InitReserveInput[] calldata input) external;\n\n /**\n * @dev Updates the aToken implementation for the reserve.\n * @param input The aToken update parameters\n */\n function updateAToken(ConfiguratorInputTypes.UpdateATokenInput calldata input) external;\n\n /**\n * @notice Updates the stable debt token implementation for the reserve.\n * @param input The stableDebtToken update parameters\n */\n function updateStableDebtToken(ConfiguratorInputTypes.UpdateDebtTokenInput calldata input)\n external;\n\n /**\n * @notice Updates the variable debt token implementation for the asset.\n * @param input The variableDebtToken update parameters\n */\n function updateVariableDebtToken(ConfiguratorInputTypes.UpdateDebtTokenInput calldata input)\n external;\n\n /**\n * @notice Configures borrowing on a reserve.\n * @dev Can only be disabled (set to false) if stable borrowing is disabled\n * @param asset The address of the underlying asset of the reserve\n * @param enabled True if borrowing needs to be enabled, false otherwise\n */\n function setReserveBorrowing(address asset, bool enabled) external;\n\n /**\n * @notice Configures the reserve collateralization parameters.\n * @dev All the values are expressed in bps. A value of 10000, results in 100.00%\n * @dev The `liquidationBonus` is always above 100%. A value of 105% means the liquidator will receive a 5% bonus\n * @param asset The address of the underlying asset of the reserve\n * @param ltv The loan to value of the asset when used as collateral\n * @param liquidationThreshold The threshold at which loans using this asset as collateral will be considered undercollateralized\n * @param liquidationBonus The bonus liquidators receive to liquidate this asset\n */\n function configureReserveAsCollateral(\n address asset,\n uint256 ltv,\n uint256 liquidationThreshold,\n uint256 liquidationBonus\n ) external;\n\n /**\n * @notice Enable or disable stable rate borrowing on a reserve.\n * @dev Can only be enabled (set to true) if borrowing is enabled\n * @param asset The address of the underlying asset of the reserve\n * @param enabled True if stable rate borrowing needs to be enabled, false otherwise\n */\n function setReserveStableRateBorrowing(address asset, bool enabled) external;\n\n /**\n * @notice Enable or disable flashloans on a reserve\n * @param asset The address of the underlying asset of the reserve\n * @param enabled True if flashloans need to be enabled, false otherwise\n */\n function setReserveFlashLoaning(address asset, bool enabled) external;\n\n /**\n * @notice Activate or deactivate a reserve\n * @param asset The address of the underlying asset of the reserve\n * @param active True if the reserve needs to be active, false otherwise\n */\n function setReserveActive(address asset, bool active) external;\n\n /**\n * @notice Freeze or unfreeze a reserve. A frozen reserve doesn't allow any new supply, borrow\n * or rate swap but allows repayments, liquidations, rate rebalances and withdrawals.\n * @param asset The address of the underlying asset of the reserve\n * @param freeze True if the reserve needs to be frozen, false otherwise\n */\n function setReserveFreeze(address asset, bool freeze) external;\n\n /**\n * @notice Sets the borrowable in isolation flag for the reserve.\n * @dev When this flag is set to true, the asset will be borrowable against isolated collaterals and the\n * borrowed amount will be accumulated in the isolated collateral's total debt exposure\n * @dev Only assets of the same family (e.g. USD stablecoins) should be borrowable in isolation mode to keep\n * consistency in the debt ceiling calculations\n * @param asset The address of the underlying asset of the reserve\n * @param borrowable True if the asset should be borrowable in isolation, false otherwise\n */\n function setBorrowableInIsolation(address asset, bool borrowable) external;\n\n /**\n * @notice Pauses a reserve. A paused reserve does not allow any interaction (supply, borrow, repay,\n * swap interest rate, liquidate, atoken transfers).\n * @param asset The address of the underlying asset of the reserve\n * @param paused True if pausing the reserve, false if unpausing\n */\n function setReservePause(address asset, bool paused) external;\n\n /**\n * @notice Updates the reserve factor of a reserve.\n * @param asset The address of the underlying asset of the reserve\n * @param newReserveFactor The new reserve factor of the reserve\n */\n function setReserveFactor(address asset, uint256 newReserveFactor) external;\n\n /**\n * @notice Sets the interest rate strategy of a reserve.\n * @param asset The address of the underlying asset of the reserve\n * @param newRateStrategyAddress The address of the new interest strategy contract\n */\n function setReserveInterestRateStrategyAddress(address asset, address newRateStrategyAddress)\n external;\n\n /**\n * @notice Pauses or unpauses all the protocol reserves. In the paused state all the protocol interactions\n * are suspended.\n * @param paused True if protocol needs to be paused, false otherwise\n */\n function setPoolPause(bool paused) external;\n\n /**\n * @notice Updates the borrow cap of a reserve.\n * @param asset The address of the underlying asset of the reserve\n * @param newBorrowCap The new borrow cap of the reserve\n */\n function setBorrowCap(address asset, uint256 newBorrowCap) external;\n\n /**\n * @notice Updates the supply cap of a reserve.\n * @param asset The address of the underlying asset of the reserve\n * @param newSupplyCap The new supply cap of the reserve\n */\n function setSupplyCap(address asset, uint256 newSupplyCap) external;\n\n /**\n * @notice Updates the liquidation protocol fee of reserve.\n * @param asset The address of the underlying asset of the reserve\n * @param newFee The new liquidation protocol fee of the reserve, expressed in bps\n */\n function setLiquidationProtocolFee(address asset, uint256 newFee) external;\n\n /**\n * @notice Updates the unbacked mint cap of reserve.\n * @param asset The address of the underlying asset of the reserve\n * @param newUnbackedMintCap The new unbacked mint cap of the reserve\n */\n function setUnbackedMintCap(address asset, uint256 newUnbackedMintCap) external;\n\n /**\n * @notice Assign an efficiency mode (eMode) category to asset.\n * @param asset The address of the underlying asset of the reserve\n * @param newCategoryId The new category id of the asset\n */\n function setAssetEModeCategory(address asset, uint8 newCategoryId) external;\n\n /**\n * @notice Adds a new efficiency mode (eMode) category.\n * @dev If zero is provided as oracle address, the default asset oracles will be used to compute the overall debt and\n * overcollateralization of the users using this category.\n * @dev The new ltv and liquidation threshold must be greater than the base\n * ltvs and liquidation thresholds of all assets within the eMode category\n * @param categoryId The id of the category to be configured\n * @param ltv The ltv associated with the category\n * @param liquidationThreshold The liquidation threshold associated with the category\n * @param liquidationBonus The liquidation bonus associated with the category\n * @param oracle The oracle associated with the category\n * @param label A label identifying the category\n */\n function setEModeCategory(\n uint8 categoryId,\n uint16 ltv,\n uint16 liquidationThreshold,\n uint16 liquidationBonus,\n address oracle,\n string calldata label\n ) external;\n\n /**\n * @notice Drops a reserve entirely.\n * @param asset The address of the reserve to drop\n */\n function dropReserve(address asset) external;\n\n /**\n * @notice Updates the bridge fee collected by the protocol reserves.\n * @param newBridgeProtocolFee The part of the fee sent to the protocol treasury, expressed in bps\n */\n function updateBridgeProtocolFee(uint256 newBridgeProtocolFee) external;\n\n /**\n * @notice Updates the total flash loan premium.\n * Total flash loan premium consists of two parts:\n * - A part is sent to aToken holders as extra balance\n * - A part is collected by the protocol reserves\n * @dev Expressed in bps\n * @dev The premium is calculated on the total amount borrowed\n * @param newFlashloanPremiumTotal The total flashloan premium\n */\n function updateFlashloanPremiumTotal(uint128 newFlashloanPremiumTotal) external;\n\n /**\n * @notice Updates the flash loan premium collected by protocol reserves\n * @dev Expressed in bps\n * @dev The premium to protocol is calculated on the total flashloan premium\n * @param newFlashloanPremiumToProtocol The part of the flashloan premium sent to the protocol treasury\n */\n function updateFlashloanPremiumToProtocol(uint128 newFlashloanPremiumToProtocol) external;\n\n /**\n * @notice Sets the debt ceiling for an asset.\n * @param newDebtCeiling The new debt ceiling\n */\n function setDebtCeiling(address asset, uint256 newDebtCeiling) external;\n\n /**\n * @notice Sets siloed borrowing for an asset\n * @param siloed The new siloed borrowing state\n */\n function setSiloedBorrowing(address asset, bool siloed) external;\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IPoolDataProvider.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';\n\n/**\n * @title IPoolDataProvider\n * @author Aave\n * @notice Defines the basic interface of a PoolDataProvider\n */\ninterface IPoolDataProvider {\n struct TokenData {\n string symbol;\n address tokenAddress;\n }\n\n /**\n * @notice Returns the address for the PoolAddressesProvider contract.\n * @return The address for the PoolAddressesProvider contract\n */\n function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);\n\n /**\n * @notice Returns the list of the existing reserves in the pool.\n * @dev Handling MKR and ETH in a different way since they do not have standard `symbol` functions.\n * @return The list of reserves, pairs of symbols and addresses\n */\n function getAllReservesTokens() external view returns (TokenData[] memory);\n\n /**\n * @notice Returns the list of the existing ATokens in the pool.\n * @return The list of ATokens, pairs of symbols and addresses\n */\n function getAllATokens() external view returns (TokenData[] memory);\n\n /**\n * @notice Returns the configuration data of the reserve\n * @dev Not returning borrow and supply caps for compatibility, nor pause flag\n * @param asset The address of the underlying asset of the reserve\n * @return decimals The number of decimals of the reserve\n * @return ltv The ltv of the reserve\n * @return liquidationThreshold The liquidationThreshold of the reserve\n * @return liquidationBonus The liquidationBonus of the reserve\n * @return reserveFactor The reserveFactor of the reserve\n * @return usageAsCollateralEnabled True if the usage as collateral is enabled, false otherwise\n * @return borrowingEnabled True if borrowing is enabled, false otherwise\n * @return stableBorrowRateEnabled True if stable rate borrowing is enabled, false otherwise\n * @return isActive True if it is active, false otherwise\n * @return isFrozen True if it is frozen, false otherwise\n */\n function getReserveConfigurationData(address asset)\n external\n view\n returns (\n uint256 decimals,\n uint256 ltv,\n uint256 liquidationThreshold,\n uint256 liquidationBonus,\n uint256 reserveFactor,\n bool usageAsCollateralEnabled,\n bool borrowingEnabled,\n bool stableBorrowRateEnabled,\n bool isActive,\n bool isFrozen\n );\n\n /**\n * @notice Returns the efficiency mode category of the reserve\n * @param asset The address of the underlying asset of the reserve\n * @return The eMode id of the reserve\n */\n function getReserveEModeCategory(address asset) external view returns (uint256);\n\n /**\n * @notice Returns the caps parameters of the reserve\n * @param asset The address of the underlying asset of the reserve\n * @return borrowCap The borrow cap of the reserve\n * @return supplyCap The supply cap of the reserve\n */\n function getReserveCaps(address asset)\n external\n view\n returns (uint256 borrowCap, uint256 supplyCap);\n\n /**\n * @notice Returns if the pool is paused\n * @param asset The address of the underlying asset of the reserve\n * @return isPaused True if the pool is paused, false otherwise\n */\n function getPaused(address asset) external view returns (bool isPaused);\n\n /**\n * @notice Returns the siloed borrowing flag\n * @param asset The address of the underlying asset of the reserve\n * @return True if the asset is siloed for borrowing\n */\n function getSiloedBorrowing(address asset) external view returns (bool);\n\n /**\n * @notice Returns the protocol fee on the liquidation bonus\n * @param asset The address of the underlying asset of the reserve\n * @return The protocol fee on liquidation\n */\n function getLiquidationProtocolFee(address asset) external view returns (uint256);\n\n /**\n * @notice Returns the unbacked mint cap of the reserve\n * @param asset The address of the underlying asset of the reserve\n * @return The unbacked mint cap of the reserve\n */\n function getUnbackedMintCap(address asset) external view returns (uint256);\n\n /**\n * @notice Returns the debt ceiling of the reserve\n * @param asset The address of the underlying asset of the reserve\n * @return The debt ceiling of the reserve\n */\n function getDebtCeiling(address asset) external view returns (uint256);\n\n /**\n * @notice Returns the debt ceiling decimals\n * @return The debt ceiling decimals\n */\n function getDebtCeilingDecimals() external pure returns (uint256);\n\n /**\n * @notice Returns the reserve data\n * @param asset The address of the underlying asset of the reserve\n * @return unbacked The amount of unbacked tokens\n * @return accruedToTreasuryScaled The scaled amount of tokens accrued to treasury that is to be minted\n * @return totalAToken The total supply of the aToken\n * @return totalStableDebt The total stable debt of the reserve\n * @return totalVariableDebt The total variable debt of the reserve\n * @return liquidityRate The liquidity rate of the reserve\n * @return variableBorrowRate The variable borrow rate of the reserve\n * @return stableBorrowRate The stable borrow rate of the reserve\n * @return averageStableBorrowRate The average stable borrow rate of the reserve\n * @return liquidityIndex The liquidity index of the reserve\n * @return variableBorrowIndex The variable borrow index of the reserve\n * @return lastUpdateTimestamp The timestamp of the last update of the reserve\n */\n function getReserveData(address asset)\n external\n view\n returns (\n uint256 unbacked,\n uint256 accruedToTreasuryScaled,\n uint256 totalAToken,\n uint256 totalStableDebt,\n uint256 totalVariableDebt,\n uint256 liquidityRate,\n uint256 variableBorrowRate,\n uint256 stableBorrowRate,\n uint256 averageStableBorrowRate,\n uint256 liquidityIndex,\n uint256 variableBorrowIndex,\n uint40 lastUpdateTimestamp\n );\n\n /**\n * @notice Returns the total supply of aTokens for a given asset\n * @param asset The address of the underlying asset of the reserve\n * @return The total supply of the aToken\n */\n function getATokenTotalSupply(address asset) external view returns (uint256);\n\n /**\n * @notice Returns the total debt for a given asset\n * @param asset The address of the underlying asset of the reserve\n * @return The total debt for asset\n */\n function getTotalDebt(address asset) external view returns (uint256);\n\n /**\n * @notice Returns the user data in a reserve\n * @param asset The address of the underlying asset of the reserve\n * @param user The address of the user\n * @return currentATokenBalance The current AToken balance of the user\n * @return currentStableDebt The current stable debt of the user\n * @return currentVariableDebt The current variable debt of the user\n * @return principalStableDebt The principal stable debt of the user\n * @return scaledVariableDebt The scaled variable debt of the user\n * @return stableBorrowRate The stable borrow rate of the user\n * @return liquidityRate The liquidity rate of the reserve\n * @return stableRateLastUpdated The timestamp of the last update of the user stable rate\n * @return usageAsCollateralEnabled True if the user is using the asset as collateral, false\n * otherwise\n */\n function getUserReserveData(address asset, address user)\n external\n view\n returns (\n uint256 currentATokenBalance,\n uint256 currentStableDebt,\n uint256 currentVariableDebt,\n uint256 principalStableDebt,\n uint256 scaledVariableDebt,\n uint256 stableBorrowRate,\n uint256 liquidityRate,\n uint40 stableRateLastUpdated,\n bool usageAsCollateralEnabled\n );\n\n /**\n * @notice Returns the token addresses of the reserve\n * @param asset The address of the underlying asset of the reserve\n * @return aTokenAddress The AToken address of the reserve\n * @return stableDebtTokenAddress The StableDebtToken address of the reserve\n * @return variableDebtTokenAddress The VariableDebtToken address of the reserve\n */\n function getReserveTokensAddresses(address asset)\n external\n view\n returns (\n address aTokenAddress,\n address stableDebtTokenAddress,\n address variableDebtTokenAddress\n );\n\n /**\n * @notice Returns the address of the Interest Rate strategy\n * @param asset The address of the underlying asset of the reserve\n * @return irStrategyAddress The address of the Interest Rate strategy\n */\n function getInterestRateStrategyAddress(address asset)\n external\n view\n returns (address irStrategyAddress);\n\n /**\n * @notice Returns whether the reserve has FlashLoans enabled or disabled\n * @param asset The address of the underlying asset of the reserve\n * @return True if FlashLoans are enabled, false otherwise\n */\n function getFlashLoanEnabled(address asset) external view returns (bool);\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IPriceOracleGetter.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\n/**\n * @title IPriceOracleGetter\n * @author Aave\n * @notice Interface for the Aave price oracle.\n */\ninterface IPriceOracleGetter {\n /**\n * @notice Returns the base currency address\n * @dev Address 0x0 is reserved for USD as base currency.\n * @return Returns the base currency address.\n */\n function BASE_CURRENCY() external view returns (address);\n\n /**\n * @notice Returns the base currency unit\n * @dev 1 ether for ETH, 1e8 for USD.\n * @return Returns the base currency unit.\n */\n function BASE_CURRENCY_UNIT() external view returns (uint256);\n\n /**\n * @notice Returns the asset price in the base currency\n * @param asset The address of the asset\n * @return The price of the asset\n */\n function getAssetPrice(address asset) external view returns (uint256);\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/interfaces/IReserveInterestRateStrategy.sol": {
|
|
"content": "// SPDX-License-Identifier: AGPL-3.0\npragma solidity ^0.8.0;\n\nimport {DataTypes} from '../protocol/libraries/types/DataTypes.sol';\n\n/**\n * @title IReserveInterestRateStrategy\n * @author Aave\n * @notice Interface for the calculation of the interest rates\n */\ninterface IReserveInterestRateStrategy {\n /**\n * @notice Calculates the interest rates depending on the reserve's state and configurations\n * @param params The parameters needed to calculate interest rates\n * @return liquidityRate The liquidity rate expressed in rays\n * @return stableBorrowRate The stable borrow rate expressed in rays\n * @return variableBorrowRate The variable borrow rate expressed in rays\n */\n function calculateInterestRates(DataTypes.CalculateInterestRatesParams memory params)\n external\n view\n returns (\n uint256,\n uint256,\n uint256\n );\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol": {
|
|
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\nlibrary ConfiguratorInputTypes {\n struct InitReserveInput {\n address aTokenImpl;\n address stableDebtTokenImpl;\n address variableDebtTokenImpl;\n uint8 underlyingAssetDecimals;\n address interestRateStrategyAddress;\n address underlyingAsset;\n address treasury;\n address incentivesController;\n string aTokenName;\n string aTokenSymbol;\n string variableDebtTokenName;\n string variableDebtTokenSymbol;\n string stableDebtTokenName;\n string stableDebtTokenSymbol;\n bytes params;\n }\n\n struct UpdateATokenInput {\n address asset;\n address treasury;\n address incentivesController;\n string name;\n string symbol;\n address implementation;\n bytes params;\n }\n\n struct UpdateDebtTokenInput {\n address asset;\n address incentivesController;\n string name;\n string symbol;\n address implementation;\n bytes params;\n }\n}\n"
|
|
},
|
|
"lib/aave-address-book/lib/aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol": {
|
|
"content": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\nlibrary DataTypes {\n struct ReserveData {\n //stores the reserve configuration\n ReserveConfigurationMap configuration;\n //the liquidity index. Expressed in ray\n uint128 liquidityIndex;\n //the current supply rate. Expressed in ray\n uint128 currentLiquidityRate;\n //variable borrow index. Expressed in ray\n uint128 variableBorrowIndex;\n //the current variable borrow rate. Expressed in ray\n uint128 currentVariableBorrowRate;\n //the current stable borrow rate. Expressed in ray\n uint128 currentStableBorrowRate;\n //timestamp of last update\n uint40 lastUpdateTimestamp;\n //the id of the reserve. Represents the position in the list of the active reserves\n uint16 id;\n //aToken address\n address aTokenAddress;\n //stableDebtToken address\n address stableDebtTokenAddress;\n //variableDebtToken address\n address variableDebtTokenAddress;\n //address of the interest rate strategy\n address interestRateStrategyAddress;\n //the current treasury balance, scaled\n uint128 accruedToTreasury;\n //the outstanding unbacked aTokens minted through the bridging feature\n uint128 unbacked;\n //the outstanding debt borrowed against this asset in isolation mode\n uint128 isolationModeTotalDebt;\n }\n\n struct ReserveConfigurationMap {\n //bit 0-15: LTV\n //bit 16-31: Liq. threshold\n //bit 32-47: Liq. bonus\n //bit 48-55: Decimals\n //bit 56: reserve is active\n //bit 57: reserve is frozen\n //bit 58: borrowing is enabled\n //bit 59: stable rate borrowing enabled\n //bit 60: asset is paused\n //bit 61: borrowing in isolation mode is enabled\n //bit 62-63: reserved\n //bit 64-79: reserve factor\n //bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap\n //bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap\n //bit 152-167 liquidation protocol fee\n //bit 168-175 eMode category\n //bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled\n //bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals\n //bit 252-255 unused\n\n uint256 data;\n }\n\n struct UserConfigurationMap {\n /**\n * @dev Bitmap of the users collaterals and borrows. It is divided in pairs of bits, one pair per asset.\n * The first bit indicates if an asset is used as collateral by the user, the second whether an\n * asset is borrowed by the user.\n */\n uint256 data;\n }\n\n struct EModeCategory {\n // each eMode category has a custom ltv and liquidation threshold\n uint16 ltv;\n uint16 liquidationThreshold;\n uint16 liquidationBonus;\n // each eMode category may or may not have a custom oracle to override the individual assets price oracles\n address priceSource;\n string label;\n }\n\n enum InterestRateMode {\n NONE,\n STABLE,\n VARIABLE\n }\n\n struct ReserveCache {\n uint256 currScaledVariableDebt;\n uint256 nextScaledVariableDebt;\n uint256 currPrincipalStableDebt;\n uint256 currAvgStableBorrowRate;\n uint256 currTotalStableDebt;\n uint256 nextAvgStableBorrowRate;\n uint256 nextTotalStableDebt;\n uint256 currLiquidityIndex;\n uint256 nextLiquidityIndex;\n uint256 currVariableBorrowIndex;\n uint256 nextVariableBorrowIndex;\n uint256 currLiquidityRate;\n uint256 currVariableBorrowRate;\n uint256 reserveFactor;\n ReserveConfigurationMap reserveConfiguration;\n address aTokenAddress;\n address stableDebtTokenAddress;\n address variableDebtTokenAddress;\n uint40 reserveLastUpdateTimestamp;\n uint40 stableDebtLastUpdateTimestamp;\n }\n\n struct ExecuteLiquidationCallParams {\n uint256 reservesCount;\n uint256 debtToCover;\n address collateralAsset;\n address debtAsset;\n address user;\n bool receiveAToken;\n address priceOracle;\n uint8 userEModeCategory;\n address priceOracleSentinel;\n }\n\n struct ExecuteSupplyParams {\n address asset;\n uint256 amount;\n address onBehalfOf;\n uint16 referralCode;\n }\n\n struct ExecuteBorrowParams {\n address asset;\n address user;\n address onBehalfOf;\n uint256 amount;\n InterestRateMode interestRateMode;\n uint16 referralCode;\n bool releaseUnderlying;\n uint256 maxStableRateBorrowSizePercent;\n uint256 reservesCount;\n address oracle;\n uint8 userEModeCategory;\n address priceOracleSentinel;\n }\n\n struct ExecuteRepayParams {\n address asset;\n uint256 amount;\n InterestRateMode interestRateMode;\n address onBehalfOf;\n bool useATokens;\n }\n\n struct ExecuteWithdrawParams {\n address asset;\n uint256 amount;\n address to;\n uint256 reservesCount;\n address oracle;\n uint8 userEModeCategory;\n }\n\n struct ExecuteSetUserEModeParams {\n uint256 reservesCount;\n address oracle;\n uint8 categoryId;\n }\n\n struct FinalizeTransferParams {\n address asset;\n address from;\n address to;\n uint256 amount;\n uint256 balanceFromBefore;\n uint256 balanceToBefore;\n uint256 reservesCount;\n address oracle;\n uint8 fromEModeCategory;\n }\n\n struct FlashloanParams {\n address receiverAddress;\n address[] assets;\n uint256[] amounts;\n uint256[] interestRateModes;\n address onBehalfOf;\n bytes params;\n uint16 referralCode;\n uint256 flashLoanPremiumToProtocol;\n uint256 flashLoanPremiumTotal;\n uint256 maxStableRateBorrowSizePercent;\n uint256 reservesCount;\n address addressesProvider;\n uint8 userEModeCategory;\n bool isAuthorizedFlashBorrower;\n }\n\n struct FlashloanSimpleParams {\n address receiverAddress;\n address asset;\n uint256 amount;\n bytes params;\n uint16 referralCode;\n uint256 flashLoanPremiumToProtocol;\n uint256 flashLoanPremiumTotal;\n }\n\n struct FlashLoanRepaymentParams {\n uint256 amount;\n uint256 totalPremium;\n uint256 flashLoanPremiumToProtocol;\n address asset;\n address receiverAddress;\n uint16 referralCode;\n }\n\n struct CalculateUserAccountDataParams {\n UserConfigurationMap userConfig;\n uint256 reservesCount;\n address user;\n address oracle;\n uint8 userEModeCategory;\n }\n\n struct ValidateBorrowParams {\n ReserveCache reserveCache;\n UserConfigurationMap userConfig;\n address asset;\n address userAddress;\n uint256 amount;\n InterestRateMode interestRateMode;\n uint256 maxStableLoanPercent;\n uint256 reservesCount;\n address oracle;\n uint8 userEModeCategory;\n address priceOracleSentinel;\n bool isolationModeActive;\n address isolationModeCollateralAddress;\n uint256 isolationModeDebtCeiling;\n }\n\n struct ValidateLiquidationCallParams {\n ReserveCache debtReserveCache;\n uint256 totalDebt;\n uint256 healthFactor;\n address priceOracleSentinel;\n }\n\n struct CalculateInterestRatesParams {\n uint256 unbacked;\n uint256 liquidityAdded;\n uint256 liquidityTaken;\n uint256 totalStableDebt;\n uint256 totalVariableDebt;\n uint256 averageStableBorrowRate;\n uint256 reserveFactor;\n address reserve;\n address aToken;\n }\n\n struct InitReserveParams {\n address asset;\n address aTokenAddress;\n address stableDebtAddress;\n address variableDebtAddress;\n address interestRateStrategyAddress;\n uint16 reservesCount;\n uint16 maxNumberReserves;\n }\n}\n"
|
|
},
|
|
"lib/aave-address-book/src/AaveV3.sol": {
|
|
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\nimport {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol';\nimport {ConfiguratorInputTypes} from 'aave-v3-core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol';\nimport {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol';\nimport {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol';\nimport {IPoolConfigurator} from 'aave-v3-core/contracts/interfaces/IPoolConfigurator.sol';\nimport {IPriceOracleGetter} from 'aave-v3-core/contracts/interfaces/IPriceOracleGetter.sol';\nimport {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol';\nimport {IACLManager as BasicIACLManager} from 'aave-v3-core/contracts/interfaces/IACLManager.sol';\nimport {IPoolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol';\nimport {IDefaultInterestRateStrategy} from 'aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategy.sol';\nimport {IReserveInterestRateStrategy} from 'aave-v3-core/contracts/interfaces/IReserveInterestRateStrategy.sol';\nimport {IPoolDataProvider as IAaveProtocolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol';\n\n/**\n * @title ICollector\n * @notice Defines the interface of the Collector contract\n * @author Aave\n **/\ninterface ICollector {\n /**\n * @dev Emitted during the transfer of ownership of the funds administrator address\n * @param fundsAdmin The new funds administrator address\n **/\n event NewFundsAdmin(address indexed fundsAdmin);\n\n /**\n * @dev Retrieve the current implementation Revision of the proxy\n * @return The revision version\n */\n function REVISION() external view returns (uint256);\n\n /**\n * @dev Retrieve the current funds administrator\n * @return The address of the funds administrator\n */\n function getFundsAdmin() external view returns (address);\n\n /**\n * @dev Approve an amount of tokens to be pulled by the recipient.\n * @param token The address of the asset\n * @param recipient The address of the entity allowed to pull tokens\n * @param amount The amount allowed to be pulled. If zero it will revoke the approval.\n */\n function approve(\n // IERC20 token,\n address token,\n address recipient,\n uint256 amount\n ) external;\n\n /**\n * @dev Transfer an amount of tokens to the recipient.\n * @param token The address of the asset\n * @param recipient The address of the entity to transfer the tokens.\n * @param amount The amount to be transferred.\n */\n function transfer(\n // IERC20 token,\n address token,\n address recipient,\n uint256 amount\n ) external;\n\n /**\n * @dev Transfer the ownership of the funds administrator role.\n This function should only be callable by the current funds administrator.\n * @param admin The address of the new funds administrator\n */\n function setFundsAdmin(address admin) external;\n}\n\ninterface IACLManager is BasicIACLManager {\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n function DEFAULT_ADMIN_ROLE() external pure returns (bytes32);\n\n function renounceRole(bytes32 role, address account) external;\n\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n function grantRole(bytes32 role, address account) external;\n\n function revokeRole(bytes32 role, address account) external;\n}\n"
|
|
},
|
|
"lib/aave-address-book/src/AaveV3Ethereum.sol": {
|
|
"content": "// SPDX-License-Identifier: MIT\n// AUTOGENERATED - DON'T MANUALLY CHANGE\npragma solidity >=0.6.0;\n\nimport {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from './AaveV3.sol';\n\nlibrary AaveV3Ethereum {\n IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER =\n IPoolAddressesProvider(0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e);\n\n IPool internal constant POOL = IPool(0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2);\n\n IPoolConfigurator internal constant POOL_CONFIGURATOR =\n IPoolConfigurator(0x64b761D848206f447Fe2dd461b0c635Ec39EbB27);\n\n IAaveOracle internal constant ORACLE = IAaveOracle(0x54586bE62E3c3580375aE3723C145253060Ca0C2);\n\n IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER =\n IPoolDataProvider(0x7B4EB56E7CD4b454BA8ff71E4518426369a138a3);\n\n IACLManager internal constant ACL_MANAGER =\n IACLManager(0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0);\n\n address internal constant ACL_ADMIN = 0xEE56e2B3D491590B5b31738cC34d5232F378a8D5;\n\n address internal constant COLLECTOR = 0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c;\n\n ICollector internal constant COLLECTOR_CONTROLLER =\n ICollector(0x3d569673dAa0575c936c7c67c4E6AedA69CC630C);\n\n address internal constant DEFAULT_INCENTIVES_CONTROLLER =\n 0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb;\n\n address internal constant DEFAULT_A_TOKEN_IMPL_REV_1 = 0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d;\n\n address internal constant DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1 =\n 0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6;\n\n address internal constant DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_1 =\n 0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57;\n\n address internal constant EMISSION_MANAGER = 0x223d844fc4B006D67c0cDbd39371A9F73f69d974;\n\n address internal constant POOL_ADDRESSES_PROVIDER_REGISTRY =\n 0xbaA999AC55EAce41CcAE355c77809e68Bb345170;\n\n address internal constant WETH_GATEWAY = 0xD322A49006FC828F9B5B37Ab215F99B4E5caB19C;\n\n address internal constant REPAY_WITH_COLLATERAL_ADAPTER =\n 0x1809f186D680f239420B56948C58F8DbbCdf1E18;\n\n address internal constant SWAP_COLLATERAL_ADAPTER = 0x872fBcb1B582e8Cd0D0DD4327fBFa0B4C2730995;\n\n address internal constant LISTING_ENGINE = 0xC51e6E38d406F98049622Ca54a6096a23826B426;\n}\n"
|
|
},
|
|
"lib/aave-helpers/src/v3-listing-engine/AaveV3ListingBase.sol": {
|
|
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {Address} from 'solidity-utils/contracts/oz-common/Address.sol';\nimport {IGenericV3ListingEngine} from './IGenericV3ListingEngine.sol';\n\n/**\n * @dev Base smart contract for an Aave v3.0.1 listing.\n * - Assumes this contract has the right permissions\n * - Connected to a IGenericV3ListingEngine, handling the internals of the listing\n * and exposing a simple interface\n * @author BGD Labs\n */\nabstract contract AaveV3ListingBase {\n using Address for address;\n\n IGenericV3ListingEngine public immutable LISTING_ENGINE;\n\n constructor(IGenericV3ListingEngine listingEngine) {\n LISTING_ENGINE = listingEngine;\n }\n\n /// @dev to be overriden on the child if any extra logic is needed pre-listing\n function _preExecute() internal virtual {}\n\n /// @dev to be overriden on the child if any extra logic is needed post-listing\n function _postExecute() internal virtual {}\n\n function execute() external {\n _preExecute();\n\n address(LISTING_ENGINE).functionDelegateCall(\n abi.encodeWithSelector(LISTING_ENGINE.listAssets.selector, getPoolContext(), getAllConfigs())\n );\n\n _postExecute();\n }\n\n /// @dev to be defined in the child with the specific listing config\n function getAllConfigs() public virtual returns (IGenericV3ListingEngine.Listing[] memory);\n\n /// @dev the lack of support for immutable strings kinds of forces for this\n /// Besides that, it can actually be useful being able to change the naming, but remote\n function getPoolContext() public virtual returns (IGenericV3ListingEngine.PoolContext memory);\n}\n"
|
|
},
|
|
"lib/aave-helpers/src/v3-listing-engine/AaveV3ListingEthereum.sol": {
|
|
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {AaveV3ListingBase, IGenericV3ListingEngine} from './AaveV3ListingBase.sol';\n\n/**\n * @dev Base smart contract for an Aave v3.0.1 listing (or other change of configs) on v3 Ethereum.\n * @author BGD Labs\n */\nabstract contract AaveV3ListingEthereum is AaveV3ListingBase {\n constructor(IGenericV3ListingEngine listingEngine) AaveV3ListingBase(listingEngine) {}\n\n function getPoolContext()\n public\n pure\n override\n returns (IGenericV3ListingEngine.PoolContext memory)\n {\n return\n IGenericV3ListingEngine.PoolContext({networkName: 'Ethereum', networkAbbreviation: 'Eth'});\n }\n}\n"
|
|
},
|
|
"lib/aave-helpers/src/v3-listing-engine/IGenericV3ListingEngine.sol": {
|
|
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IGenericV3ListingEngine {\n /**\n * @dev Required for naming of a/v/s tokens\n * Example:\n * PoolContext({\n * networkName: 'Polygon',\n * networkAbbreviation: 'Pol'\n * })\n */\n struct PoolContext {\n string networkName;\n string networkAbbreviation;\n }\n\n /**\n * @dev Example (mock addresses):\n * Listing({\n * asset: 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9,\n * assetSymbol: 'AAVE',\n * priceFeed: 0x547a514d5e3769680Ce22B2361c10Ea13619e8a9,\n * rateStrategy: 0x03733F4E008d36f2e37F0080fF1c8DF756622E6F,\n * enabledToBorrow: true,\n * flashloanable: true,\n * stableRateModeEnabled: false,\n * borrowableInIsolation: true,\n * withSiloedBorrowing:, false,\n * ltv: 70_50, // 70.5%\n * liqThreshold: 76_00, // 76%\n * liqBonus: 5_00, // 5%\n * reserveFactor: 10_00, // 10%\n * supplyCap: 100_000, // 100k AAVE\n * borrowCap: 60_000, // 60k AAVE\n * debtCeiling: 100_000, // 100k USD\n * liqProtocolFee: 10_00, // 10%\n * eModeCategory: 0, // No category\n * }\n */\n struct Listing {\n address asset;\n string assetSymbol;\n address priceFeed;\n address rateStrategy; // Mandatory, no matter if enabled for borrowing or not\n bool enabledToBorrow;\n bool stableRateModeEnabled; // Only considered is enabledToBorrow == true\n bool borrowableInIsolation; // Only considered is enabledToBorrow == true\n bool withSiloedBorrowing; // Only considered if enabledToBorrow == true\n bool flashloanable; // Independent from enabled to borrow: an asset can be flashloanble and not enabled to borrow\n uint256 ltv; // Only considered if liqThreshold > 0\n uint256 liqThreshold; // If `0`, the asset will not be enabled as collateral\n uint256 liqBonus; // Only considered if liqThreshold > 0\n uint256 reserveFactor; // Only considered if enabledToBorrow == true\n uint256 supplyCap; // Always configured\n uint256 borrowCap; // Always configured, no matter if enabled for borrowing or not\n uint256 debtCeiling; // Only considered if liqThreshold > 0\n uint256 liqProtocolFee; // Only considered if liqThreshold > 0\n uint8 eModeCategory; // If `O`, no eMode category will be set\n }\n\n struct AssetsConfig {\n address[] ids;\n Basic[] basics;\n Borrow[] borrows;\n Collateral[] collaterals;\n Caps[] caps;\n }\n\n struct Basic {\n string assetSymbol;\n address priceFeed;\n address rateStrategy; // Mandatory, no matter if enabled for borrowing or not\n }\n\n struct Borrow {\n bool enabledToBorrow; // Main config flag, if false, some of the other fields will not be considered\n bool flashloanable;\n bool stableRateModeEnabled;\n bool borrowableInIsolation;\n bool withSiloedBorrowing;\n uint256 reserveFactor; // With 2 digits precision, `10_00` for 10%. Should be positive and < 100_00\n }\n\n struct Collateral {\n uint256 ltv; // Only considered if liqThreshold > 0. With 2 digits precision, `10_00` for 10%. Should be lower than liquidationThreshold\n uint256 liqThreshold; // If `0`, the asset will not be enabled as collateral. Same format as ltv, and should be higher\n uint256 liqBonus; // Only considered if liqThreshold > 0. Same format as ltv\n uint256 debtCeiling; // Only considered if liqThreshold > 0. In USD and with 2 digits for decimals, e.g. 10_000_00 for 10k\n uint256 liqProtocolFee; // Only considered if liqThreshold > 0. Same format as ltv\n uint8 eModeCategory;\n }\n\n struct Caps {\n uint256 supplyCap; // Always configured. In \"big units\" of the asset, and no decimals. 100 for 100 ETH supply cap\n uint256 borrowCap; // Always configured, no matter if enabled for borrowing or not. Same format as supply cap\n }\n\n /**\n * @notice Performs a full listing of an asset in the Aave pool configured in this engine instance\n * @param context `PoolContext` struct, effectively meta-data for naming of a/v/s tokens.\n * More information on the documentation of the struct.\n * @param listings `Listing[]` list of declarative configs for every aspect of the asset listing.\n * More information on the documentation of the struct.\n */\n function listAssets(PoolContext memory context, Listing[] memory listings) external;\n}\n"
|
|
},
|
|
"lib/solidity-utils/src/contracts/oz-common/Address.sol": {
|
|
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\n// From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/8b778fa20d6d76340c5fac1ed66c80273f05b95a\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), 'Address: call to non-contract');\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
|
|
},
|
|
"src/contracts/mainnet/AaveV3EthcbETHPayload.sol": {
|
|
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';\nimport {IGenericV3ListingEngine, AaveV3ListingEthereum} from 'aave-helpers/v3-listing-engine/AaveV3ListingEthereum.sol';\n\n/**\n * @title This proposal lists cbETH on Aave V3 Ethereum\n * @author BGD Labs\n * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0xcbb588f0030f7726da3d065a30c2500652bbd0def6ca5f5f17a82daca777578e\n * - Dicussion: https://governance.aave.com/t/arc-add-support-for-cbeth/10425/30\n */\ncontract AaveV3EthcbETHPayload is AaveV3ListingEthereum {\n address constant CBETH = 0xBe9895146f7AF43049ca1c1AE358B0541Ea49704;\n address constant CBETH_USD_FEED =\n address(0x5f4d15d761528c57a5C30c43c1DAb26Fc5452731);\n\n constructor()\n AaveV3ListingEthereum(\n IGenericV3ListingEngine(AaveV3Ethereum.LISTING_ENGINE)\n )\n {}\n\n function getAllConfigs()\n public\n pure\n override\n returns (IGenericV3ListingEngine.Listing[] memory)\n {\n IGenericV3ListingEngine.Listing[]\n memory listings = new IGenericV3ListingEngine.Listing[](1);\n\n listings[0] = IGenericV3ListingEngine.Listing({\n asset: CBETH,\n assetSymbol: 'cbETH',\n priceFeed: CBETH_USD_FEED,\n rateStrategy: 0x24701A6368Ff6D2874d6b8cDadd461552B8A5283,\n enabledToBorrow: true,\n stableRateModeEnabled: false,\n borrowableInIsolation: false,\n withSiloedBorrowing: false,\n flashloanable: true,\n ltv: 67_00,\n liqThreshold: 74_00,\n liqBonus: 7_50,\n reserveFactor: 15_00,\n supplyCap: 10_000,\n borrowCap: 1_200,\n debtCeiling: 0,\n liqProtocolFee: 10_00,\n eModeCategory: 0\n });\n\n return listings;\n }\n}\n"
|
|
}
|
|
},
|
|
"settings": {
|
|
"remappings": [
|
|
"@aave/core-v3/=lib/aave-address-book/lib/aave-v3-core/",
|
|
"@aave/periphery-v3/=lib/aave-address-book/lib/aave-v3-periphery/",
|
|
"aave-address-book/=lib/aave-address-book/src/",
|
|
"aave-helpers/=lib/aave-helpers/src/",
|
|
"aave-v3-core/=lib/aave-address-book/lib/aave-v3-core/",
|
|
"aave-v3-periphery/=lib/aave-address-book/lib/aave-v3-periphery/",
|
|
"ds-test/=lib/forge-std/lib/ds-test/src/",
|
|
"forge-std/=lib/forge-std/src/",
|
|
"governance-crosschain-bridges/=lib/governance-crosschain-bridges/",
|
|
"solidity-utils/=lib/solidity-utils/src/"
|
|
],
|
|
"optimizer": {
|
|
"enabled": true,
|
|
"runs": 200
|
|
},
|
|
"metadata": {
|
|
"bytecodeHash": "ipfs"
|
|
},
|
|
"outputSelection": {
|
|
"*": {
|
|
"*": [
|
|
"evm.bytecode",
|
|
"evm.deployedBytecode",
|
|
"devdoc",
|
|
"userdoc",
|
|
"metadata",
|
|
"abi"
|
|
]
|
|
}
|
|
},
|
|
"evmVersion": "london",
|
|
"libraries": {}
|
|
}
|
|
} |