Skip to content

Commit ce53c4a

Browse files
authored
Merge pull request #324 from aave/feat/flashloanable-flag
feat: flashloanable flag
2 parents 0829f97 + 87121b5 commit ce53c4a

File tree

6 files changed

+4381
-4589
lines changed

6 files changed

+4381
-4589
lines changed

contracts/misc/UiPoolDataProviderV2V3.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 {
137137
reserveData.stableBorrowRateEnabled
138138
) = baseData.configuration.getFlagsMemory();
139139
reserveData.usageAsCollateralEnabled = reserveData.baseLTVasCollateral != 0;
140-
140+
141141
InterestRates memory interestRates = getInterestRateStrategySlopes(
142142
DefaultReserveInterestRateStrategy(reserveData.interestRateStrategyAddress), provider, reserveData.underlyingAsset
143143
);
@@ -149,6 +149,7 @@ contract UiPoolDataProviderV2V3 is IUiPoolDataProviderV3 {
149149
reserveData.baseStableBorrowRate = interestRates.baseStableBorrowRate;
150150
reserveData.baseVariableBorrowRate = interestRates.baseVariableBorrowRate;
151151
reserveData.optimalUsageRatio = interestRates.optimalUsageRatio;
152+
reserveData.flashLoanEnabled = true;
152153
}
153154

154155
BaseCurrencyInfo memory baseCurrencyInfo;

contracts/misc/interfaces/IUiPoolDataProviderV3.sol

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pragma experimental ABIEncoderV2;
55
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
66

77
interface IUiPoolDataProviderV3 {
8-
struct InterestRates {
8+
struct InterestRates {
99
uint256 variableRateSlope1;
1010
uint256 variableRateSlope2;
1111
uint256 stableRateSlope1;
@@ -57,15 +57,17 @@ interface IUiPoolDataProviderV3 {
5757
uint256 optimalUsageRatio;
5858
// v3
5959
bool isPaused;
60+
bool isSiloedBorrowing;
6061
uint128 accruedToTreasury;
6162
uint128 unbacked;
6263
uint128 isolationModeTotalDebt;
64+
bool flashLoanEnabled;
6365
//
6466
uint256 debtCeiling;
6567
uint256 debtCeilingDecimals;
6668
uint8 eModeCategoryId;
6769
uint256 borrowCap;
68-
uint256 supplyCap;
70+
uint256 supplyCap;
6971
// eMode
7072
uint16 eModeLtv;
7173
uint16 eModeLiquidationThreshold;
@@ -100,15 +102,10 @@ interface IUiPoolDataProviderV3 {
100102
function getReservesData(ILendingPoolAddressesProvider provider)
101103
external
102104
view
103-
returns (
104-
AggregatedReserveData[] memory,
105-
BaseCurrencyInfo memory
106-
);
105+
returns (AggregatedReserveData[] memory, BaseCurrencyInfo memory);
107106

108107
function getUserReservesData(ILendingPoolAddressesProvider provider, address user)
109108
external
110109
view
111-
returns (
112-
UserReserveData[] memory, uint8
113-
);
114-
}
110+
returns (UserReserveData[] memory, uint8);
111+
}

hardhat.config.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ require('dotenv').config();
2222

2323
import '@nomiclabs/hardhat-ethers';
2424
import '@nomiclabs/hardhat-waffle';
25-
import 'temp-hardhat-etherscan';
25+
import '@nomiclabs/hardhat-etherscan';
26+
2627
import 'hardhat-gas-reporter';
2728
import 'hardhat-typechain';
2829
import '@tenderly/hardhat-tenderly';
@@ -84,8 +85,16 @@ const buidlerConfig: HardhatUserConfig = {
8485
target: 'ethers-v5',
8586
},
8687
etherscan: {
87-
apiKey: ETHERSCAN_KEY,
88+
apiKey: {
89+
polygonMumbai: process.env.ETHERSCAN_POLYGON_KEY || '',
90+
goerli: process.env.ETHERSCAN_KEY || '',
91+
fuji: process.env.ETHERSCAN_SNOWTRACE_KEY || '',
92+
mainnet: process.env.ETHERSCAN_KEY || '',
93+
polygon: process.env.ETHERSCAN_POLYGON_KEY || '',
94+
avalanche: process.env.ETHERSCAN_SNOWTRACE_KEY || '',
95+
},
8896
},
97+
8998
mocha: {
9099
timeout: 0,
91100
},

helpers/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const chainlinkAggregatorProxy = {
8686
'arbitrum-rinkeby': '0x5f0423B1a6935dc5596e7A24d98532b67A0AeFd8',
8787
arbitrum: '0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612',
8888
rinkeby: '0x8A753747A1Fa494EC906cE90E9f37563A8AF630e',
89-
goerli: '0x9F54B624fb17d07816C5552f8AB133c21b0322cD',
89+
goerli: '0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e',
9090
};
9191

9292
export const chainlinkEthUsdAggregatorProxy = {
@@ -100,5 +100,5 @@ export const chainlinkEthUsdAggregatorProxy = {
100100
'arbitrum-rinkeby': '0x5f0423B1a6935dc5596e7A24d98532b67A0AeFd8',
101101
arbitrum: '0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612',
102102
rinkeby: '0x8A753747A1Fa494EC906cE90E9f37563A8AF630e',
103-
goerli: '0x9F54B624fb17d07816C5552f8AB133c21b0322cD',
103+
goerli: '0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e',
104104
};

0 commit comments

Comments
 (0)