mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
fix more imports
This commit is contained in:
parent
65f0ebf4f4
commit
ae8878a50e
|
@ -1,10 +1,10 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '@openzeppelin/contracts/math/SafeMath.sol';
|
||||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
import '../interfaces/IFlashLoanReceiver.sol';
|
||||
import '../../interfaces/ILendingPoolAddressesProvider.sol';
|
||||
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
|
||||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
import {IFlashLoanReceiver} from '../interfaces/IFlashLoanReceiver.sol';
|
||||
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
|
||||
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
|
||||
import '@nomiclabs/buidler/console.sol';
|
||||
|
||||
|
@ -35,5 +35,4 @@ abstract contract FlashLoanReceiverBase is IFlashLoanReceiver {
|
|||
) internal {
|
||||
IERC20(_reserve).safeTransfer(_destination, _amount);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
|
||||
interface IERC20Detailed is IERC20 {
|
||||
function name() external view returns (string memory);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
|
||||
interface IExchangeAdapter {
|
||||
event Exchange(
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '@openzeppelin/contracts/access/Ownable.sol';
|
||||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
|
||||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
|
||||
import '../interfaces/IPriceOracleGetter.sol';
|
||||
import '../interfaces/IChainlinkAggregator.sol';
|
||||
import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol';
|
||||
import {IChainlinkAggregator} from '../interfaces/IChainlinkAggregator.sol';
|
||||
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
|
||||
|
||||
/// @title ChainlinkProxyPriceProvider
|
||||
|
@ -77,17 +77,17 @@ contract ChainlinkProxyPriceProvider is IPriceOracleGetter, Ownable {
|
|||
/// @param _asset The asset address
|
||||
function getAssetPrice(address _asset) public override view returns (uint256) {
|
||||
IChainlinkAggregator source = assetsSources[_asset];
|
||||
// If there is no registered source for the asset, call the fallbackOracle
|
||||
if (address(source) == address(0)) {
|
||||
return IPriceOracleGetter(fallbackOracle).getAssetPrice(_asset);
|
||||
// If there is no registered source for the asset, call the fallbackOracle
|
||||
if (address(source) == address(0)) {
|
||||
return IPriceOracleGetter(fallbackOracle).getAssetPrice(_asset);
|
||||
} else {
|
||||
int256 _price = IChainlinkAggregator(source).latestAnswer();
|
||||
if (_price > 0) {
|
||||
return uint256(_price);
|
||||
} else {
|
||||
int256 _price = IChainlinkAggregator(source).latestAnswer();
|
||||
if (_price > 0) {
|
||||
return uint256(_price);
|
||||
} else {
|
||||
return IPriceOracleGetter(fallbackOracle).getAssetPrice(_asset);
|
||||
}
|
||||
return IPriceOracleGetter(fallbackOracle).getAssetPrice(_asset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @notice Gets a list of prices from a list of assets addresses
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '@openzeppelin/contracts/utils/Address.sol';
|
||||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
import {Address} from '@openzeppelin/contracts/utils/Address.sol';
|
||||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
|
||||
import '../configuration/LendingPoolAddressesProvider.sol';
|
||||
import '../lendingpool/LendingPool.sol';
|
||||
import {LendingPoolAddressesProvider} from '../configuration/LendingPoolAddressesProvider.sol';
|
||||
import {LendingPool} from '../lendingpool/LendingPool.sol';
|
||||
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ contract WalletBalanceProvider {
|
|||
provider = _provider;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
@dev Fallback function, don't accept any ETH
|
||||
**/
|
||||
receive() external payable {
|
||||
|
@ -97,7 +97,7 @@ contract WalletBalanceProvider {
|
|||
balances[j] = 0;
|
||||
continue;
|
||||
}
|
||||
balances[j] = balanceOf(_user, reserves[j]);
|
||||
balances[j] = balanceOf(_user, reserves[j]);
|
||||
}
|
||||
|
||||
return (reserves, balances);
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '@openzeppelin/contracts/math/SafeMath.sol';
|
||||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
|
||||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
|
||||
import '../../flashloan/base/FlashLoanReceiverBase.sol';
|
||||
import '../tokens/MintableERC20.sol';
|
||||
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
|
||||
import {FlashLoanReceiverBase} from '../../flashloan/base/FlashLoanReceiverBase.sol';
|
||||
import {MintableERC20} from '../tokens/MintableERC20.sol';
|
||||
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
|
||||
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
|
||||
|
||||
contract MockFlashLoanReceiver is FlashLoanReceiverBase {
|
||||
using SafeMath for uint256;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '../../interfaces/ILendingRateOracle.sol';
|
||||
import '@openzeppelin/contracts/access/Ownable.sol';
|
||||
import {ILendingRateOracle} from '../../interfaces/ILendingRateOracle.sol';
|
||||
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
|
||||
|
||||
contract LendingRateOracle is ILendingRateOracle, Ownable {
|
||||
mapping(address => uint256) borrowRates;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '../../interfaces/IPriceOracle.sol';
|
||||
import {IPriceOracle} from '../../interfaces/IPriceOracle.sol';
|
||||
|
||||
contract PriceOracle is IPriceOracle {
|
||||
mapping(address => uint256) prices;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
|
||||
import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol';
|
||||
|
||||
/**
|
||||
* @title ERC20Mintable
|
||||
|
|
Loading…
Reference in New Issue
Block a user