Skip to content

Commit

Permalink
Add a getter for flashloanable flag (#146)
Browse files Browse the repository at this point in the history
* feat: added flashLoanEnabled flag. Waiting for v3.0.1

* feat: point core to v3.0.1

* fix: added try catch flashLoanEnabled

* fix: updated core dependency

Co-authored-by: sendra <[email protected]>
  • Loading branch information
miguelmtzinf and sendra authored Dec 28, 2022
1 parent ec151d9 commit 05747c1
Show file tree
Hide file tree
Showing 5 changed files with 929 additions and 256 deletions.
1 change: 1 addition & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const cp = require('child_process');

module.exports = {
configureYulOptimizer: true,
skipFiles: [
'./mocks',
'./misc/UiIncentiveDataProvider.sol',
Expand Down
6 changes: 6 additions & 0 deletions contracts/misc/UiPoolDataProviderV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ contract UiPoolDataProviderV3 is IUiPoolDataProviderV3 {
reserveData.debtCeilingDecimals = poolDataProvider.getDebtCeilingDecimals();
(reserveData.borrowCap, reserveData.supplyCap) = reserveConfigurationMap.getCaps();

try poolDataProvider.getFlashLoanEnabled(reserveData.underlyingAsset) returns (bool flashLoanEnabled) {
reserveData.flashLoanEnabled = flashLoanEnabled;
} catch (bytes memory) {
reserveData.flashLoanEnabled = true;
}

reserveData.isSiloedBorrowing = reserveConfigurationMap.getSiloedBorrowing();
reserveData.unbacked = baseData.unbacked;
reserveData.isolationModeTotalDebt = baseData.isolationModeTotalDebt;
Expand Down
1 change: 1 addition & 0 deletions contracts/misc/interfaces/IUiPoolDataProviderV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ interface IUiPoolDataProviderV3 {
uint128 accruedToTreasury;
uint128 unbacked;
uint128 isolationModeTotalDebt;
bool flashLoanEnabled;
//
uint256 debtCeiling;
uint256 debtCeilingDecimals;
Expand Down
Loading

0 comments on commit 05747c1

Please sign in to comment.