Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: flashloanable flag #324

Merged
merged 7 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contracts/misc/UiPoolDataProviderV2V3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 {
reserveData.stableBorrowRateEnabled
) = baseData.configuration.getFlagsMemory();
reserveData.usageAsCollateralEnabled = reserveData.baseLTVasCollateral != 0;

InterestRates memory interestRates = getInterestRateStrategySlopes(
DefaultReserveInterestRateStrategy(reserveData.interestRateStrategyAddress), provider, reserveData.underlyingAsset
);
Expand All @@ -149,6 +149,7 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 {
reserveData.baseStableBorrowRate = interestRates.baseStableBorrowRate;
reserveData.baseVariableBorrowRate = interestRates.baseVariableBorrowRate;
reserveData.optimalUsageRatio = interestRates.optimalUsageRatio;
reserveData.flashLoanEnabled = true;
}

BaseCurrencyInfo memory baseCurrencyInfo;
Expand Down
17 changes: 7 additions & 10 deletions contracts/misc/interfaces/IUiPoolDataProviderV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';

interface IUiPoolDataProviderV3 {
struct InterestRates {
struct InterestRates {
uint256 variableRateSlope1;
uint256 variableRateSlope2;
uint256 stableRateSlope1;
Expand Down Expand Up @@ -57,15 +57,17 @@ interface IUiPoolDataProviderV3 {
uint256 optimalUsageRatio;
// v3
bool isPaused;
bool isSiloedBorrowing;
uint128 accruedToTreasury;
uint128 unbacked;
uint128 isolationModeTotalDebt;
bool flashLoanEnabled;
//
uint256 debtCeiling;
uint256 debtCeilingDecimals;
uint8 eModeCategoryId;
uint256 borrowCap;
uint256 supplyCap;
uint256 supplyCap;
// eMode
uint16 eModeLtv;
uint16 eModeLiquidationThreshold;
Expand Down Expand Up @@ -100,15 +102,10 @@ interface IUiPoolDataProviderV3 {
function getReservesData(ILendingPoolAddressesProvider provider)
external
view
returns (
AggregatedReserveData[] memory,
BaseCurrencyInfo memory
);
returns (AggregatedReserveData[] memory, BaseCurrencyInfo memory);

function getUserReservesData(ILendingPoolAddressesProvider provider, address user)
external
view
returns (
UserReserveData[] memory, uint8
);
}
returns (UserReserveData[] memory, uint8);
}
13 changes: 11 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ require('dotenv').config();

import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-waffle';
import 'temp-hardhat-etherscan';
import '@nomiclabs/hardhat-etherscan';

import 'hardhat-gas-reporter';
import 'hardhat-typechain';
import '@tenderly/hardhat-tenderly';
Expand Down Expand Up @@ -84,8 +85,16 @@ const buidlerConfig: HardhatUserConfig = {
target: 'ethers-v5',
},
etherscan: {
apiKey: ETHERSCAN_KEY,
apiKey: {
polygonMumbai: process.env.ETHERSCAN_POLYGON_KEY || '',
goerli: process.env.ETHERSCAN_KEY || '',
fuji: process.env.ETHERSCAN_SNOWTRACE_KEY || '',
mainnet: process.env.ETHERSCAN_KEY || '',
polygon: process.env.ETHERSCAN_POLYGON_KEY || '',
avalanche: process.env.ETHERSCAN_SNOWTRACE_KEY || '',
},
},

mocha: {
timeout: 0,
},
Expand Down
4 changes: 2 additions & 2 deletions helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const chainlinkAggregatorProxy = {
'arbitrum-rinkeby': '0x5f0423B1a6935dc5596e7A24d98532b67A0AeFd8',
arbitrum: '0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612',
rinkeby: '0x8A753747A1Fa494EC906cE90E9f37563A8AF630e',
goerli: '0x9F54B624fb17d07816C5552f8AB133c21b0322cD',
goerli: '0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e',
};

export const chainlinkEthUsdAggregatorProxy = {
Expand All @@ -100,5 +100,5 @@ export const chainlinkEthUsdAggregatorProxy = {
'arbitrum-rinkeby': '0x5f0423B1a6935dc5596e7A24d98532b67A0AeFd8',
arbitrum: '0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612',
rinkeby: '0x8A753747A1Fa494EC906cE90E9f37563A8AF630e',
goerli: '0x9F54B624fb17d07816C5552f8AB133c21b0322cD',
goerli: '0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e',
};
Loading