mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Folders reorg
This commit is contained in:
parent
86ddf25a3a
commit
937fb1df93
contracts
configuration
dependencies/openzeppelin
contracts
upgradeability
flashloan/base
lendingpool
libraries/aave-upgradeability
misc
mocks/flashloan
tokenization
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
|
||||
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
|
||||
import {
|
||||
InitializableImmutableAdminUpgradeabilityProxy
|
||||
} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol';
|
||||
|
@ -153,9 +153,9 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
|
|||
function _updateImpl(bytes32 id, address newAddress) internal {
|
||||
address payable proxyAddress = payable(_addresses[id]);
|
||||
|
||||
InitializableImmutableAdminUpgradeabilityProxy proxy = InitializableImmutableAdminUpgradeabilityProxy(
|
||||
proxyAddress
|
||||
);
|
||||
|
||||
InitializableImmutableAdminUpgradeabilityProxy proxy
|
||||
= InitializableImmutableAdminUpgradeabilityProxy(proxyAddress);
|
||||
bytes memory params = abi.encodeWithSignature('initialize(address)', address(this));
|
||||
|
||||
if (proxyAddress == address(0)) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
|
||||
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
|
||||
import {
|
||||
ILendingPoolAddressesProviderRegistry
|
||||
} from '../interfaces/ILendingPoolAddressesProviderRegistry.sol';
|
||||
|
|
69
contracts/dependencies/openzeppelin/contracts/Ownable.sol
Normal file
69
contracts/dependencies/openzeppelin/contracts/Ownable.sol
Normal file
|
@ -0,0 +1,69 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.6.0;
|
||||
|
||||
import './Context.sol';
|
||||
|
||||
/**
|
||||
* @dev Contract module which provides a basic access control mechanism, where
|
||||
* there is an account (an owner) that can be granted exclusive access to
|
||||
* specific functions.
|
||||
*
|
||||
* By default, the owner account will be the one that deploys the contract. This
|
||||
* can later be changed with {transferOwnership}.
|
||||
*
|
||||
* This module is used through inheritance. It will make available the modifier
|
||||
* `onlyOwner`, which can be applied to your functions to restrict their use to
|
||||
* the owner.
|
||||
*/
|
||||
contract Ownable is Context {
|
||||
address private _owner;
|
||||
|
||||
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
|
||||
|
||||
/**
|
||||
* @dev Initializes the contract setting the deployer as the initial owner.
|
||||
*/
|
||||
constructor() internal {
|
||||
address msgSender = _msgSender();
|
||||
_owner = msgSender;
|
||||
emit OwnershipTransferred(address(0), msgSender);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Returns the address of the current owner.
|
||||
*/
|
||||
function owner() public view returns (address) {
|
||||
return _owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Throws if called by any account other than the owner.
|
||||
*/
|
||||
modifier onlyOwner() {
|
||||
require(_owner == _msgSender(), 'Ownable: caller is not the owner');
|
||||
_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Leaves the contract without owner. It will not be possible to call
|
||||
* `onlyOwner` functions anymore. Can only be called by the current owner.
|
||||
*
|
||||
* NOTE: Renouncing ownership will leave the contract without an owner,
|
||||
* thereby removing any functionality that is only available to the owner.
|
||||
*/
|
||||
function renounceOwnership() public virtual onlyOwner {
|
||||
emit OwnershipTransferred(_owner, address(0));
|
||||
_owner = address(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Transfers ownership of the contract to a new account (`newOwner`).
|
||||
* Can only be called by the current owner.
|
||||
*/
|
||||
function transferOwnership(address newOwner) public virtual onlyOwner {
|
||||
require(newOwner != address(0), 'Ownable: new owner is the zero address');
|
||||
emit OwnershipTransferred(_owner, newOwner);
|
||||
_owner = newOwner;
|
||||
}
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
|
||||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
|
||||
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
|
||||
import {IFlashLoanReceiver} from '../interfaces/IFlashLoanReceiver.sol';
|
||||
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
|
||||
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
|
||||
import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
|
||||
|
||||
abstract contract FlashLoanReceiverBase is IFlashLoanReceiver {
|
||||
using SafeERC20 for IERC20;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import {SafeMath} from '../libraries/external/openzeppelin/contracts//SafeMath.sol';
|
||||
import {IERC20} from '../libraries/external/openzeppelin/contracts//IERC20.sol';
|
||||
import {SafeMath} from '../dependencies/openzeppelin/contracts//SafeMath.sol';
|
||||
import {IERC20} from '../dependencies/openzeppelin/contracts//IERC20.sol';
|
||||
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
|
||||
import {IAToken} from '../tokenization/interfaces/IAToken.sol';
|
||||
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol';
|
||||
|
@ -14,7 +14,7 @@ import {UserConfiguration} from '../libraries/configuration/UserConfiguration.so
|
|||
import {Helpers} from '../libraries/helpers/Helpers.sol';
|
||||
import {WadRayMath} from '../libraries/math/WadRayMath.sol';
|
||||
import {PercentageMath} from '../libraries/math/PercentageMath.sol';
|
||||
import {SafeERC20} from '../libraries/external/openzeppelin/contracts/SafeERC20.sol';
|
||||
import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol';
|
||||
import {ISwapAdapter} from '../interfaces/ISwapAdapter.sol';
|
||||
import {Errors} from '../libraries/helpers/Errors.sol';
|
||||
import {ValidationLogic} from '../libraries/logic/ValidationLogic.sol';
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
pragma solidity ^0.6.8;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import {SafeMath} from '../libraries/external/openzeppelin/contracts/SafeMath.sol';
|
||||
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';
|
||||
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
|
||||
import {
|
||||
InitializableImmutableAdminUpgradeabilityProxy
|
||||
|
@ -10,7 +10,7 @@ import {
|
|||
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
|
||||
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
|
||||
import {ILendingPool} from '../interfaces/ILendingPool.sol';
|
||||
import {IERC20Detailed} from '../libraries/external/openzeppelin/contracts/IERC20Detailed.sol';
|
||||
import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
|
||||
import {Errors} from '../libraries/helpers/Errors.sol';
|
||||
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import '../external/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol';
|
||||
import '../../dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol';
|
||||
|
||||
/**
|
||||
* @title BaseImmutableAdminUpgradeabilityProxy
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
pragma solidity ^0.6.8;
|
||||
|
||||
import './BaseImmutableAdminUpgradeabilityProxy.sol';
|
||||
import '../external/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol';
|
||||
import '../../dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol';
|
||||
|
||||
/**
|
||||
* @title InitializableAdminUpgradeabilityProxy
|
||||
|
|
|
@ -3,7 +3,7 @@ pragma solidity ^0.6.8;
|
|||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
|
||||
import {IERC20Detailed} from '../libraries/external/openzeppelin/contracts/IERC20Detailed.sol';
|
||||
import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
|
||||
import {ILendingPool} from '../interfaces/ILendingPool.sol';
|
||||
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol';
|
||||
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import {SafeMath} from '../../libraries/external/openzeppelin/contracts/SafeMath.sol';
|
||||
import {IERC20} from '../../libraries/external/openzeppelin/contracts/IERC20.sol';
|
||||
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
|
||||
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
|
||||
|
||||
import {FlashLoanReceiverBase} from '../../flashloan/base/FlashLoanReceiverBase.sol';
|
||||
import {MintableERC20} from '../tokens/MintableERC20.sol';
|
||||
import {SafeERC20} from '../../libraries/external/openzeppelin/contracts/SafeERC20.sol';
|
||||
import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
|
||||
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
|
||||
|
||||
contract MockFlashLoanReceiver is FlashLoanReceiverBase {
|
||||
|
|
|
@ -7,8 +7,8 @@ import {WadRayMath} from '../libraries/math/WadRayMath.sol';
|
|||
import {Errors} from '../libraries/helpers/Errors.sol';
|
||||
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
|
||||
import {IAToken} from './interfaces/IAToken.sol';
|
||||
import {IERC20} from '../libraries/external/openzeppelin/contracts/IERC20.sol';
|
||||
import {SafeERC20} from '../libraries/external/openzeppelin/contracts/SafeERC20.sol';
|
||||
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';
|
||||
import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol';
|
||||
|
||||
/**
|
||||
* @title Aave ERC20 AToken
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity 0.6.8;
|
||||
|
||||
import {Context} from '../libraries/external/openzeppelin/contracts/Context.sol';
|
||||
import {IERC20} from '../libraries/external/openzeppelin/contracts/IERC20.sol';
|
||||
import {IERC20Detailed} from '../libraries/external/openzeppelin/contracts/IERC20Detailed.sol';
|
||||
import {SafeMath} from '../libraries/external/openzeppelin/contracts/SafeMath.sol';
|
||||
import {Context} from '../dependencies/openzeppelin/contracts/Context.sol';
|
||||
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';
|
||||
import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
|
||||
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';
|
||||
import {IAaveIncentivesController} from '../interfaces/IAaveIncentivesController.sol';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import {IERC20} from '../../libraries/external/openzeppelin/contracts/IERC20.sol';
|
||||
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
|
||||
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
|
||||
|
||||
interface IAToken is IERC20, IScaledBalanceToken {
|
||||
|
|
Loading…
Reference in New Issue
Block a user