diff --git a/Makefile b/Makefile index 5d0ee01e..f46c33c3 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ update:; forge update # Build & test test :; forge test -vvv --no-match-contract DeploymentsGasLimits +test-contract :; forge test --match-contract ${filter} -vvv test-watch :; forge test --watch -vvv --no-match-contract DeploymentsGasLimits coverage :; forge coverage --report lcov && \ lcov --remove ./lcov.info -o ./lcov.info.p \ @@ -34,4 +35,4 @@ coverage :; forge coverage --report lcov && \ download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address} git-diff : @mkdir -p diffs - @printf '%s\n%s\n%s\n' "\`\`\`diff" "$$(git diff --no-index --diff-algorithm=patience --ignore-space-at-eol ${before} ${after})" "\`\`\`" > diffs/${out}.md \ No newline at end of file + @printf '%s\n%s\n%s\n' "\`\`\`diff" "$$(git diff --no-index --diff-algorithm=patience --ignore-space-at-eol ${before} ${after})" "\`\`\`" > diffs/${out}.md diff --git a/certora/applyHarness.patch b/certora/applyHarness.patch index 62c1705e..06b4e1ca 100644 --- a/certora/applyHarness.patch +++ b/certora/applyHarness.patch @@ -1,22 +1,22 @@ -diff -ruN core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol ---- core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol 2024-03-27 12:57:15.497294747 +0200 -+++ core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol 2024-03-27 13:08:22.155984803 +0200 +diff -ruN contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol +--- contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol 2024-03-27 12:57:15.497294747 +0200 ++++ contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol 2024-03-27 13:08:22.155984803 +0200 @@ -34,7 +34,7 @@ } - + /// @inheritdoc IScaledBalanceToken - function scaledBalanceOf(address user) external view override returns (uint256) { + function scaledBalanceOf(address user) public view override returns (uint256) { return super.balanceOf(user); } - -diff -ruN core/instances/ATokenInstance.sol core/instances/ATokenInstance.sol ---- core/instances/ATokenInstance.sol 2024-03-27 12:57:15.497294747 +0200 -+++ core/instances/ATokenInstance.sol 2024-03-27 13:14:17.971198372 +0200 + +diff -ruN contracts/instances/ATokenInstance.sol contracts/instances/ATokenInstance.sol +--- contracts/instances/ATokenInstance.sol 2024-03-27 12:57:15.497294747 +0200 ++++ contracts/instances/ATokenInstance.sol 2024-03-27 13:14:17.971198372 +0200 @@ -35,15 +35,15 @@ - + _domainSeparator = _calculateDomainSeparator(); - + - emit Initialized( - underlyingAsset, - address(POOL), diff --git a/certora/conf/NEW-pool-no-summarizations.conf b/certora/conf/NEW-pool-no-summarizations.conf index 11f62350..cd2365aa 100644 --- a/certora/conf/NEW-pool-no-summarizations.conf +++ b/certora/conf/NEW-pool-no-summarizations.conf @@ -4,13 +4,13 @@ "certora/harness/PoolHarness.sol", "certora/harness/StableDebtTokenHarness.sol", "certora/harness/SimpleERC20.sol", - "src/core/instances/VariableDebtTokenInstance.sol", - "src/core/contracts/misc/AaveProtocolDataProvider.sol", - "src/core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol", - "src/core/contracts/protocol/configuration/ACLManager.sol", - "src/core/contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol", - "src/core/contracts/protocol/configuration/PriceOracleSentinel.sol", - "src/core/contracts/protocol/configuration/PoolAddressesProvider.sol", + "src/contracts/instances/VariableDebtTokenInstance.sol", + "src/contracts/helpers/AaveProtocolDataProvider.sol", + "src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol", + "src/contracts/protocol/configuration/ACLManager.sol", + "src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol", + "src/contracts/misc/PriceOracleSentinel.sol", + "src/contracts/protocol/configuration/PoolAddressesProvider.sol", ], "link": [ "ATokenHarness:POOL=PoolHarness", diff --git a/certora/conf/NEW-pool-simple-properties.conf b/certora/conf/NEW-pool-simple-properties.conf index 96a78c78..e5606325 100644 --- a/certora/conf/NEW-pool-simple-properties.conf +++ b/certora/conf/NEW-pool-simple-properties.conf @@ -4,11 +4,11 @@ "certora/harness/PoolHarness.sol", "certora/harness/StableDebtTokenHarness.sol", "certora/harness/SimpleERC20.sol", - "src/core/instances/VariableDebtTokenInstance.sol", - "src/core/contracts/misc/AaveProtocolDataProvider.sol", - "src/core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol", - "src/core/contracts/protocol/libraries/types/DataTypes.sol", - "src/core/contracts/protocol/configuration/PoolAddressesProvider.sol", + "src/contracts/instances/VariableDebtTokenInstance.sol", + "src/contracts/helpers/AaveProtocolDataProvider.sol", + "src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol", + "src/contracts/protocol/libraries/types/DataTypes.sol", + "src/contracts/protocol/configuration/PoolAddressesProvider.sol", ], "link": [ "ATokenHarness:POOL=PoolHarness", diff --git a/certora/harness/ATokenHarness.sol b/certora/harness/ATokenHarness.sol index cc23245c..bcb5d32a 100644 --- a/certora/harness/ATokenHarness.sol +++ b/certora/harness/ATokenHarness.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.19; -import {Pool} from '../munged/core/contracts/protocol/pool/Pool.sol'; -import {ATokenInstance} from '../munged/core/instances/ATokenInstance.sol'; -import {WadRayMath} from '../munged/core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {ScaledBalanceTokenBase} from '../munged/core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol'; -import {IScaledBalanceToken} from '../munged/core/contracts/interfaces/IScaledBalanceToken.sol'; +import {Pool} from '../munged/contracts/protocol/pool/Pool.sol'; +import {ATokenInstance} from '../munged/contracts/instances/ATokenInstance.sol'; +import {WadRayMath} from '../munged/contracts/protocol/libraries/math/WadRayMath.sol'; +import {ScaledBalanceTokenBase} from '../munged/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol'; +import {IScaledBalanceToken} from '../munged/contracts/interfaces/IScaledBalanceToken.sol'; -/** +/* * @title Certora harness for Aave ERC20 AToken * * @dev Certora's harness contract for the verification of Aave ERC20 AToken. diff --git a/certora/harness/PoolHarness.sol b/certora/harness/PoolHarness.sol index 70deadf9..a914b868 100644 --- a/certora/harness/PoolHarness.sol +++ b/certora/harness/PoolHarness.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.19; -import {PoolInstance} from '../munged/core/instances/PoolInstance.sol'; -import {DataTypes} from '../munged/core/contracts/protocol/libraries/types/DataTypes.sol'; -import {ReserveLogic} from '../munged/core/contracts/protocol/libraries/logic/ReserveLogic.sol'; -import {IPoolAddressesProvider} from '../munged/core/contracts/interfaces/IPoolAddressesProvider.sol'; +import {PoolInstance} from '../munged/contracts/instances/PoolInstance.sol'; +import {DataTypes} from '../munged/contracts/protocol/libraries/types/DataTypes.sol'; +import {ReserveLogic} from '../munged/contracts/protocol/libraries/logic/ReserveLogic.sol'; +import {IPoolAddressesProvider} from '../munged/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IERC20} from '../../src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {ReserveConfiguration} from '../munged/core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; +import {IERC20} from '../../src/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {ReserveConfiguration} from '../munged/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; contract PoolHarness is PoolInstance { using ReserveLogic for DataTypes.ReserveData; diff --git a/certora/harness/ReserveConfigurationHarness.sol b/certora/harness/ReserveConfigurationHarness.sol index d4edade2..c4c35d96 100644 --- a/certora/harness/ReserveConfigurationHarness.sol +++ b/certora/harness/ReserveConfigurationHarness.sol @@ -1,8 +1,9 @@ +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.19; pragma experimental ABIEncoderV2; -import {ReserveConfiguration} from '../munged/core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; -import {DataTypes} from '../munged/core/contracts/protocol/libraries/types/DataTypes.sol'; +import {ReserveConfiguration} from '../munged/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; +import {DataTypes} from '../munged/contracts/protocol/libraries/types/DataTypes.sol'; contract ReserveConfigurationHarness { DataTypes.ReserveConfigurationMap public reservesConfig; diff --git a/certora/harness/SimpleERC20.sol b/certora/harness/SimpleERC20.sol index 81d12bad..68733603 100644 --- a/certora/harness/SimpleERC20.sol +++ b/certora/harness/SimpleERC20.sol @@ -1,7 +1,7 @@ -// SPDX-License-Identifier: agpl-3.0 +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.19; -import {IERC20} from '../munged/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {IERC20} from '../munged/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; /** A simple ERC implementation used as the underlying_asset for the verification process. diff --git a/certora/harness/StableDebtTokenHarness.sol b/certora/harness/StableDebtTokenHarness.sol index 99ce3355..8702fe24 100644 --- a/certora/harness/StableDebtTokenHarness.sol +++ b/certora/harness/StableDebtTokenHarness.sol @@ -1,8 +1,9 @@ +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.19; -import {StableDebtTokenInstance} from '../munged/core/instances/StableDebtTokenInstance.sol'; -import {IncentivizedERC20} from '../munged/core/contracts/protocol/tokenization/base/IncentivizedERC20.sol'; -import {IPool} from '../munged/core/contracts/interfaces/IPool.sol'; +import {StableDebtTokenInstance} from '../munged/contracts/instances/StableDebtTokenInstance.sol'; +import {IncentivizedERC20} from '../munged/contracts/protocol/tokenization/base/IncentivizedERC20.sol'; +import {IPool} from '../munged/contracts/interfaces/IPool.sol'; contract StableDebtTokenHarness is StableDebtTokenInstance { constructor(IPool pool) public StableDebtTokenInstance(pool) {} diff --git a/certora/harness/SymbolicPriceOracle.sol b/certora/harness/SymbolicPriceOracle.sol index b90e21dd..d268e5d0 100644 --- a/certora/harness/SymbolicPriceOracle.sol +++ b/certora/harness/SymbolicPriceOracle.sol @@ -1,6 +1,7 @@ +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.19; -import {IPriceOracleGetter} from '../munged/interfaces/IPriceOracleGetter.sol'; +import {IPriceOracleGetter} from '../munged/contracts/interfaces/IPriceOracleGetter.sol'; contract SymbolicPriceOracle is IPriceOracleGetter { address public base; diff --git a/certora/harness/UserConfigurationHarness.sol b/certora/harness/UserConfigurationHarness.sol index 4c82a29b..3f1637ea 100644 --- a/certora/harness/UserConfigurationHarness.sol +++ b/certora/harness/UserConfigurationHarness.sol @@ -1,9 +1,10 @@ +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.19; pragma experimental ABIEncoderV2; -import {UserConfiguration} from '../munged/core/contracts/protocol/libraries/configuration/UserConfiguration.sol'; -import {DataTypes} from '../munged/core/contracts/protocol/libraries/types/DataTypes.sol'; -import {PoolStorage} from '../munged/core/contracts/protocol/pool/PoolStorage.sol'; +import {UserConfiguration} from '../munged/contracts/protocol/libraries/configuration/UserConfiguration.sol'; +import {DataTypes} from '../munged/contracts/protocol/libraries/types/DataTypes.sol'; +import {PoolStorage} from '../munged/contracts/protocol/pool/PoolStorage.sol'; /* A wrapper contract for calling functions from the library UserConfiguration. diff --git a/certora/harness/VariableDebtTokenHarness.sol b/certora/harness/VariableDebtTokenHarness.sol index 33da454f..ca2696a6 100644 --- a/certora/harness/VariableDebtTokenHarness.sol +++ b/certora/harness/VariableDebtTokenHarness.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.19; -import {VariableDebtTokenInstance} from '../munged/core/instances/VariableDebtTokenInstance.sol'; -import {WadRayMath} from '../munged/core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {IPool} from '../munged/core/contracts/interfaces/IPool.sol'; +import {VariableDebtTokenInstance} from '../munged/contracts/instances/VariableDebtTokenInstance.sol'; +import {WadRayMath} from '../munged/contracts/protocol/libraries/math/WadRayMath.sol'; +import {IPool} from '../munged/contracts/interfaces/IPool.sol'; contract VariableDebtTokenHarness is VariableDebtTokenInstance { using WadRayMath for uint256; diff --git a/docs/Aave-v3.1-features.md b/docs/Aave-v3.1-features.md index 285433c7..6219dbeb 100644 --- a/docs/Aave-v3.1-features.md +++ b/docs/Aave-v3.1-features.md @@ -28,7 +28,12 @@ This new feature doesn’t create any incompatibility with Aave v3 integrations, Given its implications and criticality, virtual accounting can be considered the major feature of Aave 3.1. -_Important_. Virtual balance doesn't fix the imprecision caused by other components of the protocol, its objective is to add stricter validations, reducing any type of vector to the minimum. +**Misc considerations & acknowledged limitations** + +- Virtual balance doesn't fix the imprecision caused by other components of the protocol, its objective is to add stricter validations, reducing any type of attack vector to the minimum. +- An extra "soft" protection has been added on borrowing actions (flash loan and borrow): the amount borrowed of underlying should not be higher than the aToken supply. The idea behind is to add more defenses on inflation scenarios, even if we are aware total protection is not achieved (e.g. against certain edge iteration vectors). + Not using `accruedToTreasury` in the calculation is intentional. +- The addition of virtual accounting can create a situation over time that more liquidity will be available in the aToken contract than what the the virtual balance allows to withdraw/borrow. This is intended by design.
diff --git a/reports/.empty b/reports/.empty new file mode 100644 index 00000000..e69de29b diff --git a/scripts/misc/LibraryPreCompileOne.sol b/scripts/misc/LibraryPreCompileOne.sol index 502b5cdf..746a7920 100644 --- a/scripts/misc/LibraryPreCompileOne.sol +++ b/scripts/misc/LibraryPreCompileOne.sol @@ -71,16 +71,16 @@ contract LibraryPreCompileOne is FfiUtils, Script, DeployUtils { return string( abi.encodePacked( - 'aave-v3-core/contracts/protocol/libraries/logic/BorrowLogic.sol:BorrowLogic:', + 'src/contracts/protocol/libraries/logic/BorrowLogic.sol:BorrowLogic:', vm.toString(report.borrowLogic), ',', - 'aave-v3-core/contracts/protocol/libraries/logic/BridgeLogic.sol:BridgeLogic:', + 'src/contracts/protocol/libraries/logic/BridgeLogic.sol:BridgeLogic:', vm.toString(report.bridgeLogic), ',', - 'aave-v3-core/contracts/protocol/libraries/logic/ConfiguratorLogic.sol:ConfiguratorLogic:', + 'src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol:ConfiguratorLogic:', vm.toString(report.configuratorLogic), ',', - 'aave-v3-core/contracts/protocol/libraries/logic/EModeLogic.sol:EModeLogic:', + 'src/contracts/protocol/libraries/logic/EModeLogic.sol:EModeLogic:', vm.toString(report.eModeLogic) ) ); diff --git a/scripts/misc/LibraryPreCompileTwo.sol b/scripts/misc/LibraryPreCompileTwo.sol index cab49cec..9b381a66 100644 --- a/scripts/misc/LibraryPreCompileTwo.sol +++ b/scripts/misc/LibraryPreCompileTwo.sol @@ -71,16 +71,16 @@ contract LibraryPreCompileTwo is FfiUtils, Script, DeployUtils { string( abi.encodePacked( ',', - 'aave-v3-core/contracts/protocol/libraries/logic/FlashLoanLogic.sol:FlashLoanLogic:', + 'src/contracts/protocol/libraries/logic/FlashLoanLogic.sol:FlashLoanLogic:', vm.toString(report.flashLoanLogic), ',', - 'aave-v3-core/contracts/protocol/libraries/logic/LiquidationLogic.sol:LiquidationLogic:', + 'src/contracts/protocol/libraries/logic/LiquidationLogic.sol:LiquidationLogic:', vm.toString(report.liquidationLogic), ',', - 'aave-v3-core/contracts/protocol/libraries/logic/PoolLogic.sol:PoolLogic:', + 'src/contracts/protocol/libraries/logic/PoolLogic.sol:PoolLogic:', vm.toString(report.poolLogic), ',', - 'aave-v3-core/contracts/protocol/libraries/logic/SupplyLogic.sol:SupplyLogic:', + 'src/contracts/protocol/libraries/logic/SupplyLogic.sol:SupplyLogic:', vm.toString(report.supplyLogic) ) ); diff --git a/src/core/contracts/dependencies/chainlink/AggregatorInterface.sol b/src/contracts/dependencies/chainlink/AggregatorInterface.sol similarity index 100% rename from src/core/contracts/dependencies/chainlink/AggregatorInterface.sol rename to src/contracts/dependencies/chainlink/AggregatorInterface.sol diff --git a/src/core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol b/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol similarity index 100% rename from src/core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol rename to src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol diff --git a/src/periphery/contracts/dependencies/openzeppelin/ReentrancyGuard.sol b/src/contracts/dependencies/openzeppelin/ReentrancyGuard.sol similarity index 100% rename from src/periphery/contracts/dependencies/openzeppelin/ReentrancyGuard.sol rename to src/contracts/dependencies/openzeppelin/ReentrancyGuard.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/AccessControl.sol b/src/contracts/dependencies/openzeppelin/contracts/AccessControl.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/AccessControl.sol rename to src/contracts/dependencies/openzeppelin/contracts/AccessControl.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/Address.sol b/src/contracts/dependencies/openzeppelin/contracts/Address.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/Address.sol rename to src/contracts/dependencies/openzeppelin/contracts/Address.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/Context.sol b/src/contracts/dependencies/openzeppelin/contracts/Context.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/Context.sol rename to src/contracts/dependencies/openzeppelin/contracts/Context.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/ERC165.sol b/src/contracts/dependencies/openzeppelin/contracts/ERC165.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/ERC165.sol rename to src/contracts/dependencies/openzeppelin/contracts/ERC165.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/ERC20.sol b/src/contracts/dependencies/openzeppelin/contracts/ERC20.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/ERC20.sol rename to src/contracts/dependencies/openzeppelin/contracts/ERC20.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol b/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol rename to src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/IERC165.sol b/src/contracts/dependencies/openzeppelin/contracts/IERC165.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/IERC165.sol rename to src/contracts/dependencies/openzeppelin/contracts/IERC165.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol b/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol rename to src/contracts/dependencies/openzeppelin/contracts/IERC20.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol b/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol rename to src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/Ownable.sol b/src/contracts/dependencies/openzeppelin/contracts/Ownable.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/Ownable.sol rename to src/contracts/dependencies/openzeppelin/contracts/Ownable.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol b/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol rename to src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol b/src/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol rename to src/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/SafeMath.sol b/src/contracts/dependencies/openzeppelin/contracts/SafeMath.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/SafeMath.sol rename to src/contracts/dependencies/openzeppelin/contracts/SafeMath.sol diff --git a/src/core/contracts/dependencies/openzeppelin/contracts/Strings.sol b/src/contracts/dependencies/openzeppelin/contracts/Strings.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/contracts/Strings.sol rename to src/contracts/dependencies/openzeppelin/contracts/Strings.sol diff --git a/src/core/contracts/dependencies/openzeppelin/upgradeability/AdminUpgradeabilityProxy.sol b/src/contracts/dependencies/openzeppelin/upgradeability/AdminUpgradeabilityProxy.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/upgradeability/AdminUpgradeabilityProxy.sol rename to src/contracts/dependencies/openzeppelin/upgradeability/AdminUpgradeabilityProxy.sol diff --git a/src/core/contracts/dependencies/openzeppelin/upgradeability/BaseAdminUpgradeabilityProxy.sol b/src/contracts/dependencies/openzeppelin/upgradeability/BaseAdminUpgradeabilityProxy.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/upgradeability/BaseAdminUpgradeabilityProxy.sol rename to src/contracts/dependencies/openzeppelin/upgradeability/BaseAdminUpgradeabilityProxy.sol diff --git a/src/core/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol b/src/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol rename to src/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol diff --git a/src/core/contracts/dependencies/openzeppelin/upgradeability/Initializable.sol b/src/contracts/dependencies/openzeppelin/upgradeability/Initializable.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/upgradeability/Initializable.sol rename to src/contracts/dependencies/openzeppelin/upgradeability/Initializable.sol diff --git a/src/core/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol b/src/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol rename to src/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol diff --git a/src/core/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol b/src/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol rename to src/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol diff --git a/src/core/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol b/src/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol rename to src/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol diff --git a/src/core/contracts/dependencies/openzeppelin/upgradeability/UpgradeabilityProxy.sol b/src/contracts/dependencies/openzeppelin/upgradeability/UpgradeabilityProxy.sol similarity index 100% rename from src/core/contracts/dependencies/openzeppelin/upgradeability/UpgradeabilityProxy.sol rename to src/contracts/dependencies/openzeppelin/upgradeability/UpgradeabilityProxy.sol diff --git a/src/core/contracts/dependencies/weth/WETH9.sol b/src/contracts/dependencies/weth/WETH9.sol similarity index 100% rename from src/core/contracts/dependencies/weth/WETH9.sol rename to src/contracts/dependencies/weth/WETH9.sol diff --git a/src/periphery/contracts/adapters/paraswap/AaveParaSwapFeeClaimer.sol b/src/contracts/extensions/paraswap-adapters/AaveParaSwapFeeClaimer.sol similarity index 95% rename from src/periphery/contracts/adapters/paraswap/AaveParaSwapFeeClaimer.sol rename to src/contracts/extensions/paraswap-adapters/AaveParaSwapFeeClaimer.sol index 5a0bb34a..2d47b182 100644 --- a/src/periphery/contracts/adapters/paraswap/AaveParaSwapFeeClaimer.sol +++ b/src/contracts/extensions/paraswap-adapters/AaveParaSwapFeeClaimer.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.0; import {IFeeClaimer} from './interfaces/IFeeClaimer.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; /** * @title AaveParaSwapFeeClaimer diff --git a/src/periphery/contracts/adapters/paraswap/BaseParaSwapAdapter.sol b/src/contracts/extensions/paraswap-adapters/BaseParaSwapAdapter.sol similarity index 79% rename from src/periphery/contracts/adapters/paraswap/BaseParaSwapAdapter.sol rename to src/contracts/extensions/paraswap-adapters/BaseParaSwapAdapter.sol index 247f4437..45988edf 100644 --- a/src/periphery/contracts/adapters/paraswap/BaseParaSwapAdapter.sol +++ b/src/contracts/extensions/paraswap-adapters/BaseParaSwapAdapter.sol @@ -1,16 +1,16 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {FlashLoanSimpleReceiverBase} from 'aave-v3-core/contracts/flashloan/base/FlashLoanSimpleReceiverBase.sol'; -import {GPv2SafeERC20} from 'aave-v3-core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {IERC20WithPermit} from 'aave-v3-core/contracts/interfaces/IERC20WithPermit.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPriceOracleGetter} from 'aave-v3-core/contracts/interfaces/IPriceOracleGetter.sol'; -import {SafeMath} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeMath.sol'; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; +import {DataTypes} from '../../protocol/libraries/types/DataTypes.sol'; +import {FlashLoanSimpleReceiverBase} from '../../misc/flashloan/base/FlashLoanSimpleReceiverBase.sol'; +import {GPv2SafeERC20} from '../../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; +import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IERC20WithPermit} from '../../interfaces/IERC20WithPermit.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; +import {IPriceOracleGetter} from '../../interfaces/IPriceOracleGetter.sol'; +import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; +import {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol'; /** * @title BaseParaSwapAdapter diff --git a/src/periphery/contracts/adapters/paraswap/BaseParaSwapBuyAdapter.sol b/src/contracts/extensions/paraswap-adapters/BaseParaSwapBuyAdapter.sol similarity index 89% rename from src/periphery/contracts/adapters/paraswap/BaseParaSwapBuyAdapter.sol rename to src/contracts/extensions/paraswap-adapters/BaseParaSwapBuyAdapter.sol index 9fcfdc11..5d9db556 100644 --- a/src/periphery/contracts/adapters/paraswap/BaseParaSwapBuyAdapter.sol +++ b/src/contracts/extensions/paraswap-adapters/BaseParaSwapBuyAdapter.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {SafeERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol'; -import {SafeMath} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeMath.sol'; -import {PercentageMath} from 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; +import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; +import {PercentageMath} from '../../protocol/libraries/math/PercentageMath.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; +import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {IParaSwapAugustus} from './interfaces/IParaSwapAugustus.sol'; import {IParaSwapAugustusRegistry} from './interfaces/IParaSwapAugustusRegistry.sol'; import {BaseParaSwapAdapter} from './BaseParaSwapAdapter.sol'; diff --git a/src/periphery/contracts/adapters/paraswap/BaseParaSwapSellAdapter.sol b/src/contracts/extensions/paraswap-adapters/BaseParaSwapSellAdapter.sol similarity index 89% rename from src/periphery/contracts/adapters/paraswap/BaseParaSwapSellAdapter.sol rename to src/contracts/extensions/paraswap-adapters/BaseParaSwapSellAdapter.sol index 8086a5c0..5292a3b8 100644 --- a/src/periphery/contracts/adapters/paraswap/BaseParaSwapSellAdapter.sol +++ b/src/contracts/extensions/paraswap-adapters/BaseParaSwapSellAdapter.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {SafeERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol'; -import {SafeMath} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeMath.sol'; -import {PercentageMath} from 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; +import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; +import {PercentageMath} from '../../protocol/libraries/math/PercentageMath.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; +import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {IParaSwapAugustus} from './interfaces/IParaSwapAugustus.sol'; import {IParaSwapAugustusRegistry} from './interfaces/IParaSwapAugustusRegistry.sol'; import {BaseParaSwapAdapter} from './BaseParaSwapAdapter.sol'; diff --git a/src/periphery/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol b/src/contracts/extensions/paraswap-adapters/ParaSwapLiquiditySwapAdapter.sol similarity index 94% rename from src/periphery/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol rename to src/contracts/extensions/paraswap-adapters/ParaSwapLiquiditySwapAdapter.sol index 7852f16e..db855a33 100644 --- a/src/periphery/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol +++ b/src/contracts/extensions/paraswap-adapters/ParaSwapLiquiditySwapAdapter.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {IERC20WithPermit} from 'aave-v3-core/contracts/interfaces/IERC20WithPermit.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {SafeERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol'; -import {SafeMath} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeMath.sol'; +import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IERC20WithPermit} from '../../interfaces/IERC20WithPermit.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; +import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; +import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {BaseParaSwapSellAdapter} from './BaseParaSwapSellAdapter.sol'; import {IParaSwapAugustusRegistry} from './interfaces/IParaSwapAugustusRegistry.sol'; import {IParaSwapAugustus} from './interfaces/IParaSwapAugustus.sol'; diff --git a/src/periphery/contracts/adapters/paraswap/ParaSwapRepayAdapter.sol b/src/contracts/extensions/paraswap-adapters/ParaSwapRepayAdapter.sol similarity index 92% rename from src/periphery/contracts/adapters/paraswap/ParaSwapRepayAdapter.sol rename to src/contracts/extensions/paraswap-adapters/ParaSwapRepayAdapter.sol index f776c757..6cfb3f22 100644 --- a/src/periphery/contracts/adapters/paraswap/ParaSwapRepayAdapter.sol +++ b/src/contracts/extensions/paraswap-adapters/ParaSwapRepayAdapter.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {IERC20WithPermit} from 'aave-v3-core/contracts/interfaces/IERC20WithPermit.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {SafeERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol'; -import {SafeMath} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeMath.sol'; +import {DataTypes} from '../../protocol/libraries/types/DataTypes.sol'; +import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; +import {IERC20WithPermit} from '../../interfaces/IERC20WithPermit.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; +import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; +import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {BaseParaSwapBuyAdapter} from './BaseParaSwapBuyAdapter.sol'; import {IParaSwapAugustusRegistry} from './interfaces/IParaSwapAugustusRegistry.sol'; import {IParaSwapAugustus} from './interfaces/IParaSwapAugustus.sol'; diff --git a/src/periphery/contracts/adapters/paraswap/ParaSwapWithdrawSwapAdapter.sol b/src/contracts/extensions/paraswap-adapters/ParaSwapWithdrawSwapAdapter.sol similarity index 87% rename from src/periphery/contracts/adapters/paraswap/ParaSwapWithdrawSwapAdapter.sol rename to src/contracts/extensions/paraswap-adapters/ParaSwapWithdrawSwapAdapter.sol index 499c7d6a..2522ee88 100644 --- a/src/periphery/contracts/adapters/paraswap/ParaSwapWithdrawSwapAdapter.sol +++ b/src/contracts/extensions/paraswap-adapters/ParaSwapWithdrawSwapAdapter.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.10; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {IERC20WithPermit} from 'aave-v3-core/contracts/interfaces/IERC20WithPermit.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IERC20WithPermit} from '../../interfaces/IERC20WithPermit.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {BaseParaSwapSellAdapter} from './BaseParaSwapSellAdapter.sol'; import {IParaSwapAugustusRegistry} from './interfaces/IParaSwapAugustusRegistry.sol'; -import {SafeERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol'; +import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {IParaSwapAugustus} from './interfaces/IParaSwapAugustus.sol'; import {ReentrancyGuard} from '../../dependencies/openzeppelin/ReentrancyGuard.sol'; diff --git a/src/periphery/contracts/adapters/paraswap/interfaces/IFeeClaimer.sol b/src/contracts/extensions/paraswap-adapters/interfaces/IFeeClaimer.sol similarity index 97% rename from src/periphery/contracts/adapters/paraswap/interfaces/IFeeClaimer.sol rename to src/contracts/extensions/paraswap-adapters/interfaces/IFeeClaimer.sol index 5fd9d59a..161bcd51 100644 --- a/src/periphery/contracts/adapters/paraswap/interfaces/IFeeClaimer.sol +++ b/src/contracts/extensions/paraswap-adapters/interfaces/IFeeClaimer.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: ISC pragma solidity ^0.8.0; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol'; interface IFeeClaimer { /** diff --git a/src/periphery/contracts/adapters/paraswap/interfaces/IParaSwapAugustus.sol b/src/contracts/extensions/paraswap-adapters/interfaces/IParaSwapAugustus.sol similarity index 100% rename from src/periphery/contracts/adapters/paraswap/interfaces/IParaSwapAugustus.sol rename to src/contracts/extensions/paraswap-adapters/interfaces/IParaSwapAugustus.sol diff --git a/src/periphery/contracts/adapters/paraswap/interfaces/IParaSwapAugustusRegistry.sol b/src/contracts/extensions/paraswap-adapters/interfaces/IParaSwapAugustusRegistry.sol similarity index 100% rename from src/periphery/contracts/adapters/paraswap/interfaces/IParaSwapAugustusRegistry.sol rename to src/contracts/extensions/paraswap-adapters/interfaces/IParaSwapAugustusRegistry.sol diff --git a/src/periphery/contracts/v3-config-engine/AaveV3ConfigEngine.sol b/src/contracts/extensions/v3-config-engine/AaveV3ConfigEngine.sol similarity index 99% rename from src/periphery/contracts/v3-config-engine/AaveV3ConfigEngine.sol rename to src/contracts/extensions/v3-config-engine/AaveV3ConfigEngine.sol index 2d5cd360..25b07174 100644 --- a/src/periphery/contracts/v3-config-engine/AaveV3ConfigEngine.sol +++ b/src/contracts/extensions/v3-config-engine/AaveV3ConfigEngine.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; import {CapsEngine} from './libraries/CapsEngine.sol'; diff --git a/src/periphery/contracts/v3-config-engine/AaveV3Payload.sol b/src/contracts/extensions/v3-config-engine/AaveV3Payload.sol similarity index 98% rename from src/periphery/contracts/v3-config-engine/AaveV3Payload.sol rename to src/contracts/extensions/v3-config-engine/AaveV3Payload.sol index 003d3d3e..065263b1 100644 --- a/src/periphery/contracts/v3-config-engine/AaveV3Payload.sol +++ b/src/contracts/extensions/v3-config-engine/AaveV3Payload.sol @@ -1,8 +1,8 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {Address} from 'solidity-utils/contracts/oz-common/Address.sol'; -import {WadRayMath} from '../../../core/contracts/protocol/libraries/math/WadRayMath.sol'; +import {WadRayMath} from '../../protocol/libraries/math/WadRayMath.sol'; import {IAaveV3ConfigEngine as IEngine} from './IAaveV3ConfigEngine.sol'; import {EngineFlags} from './EngineFlags.sol'; diff --git a/src/periphery/contracts/v3-config-engine/EngineFlags.sol b/src/contracts/extensions/v3-config-engine/EngineFlags.sol similarity index 97% rename from src/periphery/contracts/v3-config-engine/EngineFlags.sol rename to src/contracts/extensions/v3-config-engine/EngineFlags.sol index de54c40d..822292a6 100644 --- a/src/periphery/contracts/v3-config-engine/EngineFlags.sol +++ b/src/contracts/extensions/v3-config-engine/EngineFlags.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; library EngineFlags { diff --git a/src/periphery/contracts/v3-config-engine/IAaveV3ConfigEngine.sol b/src/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol similarity index 97% rename from src/periphery/contracts/v3-config-engine/IAaveV3ConfigEngine.sol rename to src/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol index ddbcdf13..c2007d35 100644 --- a/src/periphery/contracts/v3-config-engine/IAaveV3ConfigEngine.sol +++ b/src/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; -import {IPool} from '../../../core/contracts/interfaces/IPool.sol'; -import {IPoolConfigurator} from '../../../core/contracts/interfaces/IPoolConfigurator.sol'; -import {IAaveOracle} from '../../../core/contracts/interfaces/IAaveOracle.sol'; -import {IDefaultInterestRateStrategyV2} from '../../../core/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; +import {IPool} from '../../interfaces/IPool.sol'; +import {IPoolConfigurator} from '../../interfaces/IPoolConfigurator.sol'; +import {IAaveOracle} from '../../interfaces/IAaveOracle.sol'; +import {IDefaultInterestRateStrategyV2} from '../../interfaces/IDefaultInterestRateStrategyV2.sol'; /// @dev Examples here assume the usage of the `AaveV3Payload` base contracts /// contained in this same repository diff --git a/src/contracts/extensions/v3-config-engine/README.md b/src/contracts/extensions/v3-config-engine/README.md new file mode 100644 index 00000000..62480d8f --- /dev/null +++ b/src/contracts/extensions/v3-config-engine/README.md @@ -0,0 +1,63 @@ +## Aave v3 config engine + +![Config Engine Diagram](../../../../resources/configs-engine.svg) + +## What is the AaveV3ConfigEngine? + +The `AaveV3ConfigEngine` is a helper smart contract to abstract good practices when doing "admin" interactions with the Aave v3 protocol, but built on top, without touching the core contracts. + +At the same time, it defines a new interface oriented to simplify developer experience when coding proposal payloads: the `AaveV3ConfigEngine` is built from our experience supervising governance payloads review, for actions like full cycle of listing assets, modify caps (supply/borrow), changing collateral or borrow related parameters and changing the price feeds of assets. + +_Note: In an effort for unification and streamlining deployment procedures, the config engine has been migrated from the [aave-helpers](https://github.com/bgd-labs/aave-helpers) repository to this location._ + +## How to use the engine? + +The engine is not designed to be used directly when writing a payload, but through abstract contracts that we will call `Base Aave v3 Payloads`. + +This [aave-helpers](https://github.com/bgd-labs/aave-helpers) repository contains `Base Aave v3 Payloads` for all the Aave v3 instances, under the hood powered by this config engine and aave-address-book, and abstracting all the complexity: ordering of execution of actions, extra validations, deciding when to keep a current configured parameter and how to get it, etc. + +As base for any payload, you only need to inherit from the corresponding (per pool) `Base Aave v3 Payload`, for example inheriting from `AaveV3PayloadEthereum` in the case of Ethereum, `AaveV3PayloadAvalanche` in the case of Avalanche, and so on. + +If you want just to do one or multiple listings, you only need to define the listing within a `newListings()` function, and the base payload will take care of executing it correctly for you. + +Do you want instead to update supply/borrow caps? Same approach as with the listings, you only need to define the update of caps within a `capsUpdates()` function, and the base payload will take care of the rest. + +Do you want to update the price-feed of an asset? You only need to define the update of price feed within a `priceFeedsUpdates()` function, and the base payload will take care of the rest. + +Change collateral-related parameters? Same approach as previous, you only need to define the update within a `collateralsUpdates()` function, and the base payload will take care of the rest. + +Change Borrow-related parameters? Same as previous, just define the update within a `borrowsUpdates()` function, and the base payload will take care of the rest. + +Change eMode category configuration? Same as previous, just define the update within a `eModeCategoriesUpdates()` function, and the base payload will take care of the rest. + +Change eMode category of a particular asset? Same as previous, just define the update within a `assetsEModeUpdates()` function, and the base payload will take care of the rest. + +### Internal aspects to consider + +- Frequently, at the same time that you want to do an update of parameters or listing, you also want to do something extra before or after. + The `Base Aave v3 Payload` defines `_preExecute()` and `_postExecute()` hook functions, that you can redefine on your payload and will the execute before and after all configs changes/listings you define. + +- The payload also allow you to group changes of parameters and listings, just by defining at the same time the aforementioned `newListings()`, `capsUpdate()` and/or `collateralsUpdates()` and so on. For reference, the execution ordering is the following: + 1. `_preExecute()` + 2. `eModeCategoriesUpdates()` + 3. `newListings()` + 4. `newListingsCustom()` + 5. `borrowsUpdates()` + 6. `collateralsUpdates()` + 7. `rateStrategiesUpdates()` + 8. `priceFeedsUpdates()` + 9. `assetsEModeUpdates()` + 10. `capsUpdates()` + 11. `_postExecute()` + +## Links to examples + +- [Simple mock listing on Aave v3](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockListing.sol) +- [Simple custom mock listing on Aave V3 with custom token impl](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockListingCustom.sol) +- [Mock e-mode category update on Aave V3](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockEModeCategoryUpdate.sol) +- [Mock e-mode asset update on Aave V3](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockAssetEModeUpdate.sol) +- [Mock caps updates (only supply, keeping current borrow cap) on Aave v3](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockCapUpdate.sol) +- [Mock collateral updates (changing some, keeping current values on others), on Aave v3](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockCollateralUpdate.sol) +- [Mock borrow updates (changing some, keeping current values on others), on Aave v3](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockBorrowUpdate.sol) +- [Mock rates updates (changing some, keeping current values on others), on Aave v3](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockRatesUpdate.sol) +- [Mock price feed updates on Aave v3](../../../../tests/helpers/v3-config-engine/mocks/AaveV3MockPriceFeedUpdate.sol) diff --git a/src/periphery/contracts/v3-config-engine/libraries/BorrowEngine.sol b/src/contracts/extensions/v3-config-engine/libraries/BorrowEngine.sol similarity index 91% rename from src/periphery/contracts/v3-config-engine/libraries/BorrowEngine.sol rename to src/contracts/extensions/v3-config-engine/libraries/BorrowEngine.sol index 4fa237b6..7a9d2ddf 100644 --- a/src/periphery/contracts/v3-config-engine/libraries/BorrowEngine.sol +++ b/src/contracts/extensions/v3-config-engine/libraries/BorrowEngine.sol @@ -1,9 +1,9 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; import {EngineFlags} from '../EngineFlags.sol'; -import {DataTypes} from '../../../../core/contracts/protocol/libraries/types/DataTypes.sol'; -import {ReserveConfiguration} from '../../../../core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; +import {DataTypes} from '../../../protocol/libraries/types/DataTypes.sol'; +import {ReserveConfiguration} from '../../../protocol/libraries/configuration/ReserveConfiguration.sol'; import {IAaveV3ConfigEngine as IEngine, IPoolConfigurator, IPool} from '../IAaveV3ConfigEngine.sol'; library BorrowEngine { diff --git a/src/periphery/contracts/v3-config-engine/libraries/CapsEngine.sol b/src/contracts/extensions/v3-config-engine/libraries/CapsEngine.sol similarity index 96% rename from src/periphery/contracts/v3-config-engine/libraries/CapsEngine.sol rename to src/contracts/extensions/v3-config-engine/libraries/CapsEngine.sol index b06c61fc..084ebc26 100644 --- a/src/periphery/contracts/v3-config-engine/libraries/CapsEngine.sol +++ b/src/contracts/extensions/v3-config-engine/libraries/CapsEngine.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; import {EngineFlags} from '../EngineFlags.sol'; diff --git a/src/periphery/contracts/v3-config-engine/libraries/CollateralEngine.sol b/src/contracts/extensions/v3-config-engine/libraries/CollateralEngine.sol similarity index 91% rename from src/periphery/contracts/v3-config-engine/libraries/CollateralEngine.sol rename to src/contracts/extensions/v3-config-engine/libraries/CollateralEngine.sol index 73e9a7f0..174068bd 100644 --- a/src/periphery/contracts/v3-config-engine/libraries/CollateralEngine.sol +++ b/src/contracts/extensions/v3-config-engine/libraries/CollateralEngine.sol @@ -1,10 +1,10 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; -import {DataTypes} from '../../../../core/contracts/protocol/libraries/types/DataTypes.sol'; -import {ReserveConfiguration} from '../../../../core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; +import {DataTypes} from '../../../protocol/libraries/types/DataTypes.sol'; +import {ReserveConfiguration} from '../../../protocol/libraries/configuration/ReserveConfiguration.sol'; import {IAaveV3ConfigEngine as IEngine, IPoolConfigurator, IPool} from '../IAaveV3ConfigEngine.sol'; -import {PercentageMath} from '../../../../core/contracts/protocol/libraries/math/PercentageMath.sol'; +import {PercentageMath} from '../../../protocol/libraries/math/PercentageMath.sol'; import {EngineFlags} from '../EngineFlags.sol'; library CollateralEngine { diff --git a/src/periphery/contracts/v3-config-engine/libraries/EModeEngine.sol b/src/contracts/extensions/v3-config-engine/libraries/EModeEngine.sol similarity index 94% rename from src/periphery/contracts/v3-config-engine/libraries/EModeEngine.sol rename to src/contracts/extensions/v3-config-engine/libraries/EModeEngine.sol index 5ccf4231..6780a9f6 100644 --- a/src/periphery/contracts/v3-config-engine/libraries/EModeEngine.sol +++ b/src/contracts/extensions/v3-config-engine/libraries/EModeEngine.sol @@ -1,10 +1,10 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; import {EngineFlags} from '../EngineFlags.sol'; -import {DataTypes} from '../../../../core/contracts/protocol/libraries/types/DataTypes.sol'; +import {DataTypes} from '../../../protocol/libraries/types/DataTypes.sol'; import {SafeCast} from 'solidity-utils/contracts/oz-common/SafeCast.sol'; -import {PercentageMath} from '../../../../core/contracts/protocol/libraries/math/PercentageMath.sol'; +import {PercentageMath} from '../../../protocol/libraries/math/PercentageMath.sol'; import {IAaveV3ConfigEngine as IEngine, IPoolConfigurator, IPool} from '../IAaveV3ConfigEngine.sol'; library EModeEngine { diff --git a/src/periphery/contracts/v3-config-engine/libraries/ListingEngine.sol b/src/contracts/extensions/v3-config-engine/libraries/ListingEngine.sol similarity index 96% rename from src/periphery/contracts/v3-config-engine/libraries/ListingEngine.sol rename to src/contracts/extensions/v3-config-engine/libraries/ListingEngine.sol index 15550697..861491be 100644 --- a/src/periphery/contracts/v3-config-engine/libraries/ListingEngine.sol +++ b/src/contracts/extensions/v3-config-engine/libraries/ListingEngine.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; import {IERC20Metadata} from 'solidity-utils/contracts/oz-common/interfaces/IERC20Metadata.sol'; @@ -8,9 +8,9 @@ import {CapsEngine} from './CapsEngine.sol'; import {BorrowEngine} from './BorrowEngine.sol'; import {CollateralEngine} from './CollateralEngine.sol'; import {EModeEngine} from './EModeEngine.sol'; -import {ConfiguratorInputTypes} from '../../../../core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol'; +import {ConfiguratorInputTypes} from '../../../protocol/libraries/types/ConfiguratorInputTypes.sol'; import {Address} from 'solidity-utils/contracts/oz-common/Address.sol'; -import {SafeCast} from '../../../../core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol'; +import {SafeCast} from '../../../dependencies/openzeppelin/contracts/SafeCast.sol'; library ListingEngine { using Address for address; diff --git a/src/periphery/contracts/v3-config-engine/libraries/PriceFeedEngine.sol b/src/contracts/extensions/v3-config-engine/libraries/PriceFeedEngine.sol similarity index 88% rename from src/periphery/contracts/v3-config-engine/libraries/PriceFeedEngine.sol rename to src/contracts/extensions/v3-config-engine/libraries/PriceFeedEngine.sol index d7186082..75cc49f4 100644 --- a/src/periphery/contracts/v3-config-engine/libraries/PriceFeedEngine.sol +++ b/src/contracts/extensions/v3-config-engine/libraries/PriceFeedEngine.sol @@ -1,8 +1,8 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; import {IAaveV3ConfigEngine as IEngine, IAaveOracle} from '../IAaveV3ConfigEngine.sol'; -import {IEACAggregatorProxy} from '../../../../periphery/contracts/misc/interfaces/IEACAggregatorProxy.sol'; +import {IEACAggregatorProxy} from '../../../helpers/interfaces/IEACAggregatorProxy.sol'; library PriceFeedEngine { function executePriceFeedsUpdate( diff --git a/src/periphery/contracts/v3-config-engine/libraries/RateEngine.sol b/src/contracts/extensions/v3-config-engine/libraries/RateEngine.sol similarity index 93% rename from src/periphery/contracts/v3-config-engine/libraries/RateEngine.sol rename to src/contracts/extensions/v3-config-engine/libraries/RateEngine.sol index db9c37d3..8ae88e2b 100644 --- a/src/periphery/contracts/v3-config-engine/libraries/RateEngine.sol +++ b/src/contracts/extensions/v3-config-engine/libraries/RateEngine.sol @@ -1,8 +1,8 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.18; -import {IDefaultInterestRateStrategyV2} from '../../../../core/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; -import {SafeCast} from '../../../../core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol'; +import {IDefaultInterestRateStrategyV2} from '../../../interfaces/IDefaultInterestRateStrategyV2.sol'; +import {SafeCast} from '../../../dependencies/openzeppelin/contracts/SafeCast.sol'; import {EngineFlags} from '../EngineFlags.sol'; import {IAaveV3ConfigEngine as IEngine, IPoolConfigurator} from '../IAaveV3ConfigEngine.sol'; diff --git a/src/core/contracts/misc/AaveProtocolDataProvider.sol b/src/contracts/helpers/AaveProtocolDataProvider.sol similarity index 100% rename from src/core/contracts/misc/AaveProtocolDataProvider.sol rename to src/contracts/helpers/AaveProtocolDataProvider.sol diff --git a/src/core/contracts/misc/L2Encoder.sol b/src/contracts/helpers/L2Encoder.sol similarity index 100% rename from src/core/contracts/misc/L2Encoder.sol rename to src/contracts/helpers/L2Encoder.sol diff --git a/src/periphery/contracts/misc/UiIncentiveDataProviderV3.sol b/src/contracts/helpers/UiIncentiveDataProviderV3.sol similarity index 96% rename from src/periphery/contracts/misc/UiIncentiveDataProviderV3.sol rename to src/contracts/helpers/UiIncentiveDataProviderV3.sol index 5c8f3e7f..d5d620d9 100644 --- a/src/periphery/contracts/misc/UiIncentiveDataProviderV3.sol +++ b/src/contracts/helpers/UiIncentiveDataProviderV3.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {IncentivizedERC20} from 'aave-v3-core/contracts/protocol/tokenization/base/IncentivizedERC20.sol'; -import {UserConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/UserConfiguration.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../interfaces/IPool.sol'; +import {IncentivizedERC20} from '../protocol/tokenization/base/IncentivizedERC20.sol'; +import {UserConfiguration} from '../../contracts/protocol/libraries/configuration/UserConfiguration.sol'; +import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; import {IRewardsController} from '../rewards/interfaces/IRewardsController.sol'; import {IEACAggregatorProxy} from './interfaces/IEACAggregatorProxy.sol'; import {IUiIncentiveDataProviderV3} from './interfaces/IUiIncentiveDataProviderV3.sol'; diff --git a/src/periphery/contracts/misc/UiPoolDataProviderV3.sol b/src/contracts/helpers/UiPoolDataProviderV3.sol similarity index 89% rename from src/periphery/contracts/misc/UiPoolDataProviderV3.sol rename to src/contracts/helpers/UiPoolDataProviderV3.sol index cee7a456..343855bf 100644 --- a/src/periphery/contracts/misc/UiPoolDataProviderV3.sol +++ b/src/contracts/helpers/UiPoolDataProviderV3.sol @@ -1,19 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {IVariableDebtToken} from 'aave-v3-core/contracts/interfaces/IVariableDebtToken.sol'; -import {IStableDebtToken} from 'aave-v3-core/contracts/interfaces/IStableDebtToken.sol'; -import {IDefaultInterestRateStrategyV2} from 'aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; -import {AaveProtocolDataProvider} from 'aave-v3-core/contracts/misc/AaveProtocolDataProvider.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; -import {UserConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/UserConfiguration.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../interfaces/IPool.sol'; +import {IAaveOracle} from '../interfaces/IAaveOracle.sol'; +import {IAToken} from '../interfaces/IAToken.sol'; +import {IVariableDebtToken} from '../interfaces/IVariableDebtToken.sol'; +import {IStableDebtToken} from '../interfaces/IStableDebtToken.sol'; +import {IDefaultInterestRateStrategyV2} from '../interfaces/IDefaultInterestRateStrategyV2.sol'; +import {AaveProtocolDataProvider} from './AaveProtocolDataProvider.sol'; +import {WadRayMath} from '../protocol/libraries/math/WadRayMath.sol'; +import {ReserveConfiguration} from '../protocol/libraries/configuration/ReserveConfiguration.sol'; +import {UserConfiguration} from '../protocol/libraries/configuration/UserConfiguration.sol'; +import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; import {IEACAggregatorProxy} from './interfaces/IEACAggregatorProxy.sol'; import {IERC20DetailedBytes} from './interfaces/IERC20DetailedBytes.sol'; import {IUiPoolDataProviderV3} from './interfaces/IUiPoolDataProviderV3.sol'; diff --git a/src/periphery/contracts/misc/WalletBalanceProvider.sol b/src/contracts/helpers/WalletBalanceProvider.sol similarity index 83% rename from src/periphery/contracts/misc/WalletBalanceProvider.sol rename to src/contracts/helpers/WalletBalanceProvider.sol index f215610c..c074ac3f 100644 --- a/src/periphery/contracts/misc/WalletBalanceProvider.sol +++ b/src/contracts/helpers/WalletBalanceProvider.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {Address} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Address.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; - -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {GPv2SafeERC20} from 'aave-v3-core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {Address} from '../dependencies/openzeppelin/contracts/Address.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; + +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../interfaces/IPool.sol'; +import {GPv2SafeERC20} from '../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; +import {ReserveConfiguration} from '../protocol/libraries/configuration/ReserveConfiguration.sol'; +import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; /** * @title WalletBalanceProvider contract diff --git a/src/periphery/contracts/misc/WrappedTokenGatewayV3.sol b/src/contracts/helpers/WrappedTokenGatewayV3.sol similarity index 89% rename from src/periphery/contracts/misc/WrappedTokenGatewayV3.sol rename to src/contracts/helpers/WrappedTokenGatewayV3.sol index a120eeab..eb2c6dd3 100644 --- a/src/periphery/contracts/misc/WrappedTokenGatewayV3.sol +++ b/src/contracts/helpers/WrappedTokenGatewayV3.sol @@ -1,17 +1,17 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {GPv2SafeERC20} from 'aave-v3-core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol'; -import {IWETH} from 'aave-v3-core/contracts/misc/interfaces/IWETH.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; -import {UserConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/UserConfiguration.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; +import {GPv2SafeERC20} from '../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; +import {IWETH} from './interfaces/IWETH.sol'; +import {IPool} from '../interfaces/IPool.sol'; +import {IAToken} from '../interfaces/IAToken.sol'; +import {ReserveConfiguration} from '../protocol/libraries/configuration/ReserveConfiguration.sol'; +import {UserConfiguration} from '../protocol/libraries/configuration/UserConfiguration.sol'; +import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; import {IWrappedTokenGatewayV3} from './interfaces/IWrappedTokenGatewayV3.sol'; -import {DataTypesHelper} from '../libraries/DataTypesHelper.sol'; +import {DataTypesHelper} from '../misc/libraries/DataTypesHelper.sol'; /** * @dev This contract is an upgrade of the WrappedTokenGatewayV3 contract, with immutable pool address. diff --git a/src/periphery/contracts/misc/interfaces/IEACAggregatorProxy.sol b/src/contracts/helpers/interfaces/IEACAggregatorProxy.sol similarity index 100% rename from src/periphery/contracts/misc/interfaces/IEACAggregatorProxy.sol rename to src/contracts/helpers/interfaces/IEACAggregatorProxy.sol diff --git a/src/periphery/contracts/misc/interfaces/IERC20DetailedBytes.sol b/src/contracts/helpers/interfaces/IERC20DetailedBytes.sol similarity index 73% rename from src/periphery/contracts/misc/interfaces/IERC20DetailedBytes.sol rename to src/contracts/helpers/interfaces/IERC20DetailedBytes.sol index 3e213158..0541f0da 100644 --- a/src/periphery/contracts/misc/interfaces/IERC20DetailedBytes.sol +++ b/src/contracts/helpers/interfaces/IERC20DetailedBytes.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; interface IERC20DetailedBytes is IERC20 { function name() external view returns (bytes32); diff --git a/src/periphery/contracts/misc/interfaces/IUiIncentiveDataProviderV3.sol b/src/contracts/helpers/interfaces/IUiIncentiveDataProviderV3.sol similarity index 95% rename from src/periphery/contracts/misc/interfaces/IUiIncentiveDataProviderV3.sol rename to src/contracts/helpers/interfaces/IUiIncentiveDataProviderV3.sol index fb3bb00c..910c662b 100644 --- a/src/periphery/contracts/misc/interfaces/IUiIncentiveDataProviderV3.sol +++ b/src/contracts/helpers/interfaces/IUiIncentiveDataProviderV3.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; interface IUiIncentiveDataProviderV3 { struct AggregatedReserveIncentiveData { diff --git a/src/periphery/contracts/misc/interfaces/IUiPoolDataProviderV3.sol b/src/contracts/helpers/interfaces/IUiPoolDataProviderV3.sol similarity index 96% rename from src/periphery/contracts/misc/interfaces/IUiPoolDataProviderV3.sol rename to src/contracts/helpers/interfaces/IUiPoolDataProviderV3.sol index 42944eb8..9ee2402a 100644 --- a/src/periphery/contracts/misc/interfaces/IUiPoolDataProviderV3.sol +++ b/src/contracts/helpers/interfaces/IUiPoolDataProviderV3.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; interface IUiPoolDataProviderV3 { struct InterestRates { diff --git a/src/core/contracts/misc/interfaces/IWETH.sol b/src/contracts/helpers/interfaces/IWETH.sol similarity index 100% rename from src/core/contracts/misc/interfaces/IWETH.sol rename to src/contracts/helpers/interfaces/IWETH.sol diff --git a/src/periphery/contracts/misc/interfaces/IWrappedTokenGatewayV3.sol b/src/contracts/helpers/interfaces/IWrappedTokenGatewayV3.sol similarity index 100% rename from src/periphery/contracts/misc/interfaces/IWrappedTokenGatewayV3.sol rename to src/contracts/helpers/interfaces/IWrappedTokenGatewayV3.sol diff --git a/src/core/instances/ATokenInstance.sol b/src/contracts/instances/ATokenInstance.sol similarity index 93% rename from src/core/instances/ATokenInstance.sol rename to src/contracts/instances/ATokenInstance.sol index e778f91e..8e646385 100644 --- a/src/core/instances/ATokenInstance.sol +++ b/src/contracts/instances/ATokenInstance.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AToken, IPool, IAaveIncentivesController, IInitializableAToken, Errors, VersionedInitializable} from '../contracts/protocol/tokenization/AToken.sol'; +import {AToken, IPool, IAaveIncentivesController, IInitializableAToken, Errors, VersionedInitializable} from '../protocol/tokenization/AToken.sol'; contract ATokenInstance is AToken { uint256 public constant ATOKEN_REVISION = 1; diff --git a/src/core/instances/L2PoolInstance.sol b/src/contracts/instances/L2PoolInstance.sol similarity index 60% rename from src/core/instances/L2PoolInstance.sol rename to src/contracts/instances/L2PoolInstance.sol index 80bd406f..0c61f19e 100644 --- a/src/core/instances/L2PoolInstance.sol +++ b/src/contracts/instances/L2PoolInstance.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {L2Pool} from '../contracts/protocol/pool/L2Pool.sol'; -import {IPoolAddressesProvider} from '../contracts/interfaces/IPoolAddressesProvider.sol'; +import {L2Pool} from '../protocol/pool/L2Pool.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {PoolInstance} from './PoolInstance.sol'; contract L2PoolInstance is L2Pool, PoolInstance { diff --git a/src/core/instances/PoolConfiguratorInstance.sol b/src/contracts/instances/PoolConfiguratorInstance.sol similarity index 87% rename from src/core/instances/PoolConfiguratorInstance.sol rename to src/contracts/instances/PoolConfiguratorInstance.sol index 03ae6105..fefcc236 100644 --- a/src/core/instances/PoolConfiguratorInstance.sol +++ b/src/contracts/instances/PoolConfiguratorInstance.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {PoolConfigurator, IPoolAddressesProvider, IPool, VersionedInitializable} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; +import {PoolConfigurator, IPoolAddressesProvider, IPool, VersionedInitializable} from '../protocol/pool/PoolConfigurator.sol'; contract PoolConfiguratorInstance is PoolConfigurator { uint256 public constant CONFIGURATOR_REVISION = 3; diff --git a/src/core/instances/PoolInstance.sol b/src/contracts/instances/PoolInstance.sol similarity index 80% rename from src/core/instances/PoolInstance.sol rename to src/contracts/instances/PoolInstance.sol index 0af51bbe..88b0744a 100644 --- a/src/core/instances/PoolInstance.sol +++ b/src/contracts/instances/PoolInstance.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {Pool} from '../contracts/protocol/pool/Pool.sol'; -import {IPoolAddressesProvider} from '../contracts/interfaces/IPoolAddressesProvider.sol'; -import {Errors} from '../contracts/protocol/libraries/helpers/Errors.sol'; +import {Pool} from '../protocol/pool/Pool.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; +import {Errors} from '../protocol/libraries/helpers/Errors.sol'; contract PoolInstance is Pool { uint256 public constant POOL_REVISION = 4; diff --git a/src/core/instances/StableDebtTokenInstance.sol b/src/contracts/instances/StableDebtTokenInstance.sol similarity index 91% rename from src/core/instances/StableDebtTokenInstance.sol rename to src/contracts/instances/StableDebtTokenInstance.sol index 00f91a58..a4913414 100644 --- a/src/core/instances/StableDebtTokenInstance.sol +++ b/src/contracts/instances/StableDebtTokenInstance.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {StableDebtToken, IPool, IInitializableDebtToken, VersionedInitializable, IAaveIncentivesController, Errors} from '../contracts/protocol/tokenization/StableDebtToken.sol'; +import {StableDebtToken, IPool, IInitializableDebtToken, VersionedInitializable, IAaveIncentivesController, Errors} from '../protocol/tokenization/StableDebtToken.sol'; contract StableDebtTokenInstance is StableDebtToken { uint256 public constant DEBT_TOKEN_REVISION = 1; diff --git a/src/core/instances/VariableDebtTokenInstance.sol b/src/contracts/instances/VariableDebtTokenInstance.sol similarity index 91% rename from src/core/instances/VariableDebtTokenInstance.sol rename to src/contracts/instances/VariableDebtTokenInstance.sol index 11ac68e6..b2c3dc89 100644 --- a/src/core/instances/VariableDebtTokenInstance.sol +++ b/src/contracts/instances/VariableDebtTokenInstance.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {VariableDebtToken, IPool, IInitializableDebtToken, VersionedInitializable, IAaveIncentivesController, Errors} from '../contracts/protocol/tokenization/VariableDebtToken.sol'; +import {VariableDebtToken, IPool, IInitializableDebtToken, VersionedInitializable, IAaveIncentivesController, Errors} from '../protocol/tokenization/VariableDebtToken.sol'; contract VariableDebtTokenInstance is VariableDebtToken { uint256 public constant DEBT_TOKEN_REVISION = 1; diff --git a/src/core/contracts/interfaces/IACLManager.sol b/src/contracts/interfaces/IACLManager.sol similarity index 100% rename from src/core/contracts/interfaces/IACLManager.sol rename to src/contracts/interfaces/IACLManager.sol diff --git a/src/core/contracts/interfaces/IAToken.sol b/src/contracts/interfaces/IAToken.sol similarity index 100% rename from src/core/contracts/interfaces/IAToken.sol rename to src/contracts/interfaces/IAToken.sol diff --git a/src/core/contracts/interfaces/IAaveIncentivesController.sol b/src/contracts/interfaces/IAaveIncentivesController.sol similarity index 100% rename from src/core/contracts/interfaces/IAaveIncentivesController.sol rename to src/contracts/interfaces/IAaveIncentivesController.sol diff --git a/src/core/contracts/interfaces/IAaveOracle.sol b/src/contracts/interfaces/IAaveOracle.sol similarity index 100% rename from src/core/contracts/interfaces/IAaveOracle.sol rename to src/contracts/interfaces/IAaveOracle.sol diff --git a/src/core/contracts/interfaces/ICreditDelegationToken.sol b/src/contracts/interfaces/ICreditDelegationToken.sol similarity index 100% rename from src/core/contracts/interfaces/ICreditDelegationToken.sol rename to src/contracts/interfaces/ICreditDelegationToken.sol diff --git a/src/core/contracts/interfaces/IDefaultInterestRateStrategyV2.sol b/src/contracts/interfaces/IDefaultInterestRateStrategyV2.sol similarity index 100% rename from src/core/contracts/interfaces/IDefaultInterestRateStrategyV2.sol rename to src/contracts/interfaces/IDefaultInterestRateStrategyV2.sol diff --git a/src/core/contracts/interfaces/IDelegationToken.sol b/src/contracts/interfaces/IDelegationToken.sol similarity index 100% rename from src/core/contracts/interfaces/IDelegationToken.sol rename to src/contracts/interfaces/IDelegationToken.sol diff --git a/src/core/contracts/interfaces/IERC20WithPermit.sol b/src/contracts/interfaces/IERC20WithPermit.sol similarity index 100% rename from src/core/contracts/interfaces/IERC20WithPermit.sol rename to src/contracts/interfaces/IERC20WithPermit.sol diff --git a/src/core/contracts/interfaces/IInitializableAToken.sol b/src/contracts/interfaces/IInitializableAToken.sol similarity index 100% rename from src/core/contracts/interfaces/IInitializableAToken.sol rename to src/contracts/interfaces/IInitializableAToken.sol diff --git a/src/core/contracts/interfaces/IInitializableDebtToken.sol b/src/contracts/interfaces/IInitializableDebtToken.sol similarity index 100% rename from src/core/contracts/interfaces/IInitializableDebtToken.sol rename to src/contracts/interfaces/IInitializableDebtToken.sol diff --git a/src/core/contracts/interfaces/IL2Pool.sol b/src/contracts/interfaces/IL2Pool.sol similarity index 100% rename from src/core/contracts/interfaces/IL2Pool.sol rename to src/contracts/interfaces/IL2Pool.sol diff --git a/src/core/contracts/interfaces/IPool.sol b/src/contracts/interfaces/IPool.sol similarity index 100% rename from src/core/contracts/interfaces/IPool.sol rename to src/contracts/interfaces/IPool.sol diff --git a/src/core/contracts/interfaces/IPoolAddressesProvider.sol b/src/contracts/interfaces/IPoolAddressesProvider.sol similarity index 100% rename from src/core/contracts/interfaces/IPoolAddressesProvider.sol rename to src/contracts/interfaces/IPoolAddressesProvider.sol diff --git a/src/core/contracts/interfaces/IPoolAddressesProviderRegistry.sol b/src/contracts/interfaces/IPoolAddressesProviderRegistry.sol similarity index 100% rename from src/core/contracts/interfaces/IPoolAddressesProviderRegistry.sol rename to src/contracts/interfaces/IPoolAddressesProviderRegistry.sol diff --git a/src/core/contracts/interfaces/IPoolConfigurator.sol b/src/contracts/interfaces/IPoolConfigurator.sol similarity index 100% rename from src/core/contracts/interfaces/IPoolConfigurator.sol rename to src/contracts/interfaces/IPoolConfigurator.sol diff --git a/src/core/contracts/interfaces/IPoolDataProvider.sol b/src/contracts/interfaces/IPoolDataProvider.sol similarity index 100% rename from src/core/contracts/interfaces/IPoolDataProvider.sol rename to src/contracts/interfaces/IPoolDataProvider.sol diff --git a/src/core/contracts/interfaces/IPriceOracle.sol b/src/contracts/interfaces/IPriceOracle.sol similarity index 100% rename from src/core/contracts/interfaces/IPriceOracle.sol rename to src/contracts/interfaces/IPriceOracle.sol diff --git a/src/core/contracts/interfaces/IPriceOracleGetter.sol b/src/contracts/interfaces/IPriceOracleGetter.sol similarity index 100% rename from src/core/contracts/interfaces/IPriceOracleGetter.sol rename to src/contracts/interfaces/IPriceOracleGetter.sol diff --git a/src/core/contracts/interfaces/IPriceOracleSentinel.sol b/src/contracts/interfaces/IPriceOracleSentinel.sol similarity index 100% rename from src/core/contracts/interfaces/IPriceOracleSentinel.sol rename to src/contracts/interfaces/IPriceOracleSentinel.sol diff --git a/src/core/contracts/interfaces/IReserveInterestRateStrategy.sol b/src/contracts/interfaces/IReserveInterestRateStrategy.sol similarity index 100% rename from src/core/contracts/interfaces/IReserveInterestRateStrategy.sol rename to src/contracts/interfaces/IReserveInterestRateStrategy.sol diff --git a/src/core/contracts/interfaces/IScaledBalanceToken.sol b/src/contracts/interfaces/IScaledBalanceToken.sol similarity index 100% rename from src/core/contracts/interfaces/IScaledBalanceToken.sol rename to src/contracts/interfaces/IScaledBalanceToken.sol diff --git a/src/core/contracts/interfaces/ISequencerOracle.sol b/src/contracts/interfaces/ISequencerOracle.sol similarity index 100% rename from src/core/contracts/interfaces/ISequencerOracle.sol rename to src/contracts/interfaces/ISequencerOracle.sol diff --git a/src/core/contracts/interfaces/IStableDebtToken.sol b/src/contracts/interfaces/IStableDebtToken.sol similarity index 100% rename from src/core/contracts/interfaces/IStableDebtToken.sol rename to src/contracts/interfaces/IStableDebtToken.sol diff --git a/src/core/contracts/interfaces/IVariableDebtToken.sol b/src/contracts/interfaces/IVariableDebtToken.sol similarity index 100% rename from src/core/contracts/interfaces/IVariableDebtToken.sol rename to src/contracts/interfaces/IVariableDebtToken.sol diff --git a/src/core/contracts/misc/AaveOracle.sol b/src/contracts/misc/AaveOracle.sol similarity index 100% rename from src/core/contracts/misc/AaveOracle.sol rename to src/contracts/misc/AaveOracle.sol diff --git a/src/core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol b/src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol similarity index 93% rename from src/core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol rename to src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol index 40a25683..a723e331 100644 --- a/src/core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol +++ b/src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; -import {WadRayMath} from '../libraries/math/WadRayMath.sol'; -import {PercentageMath} from '../libraries/math/PercentageMath.sol'; -import {DataTypes} from '../libraries/types/DataTypes.sol'; -import {Errors} from '../libraries/helpers/Errors.sol'; -import {IDefaultInterestRateStrategyV2} from '../../interfaces/IDefaultInterestRateStrategyV2.sol'; -import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol'; -import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; +import {WadRayMath} from '../protocol/libraries/math/WadRayMath.sol'; +import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol'; +import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; +import {Errors} from '../protocol/libraries/helpers/Errors.sol'; +import {IDefaultInterestRateStrategyV2} from '../interfaces/IDefaultInterestRateStrategyV2.sol'; +import {IReserveInterestRateStrategy} from '../interfaces/IReserveInterestRateStrategy.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; /** * @title DefaultReserveInterestRateStrategyV2 contract diff --git a/src/core/contracts/protocol/configuration/PriceOracleSentinel.sol b/src/contracts/misc/PriceOracleSentinel.sol similarity index 89% rename from src/core/contracts/protocol/configuration/PriceOracleSentinel.sol rename to src/contracts/misc/PriceOracleSentinel.sol index 2ff1584f..69d5f772 100644 --- a/src/core/contracts/protocol/configuration/PriceOracleSentinel.sol +++ b/src/contracts/misc/PriceOracleSentinel.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {Errors} from '../libraries/helpers/Errors.sol'; -import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {IPriceOracleSentinel} from '../../interfaces/IPriceOracleSentinel.sol'; -import {ISequencerOracle} from '../../interfaces/ISequencerOracle.sol'; -import {IACLManager} from '../../interfaces/IACLManager.sol'; +import {Errors} from '../protocol/libraries/helpers/Errors.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; +import {IPriceOracleSentinel} from '../interfaces/IPriceOracleSentinel.sol'; +import {ISequencerOracle} from '../interfaces/ISequencerOracle.sol'; +import {IACLManager} from '../interfaces/IACLManager.sol'; /** * @title PriceOracleSentinel diff --git a/src/core/contracts/protocol/libraries/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol b/src/contracts/misc/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol similarity index 95% rename from src/core/contracts/protocol/libraries/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol rename to src/contracts/misc/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol index 06d2f827..252b4a4b 100644 --- a/src/core/contracts/protocol/libraries/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol +++ b/src/contracts/misc/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {BaseUpgradeabilityProxy} from '../../../dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol'; +import {BaseUpgradeabilityProxy} from '../../dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol'; /** * @title BaseImmutableAdminUpgradeabilityProxy diff --git a/src/core/contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol b/src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol similarity index 79% rename from src/core/contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol rename to src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol index 0deceb5b..6913a19d 100644 --- a/src/core/contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol +++ b/src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {InitializableUpgradeabilityProxy} from '../../../dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol'; -import {Proxy} from '../../../dependencies/openzeppelin/upgradeability/Proxy.sol'; +import {InitializableUpgradeabilityProxy} from '../../dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol'; +import {Proxy} from '../../dependencies/openzeppelin/upgradeability/Proxy.sol'; import {BaseImmutableAdminUpgradeabilityProxy} from './BaseImmutableAdminUpgradeabilityProxy.sol'; /** diff --git a/src/core/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol b/src/contracts/misc/aave-upgradeability/VersionedInitializable.sol similarity index 100% rename from src/core/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol rename to src/contracts/misc/aave-upgradeability/VersionedInitializable.sol diff --git a/src/core/contracts/flashloan/base/FlashLoanReceiverBase.sol b/src/contracts/misc/flashloan/base/FlashLoanReceiverBase.sol similarity index 79% rename from src/core/contracts/flashloan/base/FlashLoanReceiverBase.sol rename to src/contracts/misc/flashloan/base/FlashLoanReceiverBase.sol index cd43c2e1..55fbe6d2 100644 --- a/src/core/contracts/flashloan/base/FlashLoanReceiverBase.sol +++ b/src/contracts/misc/flashloan/base/FlashLoanReceiverBase.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.10; import {IFlashLoanReceiver} from '../interfaces/IFlashLoanReceiver.sol'; -import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {IPool} from '../../interfaces/IPool.sol'; +import {IPoolAddressesProvider} from '../../../interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../../../interfaces/IPool.sol'; /** * @title FlashLoanReceiverBase diff --git a/src/core/contracts/flashloan/base/FlashLoanSimpleReceiverBase.sol b/src/contracts/misc/flashloan/base/FlashLoanSimpleReceiverBase.sol similarity index 80% rename from src/core/contracts/flashloan/base/FlashLoanSimpleReceiverBase.sol rename to src/contracts/misc/flashloan/base/FlashLoanSimpleReceiverBase.sol index 25af62b2..2980a0cc 100644 --- a/src/core/contracts/flashloan/base/FlashLoanSimpleReceiverBase.sol +++ b/src/contracts/misc/flashloan/base/FlashLoanSimpleReceiverBase.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.10; import {IFlashLoanSimpleReceiver} from '../interfaces/IFlashLoanSimpleReceiver.sol'; -import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {IPool} from '../../interfaces/IPool.sol'; +import {IPoolAddressesProvider} from '../../../interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../../../interfaces/IPool.sol'; /** * @title FlashLoanSimpleReceiverBase diff --git a/src/core/contracts/flashloan/interfaces/IFlashLoanReceiver.sol b/src/contracts/misc/flashloan/interfaces/IFlashLoanReceiver.sol similarity index 90% rename from src/core/contracts/flashloan/interfaces/IFlashLoanReceiver.sol rename to src/contracts/misc/flashloan/interfaces/IFlashLoanReceiver.sol index fae79a9f..a3a55684 100644 --- a/src/core/contracts/flashloan/interfaces/IFlashLoanReceiver.sol +++ b/src/contracts/misc/flashloan/interfaces/IFlashLoanReceiver.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {IPool} from '../../interfaces/IPool.sol'; +import {IPoolAddressesProvider} from '../../../interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../../../interfaces/IPool.sol'; /** * @title IFlashLoanReceiver diff --git a/src/core/contracts/flashloan/interfaces/IFlashLoanSimpleReceiver.sol b/src/contracts/misc/flashloan/interfaces/IFlashLoanSimpleReceiver.sol similarity index 89% rename from src/core/contracts/flashloan/interfaces/IFlashLoanSimpleReceiver.sol rename to src/contracts/misc/flashloan/interfaces/IFlashLoanSimpleReceiver.sol index 05c45739..bff21ae4 100644 --- a/src/core/contracts/flashloan/interfaces/IFlashLoanSimpleReceiver.sol +++ b/src/contracts/misc/flashloan/interfaces/IFlashLoanSimpleReceiver.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {IPool} from '../../interfaces/IPool.sol'; +import {IPoolAddressesProvider} from '../../../interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../../../interfaces/IPool.sol'; /** * @title IFlashLoanSimpleReceiver diff --git a/src/periphery/contracts/libraries/DataTypesHelper.sol b/src/contracts/misc/libraries/DataTypesHelper.sol similarity index 80% rename from src/periphery/contracts/libraries/DataTypesHelper.sol rename to src/contracts/misc/libraries/DataTypesHelper.sol index 492678a5..eed218ec 100644 --- a/src/periphery/contracts/libraries/DataTypesHelper.sol +++ b/src/contracts/misc/libraries/DataTypesHelper.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; +import {DataTypes} from '../../protocol/libraries/types/DataTypes.sol'; /** * @title DataTypesHelper diff --git a/src/periphery/contracts/mocks/ATokenMock.sol b/src/contracts/mocks/ATokenMock.sol similarity index 100% rename from src/periphery/contracts/mocks/ATokenMock.sol rename to src/contracts/mocks/ATokenMock.sol diff --git a/src/periphery/contracts/mocks/MockBadTransferStrategy.sol b/src/contracts/mocks/MockBadTransferStrategy.sol similarity index 82% rename from src/periphery/contracts/mocks/MockBadTransferStrategy.sol rename to src/contracts/mocks/MockBadTransferStrategy.sol index 2f62c89d..696b3396 100644 --- a/src/periphery/contracts/mocks/MockBadTransferStrategy.sol +++ b/src/contracts/mocks/MockBadTransferStrategy.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.10; import {ITransferStrategyBase} from '../rewards/interfaces/ITransferStrategyBase.sol'; import {TransferStrategyBase} from '../rewards/transfer-strategies/TransferStrategyBase.sol'; -import {GPv2SafeERC20} from 'aave-v3-core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {GPv2SafeERC20} from '../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; /** * @title MockBadTransferStrategy diff --git a/src/periphery/contracts/mocks/WETH9Mock.sol b/src/contracts/mocks/WETH9Mock.sol similarity index 72% rename from src/periphery/contracts/mocks/WETH9Mock.sol rename to src/contracts/mocks/WETH9Mock.sol index 1bc1bc48..2372ffeb 100644 --- a/src/periphery/contracts/mocks/WETH9Mock.sol +++ b/src/contracts/mocks/WETH9Mock.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {WETH9} from 'aave-v3-core/contracts/dependencies/weth/WETH9.sol'; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; +import {WETH9} from '../dependencies/weth/WETH9.sol'; +import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; contract WETH9Mock is WETH9, Ownable { constructor(string memory mockName, string memory mockSymbol, address owner) { diff --git a/src/core/contracts/mocks/flashloan/MockFlashLoanReceiver.sol b/src/contracts/mocks/flashloan/MockFlashLoanReceiver.sol similarity index 96% rename from src/core/contracts/mocks/flashloan/MockFlashLoanReceiver.sol rename to src/contracts/mocks/flashloan/MockFlashLoanReceiver.sol index 516b4b38..f8877274 100644 --- a/src/core/contracts/mocks/flashloan/MockFlashLoanReceiver.sol +++ b/src/contracts/mocks/flashloan/MockFlashLoanReceiver.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.10; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {GPv2SafeERC20} from '../../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {FlashLoanReceiverBase} from '../../flashloan/base/FlashLoanReceiverBase.sol'; +import {FlashLoanReceiverBase} from '../../misc/flashloan/base/FlashLoanReceiverBase.sol'; import {MintableERC20} from '../tokens/MintableERC20.sol'; contract MockFlashLoanReceiver is FlashLoanReceiverBase { diff --git a/src/core/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol b/src/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol similarity index 95% rename from src/core/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol rename to src/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol index 1edd24a2..b3be47bc 100644 --- a/src/core/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol +++ b/src/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol @@ -6,7 +6,7 @@ import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {GPv2SafeERC20} from '../../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {FlashLoanSimpleReceiverBase} from '../../flashloan/base/FlashLoanSimpleReceiverBase.sol'; +import {FlashLoanSimpleReceiverBase} from '../../misc/flashloan/base/FlashLoanSimpleReceiverBase.sol'; import {MintableERC20} from '../tokens/MintableERC20.sol'; contract MockFlashLoanSimpleReceiver is FlashLoanSimpleReceiverBase { diff --git a/src/core/contracts/mocks/helpers/MockIncentivesController.sol b/src/contracts/mocks/helpers/MockIncentivesController.sol similarity index 100% rename from src/core/contracts/mocks/helpers/MockIncentivesController.sol rename to src/contracts/mocks/helpers/MockIncentivesController.sol diff --git a/src/core/contracts/mocks/helpers/MockL2Pool.sol b/src/contracts/mocks/helpers/MockL2Pool.sol similarity index 68% rename from src/core/contracts/mocks/helpers/MockL2Pool.sol rename to src/contracts/mocks/helpers/MockL2Pool.sol index c37a7f70..9035cddd 100644 --- a/src/core/contracts/mocks/helpers/MockL2Pool.sol +++ b/src/contracts/mocks/helpers/MockL2Pool.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.10; import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {L2PoolInstance, PoolInstance} from '../../../instances/L2PoolInstance.sol'; -import {VersionedInitializable} from '../../protocol/libraries/aave-upgradeability/VersionedInitializable.sol'; +import {L2PoolInstance, PoolInstance} from '../../instances/L2PoolInstance.sol'; +import {VersionedInitializable} from '../../misc/aave-upgradeability/VersionedInitializable.sol'; contract MockL2Pool is L2PoolInstance { function getRevision() diff --git a/src/core/contracts/mocks/helpers/MockPeripheryContract.sol b/src/contracts/mocks/helpers/MockPeripheryContract.sol similarity index 100% rename from src/core/contracts/mocks/helpers/MockPeripheryContract.sol rename to src/contracts/mocks/helpers/MockPeripheryContract.sol diff --git a/src/core/contracts/mocks/helpers/MockPool.sol b/src/contracts/mocks/helpers/MockPool.sol similarity index 92% rename from src/core/contracts/mocks/helpers/MockPool.sol rename to src/contracts/mocks/helpers/MockPool.sol index c66b83a6..7a27bf14 100644 --- a/src/core/contracts/mocks/helpers/MockPool.sol +++ b/src/contracts/mocks/helpers/MockPool.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.10; import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {PoolInstance} from '../../../instances/PoolInstance.sol'; +import {PoolInstance} from '../../instances/PoolInstance.sol'; contract MockPoolInherited is PoolInstance { uint16 internal _maxNumberOfReserves = 128; diff --git a/src/core/contracts/mocks/helpers/MockReserveConfiguration.sol b/src/contracts/mocks/helpers/MockReserveConfiguration.sol similarity index 100% rename from src/core/contracts/mocks/helpers/MockReserveConfiguration.sol rename to src/contracts/mocks/helpers/MockReserveConfiguration.sol diff --git a/src/core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol b/src/contracts/mocks/oracle/CLAggregators/MockAggregator.sol similarity index 100% rename from src/core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol rename to src/contracts/mocks/oracle/CLAggregators/MockAggregator.sol diff --git a/src/core/contracts/mocks/oracle/PriceOracle.sol b/src/contracts/mocks/oracle/PriceOracle.sol similarity index 100% rename from src/core/contracts/mocks/oracle/PriceOracle.sol rename to src/contracts/mocks/oracle/PriceOracle.sol diff --git a/src/core/contracts/mocks/oracle/SequencerOracle.sol b/src/contracts/mocks/oracle/SequencerOracle.sol similarity index 100% rename from src/core/contracts/mocks/oracle/SequencerOracle.sol rename to src/contracts/mocks/oracle/SequencerOracle.sol diff --git a/src/periphery/contracts/mocks/swap/MockParaSwapAugustus.sol b/src/contracts/mocks/swap/MockParaSwapAugustus.sol similarity index 91% rename from src/periphery/contracts/mocks/swap/MockParaSwapAugustus.sol rename to src/contracts/mocks/swap/MockParaSwapAugustus.sol index cf41670b..5970c3b7 100644 --- a/src/periphery/contracts/mocks/swap/MockParaSwapAugustus.sol +++ b/src/contracts/mocks/swap/MockParaSwapAugustus.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {IParaSwapAugustus} from '../../adapters/paraswap/interfaces/IParaSwapAugustus.sol'; +import {IParaSwapAugustus} from '../../extensions/paraswap-adapters/interfaces/IParaSwapAugustus.sol'; import {MockParaSwapTokenTransferProxy} from './MockParaSwapTokenTransferProxy.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {MintableERC20} from 'aave-v3-core/contracts/mocks/tokens/MintableERC20.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; +import {MintableERC20} from '../tokens/MintableERC20.sol'; contract MockParaSwapAugustus is IParaSwapAugustus { MockParaSwapTokenTransferProxy immutable TOKEN_TRANSFER_PROXY; diff --git a/src/periphery/contracts/mocks/swap/MockParaSwapAugustusRegistry.sol b/src/contracts/mocks/swap/MockParaSwapAugustusRegistry.sol similarity index 74% rename from src/periphery/contracts/mocks/swap/MockParaSwapAugustusRegistry.sol rename to src/contracts/mocks/swap/MockParaSwapAugustusRegistry.sol index 5e34d659..82fa93f8 100644 --- a/src/periphery/contracts/mocks/swap/MockParaSwapAugustusRegistry.sol +++ b/src/contracts/mocks/swap/MockParaSwapAugustusRegistry.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {IParaSwapAugustusRegistry} from '../../adapters/paraswap/interfaces/IParaSwapAugustusRegistry.sol'; +import {IParaSwapAugustusRegistry} from '../../extensions/paraswap-adapters/interfaces/IParaSwapAugustusRegistry.sol'; contract MockParaSwapAugustusRegistry is IParaSwapAugustusRegistry { address immutable AUGUSTUS; diff --git a/src/periphery/contracts/mocks/swap/MockParaSwapFeeClaimer.sol b/src/contracts/mocks/swap/MockParaSwapFeeClaimer.sol similarity index 88% rename from src/periphery/contracts/mocks/swap/MockParaSwapFeeClaimer.sol rename to src/contracts/mocks/swap/MockParaSwapFeeClaimer.sol index efec5e9d..80f41d19 100644 --- a/src/periphery/contracts/mocks/swap/MockParaSwapFeeClaimer.sol +++ b/src/contracts/mocks/swap/MockParaSwapFeeClaimer.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {IFeeClaimer} from '../../adapters/paraswap/interfaces/IFeeClaimer.sol'; +import {IFeeClaimer} from '../../extensions/paraswap-adapters/interfaces/IFeeClaimer.sol'; import {MockParaSwapTokenTransferProxy} from './MockParaSwapTokenTransferProxy.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {MintableERC20} from 'aave-v3-core/contracts/mocks/tokens/MintableERC20.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; +import {MintableERC20} from '../tokens/MintableERC20.sol'; contract MockParaSwapFeeClaimer is IFeeClaimer { MockParaSwapTokenTransferProxy immutable TOKEN_TRANSFER_PROXY; diff --git a/src/periphery/contracts/mocks/swap/MockParaSwapTokenTransferProxy.sol b/src/contracts/mocks/swap/MockParaSwapTokenTransferProxy.sol similarity index 60% rename from src/periphery/contracts/mocks/swap/MockParaSwapTokenTransferProxy.sol rename to src/contracts/mocks/swap/MockParaSwapTokenTransferProxy.sol index 711012e8..b36e6a44 100644 --- a/src/periphery/contracts/mocks/swap/MockParaSwapTokenTransferProxy.sol +++ b/src/contracts/mocks/swap/MockParaSwapTokenTransferProxy.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; contract MockParaSwapTokenTransferProxy is Ownable { function transferFrom( diff --git a/src/periphery/contracts/mocks/testnet-helpers/Faucet.sol b/src/contracts/mocks/testnet-helpers/Faucet.sol similarity index 95% rename from src/periphery/contracts/mocks/testnet-helpers/Faucet.sol rename to src/contracts/mocks/testnet-helpers/Faucet.sol index 539aee46..47a2a3f6 100644 --- a/src/periphery/contracts/mocks/testnet-helpers/Faucet.sol +++ b/src/contracts/mocks/testnet-helpers/Faucet.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; +import {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol'; import {TestnetERC20} from './TestnetERC20.sol'; import {IFaucet} from './IFaucet.sol'; diff --git a/src/periphery/contracts/mocks/testnet-helpers/IFaucet.sol b/src/contracts/mocks/testnet-helpers/IFaucet.sol similarity index 100% rename from src/periphery/contracts/mocks/testnet-helpers/IFaucet.sol rename to src/contracts/mocks/testnet-helpers/IFaucet.sol diff --git a/src/periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol b/src/contracts/mocks/testnet-helpers/TestnetERC20.sol similarity index 90% rename from src/periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol rename to src/contracts/mocks/testnet-helpers/TestnetERC20.sol index 58e4ddf2..efe94186 100644 --- a/src/periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol +++ b/src/contracts/mocks/testnet-helpers/TestnetERC20.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; -import {ERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/ERC20.sol'; -import {IERC20WithPermit} from 'aave-v3-core/contracts/interfaces/IERC20WithPermit.sol'; +import {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol'; +import {ERC20} from '../../dependencies/openzeppelin/contracts/ERC20.sol'; +import {IERC20WithPermit} from '../../interfaces/IERC20WithPermit.sol'; /** * @title TestnetERC20 diff --git a/src/core/contracts/mocks/tests/FlashloanAttacker.sol b/src/contracts/mocks/tests/FlashloanAttacker.sol similarity index 95% rename from src/core/contracts/mocks/tests/FlashloanAttacker.sol rename to src/contracts/mocks/tests/FlashloanAttacker.sol index 63d09b1b..9f32fbd9 100644 --- a/src/core/contracts/mocks/tests/FlashloanAttacker.sol +++ b/src/contracts/mocks/tests/FlashloanAttacker.sol @@ -6,7 +6,7 @@ import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {GPv2SafeERC20} from '../../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {FlashLoanSimpleReceiverBase} from '../../flashloan/base/FlashLoanSimpleReceiverBase.sol'; +import {FlashLoanSimpleReceiverBase} from '../../misc/flashloan/base/FlashLoanSimpleReceiverBase.sol'; import {MintableERC20} from '../tokens/MintableERC20.sol'; import {IPool} from '../../interfaces/IPool.sol'; import {DataTypes} from '../../protocol/libraries/types/DataTypes.sol'; diff --git a/src/core/contracts/mocks/tests/MathUtilsWrapper.sol b/src/contracts/mocks/tests/MathUtilsWrapper.sol similarity index 100% rename from src/core/contracts/mocks/tests/MathUtilsWrapper.sol rename to src/contracts/mocks/tests/MathUtilsWrapper.sol diff --git a/src/core/contracts/mocks/tests/MockReserveInterestRateStrategy.sol b/src/contracts/mocks/tests/MockReserveInterestRateStrategy.sol similarity index 88% rename from src/core/contracts/mocks/tests/MockReserveInterestRateStrategy.sol rename to src/contracts/mocks/tests/MockReserveInterestRateStrategy.sol index 082d7651..fd7b1f25 100644 --- a/src/core/contracts/mocks/tests/MockReserveInterestRateStrategy.sol +++ b/src/contracts/mocks/tests/MockReserveInterestRateStrategy.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {DefaultReserveInterestRateStrategyV2} from '../../protocol/pool/DefaultReserveInterestRateStrategyV2.sol'; +import {DefaultReserveInterestRateStrategyV2} from '../../misc/DefaultReserveInterestRateStrategyV2.sol'; import {DataTypes} from '../../protocol/libraries/types/DataTypes.sol'; contract MockReserveInterestRateStrategy is DefaultReserveInterestRateStrategyV2 { diff --git a/src/core/contracts/mocks/tests/PercentageMathWrapper.sol b/src/contracts/mocks/tests/PercentageMathWrapper.sol similarity index 100% rename from src/core/contracts/mocks/tests/PercentageMathWrapper.sol rename to src/contracts/mocks/tests/PercentageMathWrapper.sol diff --git a/src/core/contracts/mocks/tests/WadRayMathWrapper.sol b/src/contracts/mocks/tests/WadRayMathWrapper.sol similarity index 100% rename from src/core/contracts/mocks/tests/WadRayMathWrapper.sol rename to src/contracts/mocks/tests/WadRayMathWrapper.sol diff --git a/src/core/contracts/mocks/tokens/MintableDelegationERC20.sol b/src/contracts/mocks/tokens/MintableDelegationERC20.sol similarity index 100% rename from src/core/contracts/mocks/tokens/MintableDelegationERC20.sol rename to src/contracts/mocks/tokens/MintableDelegationERC20.sol diff --git a/src/core/contracts/mocks/tokens/MintableERC20.sol b/src/contracts/mocks/tokens/MintableERC20.sol similarity index 100% rename from src/core/contracts/mocks/tokens/MintableERC20.sol rename to src/contracts/mocks/tokens/MintableERC20.sol diff --git a/src/core/contracts/mocks/tokens/MockATokenRepayment.sol b/src/contracts/mocks/tokens/MockATokenRepayment.sol similarity index 88% rename from src/core/contracts/mocks/tokens/MockATokenRepayment.sol rename to src/contracts/mocks/tokens/MockATokenRepayment.sol index 4e2c0dd2..c0f77de5 100644 --- a/src/core/contracts/mocks/tokens/MockATokenRepayment.sol +++ b/src/contracts/mocks/tokens/MockATokenRepayment.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {ATokenInstance} from '../../../instances/ATokenInstance.sol'; +import {ATokenInstance} from '../../instances/ATokenInstance.sol'; import {IPool} from '../../interfaces/IPool.sol'; contract MockATokenRepayment is ATokenInstance { diff --git a/src/core/contracts/mocks/tokens/MockDebtTokens.sol b/src/contracts/mocks/tokens/MockDebtTokens.sol similarity index 74% rename from src/core/contracts/mocks/tokens/MockDebtTokens.sol rename to src/contracts/mocks/tokens/MockDebtTokens.sol index 8c186b82..7418dab3 100644 --- a/src/core/contracts/mocks/tokens/MockDebtTokens.sol +++ b/src/contracts/mocks/tokens/MockDebtTokens.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {VariableDebtTokenInstance} from '../../../instances/VariableDebtTokenInstance.sol'; -import {StableDebtTokenInstance} from '../../../instances/StableDebtTokenInstance.sol'; +import {VariableDebtTokenInstance} from '../../instances/VariableDebtTokenInstance.sol'; +import {StableDebtTokenInstance} from '../../instances/StableDebtTokenInstance.sol'; import {IPool} from '../../interfaces/IPool.sol'; contract MockVariableDebtToken is VariableDebtTokenInstance { diff --git a/src/core/contracts/mocks/tokens/MockScaledToken.sol b/src/contracts/mocks/tokens/MockScaledToken.sol similarity index 85% rename from src/core/contracts/mocks/tokens/MockScaledToken.sol rename to src/contracts/mocks/tokens/MockScaledToken.sol index 854f4356..f3a26e2e 100644 --- a/src/core/contracts/mocks/tokens/MockScaledToken.sol +++ b/src/contracts/mocks/tokens/MockScaledToken.sol @@ -1,7 +1,8 @@ +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import 'aave-v3-core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol'; -import 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; +import '../../protocol/tokenization/base/ScaledBalanceTokenBase.sol'; +import '../../protocol/libraries/math/WadRayMath.sol'; contract MockScaledToken is ScaledBalanceTokenBase { using WadRayMath for uint256; diff --git a/src/core/contracts/mocks/tokens/WETH9Mocked.sol b/src/contracts/mocks/tokens/WETH9Mocked.sol similarity index 100% rename from src/core/contracts/mocks/tokens/WETH9Mocked.sol rename to src/contracts/mocks/tokens/WETH9Mocked.sol diff --git a/src/core/contracts/mocks/upgradeability/MockAToken.sol b/src/contracts/mocks/upgradeability/MockAToken.sol similarity index 80% rename from src/core/contracts/mocks/upgradeability/MockAToken.sol rename to src/contracts/mocks/upgradeability/MockAToken.sol index bcdc8c1c..14bbf1a8 100644 --- a/src/core/contracts/mocks/upgradeability/MockAToken.sol +++ b/src/contracts/mocks/upgradeability/MockAToken.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {ATokenInstance} from '../../../instances/ATokenInstance.sol'; +import {ATokenInstance} from '../../instances/ATokenInstance.sol'; import {IPool} from '../../interfaces/IPool.sol'; contract MockAToken is ATokenInstance { diff --git a/src/core/contracts/mocks/upgradeability/MockInitializableImplementation.sol b/src/contracts/mocks/upgradeability/MockInitializableImplementation.sol similarity index 96% rename from src/core/contracts/mocks/upgradeability/MockInitializableImplementation.sol rename to src/contracts/mocks/upgradeability/MockInitializableImplementation.sol index 9f63a598..ed48f44b 100644 --- a/src/core/contracts/mocks/upgradeability/MockInitializableImplementation.sol +++ b/src/contracts/mocks/upgradeability/MockInitializableImplementation.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {VersionedInitializable} from '../../protocol/libraries/aave-upgradeability/VersionedInitializable.sol'; +import {VersionedInitializable} from '../../misc/aave-upgradeability/VersionedInitializable.sol'; import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; contract MockInitializableImple is VersionedInitializable { diff --git a/src/core/contracts/mocks/upgradeability/MockStableDebtToken.sol b/src/contracts/mocks/upgradeability/MockStableDebtToken.sol similarity index 78% rename from src/core/contracts/mocks/upgradeability/MockStableDebtToken.sol rename to src/contracts/mocks/upgradeability/MockStableDebtToken.sol index ea9d5cca..ecbd73c9 100644 --- a/src/core/contracts/mocks/upgradeability/MockStableDebtToken.sol +++ b/src/contracts/mocks/upgradeability/MockStableDebtToken.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {StableDebtTokenInstance} from '../../../instances/StableDebtTokenInstance.sol'; +import {StableDebtTokenInstance} from '../../instances/StableDebtTokenInstance.sol'; import {IPool} from '../../interfaces/IPool.sol'; contract MockStableDebtToken is StableDebtTokenInstance { diff --git a/src/core/contracts/mocks/upgradeability/MockVariableDebtToken.sol b/src/contracts/mocks/upgradeability/MockVariableDebtToken.sol similarity index 77% rename from src/core/contracts/mocks/upgradeability/MockVariableDebtToken.sol rename to src/contracts/mocks/upgradeability/MockVariableDebtToken.sol index 211821f5..a75db430 100644 --- a/src/core/contracts/mocks/upgradeability/MockVariableDebtToken.sol +++ b/src/contracts/mocks/upgradeability/MockVariableDebtToken.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {VariableDebtTokenInstance} from '../../../instances/VariableDebtTokenInstance.sol'; +import {VariableDebtTokenInstance} from '../../instances/VariableDebtTokenInstance.sol'; import {IPool} from '../../interfaces/IPool.sol'; contract MockVariableDebtToken is VariableDebtTokenInstance { diff --git a/src/core/contracts/protocol/configuration/ACLManager.sol b/src/contracts/protocol/configuration/ACLManager.sol similarity index 100% rename from src/core/contracts/protocol/configuration/ACLManager.sol rename to src/contracts/protocol/configuration/ACLManager.sol diff --git a/src/core/contracts/protocol/configuration/PoolAddressesProvider.sol b/src/contracts/protocol/configuration/PoolAddressesProvider.sol similarity index 98% rename from src/core/contracts/protocol/configuration/PoolAddressesProvider.sol rename to src/contracts/protocol/configuration/PoolAddressesProvider.sol index 06fa9333..009f4e5c 100644 --- a/src/core/contracts/protocol/configuration/PoolAddressesProvider.sol +++ b/src/contracts/protocol/configuration/PoolAddressesProvider.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.10; import {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol'; import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; -import {InitializableImmutableAdminUpgradeabilityProxy} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; +import {InitializableImmutableAdminUpgradeabilityProxy} from '../../misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; /** * @title PoolAddressesProvider diff --git a/src/core/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol b/src/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol similarity index 100% rename from src/core/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol rename to src/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol diff --git a/src/core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol b/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol similarity index 100% rename from src/core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol rename to src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol diff --git a/src/core/contracts/protocol/libraries/configuration/UserConfiguration.sol b/src/contracts/protocol/libraries/configuration/UserConfiguration.sol similarity index 100% rename from src/core/contracts/protocol/libraries/configuration/UserConfiguration.sol rename to src/contracts/protocol/libraries/configuration/UserConfiguration.sol diff --git a/src/core/contracts/protocol/libraries/helpers/Errors.sol b/src/contracts/protocol/libraries/helpers/Errors.sol similarity index 100% rename from src/core/contracts/protocol/libraries/helpers/Errors.sol rename to src/contracts/protocol/libraries/helpers/Errors.sol diff --git a/src/core/contracts/protocol/libraries/helpers/Helpers.sol b/src/contracts/protocol/libraries/helpers/Helpers.sol similarity index 100% rename from src/core/contracts/protocol/libraries/helpers/Helpers.sol rename to src/contracts/protocol/libraries/helpers/Helpers.sol diff --git a/src/core/contracts/protocol/libraries/logic/BorrowLogic.sol b/src/contracts/protocol/libraries/logic/BorrowLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/BorrowLogic.sol rename to src/contracts/protocol/libraries/logic/BorrowLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/BridgeLogic.sol b/src/contracts/protocol/libraries/logic/BridgeLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/BridgeLogic.sol rename to src/contracts/protocol/libraries/logic/BridgeLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/CalldataLogic.sol b/src/contracts/protocol/libraries/logic/CalldataLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/CalldataLogic.sol rename to src/contracts/protocol/libraries/logic/CalldataLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/ConfiguratorLogic.sol b/src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol similarity index 99% rename from src/core/contracts/protocol/libraries/logic/ConfiguratorLogic.sol rename to src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol index e0b14e7b..244a2a55 100644 --- a/src/core/contracts/protocol/libraries/logic/ConfiguratorLogic.sol +++ b/src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.10; import {IPool} from '../../../interfaces/IPool.sol'; import {IInitializableAToken} from '../../../interfaces/IInitializableAToken.sol'; import {IInitializableDebtToken} from '../../../interfaces/IInitializableDebtToken.sol'; -import {InitializableImmutableAdminUpgradeabilityProxy} from '../aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; +import {InitializableImmutableAdminUpgradeabilityProxy} from '../../../misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; import {IReserveInterestRateStrategy} from '../../../interfaces/IReserveInterestRateStrategy.sol'; import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol'; import {DataTypes} from '../types/DataTypes.sol'; diff --git a/src/core/contracts/protocol/libraries/logic/EModeLogic.sol b/src/contracts/protocol/libraries/logic/EModeLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/EModeLogic.sol rename to src/contracts/protocol/libraries/logic/EModeLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/FlashLoanLogic.sol b/src/contracts/protocol/libraries/logic/FlashLoanLogic.sol similarity index 98% rename from src/core/contracts/protocol/libraries/logic/FlashLoanLogic.sol rename to src/contracts/protocol/libraries/logic/FlashLoanLogic.sol index 615b2fdd..efb4feae 100644 --- a/src/core/contracts/protocol/libraries/logic/FlashLoanLogic.sol +++ b/src/contracts/protocol/libraries/logic/FlashLoanLogic.sol @@ -6,8 +6,8 @@ import {SafeCast} from '../../../dependencies/openzeppelin/contracts/SafeCast.so import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol'; import {IAToken} from '../../../interfaces/IAToken.sol'; import {IPool} from '../../../interfaces/IPool.sol'; -import {IFlashLoanReceiver} from '../../../flashloan/interfaces/IFlashLoanReceiver.sol'; -import {IFlashLoanSimpleReceiver} from '../../../flashloan/interfaces/IFlashLoanSimpleReceiver.sol'; +import {IFlashLoanReceiver} from '../../../misc/flashloan/interfaces/IFlashLoanReceiver.sol'; +import {IFlashLoanSimpleReceiver} from '../../../misc/flashloan/interfaces/IFlashLoanSimpleReceiver.sol'; import {IPoolAddressesProvider} from '../../../interfaces/IPoolAddressesProvider.sol'; import {UserConfiguration} from '../configuration/UserConfiguration.sol'; import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol'; diff --git a/src/core/contracts/protocol/libraries/logic/GenericLogic.sol b/src/contracts/protocol/libraries/logic/GenericLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/GenericLogic.sol rename to src/contracts/protocol/libraries/logic/GenericLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/IsolationModeLogic.sol b/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/IsolationModeLogic.sol rename to src/contracts/protocol/libraries/logic/IsolationModeLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/LiquidationLogic.sol b/src/contracts/protocol/libraries/logic/LiquidationLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/LiquidationLogic.sol rename to src/contracts/protocol/libraries/logic/LiquidationLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/PoolLogic.sol b/src/contracts/protocol/libraries/logic/PoolLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/PoolLogic.sol rename to src/contracts/protocol/libraries/logic/PoolLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/ReserveLogic.sol b/src/contracts/protocol/libraries/logic/ReserveLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/ReserveLogic.sol rename to src/contracts/protocol/libraries/logic/ReserveLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/SupplyLogic.sol b/src/contracts/protocol/libraries/logic/SupplyLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/SupplyLogic.sol rename to src/contracts/protocol/libraries/logic/SupplyLogic.sol diff --git a/src/core/contracts/protocol/libraries/logic/ValidationLogic.sol b/src/contracts/protocol/libraries/logic/ValidationLogic.sol similarity index 100% rename from src/core/contracts/protocol/libraries/logic/ValidationLogic.sol rename to src/contracts/protocol/libraries/logic/ValidationLogic.sol diff --git a/src/core/contracts/protocol/libraries/math/MathUtils.sol b/src/contracts/protocol/libraries/math/MathUtils.sol similarity index 100% rename from src/core/contracts/protocol/libraries/math/MathUtils.sol rename to src/contracts/protocol/libraries/math/MathUtils.sol diff --git a/src/core/contracts/protocol/libraries/math/PercentageMath.sol b/src/contracts/protocol/libraries/math/PercentageMath.sol similarity index 100% rename from src/core/contracts/protocol/libraries/math/PercentageMath.sol rename to src/contracts/protocol/libraries/math/PercentageMath.sol diff --git a/src/core/contracts/protocol/libraries/math/WadRayMath.sol b/src/contracts/protocol/libraries/math/WadRayMath.sol similarity index 100% rename from src/core/contracts/protocol/libraries/math/WadRayMath.sol rename to src/contracts/protocol/libraries/math/WadRayMath.sol diff --git a/src/core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol b/src/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol similarity index 100% rename from src/core/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol rename to src/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol diff --git a/src/core/contracts/protocol/libraries/types/DataTypes.sol b/src/contracts/protocol/libraries/types/DataTypes.sol similarity index 100% rename from src/core/contracts/protocol/libraries/types/DataTypes.sol rename to src/contracts/protocol/libraries/types/DataTypes.sol diff --git a/src/core/contracts/protocol/pool/L2Pool.sol b/src/contracts/protocol/pool/L2Pool.sol similarity index 100% rename from src/core/contracts/protocol/pool/L2Pool.sol rename to src/contracts/protocol/pool/L2Pool.sol diff --git a/src/core/contracts/protocol/pool/Pool.sol b/src/contracts/protocol/pool/Pool.sol similarity index 99% rename from src/core/contracts/protocol/pool/Pool.sol rename to src/contracts/protocol/pool/Pool.sol index 4397323d..c58a78d5 100644 --- a/src/core/contracts/protocol/pool/Pool.sol +++ b/src/contracts/protocol/pool/Pool.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; +import {VersionedInitializable} from '../../misc/aave-upgradeability/VersionedInitializable.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {PoolLogic} from '../libraries/logic/PoolLogic.sol'; diff --git a/src/core/contracts/protocol/pool/PoolConfigurator.sol b/src/contracts/protocol/pool/PoolConfigurator.sol similarity index 99% rename from src/core/contracts/protocol/pool/PoolConfigurator.sol rename to src/contracts/protocol/pool/PoolConfigurator.sol index 041943e1..b22581b0 100644 --- a/src/core/contracts/protocol/pool/PoolConfigurator.sol +++ b/src/contracts/protocol/pool/PoolConfigurator.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; +import {VersionedInitializable} from '../../misc/aave-upgradeability/VersionedInitializable.sol'; import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {IDefaultInterestRateStrategyV2} from '../../interfaces/IDefaultInterestRateStrategyV2.sol'; diff --git a/src/core/contracts/protocol/pool/PoolStorage.sol b/src/contracts/protocol/pool/PoolStorage.sol similarity index 100% rename from src/core/contracts/protocol/pool/PoolStorage.sol rename to src/contracts/protocol/pool/PoolStorage.sol diff --git a/src/core/contracts/protocol/tokenization/AToken.sol b/src/contracts/protocol/tokenization/AToken.sol similarity index 98% rename from src/core/contracts/protocol/tokenization/AToken.sol rename to src/contracts/protocol/tokenization/AToken.sol index 126801bf..47ba03d9 100644 --- a/src/core/contracts/protocol/tokenization/AToken.sol +++ b/src/contracts/protocol/tokenization/AToken.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.10; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {GPv2SafeERC20} from '../../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; import {SafeCast} from '../../dependencies/openzeppelin/contracts/SafeCast.sol'; -import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; +import {VersionedInitializable} from '../../misc/aave-upgradeability/VersionedInitializable.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {IPool} from '../../interfaces/IPool.sol'; diff --git a/src/core/contracts/protocol/tokenization/StableDebtToken.sol b/src/contracts/protocol/tokenization/StableDebtToken.sol similarity index 97% rename from src/core/contracts/protocol/tokenization/StableDebtToken.sol rename to src/contracts/protocol/tokenization/StableDebtToken.sol index e7c785e6..74995247 100644 --- a/src/core/contracts/protocol/tokenization/StableDebtToken.sol +++ b/src/contracts/protocol/tokenization/StableDebtToken.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.10; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; -import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; +import {VersionedInitializable} from '../../misc/aave-upgradeability/VersionedInitializable.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol'; import {IInitializableDebtToken} from '../../interfaces/IInitializableDebtToken.sol'; diff --git a/src/core/contracts/protocol/tokenization/VariableDebtToken.sol b/src/contracts/protocol/tokenization/VariableDebtToken.sol similarity index 97% rename from src/core/contracts/protocol/tokenization/VariableDebtToken.sol rename to src/contracts/protocol/tokenization/VariableDebtToken.sol index 0987494b..37494c85 100644 --- a/src/core/contracts/protocol/tokenization/VariableDebtToken.sol +++ b/src/contracts/protocol/tokenization/VariableDebtToken.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.10; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {SafeCast} from '../../dependencies/openzeppelin/contracts/SafeCast.sol'; -import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; +import {VersionedInitializable} from '../../misc/aave-upgradeability/VersionedInitializable.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {IPool} from '../../interfaces/IPool.sol'; diff --git a/src/core/contracts/protocol/tokenization/base/DebtTokenBase.sol b/src/contracts/protocol/tokenization/base/DebtTokenBase.sol similarity index 97% rename from src/core/contracts/protocol/tokenization/base/DebtTokenBase.sol rename to src/contracts/protocol/tokenization/base/DebtTokenBase.sol index 8dc79203..3280add0 100644 --- a/src/core/contracts/protocol/tokenization/base/DebtTokenBase.sol +++ b/src/contracts/protocol/tokenization/base/DebtTokenBase.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.10; import {Context} from '../../../dependencies/openzeppelin/contracts/Context.sol'; import {Errors} from '../../libraries/helpers/Errors.sol'; -import {VersionedInitializable} from '../../libraries/aave-upgradeability/VersionedInitializable.sol'; +import {VersionedInitializable} from '../../../misc/aave-upgradeability/VersionedInitializable.sol'; import {ICreditDelegationToken} from '../../../interfaces/ICreditDelegationToken.sol'; import {EIP712Base} from './EIP712Base.sol'; diff --git a/src/core/contracts/protocol/tokenization/base/EIP712Base.sol b/src/contracts/protocol/tokenization/base/EIP712Base.sol similarity index 100% rename from src/core/contracts/protocol/tokenization/base/EIP712Base.sol rename to src/contracts/protocol/tokenization/base/EIP712Base.sol diff --git a/src/core/contracts/protocol/tokenization/base/IncentivizedERC20.sol b/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol similarity index 100% rename from src/core/contracts/protocol/tokenization/base/IncentivizedERC20.sol rename to src/contracts/protocol/tokenization/base/IncentivizedERC20.sol diff --git a/src/core/contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol b/src/contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol similarity index 100% rename from src/core/contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol rename to src/contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol diff --git a/src/core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol b/src/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol similarity index 100% rename from src/core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol rename to src/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol diff --git a/src/periphery/contracts/rewards/EmissionManager.sol b/src/contracts/rewards/EmissionManager.sol similarity index 95% rename from src/periphery/contracts/rewards/EmissionManager.sol rename to src/contracts/rewards/EmissionManager.sol index 19138df8..b18473ff 100644 --- a/src/periphery/contracts/rewards/EmissionManager.sol +++ b/src/contracts/rewards/EmissionManager.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; -import {IEACAggregatorProxy} from '../misc/interfaces/IEACAggregatorProxy.sol'; +import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; +import {IEACAggregatorProxy} from '../helpers/interfaces/IEACAggregatorProxy.sol'; import {IEmissionManager} from './interfaces/IEmissionManager.sol'; import {ITransferStrategyBase} from './interfaces/ITransferStrategyBase.sol'; import {IRewardsController} from './interfaces/IRewardsController.sol'; diff --git a/src/periphery/contracts/rewards/RewardsController.sol b/src/contracts/rewards/RewardsController.sol similarity index 96% rename from src/periphery/contracts/rewards/RewardsController.sol rename to src/contracts/rewards/RewardsController.sol index 0c369a60..3a817f60 100644 --- a/src/periphery/contracts/rewards/RewardsController.sol +++ b/src/contracts/rewards/RewardsController.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {VersionedInitializable} from 'aave-v3-core/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol'; -import {SafeCast} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol'; -import {IScaledBalanceToken} from 'aave-v3-core/contracts/interfaces/IScaledBalanceToken.sol'; +import {VersionedInitializable} from '../misc/aave-upgradeability/VersionedInitializable.sol'; +import {SafeCast} from '../dependencies/openzeppelin/contracts/SafeCast.sol'; +import {IScaledBalanceToken} from '../interfaces/IScaledBalanceToken.sol'; import {RewardsDistributor} from './RewardsDistributor.sol'; import {IRewardsController} from './interfaces/IRewardsController.sol'; import {ITransferStrategyBase} from './interfaces/ITransferStrategyBase.sol'; import {RewardsDataTypes} from './libraries/RewardsDataTypes.sol'; -import {IEACAggregatorProxy} from '../misc/interfaces/IEACAggregatorProxy.sol'; +import {IEACAggregatorProxy} from '../helpers/interfaces/IEACAggregatorProxy.sol'; /** * @title RewardsController diff --git a/src/periphery/contracts/rewards/RewardsDistributor.sol b/src/contracts/rewards/RewardsDistributor.sol similarity index 98% rename from src/periphery/contracts/rewards/RewardsDistributor.sol rename to src/contracts/rewards/RewardsDistributor.sol index ffc03d05..c8aa7a23 100644 --- a/src/periphery/contracts/rewards/RewardsDistributor.sol +++ b/src/contracts/rewards/RewardsDistributor.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {IScaledBalanceToken} from 'aave-v3-core/contracts/interfaces/IScaledBalanceToken.sol'; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {SafeCast} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol'; +import {IScaledBalanceToken} from '../interfaces/IScaledBalanceToken.sol'; +import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {SafeCast} from '../dependencies/openzeppelin/contracts/SafeCast.sol'; import {IRewardsDistributor} from './interfaces/IRewardsDistributor.sol'; import {RewardsDataTypes} from './libraries/RewardsDataTypes.sol'; diff --git a/src/periphery/contracts/rewards/interfaces/IEmissionManager.sol b/src/contracts/rewards/interfaces/IEmissionManager.sol similarity index 98% rename from src/periphery/contracts/rewards/interfaces/IEmissionManager.sol rename to src/contracts/rewards/interfaces/IEmissionManager.sol index 2f1f7eac..4853af21 100644 --- a/src/periphery/contracts/rewards/interfaces/IEmissionManager.sol +++ b/src/contracts/rewards/interfaces/IEmissionManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; -import {IEACAggregatorProxy} from '../../misc/interfaces/IEACAggregatorProxy.sol'; +import {IEACAggregatorProxy} from '../../helpers/interfaces/IEACAggregatorProxy.sol'; import {RewardsDataTypes} from '../libraries/RewardsDataTypes.sol'; import {ITransferStrategyBase} from './ITransferStrategyBase.sol'; import {IRewardsController} from './IRewardsController.sol'; diff --git a/src/periphery/contracts/rewards/interfaces/IPullRewardsTransferStrategy.sol b/src/contracts/rewards/interfaces/IPullRewardsTransferStrategy.sol similarity index 100% rename from src/periphery/contracts/rewards/interfaces/IPullRewardsTransferStrategy.sol rename to src/contracts/rewards/interfaces/IPullRewardsTransferStrategy.sol diff --git a/src/periphery/contracts/rewards/interfaces/IRewardsController.sol b/src/contracts/rewards/interfaces/IRewardsController.sol similarity index 99% rename from src/periphery/contracts/rewards/interfaces/IRewardsController.sol rename to src/contracts/rewards/interfaces/IRewardsController.sol index 952da7cb..cdb2ac29 100644 --- a/src/periphery/contracts/rewards/interfaces/IRewardsController.sol +++ b/src/contracts/rewards/interfaces/IRewardsController.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.10; import {IRewardsDistributor} from './IRewardsDistributor.sol'; import {ITransferStrategyBase} from './ITransferStrategyBase.sol'; -import {IEACAggregatorProxy} from '../../misc/interfaces/IEACAggregatorProxy.sol'; +import {IEACAggregatorProxy} from '../../helpers/interfaces/IEACAggregatorProxy.sol'; import {RewardsDataTypes} from '../libraries/RewardsDataTypes.sol'; /** diff --git a/src/periphery/contracts/rewards/interfaces/IRewardsDistributor.sol b/src/contracts/rewards/interfaces/IRewardsDistributor.sol similarity index 100% rename from src/periphery/contracts/rewards/interfaces/IRewardsDistributor.sol rename to src/contracts/rewards/interfaces/IRewardsDistributor.sol diff --git a/src/periphery/contracts/rewards/interfaces/IStakedToken.sol b/src/contracts/rewards/interfaces/IStakedToken.sol similarity index 100% rename from src/periphery/contracts/rewards/interfaces/IStakedToken.sol rename to src/contracts/rewards/interfaces/IStakedToken.sol diff --git a/src/periphery/contracts/rewards/interfaces/IStakedTokenTransferStrategy.sol b/src/contracts/rewards/interfaces/IStakedTokenTransferStrategy.sol similarity index 100% rename from src/periphery/contracts/rewards/interfaces/IStakedTokenTransferStrategy.sol rename to src/contracts/rewards/interfaces/IStakedTokenTransferStrategy.sol diff --git a/src/periphery/contracts/rewards/interfaces/ITransferStrategyBase.sol b/src/contracts/rewards/interfaces/ITransferStrategyBase.sol similarity index 100% rename from src/periphery/contracts/rewards/interfaces/ITransferStrategyBase.sol rename to src/contracts/rewards/interfaces/ITransferStrategyBase.sol diff --git a/src/periphery/contracts/rewards/libraries/RewardsDataTypes.sol b/src/contracts/rewards/libraries/RewardsDataTypes.sol similarity index 94% rename from src/periphery/contracts/rewards/libraries/RewardsDataTypes.sol rename to src/contracts/rewards/libraries/RewardsDataTypes.sol index 4cafda32..38fe87c5 100644 --- a/src/periphery/contracts/rewards/libraries/RewardsDataTypes.sol +++ b/src/contracts/rewards/libraries/RewardsDataTypes.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.10; import {ITransferStrategyBase} from '../interfaces/ITransferStrategyBase.sol'; -import {IEACAggregatorProxy} from '../../misc/interfaces/IEACAggregatorProxy.sol'; +import {IEACAggregatorProxy} from '../../helpers/interfaces/IEACAggregatorProxy.sol'; library RewardsDataTypes { struct RewardsConfigInput { diff --git a/src/periphery/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol b/src/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol similarity index 88% rename from src/periphery/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol rename to src/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol index 46620b3e..dc4b5a9b 100644 --- a/src/periphery/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol +++ b/src/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol @@ -4,8 +4,8 @@ pragma solidity ^0.8.10; import {IPullRewardsTransferStrategy} from '../interfaces/IPullRewardsTransferStrategy.sol'; import {ITransferStrategyBase} from '../interfaces/ITransferStrategyBase.sol'; import {TransferStrategyBase} from './TransferStrategyBase.sol'; -import {GPv2SafeERC20} from 'aave-v3-core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {GPv2SafeERC20} from '../../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; /** * @title PullRewardsTransferStrategy diff --git a/src/periphery/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol b/src/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol similarity index 92% rename from src/periphery/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol rename to src/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol index bb3901c3..9ca6f8c3 100644 --- a/src/periphery/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol +++ b/src/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol @@ -5,8 +5,8 @@ import {IStakedToken} from '../interfaces/IStakedToken.sol'; import {IStakedTokenTransferStrategy} from '../interfaces/IStakedTokenTransferStrategy.sol'; import {ITransferStrategyBase} from '../interfaces/ITransferStrategyBase.sol'; import {TransferStrategyBase} from './TransferStrategyBase.sol'; -import {GPv2SafeERC20} from 'aave-v3-core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {GPv2SafeERC20} from '../../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; /** * @title StakedTokenTransferStrategy diff --git a/src/periphery/contracts/rewards/transfer-strategies/TransferStrategyBase.sol b/src/contracts/rewards/transfer-strategies/TransferStrategyBase.sol similarity index 89% rename from src/periphery/contracts/rewards/transfer-strategies/TransferStrategyBase.sol rename to src/contracts/rewards/transfer-strategies/TransferStrategyBase.sol index 2f26b958..5064606d 100644 --- a/src/periphery/contracts/rewards/transfer-strategies/TransferStrategyBase.sol +++ b/src/contracts/rewards/transfer-strategies/TransferStrategyBase.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.10; import {ITransferStrategyBase} from '../interfaces/ITransferStrategyBase.sol'; -import {GPv2SafeERC20} from 'aave-v3-core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {GPv2SafeERC20} from '../../dependencies/gnosis/contracts/GPv2SafeERC20.sol'; +import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; /** * @title TransferStrategyStorage diff --git a/src/periphery/contracts/treasury/Collector.sol b/src/contracts/treasury/Collector.sol similarity index 96% rename from src/periphery/contracts/treasury/Collector.sol rename to src/contracts/treasury/Collector.sol index 22cf3e2f..daf6b7a3 100644 --- a/src/periphery/contracts/treasury/Collector.sol +++ b/src/contracts/treasury/Collector.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import {ICollector} from './ICollector.sol'; import {ReentrancyGuard} from '../dependencies/openzeppelin/ReentrancyGuard.sol'; -import {VersionedInitializable} from '../../../core/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol'; -import {IERC20} from '../../../core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {SafeERC20} from '../../../core/contracts/dependencies/openzeppelin/contracts/SafeERC20.sol'; -import {Address} from '../../../core/contracts/dependencies/openzeppelin/contracts/Address.sol'; +import {VersionedInitializable} from '../misc/aave-upgradeability/VersionedInitializable.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; +import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol'; +import {Address} from '../dependencies/openzeppelin/contracts/Address.sol'; /** * @title Collector diff --git a/src/periphery/contracts/treasury/ICollector.sol b/src/contracts/treasury/ICollector.sol similarity index 98% rename from src/periphery/contracts/treasury/ICollector.sol rename to src/contracts/treasury/ICollector.sol index ae92353d..94103d48 100644 --- a/src/periphery/contracts/treasury/ICollector.sol +++ b/src/contracts/treasury/ICollector.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IERC20} from '../../../core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; interface ICollector { struct Stream { diff --git a/src/core/contracts/flashloan/base/LICENSE.md b/src/core/contracts/flashloan/base/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/core/contracts/flashloan/base/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/core/contracts/flashloan/interfaces/LICENSE.md b/src/core/contracts/flashloan/interfaces/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/core/contracts/flashloan/interfaces/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/core/contracts/interfaces/LICENSE.md b/src/core/contracts/interfaces/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/core/contracts/interfaces/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/core/contracts/misc/interfaces/LICENSE.md b/src/core/contracts/misc/interfaces/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/core/contracts/misc/interfaces/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/deployments/contracts/procedures/AaveV3DefaultRateStrategyProcedure.sol b/src/deployments/contracts/procedures/AaveV3DefaultRateStrategyProcedure.sol index db3e2bc8..d26419e7 100644 --- a/src/deployments/contracts/procedures/AaveV3DefaultRateStrategyProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3DefaultRateStrategyProcedure.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import '../../interfaces/IMarketReportTypes.sol'; -import {DefaultReserveInterestRateStrategyV2} from 'aave-v3-core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol'; +import {DefaultReserveInterestRateStrategyV2} from '../../../contracts/misc/DefaultReserveInterestRateStrategyV2.sol'; contract AaveV3DefaultRateStrategyProcedure { function _deployDefaultRateStrategyV2(address poolAddressesProvider) internal returns (address) { diff --git a/src/deployments/contracts/procedures/AaveV3GettersProcedureOne.sol b/src/deployments/contracts/procedures/AaveV3GettersProcedureOne.sol index ffa52d4d..8aa66732 100644 --- a/src/deployments/contracts/procedures/AaveV3GettersProcedureOne.sol +++ b/src/deployments/contracts/procedures/AaveV3GettersProcedureOne.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {WalletBalanceProvider} from 'aave-v3-periphery/contracts/misc/WalletBalanceProvider.sol'; -import {UiPoolDataProviderV3} from 'aave-v3-periphery/contracts/misc/UiPoolDataProviderV3.sol'; -import {UiIncentiveDataProviderV3} from 'aave-v3-periphery/contracts/misc/UiIncentiveDataProviderV3.sol'; -import {IEACAggregatorProxy} from 'aave-v3-periphery/contracts/misc/interfaces/IEACAggregatorProxy.sol'; -import {AaveProtocolDataProvider} from 'aave-v3-core/contracts/misc/AaveProtocolDataProvider.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; +import {WalletBalanceProvider} from '../../../contracts/helpers/WalletBalanceProvider.sol'; +import {UiPoolDataProviderV3} from '../../../contracts/helpers/UiPoolDataProviderV3.sol'; +import {UiIncentiveDataProviderV3} from '../../../contracts/helpers/UiIncentiveDataProviderV3.sol'; +import {IEACAggregatorProxy} from '../../../contracts/helpers/interfaces/IEACAggregatorProxy.sol'; +import {AaveProtocolDataProvider} from '../../../contracts/helpers/AaveProtocolDataProvider.sol'; +import {IPoolAddressesProvider} from '../../../contracts/interfaces/IPoolAddressesProvider.sol'; contract AaveV3GettersProcedureOne { struct GettersReportBatchOne { diff --git a/src/deployments/contracts/procedures/AaveV3GettersProcedureTwo.sol b/src/deployments/contracts/procedures/AaveV3GettersProcedureTwo.sol index eaaddb17..947cc7a9 100644 --- a/src/deployments/contracts/procedures/AaveV3GettersProcedureTwo.sol +++ b/src/deployments/contracts/procedures/AaveV3GettersProcedureTwo.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {WrappedTokenGatewayV3} from 'aave-v3-periphery/contracts/misc/WrappedTokenGatewayV3.sol'; -import {L2Encoder} from 'aave-v3-core/contracts/misc/L2Encoder.sol'; +import {IPool} from '../../../contracts/interfaces/IPool.sol'; +import {WrappedTokenGatewayV3} from '../../../contracts/helpers/WrappedTokenGatewayV3.sol'; +import {L2Encoder} from '../../../contracts/helpers/L2Encoder.sol'; contract AaveV3GettersProcedureTwo { struct GettersReportBatchTwo { diff --git a/src/deployments/contracts/procedures/AaveV3IncentiveProcedure.sol b/src/deployments/contracts/procedures/AaveV3IncentiveProcedure.sol index 1801a748..b940f795 100644 --- a/src/deployments/contracts/procedures/AaveV3IncentiveProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3IncentiveProcedure.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {EmissionManager} from 'aave-v3-periphery/contracts/rewards/EmissionManager.sol'; -import {RewardsController} from 'aave-v3-periphery/contracts/rewards/RewardsController.sol'; +import {EmissionManager} from '../../../contracts/rewards/EmissionManager.sol'; +import {RewardsController} from '../../../contracts/rewards/RewardsController.sol'; contract AaveV3IncentiveProcedure { function _deployIncentives(address tempOwner) internal returns (address, address) { diff --git a/src/deployments/contracts/procedures/AaveV3L2PoolProcedure.sol b/src/deployments/contracts/procedures/AaveV3L2PoolProcedure.sol index 20c7965d..f6fcba67 100644 --- a/src/deployments/contracts/procedures/AaveV3L2PoolProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3L2PoolProcedure.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {L2PoolInstance} from 'aave-v3-core/instances/L2PoolInstance.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; +import {L2PoolInstance} from '../../../contracts/instances/L2PoolInstance.sol'; +import {IPoolAddressesProvider} from '../../../contracts/interfaces/IPoolAddressesProvider.sol'; import {AaveV3PoolConfigProcedure} from './AaveV3PoolConfigProcedure.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; +import {IPool} from '../../../contracts/interfaces/IPool.sol'; import {IErrors} from '../../interfaces/IErrors.sol'; import '../../interfaces/IMarketReportTypes.sol'; diff --git a/src/deployments/contracts/procedures/AaveV3OracleProcedure.sol b/src/deployments/contracts/procedures/AaveV3OracleProcedure.sol index 7acc6c91..77e97a40 100644 --- a/src/deployments/contracts/procedures/AaveV3OracleProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3OracleProcedure.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import '../../interfaces/IMarketReportTypes.sol'; -import {AaveOracle} from 'aave-v3-core/contracts/misc/AaveOracle.sol'; +import {AaveOracle} from '../../../contracts/misc/AaveOracle.sol'; contract AaveV3OracleProcedure { function _deployAaveOracle( diff --git a/src/deployments/contracts/procedures/AaveV3ParaswapProcedure.sol b/src/deployments/contracts/procedures/AaveV3ParaswapProcedure.sol index 8e6e8b17..b89457b6 100644 --- a/src/deployments/contracts/procedures/AaveV3ParaswapProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3ParaswapProcedure.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {ParaSwapLiquiditySwapAdapter, IParaSwapAugustusRegistry} from 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol'; -import {ParaSwapRepayAdapter} from 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapRepayAdapter.sol'; -import {ParaSwapWithdrawSwapAdapter} from 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapWithdrawSwapAdapter.sol'; -import {AaveParaSwapFeeClaimer} from 'aave-v3-periphery/contracts/adapters/paraswap/AaveParaSwapFeeClaimer.sol'; -import {IFeeClaimer} from 'aave-v3-periphery/contracts/adapters/paraswap/interfaces/IFeeClaimer.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; +import {ParaSwapLiquiditySwapAdapter, IParaSwapAugustusRegistry} from '../../../contracts/extensions/paraswap-adapters/ParaSwapLiquiditySwapAdapter.sol'; +import {ParaSwapRepayAdapter} from '../../../contracts/extensions/paraswap-adapters/ParaSwapRepayAdapter.sol'; +import {ParaSwapWithdrawSwapAdapter} from '../../../contracts/extensions/paraswap-adapters/ParaSwapWithdrawSwapAdapter.sol'; +import {AaveParaSwapFeeClaimer} from '../../../contracts/extensions/paraswap-adapters/AaveParaSwapFeeClaimer.sol'; +import {IFeeClaimer} from '../../../contracts/extensions/paraswap-adapters/interfaces/IFeeClaimer.sol'; +import {IPoolAddressesProvider} from '../../../contracts/interfaces/IPoolAddressesProvider.sol'; contract AaveV3ParaswapProcedure { struct ParaswapAdapters { diff --git a/src/deployments/contracts/procedures/AaveV3PoolConfigProcedure.sol b/src/deployments/contracts/procedures/AaveV3PoolConfigProcedure.sol index fb968ec7..6f508ab8 100644 --- a/src/deployments/contracts/procedures/AaveV3PoolConfigProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3PoolConfigProcedure.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {PoolConfiguratorInstance} from 'aave-v3-core/instances/PoolConfiguratorInstance.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {AaveOracle} from 'aave-v3-core/contracts/misc/AaveOracle.sol'; +import {PoolConfiguratorInstance} from '../../../contracts/instances/PoolConfiguratorInstance.sol'; +import {IPoolAddressesProvider} from '../../../contracts/interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../../../contracts/interfaces/IPool.sol'; +import {AaveOracle} from '../../../contracts/misc/AaveOracle.sol'; contract AaveV3PoolConfigProcedure { function _deployPoolConfigurator(address poolAddressesProvider) internal returns (address) { diff --git a/src/deployments/contracts/procedures/AaveV3PoolProcedure.sol b/src/deployments/contracts/procedures/AaveV3PoolProcedure.sol index 0bf84a5d..cc3cc694 100644 --- a/src/deployments/contracts/procedures/AaveV3PoolProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3PoolProcedure.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {PoolInstance} from 'aave-v3-core/instances/PoolInstance.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; +import {PoolInstance} from '../../../contracts/instances/PoolInstance.sol'; +import {IPoolAddressesProvider} from '../../../contracts/interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../../../contracts/interfaces/IPool.sol'; import {AaveV3PoolConfigProcedure} from './AaveV3PoolConfigProcedure.sol'; import {IErrors} from '../../interfaces/IErrors.sol'; import '../../interfaces/IMarketReportTypes.sol'; diff --git a/src/deployments/contracts/procedures/AaveV3SetupProcedure.sol b/src/deployments/contracts/procedures/AaveV3SetupProcedure.sol index ce411cc5..7f48b649 100644 --- a/src/deployments/contracts/procedures/AaveV3SetupProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3SetupProcedure.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.0; import '../../interfaces/IMarketReportTypes.sol'; import {IOwnable} from 'solidity-utils/contracts/transparent-proxy/interfaces/IOwnable.sol'; -import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {IPoolConfigurator} from 'aave-v3-core/contracts/interfaces/IPoolConfigurator.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {PoolAddressesProvider} from 'aave-v3-core/contracts/protocol/configuration/PoolAddressesProvider.sol'; -import {PoolAddressesProviderRegistry} from 'aave-v3-core/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol'; -import {IEmissionManager} from 'aave-v3-periphery/contracts/rewards/interfaces/IEmissionManager.sol'; -import {IRewardsController} from 'aave-v3-periphery/contracts/rewards/interfaces/IRewardsController.sol'; +import {ACLManager} from '../../../contracts/protocol/configuration/ACLManager.sol'; +import {IPoolConfigurator} from '../../../contracts/interfaces/IPoolConfigurator.sol'; +import {IPoolAddressesProvider} from '../../../contracts/interfaces/IPoolAddressesProvider.sol'; +import {PoolAddressesProvider} from '../../../contracts/protocol/configuration/PoolAddressesProvider.sol'; +import {PoolAddressesProviderRegistry} from '../../../contracts/protocol/configuration/PoolAddressesProviderRegistry.sol'; +import {IEmissionManager} from '../../../contracts/rewards/interfaces/IEmissionManager.sol'; +import {IRewardsController} from '../../../contracts/rewards/interfaces/IRewardsController.sol'; contract AaveV3SetupProcedure { function _initialDeployment( diff --git a/src/deployments/contracts/procedures/AaveV3TokensProcedure.sol b/src/deployments/contracts/procedures/AaveV3TokensProcedure.sol index 51668cf8..342a6926 100644 --- a/src/deployments/contracts/procedures/AaveV3TokensProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3TokensProcedure.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {ATokenInstance} from 'aave-v3-core/instances/ATokenInstance.sol'; -import {VariableDebtTokenInstance} from 'aave-v3-core/instances/VariableDebtTokenInstance.sol'; -import {StableDebtTokenInstance} from 'aave-v3-core/instances/StableDebtTokenInstance.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {IAaveIncentivesController} from 'aave-v3-core/contracts/interfaces/IAaveIncentivesController.sol'; +import {ATokenInstance} from '../../../contracts/instances/ATokenInstance.sol'; +import {VariableDebtTokenInstance} from '../../../contracts/instances/VariableDebtTokenInstance.sol'; +import {StableDebtTokenInstance} from '../../../contracts/instances/StableDebtTokenInstance.sol'; +import {IPool} from '../../../contracts/interfaces/IPool.sol'; +import {IAaveIncentivesController} from '../../../contracts/interfaces/IAaveIncentivesController.sol'; contract AaveV3TokensProcedure { struct TokensReport { diff --git a/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol b/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol index 8fddece8..d0169fc5 100644 --- a/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; import {IOwnable} from 'solidity-utils/contracts/transparent-proxy/interfaces/IOwnable.sol'; -import {Collector} from '../../../periphery/contracts/treasury/Collector.sol'; +import {Collector} from '../../../contracts/treasury/Collector.sol'; import '../../interfaces/IMarketReportTypes.sol'; contract AaveV3TreasuryProcedure { diff --git a/src/deployments/contracts/utilities/MarketReportUtils.sol b/src/deployments/contracts/utilities/MarketReportUtils.sol index 34e10e87..341a64c2 100644 --- a/src/deployments/contracts/utilities/MarketReportUtils.sol +++ b/src/deployments/contracts/utilities/MarketReportUtils.sol @@ -21,8 +21,8 @@ library MarketReportUtils { aaveOracle: IAaveOracle(report.aaveOracle), aclManager: IACLManager(report.aclManager), treasury: ICollector(report.treasury), - defaultInterestRateStrategyV2: IDefaultInterestRateStrategyV2( - report.defaultInterestRateStrategyV2 + defaultInterestRateStrategy: IDefaultInterestRateStrategyV2( + report.defaultInterestRateStrategy ), proxyAdmin: ProxyAdmin(report.proxyAdmin), treasuryImplementation: ICollector(report.treasuryImplementation), diff --git a/src/deployments/contracts/utilities/MetadataReporter.sol b/src/deployments/contracts/utilities/MetadataReporter.sol index a3a9b8ab..a4dfb787 100644 --- a/src/deployments/contracts/utilities/MetadataReporter.sol +++ b/src/deployments/contracts/utilities/MetadataReporter.sol @@ -57,6 +57,11 @@ contract MetadataReporter is IMetadataReporter { vm.serializeAddress(jsonReport, 'rewardsControllerProxy', report.rewardsControllerProxy); vm.serializeAddress(jsonReport, 'aclManager', report.aclManager); vm.serializeAddress(jsonReport, 'protocolDataProvider', report.protocolDataProvider); + vm.serializeAddress( + jsonReport, + 'defaultInterestRateStrategy', + report.defaultInterestRateStrategy + ); vm.serializeAddress( jsonReport, @@ -69,6 +74,7 @@ contract MetadataReporter is IMetadataReporter { report.paraSwapWithdrawSwapAdapter ); vm.serializeAddress(jsonReport, 'aaveParaSwapFeeClaimer', report.aaveParaSwapFeeClaimer); + string memory output = vm.serializeAddress( jsonReport, 'paraSwapRepayAdapter', diff --git a/src/deployments/interfaces/IErrors.sol b/src/deployments/interfaces/IErrors.sol index 5faefcc5..7d0df80a 100644 --- a/src/deployments/interfaces/IErrors.sol +++ b/src/deployments/interfaces/IErrors.sol @@ -5,4 +5,5 @@ interface IErrors { error L2MustBeEnabled(); error L2MustBeDisabled(); error ProviderNotFound(); + error ProxyAdminNotFound(); } diff --git a/src/deployments/interfaces/IMarketReportTypes.sol b/src/deployments/interfaces/IMarketReportTypes.sol index 2eb742f9..4d0d3967 100644 --- a/src/deployments/interfaces/IMarketReportTypes.sol +++ b/src/deployments/interfaces/IMarketReportTypes.sol @@ -1,27 +1,28 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import 'aave-v3-core/contracts/interfaces/IPoolAddressesProviderRegistry.sol'; -import 'aave-v3-core/contracts/interfaces/IPool.sol'; -import 'aave-v3-core/contracts/interfaces/IPoolConfigurator.sol'; -import 'aave-v3-core/contracts/interfaces/IAaveOracle.sol'; -import 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import 'aave-v3-core/contracts/interfaces/IVariableDebtToken.sol'; -import 'aave-v3-core/contracts/interfaces/IStableDebtToken.sol'; -import 'aave-v3-core/contracts/interfaces/IACLManager.sol'; -import 'aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; -import 'aave-v3-core/contracts/misc/AaveProtocolDataProvider.sol'; -import 'aave-v3-periphery/contracts/misc/UiPoolDataProviderV3.sol'; -import 'aave-v3-periphery/contracts/misc/UiIncentiveDataProviderV3.sol'; -import 'aave-v3-periphery/contracts/rewards/interfaces/IEmissionManager.sol'; -import 'aave-v3-periphery/contracts/rewards/interfaces/IRewardsController.sol'; -import 'aave-v3-periphery/contracts/misc/WalletBalanceProvider.sol'; -import 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol'; -import 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapRepayAdapter.sol'; -import 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapWithdrawSwapAdapter.sol'; -import 'aave-v3-periphery/contracts/misc/interfaces/IWrappedTokenGatewayV3.sol'; -import 'aave-v3-core/contracts/misc/L2Encoder.sol'; -import {ICollector} from 'aave-v3-periphery/contracts/treasury/ICollector.sol'; + +import '../../contracts/interfaces/IPoolAddressesProvider.sol'; +import '../../contracts/interfaces/IPoolAddressesProviderRegistry.sol'; +import '../../contracts/interfaces/IPool.sol'; +import '../../contracts/interfaces/IPoolConfigurator.sol'; +import '../../contracts/interfaces/IAaveOracle.sol'; +import '../../contracts/interfaces/IAToken.sol'; +import '../../contracts/interfaces/IVariableDebtToken.sol'; +import '../../contracts/interfaces/IStableDebtToken.sol'; +import '../../contracts/interfaces/IACLManager.sol'; +import '../../contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; +import '../../contracts/helpers/AaveProtocolDataProvider.sol'; +import '../../contracts/helpers/UiPoolDataProviderV3.sol'; +import '../../contracts/helpers/UiIncentiveDataProviderV3.sol'; +import '../../contracts/rewards/interfaces/IEmissionManager.sol'; +import '../../contracts/rewards/interfaces/IRewardsController.sol'; +import '../../contracts/helpers/WalletBalanceProvider.sol'; +import '../../contracts/extensions/paraswap-adapters/ParaSwapLiquiditySwapAdapter.sol'; +import '../../contracts/extensions/paraswap-adapters/ParaSwapRepayAdapter.sol'; +import '../../contracts/extensions/paraswap-adapters/ParaSwapWithdrawSwapAdapter.sol'; +import '../../contracts/helpers/interfaces/IWrappedTokenGatewayV3.sol'; +import '../../contracts/helpers/L2Encoder.sol'; +import {ICollector} from '../../contracts/treasury/ICollector.sol'; import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; struct ContractsReport { @@ -35,7 +36,7 @@ struct ContractsReport { IAaveOracle aaveOracle; IACLManager aclManager; ICollector treasury; - IDefaultInterestRateStrategyV2 defaultInterestRateStrategyV2; + IDefaultInterestRateStrategyV2 defaultInterestRateStrategy; ProxyAdmin proxyAdmin; ICollector treasuryImplementation; IWrappedTokenGatewayV3 wrappedTokenGateway; @@ -63,7 +64,7 @@ struct MarketReport { address poolConfiguratorImplementation; address protocolDataProvider; address aaveOracle; - address defaultInterestRateStrategyV2; + address defaultInterestRateStrategy; address aclManager; address treasury; address proxyAdmin; @@ -145,7 +146,7 @@ struct PeripheryReport { address treasuryImplementation; address emissionManager; address rewardsControllerImplementation; - address defaultInterestRateStrategyV2; + address defaultInterestRateStrategy; } struct ParaswapReport { diff --git a/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol b/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol index 1512596b..39b50d94 100644 --- a/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol +++ b/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol @@ -240,7 +240,7 @@ library AaveV3BatchOrchestration { report.aToken = tokensReport.aToken; report.variableDebtToken = tokensReport.variableDebtToken; report.stableDebtToken = tokensReport.stableDebtToken; - report.defaultInterestRateStrategyV2 = peripheryReport.defaultInterestRateStrategyV2; + report.defaultInterestRateStrategy = peripheryReport.defaultInterestRateStrategy; return report; } diff --git a/src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol b/src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol index 43a25d9b..8ec0c136 100644 --- a/src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol +++ b/src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol @@ -35,7 +35,7 @@ contract AaveV3PeripheryBatch is setupBatch ); - _report.defaultInterestRateStrategyV2 = _deployDefaultRateStrategyV2(poolAddressesProvider); + _report.defaultInterestRateStrategy = _deployDefaultRateStrategyV2(poolAddressesProvider); } function getPeripheryReport() external view returns (PeripheryReport memory) { diff --git a/src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol b/src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol index 78db0c47..f62bcd4f 100644 --- a/src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol +++ b/src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; +import {Ownable} from '../../../../contracts/dependencies/openzeppelin/contracts/Ownable.sol'; import {AaveV3SetupProcedure} from '../../../contracts/procedures/AaveV3SetupProcedure.sol'; import '../../../contracts/MarketReportStorage.sol'; diff --git a/src/deployments/projects/aave-v3-libraries/AaveV3LibrariesBatch1.sol b/src/deployments/projects/aave-v3-libraries/AaveV3LibrariesBatch1.sol index 1eb97e86..5c292cee 100644 --- a/src/deployments/projects/aave-v3-libraries/AaveV3LibrariesBatch1.sol +++ b/src/deployments/projects/aave-v3-libraries/AaveV3LibrariesBatch1.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import '../../contracts/LibraryReportStorage.sol'; import {Create2Utils} from '../../contracts/utilities/Create2Utils.sol'; -import {BorrowLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/BorrowLogic.sol'; -import {BridgeLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/BridgeLogic.sol'; -import {ConfiguratorLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/ConfiguratorLogic.sol'; -import {EModeLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/EModeLogic.sol'; +import {BorrowLogic} from '../../../contracts/protocol/libraries/logic/BorrowLogic.sol'; +import {BridgeLogic} from '../../../contracts/protocol/libraries/logic/BridgeLogic.sol'; +import {ConfiguratorLogic} from '../../../contracts/protocol/libraries/logic/ConfiguratorLogic.sol'; +import {EModeLogic} from '../../../contracts/protocol/libraries/logic/EModeLogic.sol'; contract AaveV3LibrariesBatch1 is LibraryReportStorage { constructor() { diff --git a/src/deployments/projects/aave-v3-libraries/AaveV3LibrariesBatch2.sol b/src/deployments/projects/aave-v3-libraries/AaveV3LibrariesBatch2.sol index ac1b3ce6..d65db0ac 100644 --- a/src/deployments/projects/aave-v3-libraries/AaveV3LibrariesBatch2.sol +++ b/src/deployments/projects/aave-v3-libraries/AaveV3LibrariesBatch2.sol @@ -4,10 +4,10 @@ pragma solidity ^0.8.0; import '../../contracts/LibraryReportStorage.sol'; import {Create2Utils} from '../../contracts/utilities/Create2Utils.sol'; -import {FlashLoanLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/FlashLoanLogic.sol'; -import {LiquidationLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/LiquidationLogic.sol'; -import {PoolLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/PoolLogic.sol'; -import {SupplyLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/SupplyLogic.sol'; +import {FlashLoanLogic} from '../../../contracts/protocol/libraries/logic/FlashLoanLogic.sol'; +import {LiquidationLogic} from '../../../contracts/protocol/libraries/logic/LiquidationLogic.sol'; +import {PoolLogic} from '../../../contracts/protocol/libraries/logic/PoolLogic.sol'; +import {SupplyLogic} from '../../../contracts/protocol/libraries/logic/SupplyLogic.sol'; contract AaveV3LibrariesBatch2 is LibraryReportStorage { constructor() { diff --git a/src/periphery/contracts/libraries/LICENSE.md b/src/periphery/contracts/libraries/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/periphery/contracts/libraries/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/periphery/contracts/misc/LICENSE.md b/src/periphery/contracts/misc/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/periphery/contracts/misc/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/periphery/contracts/misc/interfaces/IWETH.sol b/src/periphery/contracts/misc/interfaces/IWETH.sol deleted file mode 100644 index a46ede7f..00000000 --- a/src/periphery/contracts/misc/interfaces/IWETH.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.10; - -interface IWETH { - function deposit() external payable; - - function withdraw(uint256) external; - - function approve(address guy, uint256 wad) external returns (bool); - - function transferFrom(address src, address dst, uint256 wad) external returns (bool); -} diff --git a/src/periphery/contracts/misc/interfaces/LICENSE.md b/src/periphery/contracts/misc/interfaces/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/periphery/contracts/misc/interfaces/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/periphery/contracts/mocks/LICENSE.md b/src/periphery/contracts/mocks/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/periphery/contracts/mocks/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/periphery/contracts/rewards/interfaces/LICENSE.md b/src/periphery/contracts/rewards/interfaces/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/periphery/contracts/rewards/interfaces/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/periphery/contracts/rewards/libraries/LICENSE.md b/src/periphery/contracts/rewards/libraries/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/periphery/contracts/rewards/libraries/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/src/periphery/contracts/rewards/transfer-strategies/LICENSE.md b/src/periphery/contracts/rewards/transfer-strategies/LICENSE.md deleted file mode 100644 index 506d18ec..00000000 --- a/src/periphery/contracts/rewards/transfer-strategies/LICENSE.md +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2022 Aave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) -for more details diff --git a/tests/AaveV3BatchDeployment.t.sol b/tests/deployments/AaveV3BatchDeployment.t.sol similarity index 70% rename from tests/AaveV3BatchDeployment.t.sol rename to tests/deployments/AaveV3BatchDeployment.t.sol index 1e7dca5f..55c5a81d 100644 --- a/tests/AaveV3BatchDeployment.t.sol +++ b/tests/deployments/AaveV3BatchDeployment.t.sol @@ -2,19 +2,20 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import '../src/deployments/interfaces/IMarketReportTypes.sol'; -import {ConfigEngineDeployer} from './utils/ConfigEngineDeployer.sol'; - -import {AugustusRegistryMock} from './mocks/AugustusRegistryMock.sol'; -import {MockParaSwapFeeClaimer} from 'aave-v3-periphery/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; -import {BatchTestProcedures} from './utils/BatchTestProcedures.sol'; -import {AaveV3TestListing} from './mocks/AaveV3TestListing.sol'; -import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {WETH9} from 'aave-v3-core/contracts/dependencies/weth/WETH9.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IAaveV3ConfigEngine} from 'aave-v3-periphery/contracts/v3-config-engine/IAaveV3ConfigEngine.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {AaveV3ConfigEngine} from 'aave-v3-periphery/contracts/v3-config-engine/AaveV3ConfigEngine.sol'; +import '../../src/deployments/interfaces/IMarketReportTypes.sol'; +import {ConfigEngineDeployer} from '../utils/ConfigEngineDeployer.sol'; + +import {AugustusRegistryMock} from '../mocks/AugustusRegistryMock.sol'; +import {MockParaSwapFeeClaimer} from '../../src/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; +import {BatchTestProcedures} from '../utils/BatchTestProcedures.sol'; +import {AaveV3TestListing} from '../mocks/AaveV3TestListing.sol'; +import {ACLManager} from '../../src/contracts/protocol/configuration/ACLManager.sol'; +import {WETH9} from '../../src/contracts/dependencies/weth/WETH9.sol'; +import {IPoolAddressesProvider} from '../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IAaveV3ConfigEngine} from '../../src/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; +import {IPool} from '../../src/contracts/interfaces/IPool.sol'; +import {AaveV3ConfigEngine} from '../../src/contracts/extensions/v3-config-engine/AaveV3ConfigEngine.sol'; +import {SequencerOracle} from '../../src/contracts/mocks/oracle/SequencerOracle.sol'; contract AaveV3BatchDeployment is BatchTestProcedures { address public marketOwner; diff --git a/tests/AaveV3BatchTests.t.sol b/tests/deployments/AaveV3BatchTests.t.sol similarity index 71% rename from tests/AaveV3BatchTests.t.sol rename to tests/deployments/AaveV3BatchTests.t.sol index f90652f8..254db0d1 100644 --- a/tests/AaveV3BatchTests.t.sol +++ b/tests/deployments/AaveV3BatchTests.t.sol @@ -1,21 +1,20 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import 'forge-std/Test.sol'; -import '../src/deployments/interfaces/IMarketReportTypes.sol'; -import {AaveV3TokensBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3TokensBatch.sol'; -import {AaveV3PoolBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3PoolBatch.sol'; -import {AaveV3L2PoolBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3L2PoolBatch.sol'; -import {AaveV3GettersBatchOne} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchOne.sol'; -import {AaveV3GettersBatchTwo} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchTwo.sol'; -import {AaveV3PeripheryBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol'; -import {AaveV3ParaswapBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3ParaswapBatch.sol'; -import {AaveV3SetupBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol'; -import {WETH9} from 'aave-v3-core/contracts/dependencies/weth/WETH9.sol'; -import {AugustusRegistryMock} from './mocks/AugustusRegistryMock.sol'; -import {MockParaSwapFeeClaimer} from 'aave-v3-periphery/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; -import {BatchTestProcedures} from './utils/BatchTestProcedures.sol'; -import {AaveV3BatchOrchestration} from '../src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol'; +import '../../src/deployments/interfaces/IMarketReportTypes.sol'; +import {AaveV3TokensBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3TokensBatch.sol'; +import {AaveV3PoolBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3PoolBatch.sol'; +import {AaveV3L2PoolBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3L2PoolBatch.sol'; +import {AaveV3GettersBatchOne} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchOne.sol'; +import {AaveV3GettersBatchTwo} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchTwo.sol'; +import {AaveV3PeripheryBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol'; +import {AaveV3ParaswapBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3ParaswapBatch.sol'; +import {AaveV3SetupBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol'; +import {WETH9} from '../../src/contracts/dependencies/weth/WETH9.sol'; +import {AugustusRegistryMock} from '../mocks/AugustusRegistryMock.sol'; +import {MockParaSwapFeeClaimer} from 'src/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; +import {BatchTestProcedures} from '../utils/BatchTestProcedures.sol'; +import {AaveV3BatchOrchestration} from '../../src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol'; contract AaveV3BatchTests is BatchTestProcedures { address deployer; diff --git a/tests/AaveV3PermissionsTest.t.sol b/tests/deployments/AaveV3PermissionsTest.t.sol similarity index 86% rename from tests/AaveV3PermissionsTest.t.sol rename to tests/deployments/AaveV3PermissionsTest.t.sol index 4224adb2..77b40647 100644 --- a/tests/AaveV3PermissionsTest.t.sol +++ b/tests/deployments/AaveV3PermissionsTest.t.sol @@ -2,16 +2,16 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Ownable} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import '../src/deployments/interfaces/IMarketReportTypes.sol'; -import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {RewardsController} from 'aave-v3-periphery/contracts/rewards/RewardsController.sol'; -import {EmissionManager} from 'aave-v3-periphery/contracts/rewards/EmissionManager.sol'; -import {AugustusRegistryMock} from './mocks/AugustusRegistryMock.sol'; -import {MockParaSwapFeeClaimer} from '../src/periphery/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; -import {WETH9} from 'aave-v3-core/contracts/dependencies/weth/WETH9.sol'; -import {BatchTestProcedures} from './utils/BatchTestProcedures.sol'; +import {Ownable} from '../../src/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; +import {IPoolAddressesProvider} from '../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import '../../src/deployments/interfaces/IMarketReportTypes.sol'; +import {ACLManager} from '../../src/contracts/protocol/configuration/ACLManager.sol'; +import {RewardsController} from '../../src/contracts/rewards/RewardsController.sol'; +import {EmissionManager} from '../../src/contracts/rewards/EmissionManager.sol'; +import {AugustusRegistryMock} from '../mocks/AugustusRegistryMock.sol'; +import {MockParaSwapFeeClaimer} from '../../src/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; +import {WETH9} from '../../src/contracts/dependencies/weth/WETH9.sol'; +import {BatchTestProcedures} from '../utils/BatchTestProcedures.sol'; contract AaveV3PermissionsTest is BatchTestProcedures { /** diff --git a/tests/DeploymentsGasLimits.t.sol b/tests/deployments/DeploymentsGasLimits.t.sol similarity index 79% rename from tests/DeploymentsGasLimits.t.sol rename to tests/deployments/DeploymentsGasLimits.t.sol index ba1082f5..ae3865f0 100644 --- a/tests/DeploymentsGasLimits.t.sol +++ b/tests/deployments/DeploymentsGasLimits.t.sol @@ -2,19 +2,20 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import '../src/deployments/interfaces/IMarketReportTypes.sol'; -import {AaveV3TokensBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3TokensBatch.sol'; -import {AaveV3PoolBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3PoolBatch.sol'; -import {AaveV3L2PoolBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3L2PoolBatch.sol'; -import {AaveV3GettersBatchOne} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchOne.sol'; -import {AaveV3GettersBatchTwo} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchTwo.sol'; -import {AaveV3PeripheryBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol'; -import {AaveV3ParaswapBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3ParaswapBatch.sol'; -import {AaveV3SetupBatch} from '../src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol'; -import {WETH9} from 'aave-v3-core/contracts/dependencies/weth/WETH9.sol'; -import {AugustusRegistryMock} from './mocks/AugustusRegistryMock.sol'; -import {MockParaSwapFeeClaimer} from 'aave-v3-periphery/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; -import {BatchTestProcedures} from './utils/BatchTestProcedures.sol'; +import '../../src/deployments/interfaces/IMarketReportTypes.sol'; +import {AaveV3TokensBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3TokensBatch.sol'; +import {AaveV3PoolBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3PoolBatch.sol'; +import {AaveV3L2PoolBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3L2PoolBatch.sol'; +import {AaveV3GettersBatchOne} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchOne.sol'; +import {AaveV3GettersBatchTwo} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchTwo.sol'; +import {AaveV3PeripheryBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol'; +import {AaveV3ParaswapBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3ParaswapBatch.sol'; +import {AaveV3SetupBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol'; +import {WETH9} from '../../src/contracts/dependencies/weth/WETH9.sol'; +import {AugustusRegistryMock} from '../mocks/AugustusRegistryMock.sol'; +import {MockParaSwapFeeClaimer} from '../../src/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; +import {SequencerOracle} from '../../src/contracts/mocks/oracle/SequencerOracle.sol'; +import {BatchTestProcedures} from '../utils/BatchTestProcedures.sol'; contract DeploymentsGasLimits is BatchTestProcedures { Roles roles; diff --git a/tests/periphery/ParaswapAdapters.t.sol b/tests/extensions/paraswap-adapters/ParaswapAdapters.t.sol similarity index 95% rename from tests/periphery/ParaswapAdapters.t.sol rename to tests/extensions/paraswap-adapters/ParaswapAdapters.t.sol index 56017b0e..42674e83 100644 --- a/tests/periphery/ParaswapAdapters.t.sol +++ b/tests/extensions/paraswap-adapters/ParaswapAdapters.t.sol @@ -1,22 +1,20 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import 'forge-std/Test.sol'; - -import {ParaSwapLiquiditySwapAdapter, IParaSwapAugustus} from 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol'; -import {ParaSwapRepayAdapter, IParaSwapAugustusRegistry} from 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapRepayAdapter.sol'; -import {ParaSwapWithdrawSwapAdapter} from 'aave-v3-periphery/contracts/adapters/paraswap/ParaSwapWithdrawSwapAdapter.sol'; -import {AaveParaSwapFeeClaimer, IERC20} from 'aave-v3-periphery/contracts/adapters/paraswap/AaveParaSwapFeeClaimer.sol'; -import {BaseParaSwapAdapter} from 'aave-v3-periphery/contracts/adapters/paraswap/BaseParaSwapAdapter.sol'; -import {IPool, DataTypes} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {MockParaSwapAugustus} from 'aave-v3-periphery/contracts/mocks/swap/MockParaSwapAugustus.sol'; -import {MockParaSwapFeeClaimer} from 'aave-v3-periphery/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; -import {MockParaSwapAugustusRegistry} from 'aave-v3-periphery/contracts/mocks/swap/MockParaSwapAugustusRegistry.sol'; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {EIP712SigUtils} from '../utils/EIP712SigUtils.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {ParaSwapLiquiditySwapAdapter, IParaSwapAugustus} from '../../../src/contracts/extensions/paraswap-adapters/ParaSwapLiquiditySwapAdapter.sol'; +import {ParaSwapRepayAdapter, IParaSwapAugustusRegistry} from '../../../src/contracts/extensions/paraswap-adapters/ParaSwapRepayAdapter.sol'; +import {ParaSwapWithdrawSwapAdapter} from '../../../src/contracts/extensions/paraswap-adapters/ParaSwapWithdrawSwapAdapter.sol'; +import {AaveParaSwapFeeClaimer, IERC20} from '../../../src/contracts/extensions/paraswap-adapters/AaveParaSwapFeeClaimer.sol'; +import {BaseParaSwapAdapter} from '../../../src/contracts/extensions/paraswap-adapters/BaseParaSwapAdapter.sol'; +import {IPool, DataTypes} from '../../../src/contracts/interfaces/IPool.sol'; +import {IPoolAddressesProvider} from '../../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {MockParaSwapAugustus} from '../../../src/contracts/mocks/swap/MockParaSwapAugustus.sol'; +import {MockParaSwapFeeClaimer} from '../../../src/contracts/mocks/swap/MockParaSwapFeeClaimer.sol'; +import {MockParaSwapAugustusRegistry} from '../../../src/contracts/mocks/swap/MockParaSwapAugustusRegistry.sol'; +import {IERC20Detailed} from '../../../src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {TestnetERC20} from '../../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {EIP712SigUtils} from '../../utils/EIP712SigUtils.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; contract ParaswapAdaptersTest is TestnetProcedures { MockParaSwapAugustus internal mockParaSwapAugustus; diff --git a/tests/harness/StableDebtToken.sol b/tests/harness/StableDebtToken.sol index c841b9ef..72e42146 100644 --- a/tests/harness/StableDebtToken.sol +++ b/tests/harness/StableDebtToken.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {StableDebtTokenInstance, IPool} from 'aave-v3-core/instances/StableDebtTokenInstance.sol'; +import {StableDebtTokenInstance, IPool} from '../../src/contracts/instances/StableDebtTokenInstance.sol'; contract StableDebtTokenHarness is StableDebtTokenInstance { constructor(IPool pool) StableDebtTokenInstance(pool) {} diff --git a/tests/harness/VariableDebtToken.sol b/tests/harness/VariableDebtToken.sol index 2ca73a61..73815d97 100644 --- a/tests/harness/VariableDebtToken.sol +++ b/tests/harness/VariableDebtToken.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {VariableDebtTokenInstance, IPool} from 'aave-v3-core/instances/VariableDebtTokenInstance.sol'; +import {VariableDebtTokenInstance, IPool} from '../../src/contracts/instances/VariableDebtTokenInstance.sol'; contract VariableDebtTokenHarness is VariableDebtTokenInstance { constructor(IPool pool) VariableDebtTokenInstance(pool) {} diff --git a/tests/periphery/WrappedTokenGateway.t.sol b/tests/helpers/WrappedTokenGateway.t.sol similarity index 95% rename from tests/periphery/WrappedTokenGateway.t.sol rename to tests/helpers/WrappedTokenGateway.t.sol index 4b97b910..9a09ac4c 100644 --- a/tests/periphery/WrappedTokenGateway.t.sol +++ b/tests/helpers/WrappedTokenGateway.t.sol @@ -2,13 +2,13 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {AaveOracle} from 'aave-v3-core/contracts/misc/AaveOracle.sol'; -import {WrappedTokenGatewayV3} from 'aave-v3-periphery/contracts/misc/WrappedTokenGatewayV3.sol'; -import {AaveProtocolDataProvider} from 'aave-v3-core/contracts/misc/AaveProtocolDataProvider.sol'; -import {AToken} from 'aave-v3-core/contracts/protocol/tokenization/AToken.sol'; -import {StableDebtToken} from 'aave-v3-core/contracts/protocol/tokenization/StableDebtToken.sol'; -import {VariableDebtToken} from 'aave-v3-core/contracts/protocol/tokenization/VariableDebtToken.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {AaveOracle} from '../../src/contracts/misc/AaveOracle.sol'; +import {WrappedTokenGatewayV3} from '../../src/contracts/helpers/WrappedTokenGatewayV3.sol'; +import {AaveProtocolDataProvider} from '../../src/contracts/helpers/AaveProtocolDataProvider.sol'; +import {AToken} from '../../src/contracts/protocol/tokenization/AToken.sol'; +import {StableDebtToken} from '../../src/contracts/protocol/tokenization/StableDebtToken.sol'; +import {VariableDebtToken} from '../../src/contracts/protocol/tokenization/VariableDebtToken.sol'; +import {DataTypes} from '../../src/contracts/protocol/libraries/types/DataTypes.sol'; import {EIP712SigUtils} from '../utils/EIP712SigUtils.sol'; import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; diff --git a/tests/core/AaveOracle.t.sol b/tests/misc/AaveOracle.t.sol similarity index 95% rename from tests/core/AaveOracle.t.sol rename to tests/misc/AaveOracle.t.sol index 2bbd361f..3ec7335a 100644 --- a/tests/core/AaveOracle.t.sol +++ b/tests/misc/AaveOracle.t.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {MintableERC20} from 'aave-v3-core/contracts/mocks/tokens/MintableERC20.sol'; -import {MockAggregator} from 'aave-v3-core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; +import {MintableERC20} from '../../src/contracts/mocks/tokens/MintableERC20.sol'; +import {MockAggregator} from '../../src/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {PriceOracle} from 'aave-v3-core/contracts/mocks/oracle/PriceOracle.sol'; +import {Errors} from '../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {PriceOracle} from '../../src/contracts/mocks/oracle/PriceOracle.sol'; contract AaveOracleTest is TestnetProcedures { function setUp() public { diff --git a/tests/core/PriceOracleSentinel.t.sol b/tests/misc/PriceOracleSentinel.t.sol similarity index 89% rename from tests/core/PriceOracleSentinel.t.sol rename to tests/misc/PriceOracleSentinel.t.sol index ae4c0418..2ca5313b 100644 --- a/tests/core/PriceOracleSentinel.t.sol +++ b/tests/misc/PriceOracleSentinel.t.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {PriceOracleSentinel} from 'aave-v3-core/contracts/protocol/configuration/PriceOracleSentinel.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {SequencerOracle, ISequencerOracle} from 'aave-v3-core/contracts/mocks/oracle/SequencerOracle.sol'; +import {Errors} from '../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {PriceOracleSentinel} from '../../src/contracts/misc/PriceOracleSentinel.sol'; +import {IPoolAddressesProvider} from '../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {ACLManager} from '../../src/contracts/protocol/configuration/ACLManager.sol'; +import {SequencerOracle, ISequencerOracle} from '../../src/contracts/mocks/oracle/SequencerOracle.sol'; import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; contract PriceOracleSentinelTest is TestnetProcedures { diff --git a/tests/core/InitializableImmutableAdminUpgradeabilityProxy.t.sol b/tests/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.t.sol similarity index 96% rename from tests/core/InitializableImmutableAdminUpgradeabilityProxy.t.sol rename to tests/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.t.sol index 4740633c..e308ab05 100644 --- a/tests/core/InitializableImmutableAdminUpgradeabilityProxy.t.sol +++ b/tests/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {SlotParser} from '../utils/SlotParser.sol'; -import {MockInitializableImple, MockInitializableImpleV2} from 'aave-v3-core/contracts/mocks/upgradeability/MockInitializableImplementation.sol'; -import 'aave-v3-core/contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; +import {SlotParser} from '../../utils/SlotParser.sol'; +import {MockInitializableImple, MockInitializableImpleV2} from '../../../src/contracts/mocks/upgradeability/MockInitializableImplementation.sol'; +import '../../../src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; contract InitializableImmutableAdminUpgradeabilityProxyTests is Test { using stdStorage for StdStorage; diff --git a/tests/core/RateStrategy.t.sol b/tests/misc/rates/RateStrategy.t.sol similarity index 99% rename from tests/core/RateStrategy.t.sol rename to tests/misc/rates/RateStrategy.t.sol index 9cc3e6bb..844c15ec 100644 --- a/tests/core/RateStrategy.t.sol +++ b/tests/misc/rates/RateStrategy.t.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {DefaultReserveInterestRateStrategyV2, IDefaultInterestRateStrategyV2, PercentageMath, IPoolAddressesProvider} from 'aave-v3-core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {DataTypes} from '../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {WadRayMath} from '../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {DefaultReserveInterestRateStrategyV2, IDefaultInterestRateStrategyV2, PercentageMath, IPoolAddressesProvider} from '../../../src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; contract RateStrategyTests is TestnetProcedures { using WadRayMath for uint256; diff --git a/tests/core/RatesOverflow.t.sol b/tests/misc/rates/RatesOverflow.t.sol similarity index 83% rename from tests/core/RatesOverflow.t.sol rename to tests/misc/rates/RatesOverflow.t.sol index bb99d58f..af12d732 100644 --- a/tests/core/RatesOverflow.t.sol +++ b/tests/misc/rates/RatesOverflow.t.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {MockReserveInterestRateStrategy} from 'aave-v3-core/contracts/mocks/tests/MockReserveInterestRateStrategy.sol'; -import {IPoolConfigurator} from 'aave-v3-core/contracts/interfaces/IPoolConfigurator.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {MockReserveInterestRateStrategy} from '../../../src/contracts/mocks/tests/MockReserveInterestRateStrategy.sol'; +import {IPoolConfigurator} from '../../../src/contracts/interfaces/IPoolConfigurator.sol'; +import {IPoolAddressesProvider} from '../../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; // @dev Ignored from coverage report, due Foundry Coverage can not detect functions if they return 0. contract RatesOverflowCheckTests is TestnetProcedures { diff --git a/tests/core/ZeroInteresRateStrategy.t.sol b/tests/misc/rates/ZeroInteresRateStrategy.t.sol similarity index 86% rename from tests/core/ZeroInteresRateStrategy.t.sol rename to tests/misc/rates/ZeroInteresRateStrategy.t.sol index 0ce57a59..e037f453 100644 --- a/tests/core/ZeroInteresRateStrategy.t.sol +++ b/tests/misc/rates/ZeroInteresRateStrategy.t.sol @@ -3,10 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAToken} from 'aave-v3-core/contracts/protocol/tokenization/AToken.sol'; -import {DefaultReserveInterestRateStrategyV2, DataTypes, IPoolAddressesProvider} from 'aave-v3-core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol'; -import {IDefaultInterestRateStrategyV2} from 'aave-v3-core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IAToken} from '../../../src/contracts/protocol/tokenization/AToken.sol'; +import {DefaultReserveInterestRateStrategyV2, DataTypes, IPoolAddressesProvider, IDefaultInterestRateStrategyV2} from '../../../src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; // @dev Ignored from coverage report, due Foundry Coverage can not detect functions if they return 0. contract ZeroReserveInterestRateStrategyTests is TestnetProcedures { diff --git a/tests/mocks/AaveV3TestListing.sol b/tests/mocks/AaveV3TestListing.sol index 95714b0f..97cc9cce 100644 --- a/tests/mocks/AaveV3TestListing.sol +++ b/tests/mocks/AaveV3TestListing.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import 'aave-v3-periphery/contracts/v3-config-engine/AaveV3Payload.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {MockAggregator} from 'aave-v3-core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; -import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {MarketReport} from 'src/deployments/interfaces/IMarketReportTypes.sol'; +import '../../src/contracts/extensions/v3-config-engine/AaveV3Payload.sol'; +import {TestnetERC20} from '../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {MockAggregator} from '../../src/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; +import {ACLManager} from '../../src/contracts/protocol/configuration/ACLManager.sol'; +import {MarketReport} from '../../src/deployments/interfaces/IMarketReportTypes.sol'; /** * @dev Smart contract for token listing, for testing purposes @@ -156,7 +156,7 @@ contract AaveV3TestListing is AaveV3Payload { } function getPoolContext() public pure override returns (IEngine.PoolContext memory) { - return IEngine.PoolContext({networkName: 'Ethereum Sepolia', networkAbbreviation: 'EthSep'}); + return IEngine.PoolContext({networkName: 'Local', networkAbbreviation: 'Loc'}); } function _postExecute() internal override { diff --git a/tests/mocks/MockFlashLoanATokenReceiver.sol b/tests/mocks/MockFlashLoanATokenReceiver.sol index e9711df5..ae8947ec 100644 --- a/tests/mocks/MockFlashLoanATokenReceiver.sol +++ b/tests/mocks/MockFlashLoanATokenReceiver.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.10; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {FlashLoanSimpleReceiverBase} from 'aave-v3-core/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol'; +import {IERC20} from '../../src/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {IPoolAddressesProvider} from '../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../../src/contracts/interfaces/IPool.sol'; +import {FlashLoanSimpleReceiverBase} from '../../src/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol'; /// @dev Helper contract to test donation attacks not possible in the context of a flash loan contract MockFlashLoanATokenReceiver is FlashLoanSimpleReceiverBase { diff --git a/tests/periphery/mocks/StakeMock.sol b/tests/mocks/StakeMock.sol similarity index 100% rename from tests/periphery/mocks/StakeMock.sol rename to tests/mocks/StakeMock.sol diff --git a/tests/core/ACLManager.t.sol b/tests/protocol/configuration/ACLManager.t.sol similarity index 96% rename from tests/core/ACLManager.t.sol rename to tests/protocol/configuration/ACLManager.t.sol index 373c4ee0..717395d7 100644 --- a/tests/core/ACLManager.t.sol +++ b/tests/protocol/configuration/ACLManager.t.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {PoolAddressesProvider} from 'aave-v3-core/contracts/protocol/configuration/PoolAddressesProvider.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {ACLManager} from '../../../src/contracts/protocol/configuration/ACLManager.sol'; +import {PoolAddressesProvider} from '../../../src/contracts/protocol/configuration/PoolAddressesProvider.sol'; contract ACLManagerTest is TestnetProcedures { address internal immutable deployer; diff --git a/tests/core/AddressesProviderRegistry.t.sol b/tests/protocol/configuration/AddressesProviderRegistry.t.sol similarity index 97% rename from tests/core/AddressesProviderRegistry.t.sol rename to tests/protocol/configuration/AddressesProviderRegistry.t.sol index d1e5bb35..d549d752 100644 --- a/tests/core/AddressesProviderRegistry.t.sol +++ b/tests/protocol/configuration/AddressesProviderRegistry.t.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; contract PoolAddressesProviderRegistryTest is TestnetProcedures { event AddressesProviderRegistered(address indexed addressesProvider, uint256 indexed id); diff --git a/tests/core/PoolAddressesProvider.t.sol b/tests/protocol/configuration/PoolAddressesProvider.t.sol similarity index 95% rename from tests/core/PoolAddressesProvider.t.sol rename to tests/protocol/configuration/PoolAddressesProvider.t.sol index 115219b8..e4003f7c 100644 --- a/tests/core/PoolAddressesProvider.t.sol +++ b/tests/protocol/configuration/PoolAddressesProvider.t.sol @@ -3,14 +3,14 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {PoolAddressesProvider, IPoolAddressesProvider} from 'aave-v3-core/contracts/protocol/configuration/PoolAddressesProvider.sol'; -import {PoolInstance} from 'aave-v3-core/instances/PoolInstance.sol'; -import {MockInitializableV1, MockInitializableV2} from 'aave-v3-core/contracts/mocks/upgradeability/MockInitializableImplementation.sol'; -import {PoolConfiguratorInstance} from 'aave-v3-core/instances/PoolConfiguratorInstance.sol'; -import {MockPoolInherited} from 'aave-v3-core/contracts/mocks/helpers/MockPool.sol'; -import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {SlotParser} from '../utils/SlotParser.sol'; +import {PoolAddressesProvider, IPoolAddressesProvider} from '../../../src/contracts/protocol/configuration/PoolAddressesProvider.sol'; +import {PoolInstance} from '../../../src/contracts/instances/PoolInstance.sol'; +import {MockInitializableV1, MockInitializableV2} from '../../../src/contracts/mocks/upgradeability/MockInitializableImplementation.sol'; +import {PoolConfiguratorInstance} from '../../../src/contracts/instances/PoolConfiguratorInstance.sol'; +import {MockPoolInherited} from '../../../src/contracts/mocks/helpers/MockPool.sol'; +import {ACLManager} from '../../../src/contracts/protocol/configuration/ACLManager.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {SlotParser} from '../../utils/SlotParser.sol'; contract PoolAddressesProviderTests is TestnetProcedures { using stdStorage for StdStorage; diff --git a/tests/core/BridgeLogic.t.sol b/tests/protocol/libraries/logic/BridgeLogic.t.sol similarity index 92% rename from tests/core/BridgeLogic.t.sol rename to tests/protocol/libraries/logic/BridgeLogic.t.sol index db9ddbe5..18660436 100644 --- a/tests/core/BridgeLogic.t.sol +++ b/tests/protocol/libraries/logic/BridgeLogic.t.sol @@ -3,15 +3,15 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {MathUtils} from 'aave-v3-core/contracts/protocol/libraries/math/MathUtils.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {ReserveLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/ReserveLogic.sol'; -import {PercentageMath} from 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import {SafeCast} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {MathUtils} from '../../../../src/contracts/protocol/libraries/math/MathUtils.sol'; +import {WadRayMath} from '../../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {TestnetProcedures} from '../../../utils/TestnetProcedures.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {ReserveLogic} from '../../../../src/contracts/protocol/libraries/logic/ReserveLogic.sol'; +import {PercentageMath} from '../../../../src/contracts/protocol/libraries/math/PercentageMath.sol'; +import {SafeCast} from '../../../../src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol'; +import {IAToken} from '../../../../src/contracts/interfaces/IAToken.sol'; +import {DataTypes} from '../../../../src/contracts/protocol/libraries/types/DataTypes.sol'; contract BridgeLogicTests is TestnetProcedures { using WadRayMath for uint256; diff --git a/tests/core/PoolLogic.initReserves.edge.t.sol b/tests/protocol/libraries/logic/PoolLogic.initReserves.edge.t.sol similarity index 94% rename from tests/core/PoolLogic.initReserves.edge.t.sol rename to tests/protocol/libraries/logic/PoolLogic.initReserves.edge.t.sol index d7b6053c..695d96ee 100644 --- a/tests/core/PoolLogic.initReserves.edge.t.sol +++ b/tests/protocol/libraries/logic/PoolLogic.initReserves.edge.t.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {PoolLogic, ReserveLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/PoolLogic.sol'; -import '../utils/TestnetProcedures.sol'; +import {PoolLogic, ReserveLogic} from '../../../../src/contracts/protocol/libraries/logic/PoolLogic.sol'; +import '../../../utils/TestnetProcedures.sol'; contract Mock { string public constant value = 'MOCK'; diff --git a/tests/core/MathUtils.t.sol b/tests/protocol/libraries/math/MathUtils.t.sol similarity index 88% rename from tests/core/MathUtils.t.sol rename to tests/protocol/libraries/math/MathUtils.t.sol index 8f532c8e..ce27b819 100644 --- a/tests/core/MathUtils.t.sol +++ b/tests/protocol/libraries/math/MathUtils.t.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {MathUtils} from 'aave-v3-core/contracts/protocol/libraries/math/MathUtils.sol'; -import {MathUtilsWrapper} from 'aave-v3-core/contracts/mocks/tests/MathUtilsWrapper.sol'; +import {MathUtils} from '../../../../src/contracts/protocol/libraries/math/MathUtils.sol'; +import {MathUtilsWrapper} from '../../../../src/contracts/mocks/tests/MathUtilsWrapper.sol'; contract MathUtilsTests is Test { MathUtilsWrapper internal w; diff --git a/tests/core/PercentageMath.t.sol b/tests/protocol/libraries/math/PercentageMath.t.sol similarity index 89% rename from tests/core/PercentageMath.t.sol rename to tests/protocol/libraries/math/PercentageMath.t.sol index 1d6abb8c..47f949d2 100644 --- a/tests/core/PercentageMath.t.sol +++ b/tests/protocol/libraries/math/PercentageMath.t.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {PercentageMath} from 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import {PercentageMathWrapper} from 'aave-v3-core/contracts/mocks/tests/PercentageMathWrapper.sol'; +import {PercentageMath} from '../../../../src/contracts/protocol/libraries/math/PercentageMath.sol'; +import {PercentageMathWrapper} from '../../../../src/contracts/mocks/tests/PercentageMathWrapper.sol'; contract PercentageMathTests is Test { PercentageMathWrapper internal w; diff --git a/tests/core/WadRayMath.t.sol b/tests/protocol/libraries/math/WadRayMath.t.sol similarity index 97% rename from tests/core/WadRayMath.t.sol rename to tests/protocol/libraries/math/WadRayMath.t.sol index 7a582e34..baefd867 100644 --- a/tests/core/WadRayMath.t.sol +++ b/tests/protocol/libraries/math/WadRayMath.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {WadRayMathWrapper} from 'aave-v3-core/contracts/mocks/tests/WadRayMathWrapper.sol'; +import {WadRayMathWrapper} from '../../../../src/contracts/mocks/tests/WadRayMathWrapper.sol'; contract WadRayMathTests is Test { WadRayMathWrapper internal w; diff --git a/tests/core/L2Pool.t.sol b/tests/protocol/pool/L2Pool.t.sol similarity index 92% rename from tests/core/L2Pool.t.sol rename to tests/protocol/pool/L2Pool.t.sol index 18f73fd3..88b2e261 100644 --- a/tests/core/L2Pool.t.sol +++ b/tests/protocol/pool/L2Pool.t.sol @@ -3,17 +3,17 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol'; -import {L2Encoder} from 'aave-v3-core/contracts/misc/L2Encoder.sol'; -import {IL2Pool} from 'aave-v3-core/contracts/interfaces/IL2Pool.sol'; -import {IReserveInterestRateStrategy} from 'aave-v3-core/contracts/interfaces/IReserveInterestRateStrategy.sol'; -import {BorrowLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/BorrowLogic.sol'; -import {SupplyLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/SupplyLogic.sol'; -import {LiquidationLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/LiquidationLogic.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IAaveOracle} from '../../../src/contracts/interfaces/IAaveOracle.sol'; +import {L2Encoder} from '../../../src/contracts/helpers/L2Encoder.sol'; +import {IL2Pool} from '../../../src/contracts/interfaces/IL2Pool.sol'; +import {IReserveInterestRateStrategy} from '../../../src/contracts/interfaces/IReserveInterestRateStrategy.sol'; +import {BorrowLogic} from '../../../src/contracts/protocol/libraries/logic/BorrowLogic.sol'; +import {SupplyLogic} from '../../../src/contracts/protocol/libraries/logic/SupplyLogic.sol'; +import {LiquidationLogic} from '../../../src/contracts/protocol/libraries/logic/LiquidationLogic.sol'; +import {TestnetERC20} from '../../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; import {PoolTests, DataTypes, Errors, IERC20, IPool} from './Pool.t.sol'; -import {EIP712SigUtils} from '../utils/EIP712SigUtils.sol'; +import {EIP712SigUtils} from '../../utils/EIP712SigUtils.sol'; /// @dev All Pool.t.sol tests are run as L2Pool via inheriting PoolTests contract L2PoolTests is PoolTests { diff --git a/tests/core/Pool.Borrow.t.sol b/tests/protocol/pool/Pool.Borrow.t.sol similarity index 95% rename from tests/core/Pool.Borrow.t.sol rename to tests/protocol/pool/Pool.Borrow.t.sol index c73a30e8..bddd02e1 100644 --- a/tests/core/Pool.Borrow.t.sol +++ b/tests/protocol/pool/Pool.Borrow.t.sol @@ -3,21 +3,21 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IStableDebtToken} from 'aave-v3-core/contracts/interfaces/IStableDebtToken.sol'; -import {IVariableDebtToken} from 'aave-v3-core/contracts/interfaces/IVariableDebtToken.sol'; -import {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {IReserveInterestRateStrategy} from 'aave-v3-core/contracts/interfaces/IReserveInterestRateStrategy.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {ISequencerOracle} from 'aave-v3-core/contracts/interfaces/ISequencerOracle.sol'; -import {UserConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/UserConfiguration.sol'; -import {PriceOracleSentinel} from 'aave-v3-core/contracts/protocol/configuration/PriceOracleSentinel.sol'; -import {SequencerOracle} from 'aave-v3-core/contracts/mocks/oracle/SequencerOracle.sol'; -import {MockAggregator} from 'aave-v3-core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IStableDebtToken} from '../../../src/contracts/interfaces/IStableDebtToken.sol'; +import {IVariableDebtToken} from '../../../src/contracts/interfaces/IVariableDebtToken.sol'; +import {IAaveOracle} from '../../../src/contracts/interfaces/IAaveOracle.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {IReserveInterestRateStrategy} from '../../../src/contracts/interfaces/IReserveInterestRateStrategy.sol'; +import {IPoolAddressesProvider} from '../../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {ISequencerOracle} from '../../../src/contracts/interfaces/ISequencerOracle.sol'; +import {UserConfiguration} from '../../../src/contracts/protocol/libraries/configuration/UserConfiguration.sol'; +import {PriceOracleSentinel} from '../../../src/contracts/misc/PriceOracleSentinel.sol'; +import {SequencerOracle} from '../../../src/contracts/mocks/oracle/SequencerOracle.sol'; +import {MockAggregator} from '../../../src/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; +import {DataTypes} from '../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {ReserveConfiguration} from '../../../src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; +import {IERC20} from '../../../src/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; contract PoolBorrowTests is TestnetProcedures { using UserConfiguration for DataTypes.UserConfigurationMap; diff --git a/tests/core/Pool.FlashLoans.t.sol b/tests/protocol/pool/Pool.FlashLoans.t.sol similarity index 92% rename from tests/core/Pool.FlashLoans.t.sol rename to tests/protocol/pool/Pool.FlashLoans.t.sol index ea9c2e84..a98392c0 100644 --- a/tests/core/Pool.FlashLoans.t.sol +++ b/tests/protocol/pool/Pool.FlashLoans.t.sol @@ -3,20 +3,20 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {FlashLoanLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/FlashLoanLogic.sol'; -import {BorrowLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/BorrowLogic.sol'; -import {PercentageMath} from 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import {MockFlashLoanReceiver} from 'aave-v3-core/contracts/mocks/flashloan/MockFlashLoanReceiver.sol'; -import {MockFlashLoanSimpleReceiver} from 'aave-v3-core/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {MockFlashLoanATokenReceiver} from '../mocks/MockFlashLoanATokenReceiver.sol'; -import {TestnetProcedures, TestReserveConfig} from '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetERC20} from '../../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {ReserveConfiguration} from '../../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {WadRayMath} from '../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {FlashLoanLogic} from '../../../src/contracts/protocol/libraries/logic/FlashLoanLogic.sol'; +import {BorrowLogic} from '../../../src/contracts/protocol/libraries/logic/BorrowLogic.sol'; +import {PercentageMath} from '../../../src/contracts/protocol/libraries/math/PercentageMath.sol'; +import {MockFlashLoanReceiver} from '../../../src/contracts/mocks/flashloan/MockFlashLoanReceiver.sol'; +import {MockFlashLoanSimpleReceiver} from '../../../src/contracts/mocks/flashloan/MockSimpleFlashLoanReceiver.sol'; +import {IPoolAddressesProvider} from '../../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {DataTypes} from '../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {IERC20} from '../../../src/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {MockFlashLoanATokenReceiver} from '../../mocks/MockFlashLoanATokenReceiver.sol'; +import {TestnetProcedures, TestReserveConfig} from '../../utils/TestnetProcedures.sol'; contract PoolFlashLoansTests is TestnetProcedures { using ReserveConfiguration for DataTypes.ReserveConfigurationMap; diff --git a/tests/core/Pool.Liquidations.t.sol b/tests/protocol/pool/Pool.Liquidations.t.sol similarity index 96% rename from tests/core/Pool.Liquidations.t.sol rename to tests/protocol/pool/Pool.Liquidations.t.sol index 12c332da..f8466f23 100644 --- a/tests/core/Pool.Liquidations.t.sol +++ b/tests/protocol/pool/Pool.Liquidations.t.sol @@ -3,23 +3,23 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IStableDebtToken} from 'aave-v3-core/contracts/interfaces/IStableDebtToken.sol'; -import {IVariableDebtToken} from 'aave-v3-core/contracts/interfaces/IVariableDebtToken.sol'; -import {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {UserConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/UserConfiguration.sol'; -import {ReserveLogic, IERC20} from 'aave-v3-core/contracts/protocol/libraries/logic/ReserveLogic.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; -import {PriceOracleSentinel} from 'aave-v3-core/contracts/protocol/configuration/PriceOracleSentinel.sol'; -import {SequencerOracle, ISequencerOracle} from 'aave-v3-core/contracts/mocks/oracle/SequencerOracle.sol'; -import {MockAggregator} from 'aave-v3-core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; -import {LiquidationLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/LiquidationLogic.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {PercentageMath} from 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IStableDebtToken} from '../../../src/contracts/interfaces/IStableDebtToken.sol'; +import {IVariableDebtToken} from '../../../src/contracts/interfaces/IVariableDebtToken.sol'; +import {IAaveOracle} from '../../../src/contracts/interfaces/IAaveOracle.sol'; +import {IPoolAddressesProvider} from '../../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IAToken} from '../../../src/contracts/interfaces/IAToken.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {UserConfiguration} from '../../../src/contracts/protocol/libraries/configuration/UserConfiguration.sol'; +import {ReserveLogic, IERC20} from '../../../src/contracts/protocol/libraries/logic/ReserveLogic.sol'; +import {ReserveConfiguration} from '../../../src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; +import {PriceOracleSentinel} from '../../../src/contracts/misc/PriceOracleSentinel.sol'; +import {SequencerOracle, ISequencerOracle} from '../../../src/contracts/mocks/oracle/SequencerOracle.sol'; +import {MockAggregator} from '../../../src/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; +import {LiquidationLogic} from '../../../src/contracts/protocol/libraries/logic/LiquidationLogic.sol'; +import {DataTypes} from '../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {PercentageMath} from '../../../src/contracts/protocol/libraries/math/PercentageMath.sol'; +import {WadRayMath} from '../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; contract PoolLiquidationTests is TestnetProcedures { using stdStorage for StdStorage; diff --git a/tests/core/Pool.Repay.t.sol b/tests/protocol/pool/Pool.Repay.t.sol similarity index 95% rename from tests/core/Pool.Repay.t.sol rename to tests/protocol/pool/Pool.Repay.t.sol index 25530d81..79eb415a 100644 --- a/tests/core/Pool.Repay.t.sol +++ b/tests/protocol/pool/Pool.Repay.t.sol @@ -3,19 +3,19 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IStableDebtToken} from 'aave-v3-core/contracts/interfaces/IStableDebtToken.sol'; -import {IVariableDebtToken} from 'aave-v3-core/contracts/interfaces/IVariableDebtToken.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {ISequencerOracle} from 'aave-v3-core/contracts/interfaces/ISequencerOracle.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {UserConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/UserConfiguration.sol'; -import {PriceOracleSentinel} from 'aave-v3-core/contracts/protocol/configuration/PriceOracleSentinel.sol'; -import {SequencerOracle} from 'aave-v3-core/contracts/mocks/oracle/SequencerOracle.sol'; -import {BorrowLogic, IERC20} from 'aave-v3-core/contracts/protocol/libraries/logic/BorrowLogic.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {EIP712SigUtils} from '../utils/EIP712SigUtils.sol'; +import {IStableDebtToken} from '../../../src/contracts/interfaces/IStableDebtToken.sol'; +import {IVariableDebtToken} from '../../../src/contracts/interfaces/IVariableDebtToken.sol'; +import {IPoolAddressesProvider} from '../../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {ISequencerOracle} from '../../../src/contracts/interfaces/ISequencerOracle.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetERC20} from '../../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {UserConfiguration} from '../../../src/contracts/protocol/libraries/configuration/UserConfiguration.sol'; +import {PriceOracleSentinel} from '../../../src/contracts/misc/PriceOracleSentinel.sol'; +import {SequencerOracle} from '../../../src/contracts/mocks/oracle/SequencerOracle.sol'; +import {BorrowLogic, IERC20} from '../../../src/contracts/protocol/libraries/logic/BorrowLogic.sol'; +import {DataTypes} from '../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {EIP712SigUtils} from '../../utils/EIP712SigUtils.sol'; contract PoolRepayTests is TestnetProcedures { using UserConfiguration for DataTypes.UserConfigurationMap; diff --git a/tests/core/Pool.Supply.t.sol b/tests/protocol/pool/Pool.Supply.t.sol similarity index 95% rename from tests/core/Pool.Supply.t.sol rename to tests/protocol/pool/Pool.Supply.t.sol index 507c4da9..12cc4135 100644 --- a/tests/core/Pool.Supply.t.sol +++ b/tests/protocol/pool/Pool.Supply.t.sol @@ -3,12 +3,12 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {IAToken, IERC20} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {TestnetERC20, IERC20WithPermit} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {EIP712SigUtils} from '../utils/EIP712SigUtils.sol'; +import {IPool} from '../../../src/contracts/interfaces/IPool.sol'; +import {IAToken, IERC20} from '../../../src/contracts/interfaces/IAToken.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetERC20, IERC20WithPermit} from '../../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {EIP712SigUtils} from '../../utils/EIP712SigUtils.sol'; contract PoolSupplyTests is TestnetProcedures { IPool internal pool; diff --git a/tests/core/Pool.Withdraw.t.sol b/tests/protocol/pool/Pool.Withdraw.t.sol similarity index 97% rename from tests/core/Pool.Withdraw.t.sol rename to tests/protocol/pool/Pool.Withdraw.t.sol index bb5fc57f..05598338 100644 --- a/tests/core/Pool.Withdraw.t.sol +++ b/tests/protocol/pool/Pool.Withdraw.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAToken, IERC20} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IAToken, IERC20} from '../../../src/contracts/interfaces/IAToken.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; contract PoolWithdrawTests is TestnetProcedures { address internal aUSDX; diff --git a/tests/core/Pool.t.sol b/tests/protocol/pool/Pool.t.sol similarity index 97% rename from tests/core/Pool.t.sol rename to tests/protocol/pool/Pool.t.sol index 7ae63020..65aae648 100644 --- a/tests/core/Pool.t.sol +++ b/tests/protocol/pool/Pool.t.sol @@ -4,15 +4,15 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; import 'forge-std/StdStorage.sol'; -import {IAToken, IERC20} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {IPool, DataTypes} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {PoolInstance} from 'aave-v3-core/instances/PoolInstance.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IAToken, IERC20} from '../../../src/contracts/interfaces/IAToken.sol'; +import {IPool, DataTypes} from '../../../src/contracts/interfaces/IPool.sol'; +import {IPoolAddressesProvider} from '../../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {PoolInstance} from '../../../src/contracts/instances/PoolInstance.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {ReserveConfiguration} from '../../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {WadRayMath} from '../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {IAaveOracle} from '../../../src/contracts/interfaces/IAaveOracle.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; contract PoolTests is TestnetProcedures { using stdStorage for StdStorage; diff --git a/tests/core/PoolConfigurator.ACLModifiers.t.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.ACLModifiers.t.sol similarity index 97% rename from tests/core/PoolConfigurator.ACLModifiers.t.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.ACLModifiers.t.sol index 0301d7ab..dc351d2f 100644 --- a/tests/core/PoolConfigurator.ACLModifiers.t.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.ACLModifiers.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {ConfiguratorInputTypes} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {TestnetProcedures, TestVars} from '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {ConfiguratorInputTypes} from '../../../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {TestnetProcedures, TestVars} from '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorACLModifiersTest is TestnetProcedures { function setUp() public { @@ -249,7 +249,6 @@ contract PoolConfiguratorACLModifiersTest is TestnetProcedures { !contracts.aclManager.isRiskAdmin(caller) && caller != address(contracts.poolAddressesProvider) ); - vm.expectRevert(bytes(Errors.CALLER_NOT_RISK_OR_POOL_ADMIN)); vm.prank(caller); @@ -295,7 +294,6 @@ contract PoolConfiguratorACLModifiersTest is TestnetProcedures { ); vm.prank(caller); - vm.expectRevert(bytes(Errors.CALLER_NOT_POOL_OR_EMERGENCY_ADMIN)); contracts.poolConfiguratorProxy.setReservePause(asset, paused, gracePeriod); } diff --git a/tests/core/PoolConfigurator.borrowCaps.t.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.borrowCaps.t.sol similarity index 93% rename from tests/core/PoolConfigurator.borrowCaps.t.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.borrowCaps.t.sol index 6f347905..07728b7a 100644 --- a/tests/core/PoolConfigurator.borrowCaps.t.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.borrowCaps.t.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {IERC20} from '../../../../src/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {DataTypes} from '../../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {TestnetProcedures} from '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorBorrowCapTests is TestnetProcedures { address internal aUSDX; diff --git a/tests/core/PoolConfigurator.eMode.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.eMode.sol similarity index 96% rename from tests/core/PoolConfigurator.eMode.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.eMode.sol index 25351978..4a156738 100644 --- a/tests/core/PoolConfigurator.eMode.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.eMode.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {PercentageMath} from 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import {ReserveConfiguration, DataTypes} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {PercentageMath} from '../../../../src/contracts/protocol/libraries/math/PercentageMath.sol'; +import {ReserveConfiguration, DataTypes} from '../../../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {TestnetProcedures} from '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorEModeConfigTests is TestnetProcedures { using PercentageMath for uint256; diff --git a/tests/core/PoolConfigurator.initReserves.t.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.initReserves.t.sol similarity index 91% rename from tests/core/PoolConfigurator.initReserves.t.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.initReserves.t.sol index 3ce9b98b..24a16c0e 100644 --- a/tests/core/PoolConfigurator.initReserves.t.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.initReserves.t.sol @@ -3,12 +3,12 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {AToken} from 'aave-v3-core/contracts/protocol/tokenization/AToken.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {ConfiguratorInputTypes} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {IDefaultInterestRateStrategyV2} from 'aave-v3-core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol'; -import {TestnetProcedures, TestVars, TestReserveConfig} from '../utils/TestnetProcedures.sol'; +import {AToken} from '../../../../src/contracts/protocol/tokenization/AToken.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetERC20} from '../../../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {ConfiguratorInputTypes} from '../../../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {IDefaultInterestRateStrategyV2} from '../../../../src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol'; +import {TestnetProcedures, TestVars, TestReserveConfig} from '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorInitReservesTest is TestnetProcedures { event ReserveInitialized( @@ -25,6 +25,7 @@ contract PoolConfiguratorInitReservesTest is TestnetProcedures { function test_initReserves_validNumberOfAssets(TestVars[128] memory t, uint8 length) public { vm.assume(length > 0 && length < 128); + uint256 previousListedAssets = contracts.poolProxy.getReservesList().length; uint256 maxListings = contracts.poolProxy.MAX_NUMBER_RESERVES() - previousListedAssets + 1; vm.assume(length < maxListings); diff --git a/tests/core/PoolConfigurator.liquidationFee.t.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.liquidationFee.t.sol similarity index 94% rename from tests/core/PoolConfigurator.liquidationFee.t.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.liquidationFee.t.sol index d509d49d..628485bb 100644 --- a/tests/core/PoolConfigurator.liquidationFee.t.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.liquidationFee.t.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorLiquidationFeeTests is TestnetProcedures { address internal aUSDX; diff --git a/tests/core/PoolConfigurator.pendingLTV.t.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.pendingLTV.t.sol similarity index 92% rename from tests/core/PoolConfigurator.pendingLTV.t.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.pendingLTV.t.sol index 5c3582cf..b15d5d01 100644 --- a/tests/core/PoolConfigurator.pendingLTV.t.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.pendingLTV.t.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {IERC20} from '../../../../src/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {DataTypes} from '../../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {TestnetProcedures} from '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorPendingLtvTests is TestnetProcedures { function setUp() public { diff --git a/tests/core/PoolConfigurator.reserveRiskConfig.t.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.reserveRiskConfig.t.sol similarity index 99% rename from tests/core/PoolConfigurator.reserveRiskConfig.t.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.reserveRiskConfig.t.sol index fb254ccf..ab2c00cf 100644 --- a/tests/core/PoolConfigurator.reserveRiskConfig.t.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.reserveRiskConfig.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {ReserveLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/ReserveLogic.sol'; -import '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {ReserveLogic} from '../../../../src/contracts/protocol/libraries/logic/ReserveLogic.sol'; +import '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorReserveRiskConfigs is TestnetProcedures { using ReserveConfiguration for DataTypes.ReserveConfigurationMap; diff --git a/tests/core/PoolConfigurator.supplyCaps.t.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.supplyCaps.t.sol similarity index 94% rename from tests/core/PoolConfigurator.supplyCaps.t.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.supplyCaps.t.sol index a1f7c01f..151d29fe 100644 --- a/tests/core/PoolConfigurator.supplyCaps.t.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.supplyCaps.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {IERC20} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {IERC20} from '../../../../src/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; +import {TestnetProcedures} from '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorSupplyCapTests is TestnetProcedures { address internal aUSDX; diff --git a/tests/core/PoolConfigurator.upgradeabilty.t.sol b/tests/protocol/pool/pool-configurator/PoolConfigurator.upgradeabilty.t.sol similarity index 81% rename from tests/core/PoolConfigurator.upgradeabilty.t.sol rename to tests/protocol/pool/pool-configurator/PoolConfigurator.upgradeabilty.t.sol index 2c84f556..586971d9 100644 --- a/tests/core/PoolConfigurator.upgradeabilty.t.sol +++ b/tests/protocol/pool/pool-configurator/PoolConfigurator.upgradeabilty.t.sol @@ -3,18 +3,18 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {AToken} from 'aave-v3-core/contracts/protocol/tokenization/AToken.sol'; -import {VariableDebtToken} from 'aave-v3-core/contracts/protocol/tokenization/VariableDebtToken.sol'; -import {StableDebtToken} from 'aave-v3-core/contracts/protocol/tokenization/StableDebtToken.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {ConfiguratorInputTypes, IPool, IPoolAddressesProvider} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {MockATokenRepayment} from 'aave-v3-core/contracts/mocks/tokens/MockATokenRepayment.sol'; -import {MockVariableDebtToken, MockStableDebtToken} from 'aave-v3-core/contracts/mocks/tokens/MockDebtTokens.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {ReserveLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/ReserveLogic.sol'; - -import {SlotParser} from '../utils/SlotParser.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {AToken} from '../../../../src/contracts/protocol/tokenization/AToken.sol'; +import {VariableDebtToken} from '../../../../src/contracts/protocol/tokenization/VariableDebtToken.sol'; +import {StableDebtToken} from '../../../../src/contracts/protocol/tokenization/StableDebtToken.sol'; +import {Errors} from '../../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {ConfiguratorInputTypes, IPool, IPoolAddressesProvider} from '../../../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {MockATokenRepayment} from '../../../../src/contracts/mocks/tokens/MockATokenRepayment.sol'; +import {MockVariableDebtToken, MockStableDebtToken} from '../../../../src/contracts/mocks/tokens/MockDebtTokens.sol'; +import {DataTypes} from '../../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {ReserveLogic} from '../../../../src/contracts/protocol/libraries/logic/ReserveLogic.sol'; + +import {SlotParser} from '../../../utils/SlotParser.sol'; +import {TestnetProcedures} from '../../../utils/TestnetProcedures.sol'; contract PoolConfiguratorUpgradeabilityTests is TestnetProcedures { using stdStorage for StdStorage; @@ -31,6 +31,8 @@ contract PoolConfiguratorUpgradeabilityTests is TestnetProcedures { address newStrategy ); + event ReserveInterestRateDataChanged(address indexed asset, address indexed strategy, bytes data); + event ATokenUpgraded( address indexed asset, address indexed proxy, @@ -85,6 +87,32 @@ contract PoolConfiguratorUpgradeabilityTests is TestnetProcedures { assertEq(newInterestRateStrategy, updatedInterestsRateStrategy); } + function test_setReserveInterestRateData() public { + address currentInterestRateStrategy = contracts + .protocolDataProvider + .getInterestRateStrategyAddress(tokenList.usdx); + + bytes memory newInterestRateData = _getDefaultInterestRatesStrategyData(); + + vm.expectEmit(address(contracts.poolConfiguratorProxy)); + emit ReserveInterestRateDataChanged( + tokenList.usdx, + currentInterestRateStrategy, + newInterestRateData + ); + + vm.prank(poolAdmin); + contracts.poolConfiguratorProxy.setReserveInterestRateData( + tokenList.usdx, + _getDefaultInterestRatesStrategyData() + ); + + address newInterestRateStrategy = contracts.protocolDataProvider.getInterestRateStrategyAddress( + tokenList.usdx + ); + assertEq(currentInterestRateStrategy, newInterestRateStrategy); + } + function test_interestRateStrategy_update() public { vm.prank(carol); contracts.poolProxy.supply(tokenList.usdx, 100_000e6, carol, 0); diff --git a/tests/core/ATokenEdgeCases.t.sol b/tests/protocol/tokenization/ATokenEdgeCases.t.sol similarity index 95% rename from tests/core/ATokenEdgeCases.t.sol rename to tests/protocol/tokenization/ATokenEdgeCases.t.sol index ddce0cac..247ed6fd 100644 --- a/tests/core/ATokenEdgeCases.t.sol +++ b/tests/protocol/tokenization/ATokenEdgeCases.t.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {ATokenInstance} from 'aave-v3-core/instances/ATokenInstance.sol'; -import {IAaveIncentivesController} from 'aave-v3-core/contracts/interfaces/IAaveIncentivesController.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; +import {ATokenInstance} from '../../../src/contracts/instances/ATokenInstance.sol'; +import {IAaveIncentivesController} from '../../../src/contracts/interfaces/IAaveIncentivesController.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; contract ATokenEdgeCasesTests is TestnetProcedures { ATokenInstance public aToken; diff --git a/tests/core/ATokenEvents.t.sol b/tests/protocol/tokenization/ATokenEvents.t.sol similarity index 96% rename from tests/core/ATokenEvents.t.sol rename to tests/protocol/tokenization/ATokenEvents.t.sol index 6911d439..9ba61ceb 100644 --- a/tests/core/ATokenEvents.t.sol +++ b/tests/protocol/tokenization/ATokenEvents.t.sol @@ -3,12 +3,12 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {ReserveLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/ReserveLogic.sol'; -import {MathUtils} from 'aave-v3-core/contracts/protocol/libraries/math/MathUtils.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; +import {IAToken} from '../../../src/contracts/interfaces/IAToken.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {ReserveLogic} from '../../../src/contracts/protocol/libraries/logic/ReserveLogic.sol'; +import {MathUtils} from '../../../src/contracts/protocol/libraries/math/MathUtils.sol'; +import {WadRayMath} from '../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {DataTypes} from '../../../src/contracts/protocol/libraries/types/DataTypes.sol'; contract ATokenEventsTests is TestnetProcedures { using WadRayMath for uint256; diff --git a/tests/core/ATokenModifiers.t.sol b/tests/protocol/tokenization/ATokenModifiers.t.sol similarity index 85% rename from tests/core/ATokenModifiers.t.sol rename to tests/protocol/tokenization/ATokenModifiers.t.sol index e29cb4dc..b29988bb 100644 --- a/tests/core/ATokenModifiers.t.sol +++ b/tests/protocol/tokenization/ATokenModifiers.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; +import {IAToken} from '../../../src/contracts/interfaces/IAToken.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; contract ATokenModifiersTests is TestnetProcedures { IAToken public aToken; diff --git a/tests/core/ATokenPermit.t.sol b/tests/protocol/tokenization/ATokenPermit.t.sol similarity index 96% rename from tests/core/ATokenPermit.t.sol rename to tests/protocol/tokenization/ATokenPermit.t.sol index e7d90084..a1f708e4 100644 --- a/tests/core/ATokenPermit.t.sol +++ b/tests/protocol/tokenization/ATokenPermit.t.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; -import {EIP712SigUtils} from '../utils/EIP712SigUtils.sol'; +import {IAToken} from '../../../src/contracts/interfaces/IAToken.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; +import {EIP712SigUtils} from '../../utils/EIP712SigUtils.sol'; interface IATokenWithMetadata is IAToken { function name() external view returns (string memory); diff --git a/tests/core/ATokenRepay.t.sol b/tests/protocol/tokenization/ATokenRepay.t.sol similarity index 91% rename from tests/core/ATokenRepay.t.sol rename to tests/protocol/tokenization/ATokenRepay.t.sol index eb650f78..1aee8136 100644 --- a/tests/core/ATokenRepay.t.sol +++ b/tests/protocol/tokenization/ATokenRepay.t.sol @@ -3,10 +3,10 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {IVariableDebtToken} from 'aave-v3-core/contracts/interfaces/IVariableDebtToken.sol'; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IAToken} from '../../../src/contracts/interfaces/IAToken.sol'; +import {IVariableDebtToken} from '../../../src/contracts/interfaces/IVariableDebtToken.sol'; +import {IERC20Detailed} from '../../../src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; interface IVariableDebtTokenWithERC20 is IVariableDebtToken, IERC20Detailed {} diff --git a/tests/core/ATokenRescueTokens.sol b/tests/protocol/tokenization/ATokenRescueTokens.sol similarity index 90% rename from tests/core/ATokenRescueTokens.sol rename to tests/protocol/tokenization/ATokenRescueTokens.sol index 19592b12..870b3f9f 100644 --- a/tests/core/ATokenRescueTokens.sol +++ b/tests/protocol/tokenization/ATokenRescueTokens.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAToken} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IAToken} from '../../../src/contracts/interfaces/IAToken.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; contract ATokenRescueTokensTests is TestnetProcedures { IAToken public aTokenUSDX; diff --git a/tests/core/ATokenTransfers.t.sol b/tests/protocol/tokenization/ATokenTransfers.t.sol similarity index 95% rename from tests/core/ATokenTransfers.t.sol rename to tests/protocol/tokenization/ATokenTransfers.t.sol index dbf49542..1304da8b 100644 --- a/tests/core/ATokenTransfers.t.sol +++ b/tests/protocol/tokenization/ATokenTransfers.t.sol @@ -3,14 +3,14 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {IAToken, IERC20} from 'aave-v3-core/contracts/interfaces/IAToken.sol'; -import {IVariableDebtToken} from 'aave-v3-core/contracts/interfaces/IVariableDebtToken.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {SupplyLogic} from 'aave-v3-core/contracts/protocol/libraries/logic/SupplyLogic.sol'; -import {MathUtils} from 'aave-v3-core/contracts/protocol/libraries/math/MathUtils.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; +import {IAToken, IERC20} from '../../../src/contracts/interfaces/IAToken.sol'; +import {IVariableDebtToken} from '../../../src/contracts/interfaces/IVariableDebtToken.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {SupplyLogic} from '../../../src/contracts/protocol/libraries/logic/SupplyLogic.sol'; +import {MathUtils} from '../../../src/contracts/protocol/libraries/math/MathUtils.sol'; +import {WadRayMath} from '../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {DataTypes} from '../../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {TestnetProcedures} from '../../utils/TestnetProcedures.sol'; contract ATokenTransferTests is TestnetProcedures { using WadRayMath for uint256; diff --git a/tests/core/ScaledBalanceTokenBase.t.sol b/tests/protocol/tokenization/ScaledBalanceTokenBase.t.sol similarity index 94% rename from tests/core/ScaledBalanceTokenBase.t.sol rename to tests/protocol/tokenization/ScaledBalanceTokenBase.t.sol index aab5cfc5..cff2dd15 100644 --- a/tests/core/ScaledBalanceTokenBase.t.sol +++ b/tests/protocol/tokenization/ScaledBalanceTokenBase.t.sol @@ -1,10 +1,9 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {MockScaledToken} from 'aave-v3-core/contracts/mocks/tokens/MockScaledToken.sol'; - -import '../utils/TestnetProcedures.sol'; +import {WadRayMath} from '../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {MockScaledToken} from '../../../src/contracts/mocks/tokens/MockScaledToken.sol'; +import '../../utils/TestnetProcedures.sol'; contract ScaledBalanceTokenBaseEdgeTests is TestnetProcedures { using WadRayMath for uint256; diff --git a/tests/core/StableDebtToken.t.sol b/tests/protocol/tokenization/StableDebtToken.t.sol similarity index 95% rename from tests/core/StableDebtToken.t.sol rename to tests/protocol/tokenization/StableDebtToken.t.sol index 2b513554..f2461065 100644 --- a/tests/core/StableDebtToken.t.sol +++ b/tests/protocol/tokenization/StableDebtToken.t.sol @@ -3,13 +3,13 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {StableDebtTokenInstance} from 'aave-v3-core/instances/StableDebtTokenInstance.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {IAaveIncentivesController} from 'aave-v3-core/contracts/interfaces/IAaveIncentivesController.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {PoolConfigurator, ConfiguratorInputTypes, IPool} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {EIP712SigUtils} from '../utils/EIP712SigUtils.sol'; -import {TestnetProcedures, TestVars} from '../utils/TestnetProcedures.sol'; +import {StableDebtTokenHarness as StableDebtTokenInstance} from '../../harness/StableDebtToken.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {IAaveIncentivesController} from '../../../src/contracts/interfaces/IAaveIncentivesController.sol'; +import {TestnetERC20} from '../../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {PoolConfigurator, ConfiguratorInputTypes, IPool} from '../../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {EIP712SigUtils} from '../../utils/EIP712SigUtils.sol'; +import {TestnetProcedures, TestVars} from '../../utils/TestnetProcedures.sol'; contract StableDebtTokenEventsTests is TestnetProcedures { StableDebtTokenInstance public stableDebtToken; diff --git a/tests/core/VariableDebtToken.t.sol b/tests/protocol/tokenization/VariableDebtToken.t.sol similarity index 96% rename from tests/core/VariableDebtToken.t.sol rename to tests/protocol/tokenization/VariableDebtToken.t.sol index db98c01b..5124f253 100644 --- a/tests/core/VariableDebtToken.t.sol +++ b/tests/protocol/tokenization/VariableDebtToken.t.sol @@ -3,15 +3,15 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {VariableDebtTokenInstance} from 'aave-v3-core/instances/VariableDebtTokenInstance.sol'; -import {IAaveIncentivesController} from 'aave-v3-core/contracts/interfaces/IAaveIncentivesController.sol'; -import {Errors} from 'aave-v3-core/contracts/protocol/libraries/helpers/Errors.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {ReserveLogic, DataTypes} from 'aave-v3-core/contracts/protocol/libraries/logic/ReserveLogic.sol'; -import {WadRayMath} from 'aave-v3-core/contracts/protocol/libraries/math/WadRayMath.sol'; -import {ConfiguratorInputTypes, IPool} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {EIP712SigUtils} from '../utils/EIP712SigUtils.sol'; -import {TestnetProcedures, TestVars} from '../utils/TestnetProcedures.sol'; +import {VariableDebtTokenHarness as VariableDebtTokenInstance} from '../../harness/VariableDebtToken.sol'; +import {IAaveIncentivesController} from '../../../src/contracts/interfaces/IAaveIncentivesController.sol'; +import {Errors} from '../../../src/contracts/protocol/libraries/helpers/Errors.sol'; +import {TestnetERC20} from '../../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {ReserveLogic, DataTypes} from '../../../src/contracts/protocol/libraries/logic/ReserveLogic.sol'; +import {WadRayMath} from '../../../src/contracts/protocol/libraries/math/WadRayMath.sol'; +import {ConfiguratorInputTypes, IPool} from '../../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {EIP712SigUtils} from '../../utils/EIP712SigUtils.sol'; +import {TestnetProcedures, TestVars} from '../../utils/TestnetProcedures.sol'; contract VariableDebtTokenEventsTests is TestnetProcedures { using WadRayMath for uint256; diff --git a/tests/periphery/EmissionsManager.t.sol b/tests/rewards/EmissionsManager.t.sol similarity index 76% rename from tests/periphery/EmissionsManager.t.sol rename to tests/rewards/EmissionsManager.t.sol index 2ebc7afd..9c157af1 100644 --- a/tests/periphery/EmissionsManager.t.sol +++ b/tests/rewards/EmissionsManager.t.sol @@ -1,16 +1,15 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import 'forge-std/Test.sol'; -import {MockAggregator} from 'aave-v3-core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; -import {RewardsController} from 'aave-v3-periphery/contracts/rewards/RewardsController.sol'; -import {EmissionManager} from 'aave-v3-periphery/contracts/rewards/EmissionManager.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {ITransferStrategyBase} from 'aave-v3-periphery/contracts/rewards/interfaces/ITransferStrategyBase.sol'; -import {IEACAggregatorProxy} from 'aave-v3-periphery/contracts/misc/interfaces/IEACAggregatorProxy.sol'; -import {RewardsDataTypes} from 'aave-v3-periphery/contracts/rewards/libraries/RewardsDataTypes.sol'; -import {PullRewardsTransferStrategy} from 'aave-v3-periphery/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol'; +import {MockAggregator} from '../../src/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; +import {RewardsController} from '../../src/contracts/rewards/RewardsController.sol'; +import {EmissionManager} from '../../src/contracts/rewards/EmissionManager.sol'; +import {DataTypes} from '../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {IPool} from '../../src/contracts/interfaces/IPool.sol'; +import {ITransferStrategyBase} from '../../src/contracts/rewards/interfaces/ITransferStrategyBase.sol'; +import {IEACAggregatorProxy} from '../../src/contracts/helpers/interfaces/IEACAggregatorProxy.sol'; +import {RewardsDataTypes} from '../../src/contracts/rewards/libraries/RewardsDataTypes.sol'; +import {PullRewardsTransferStrategy} from '../../src/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol'; import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; contract EmissionManagerTest is TestnetProcedures { diff --git a/tests/periphery/RewardsController.t.sol b/tests/rewards/RewardsController.t.sol similarity index 94% rename from tests/periphery/RewardsController.t.sol rename to tests/rewards/RewardsController.t.sol index 38dae8cd..26d206ef 100644 --- a/tests/periphery/RewardsController.t.sol +++ b/tests/rewards/RewardsController.t.sol @@ -1,16 +1,15 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import 'forge-std/Test.sol'; -import {MockAggregator} from 'aave-v3-core/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; -import {RewardsController, RewardsDistributor} from 'aave-v3-periphery/contracts/rewards/RewardsController.sol'; -import {EmissionManager} from 'aave-v3-periphery/contracts/rewards/EmissionManager.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {IAToken, IERC20} from 'aave-v3-core/contracts/protocol/tokenization/AToken.sol'; -import {ITransferStrategyBase} from 'aave-v3-periphery/contracts/rewards/interfaces/ITransferStrategyBase.sol'; -import {IEACAggregatorProxy} from 'aave-v3-periphery/contracts/misc/interfaces/IEACAggregatorProxy.sol'; -import {RewardsDataTypes} from 'aave-v3-periphery/contracts/rewards/libraries/RewardsDataTypes.sol'; -import {PullRewardsTransferStrategy} from 'aave-v3-periphery/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol'; +import {MockAggregator} from '../../src/contracts/mocks/oracle/CLAggregators/MockAggregator.sol'; +import {RewardsController, RewardsDistributor} from '../../src/contracts/rewards/RewardsController.sol'; +import {EmissionManager} from '../../src/contracts/rewards/EmissionManager.sol'; +import {DataTypes} from '../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {IAToken, IERC20} from '../../src/contracts/protocol/tokenization/AToken.sol'; +import {ITransferStrategyBase} from '../../src/contracts/rewards/interfaces/ITransferStrategyBase.sol'; +import {IEACAggregatorProxy} from '../../src/contracts/helpers/interfaces/IEACAggregatorProxy.sol'; +import {RewardsDataTypes} from '../../src/contracts/rewards/libraries/RewardsDataTypes.sol'; +import {PullRewardsTransferStrategy} from '../../src/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol'; import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; contract RewardsControllerTest is TestnetProcedures { diff --git a/tests/periphery/StakedTokenTransferStrategy.t.sol b/tests/rewards/StakedTokenTransferStrategy.t.sol similarity index 94% rename from tests/periphery/StakedTokenTransferStrategy.t.sol rename to tests/rewards/StakedTokenTransferStrategy.t.sol index cbb78767..1c3b2775 100644 --- a/tests/periphery/StakedTokenTransferStrategy.t.sol +++ b/tests/rewards/StakedTokenTransferStrategy.t.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {StakedTokenTransferStrategy, IERC20, IStakedToken} from 'aave-v3-periphery/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol'; -import {StakeMock} from './mocks/StakeMock.sol'; +import {StakedTokenTransferStrategy, IERC20, IStakedToken} from '../../src/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol'; +import {StakeMock} from '../mocks/StakeMock.sol'; import {TestnetProcedures} from '../utils/TestnetProcedures.sol'; contract StakedTokenTransferStrategyTest is TestnetProcedures { diff --git a/tests/template/BaseTest.t.sol b/tests/template/BaseTest.t.sol new file mode 100644 index 00000000..62d10faa --- /dev/null +++ b/tests/template/BaseTest.t.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {TestnetProcedures, IERC20, IAToken} from '../utils/TestnetProcedures.sol'; + +// Base test to setup the initial config: deploying the protocol contracts and setting them up locally on foundry +// command to test: make test-contract filter=BaseTest +contract BaseTest is TestnetProcedures { + function setUp() public { + // this method deploys all the protocol contract and does the inital setup. + // -> the deployed contracts could be accessed via the ContractsReport struct internal variable `contracts`. Ex `contracts.poolProxy` + // -> the assets listed could be accessed via the TokenList struct internal variable `tokenList` + // -> the internal variable `poolAdmin` has the poolAdmin role of the protocol and holds all the admin access. + initTestEnvironment(); + + // initL2TestEnvironment(); -> deploys the protocol contracts as on an L2 (ex. we deploy L2Pool instead of Pool) + // initTestEnvironment(true); -> mints the listed assets to users: alice, bob, carol (can be accessed by the same variable name) + } + + // add your code below + function test_default() public { + uint256 supplyAmount = 0.2e8; + uint256 underlyingBalanceBefore = IERC20(tokenList.wbtc).balanceOf(alice); + (address aWBTC, , ) = contracts.protocolDataProvider.getReserveTokensAddresses(tokenList.wbtc); + + vm.prank(alice); + contracts.poolProxy.supply(tokenList.wbtc, supplyAmount, alice, 0); + + assertEq(IERC20(tokenList.wbtc).balanceOf(alice), underlyingBalanceBefore - supplyAmount); + assertEq(IAToken(aWBTC).scaledBalanceOf(alice), supplyAmount); + } +} diff --git a/tests/utils/BatchTestProcedures.sol b/tests/utils/BatchTestProcedures.sol index 00b9efa3..9a2e0984 100644 --- a/tests/utils/BatchTestProcedures.sol +++ b/tests/utils/BatchTestProcedures.sol @@ -6,17 +6,18 @@ import '../../src/deployments/interfaces/IMarketReportTypes.sol'; import {DeployUtils} from '../../src/deployments/contracts/utilities/DeployUtils.sol'; import {AaveV3GettersBatchOne} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchOne.sol'; import {AaveV3GettersBatchTwo} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3GettersBatchTwo.sol'; +import {AaveV3TokensBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3TokensBatch.sol'; import {AaveV3SetupBatch} from '../../src/deployments/projects/aave-v3-batched/batches/AaveV3SetupBatch.sol'; import {FfiUtils} from '../../src/deployments/contracts/utilities/FfiUtils.sol'; import {DefaultMarketInput} from '../../src/deployments/inputs/DefaultMarketInput.sol'; import {AaveV3BatchOrchestration} from '../../src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {ACLManager} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {WETH9} from 'aave-v3-core/contracts/dependencies/weth/WETH9.sol'; -import 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import 'aave-v3-core/contracts/misc/AaveProtocolDataProvider.sol'; +import {IPoolAddressesProvider} from '../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {ACLManager} from '../../src/contracts/protocol/configuration/ACLManager.sol'; +import {WETH9} from '../../src/contracts/dependencies/weth/WETH9.sol'; +import '../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import '../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import '../../src/contracts/protocol/libraries/math/PercentageMath.sol'; +import '../../src/contracts/helpers/AaveProtocolDataProvider.sol'; import {MarketReportUtils} from '../../src/deployments/contracts/utilities/MarketReportUtils.sol'; struct TestVars { @@ -174,10 +175,7 @@ contract BatchTestProcedures is Test, DeployUtils, FfiUtils, DefaultMarketInput assertTrue(r.poolConfiguratorImplementation != address(0), 'r.poolConfiguratorImplementation'); assertTrue(r.protocolDataProvider != address(0), 'report.protocolDataProvider'); assertTrue(r.aaveOracle != address(0), 'report.aaveOracle'); - assertTrue( - r.defaultInterestRateStrategyV2 != address(0), - 'report.defaultInterestRateStrategyV2' - ); + assertTrue(r.defaultInterestRateStrategy != address(0), 'report.defaultInterestRateStrategy'); assertTrue(r.aclManager != address(0), 'report.aclManager'); assertTrue(r.treasury != address(0), 'report.treasury'); assertTrue(r.proxyAdmin != address(0), 'report.proxyAdmin'); @@ -266,7 +264,7 @@ contract BatchTestProcedures is Test, DeployUtils, FfiUtils, DefaultMarketInput t.variableDebtSymbol = _concatStr('varDebtMISC ', x); t.stableDebtName = _concatStr('Stable Debt Misc ', x); t.stableDebtSymbol = _concatStr('stableDebtMISC ', x); - t.rateStrategy = r.defaultInterestRateStrategyV2; + t.rateStrategy = r.defaultInterestRateStrategy; t.interestRateData = abi.encode( IDefaultInterestRateStrategyV2.InterestRateData({ optimalUsageRatio: 80_00, diff --git a/tests/utils/ConfigEngineDeployer.sol b/tests/utils/ConfigEngineDeployer.sol index 1c25da03..5f3e3bb3 100644 --- a/tests/utils/ConfigEngineDeployer.sol +++ b/tests/utils/ConfigEngineDeployer.sol @@ -4,19 +4,19 @@ pragma solidity ^0.8.0; import '../../src/deployments/interfaces/IMarketReportTypes.sol'; import {Vm} from 'forge-std/Vm.sol'; import {Create2Utils} from '../../src/deployments/contracts/utilities/Create2Utils.sol'; -import {AaveV3ConfigEngine} from 'aave-v3-periphery/contracts/v3-config-engine/AaveV3ConfigEngine.sol'; -import {IAaveV3ConfigEngine} from 'aave-v3-periphery/contracts/v3-config-engine/IAaveV3ConfigEngine.sol'; -import {IPoolAddressesProvider} from '../../src/core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPool} from '../../src/core/contracts/interfaces/IPool.sol'; -import {IPoolConfigurator} from '../../src/core/contracts/interfaces/IPoolConfigurator.sol'; -import {IAaveOracle} from '../../src/core/contracts/interfaces/IAaveOracle.sol'; -import {CapsEngine} from 'aave-v3-periphery/contracts/v3-config-engine/libraries/CapsEngine.sol'; -import {BorrowEngine} from 'aave-v3-periphery/contracts/v3-config-engine/libraries/BorrowEngine.sol'; -import {CollateralEngine} from 'aave-v3-periphery/contracts/v3-config-engine/libraries/CollateralEngine.sol'; -import {RateEngine} from 'aave-v3-periphery/contracts/v3-config-engine/libraries/RateEngine.sol'; -import {PriceFeedEngine} from 'aave-v3-periphery/contracts/v3-config-engine/libraries/PriceFeedEngine.sol'; -import {EModeEngine} from 'aave-v3-periphery/contracts/v3-config-engine/libraries/EModeEngine.sol'; -import {ListingEngine} from 'aave-v3-periphery/contracts/v3-config-engine/libraries/ListingEngine.sol'; +import {AaveV3ConfigEngine} from '../../src/contracts/extensions/v3-config-engine/AaveV3ConfigEngine.sol'; +import {IAaveV3ConfigEngine} from '../../src/contracts/extensions/v3-config-engine/AaveV3ConfigEngine.sol'; +import {IPoolAddressesProvider} from '../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IPool} from '../../src/contracts/interfaces/IPool.sol'; +import {IPoolConfigurator} from '../../src/contracts/interfaces/IPoolConfigurator.sol'; +import {IAaveOracle} from '../../src/contracts/interfaces/IAaveOracle.sol'; +import {CapsEngine} from '../../src/contracts/extensions/v3-config-engine/libraries/CapsEngine.sol'; +import {BorrowEngine} from '../../src/contracts/extensions/v3-config-engine/libraries/BorrowEngine.sol'; +import {CollateralEngine} from '../../src/contracts/extensions/v3-config-engine/libraries/CollateralEngine.sol'; +import {RateEngine} from '../../src/contracts/extensions/v3-config-engine/libraries/RateEngine.sol'; +import {PriceFeedEngine} from '../../src/contracts/extensions/v3-config-engine/libraries/PriceFeedEngine.sol'; +import {EModeEngine} from '../../src/contracts/extensions/v3-config-engine/libraries/EModeEngine.sol'; +import {ListingEngine} from '../../src/contracts/extensions/v3-config-engine/libraries/ListingEngine.sol'; library ConfigEngineDeployer { function deployEngine(Vm vm, MarketReport memory report) internal returns (address) { @@ -40,7 +40,7 @@ library ConfigEngineDeployer { .EngineConstants({ pool: IPool(report.poolProxy), poolConfigurator: IPoolConfigurator(report.poolConfiguratorProxy), - defaultInterestRateStrategy: report.defaultInterestRateStrategyV2, + defaultInterestRateStrategy: report.defaultInterestRateStrategy, oracle: IAaveOracle(report.aaveOracle), rewardsController: report.rewardsControllerProxy, collector: report.treasury diff --git a/tests/utils/ProtocolV3TestBase.sol b/tests/utils/ProtocolV3TestBase.sol index 8f4aabad..616442ab 100644 --- a/tests/utils/ProtocolV3TestBase.sol +++ b/tests/utils/ProtocolV3TestBase.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.7.5 <0.9.0; -import {IERC20Detailed} from 'aave-v3-core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {IDefaultInterestRateStrategyV2} from 'aave-v3-core/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; -import {IPoolDataProvider} from 'aave-v3-core/contracts/interfaces/IPoolDataProvider.sol'; -import {IPool} from 'aave-v3-core/contracts/interfaces/IPool.sol'; -import {IAaveOracle} from 'aave-v3-core/contracts/interfaces/IAaveOracle.sol'; -import {DataTypes} from 'aave-v3-core/contracts/protocol/libraries/types/DataTypes.sol'; -import {IPoolConfigurator} from 'aave-v3-core/contracts/interfaces/IPoolConfigurator.sol'; +import {IERC20Detailed} from '../../src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IDefaultInterestRateStrategyV2} from '../../src/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; +import {ReserveConfiguration} from '../../src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; +import {IPoolAddressesProvider} from '../../src/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IPoolDataProvider} from '../../src/contracts/interfaces/IPoolDataProvider.sol'; +import {IPool} from '../../src/contracts/interfaces/IPool.sol'; +import {IAaveOracle} from '../../src/contracts/interfaces/IAaveOracle.sol'; +import {DataTypes} from '../../src/contracts/protocol/libraries/types/DataTypes.sol'; +import {IPoolConfigurator} from '../../src/contracts/interfaces/IPoolConfigurator.sol'; import {ProxyHelpers} from './ProxyHelpers.sol'; import {DiffUtils} from './DiffUtils.sol'; @@ -110,18 +110,6 @@ struct LocalVars { ReserveConfig[] configs; } -struct InterestStrategyValues { - address addressesProvider; - uint256 optimalUsageRatio; - uint256 optimalStableToTotalDebtRatio; - uint256 baseStableBorrowRate; - uint256 stableRateSlope1; - uint256 stableRateSlope2; - uint256 baseVariableBorrowRate; - uint256 variableRateSlope1; - uint256 variableRateSlope2; -} - /** * only applicable to harmony at this point */ @@ -615,7 +603,7 @@ contract ProtocolV3TestBase is DiffUtils { address reserve, address interestRateStrategyAddress, address expectedStrategy, - InterestStrategyValues memory expectedStrategyValues + IDefaultInterestRateStrategyV2.InterestRateDataRay memory expectedStrategyValues ) internal view { IDefaultInterestRateStrategyV2 strategy = IDefaultInterestRateStrategyV2( interestRateStrategyAddress @@ -630,10 +618,6 @@ contract ProtocolV3TestBase is DiffUtils { strategy.getOptimalUsageRatio(reserve) == expectedStrategyValues.optimalUsageRatio, '_validateInterestRateStrategy() : INVALID_OPTIMAL_RATIO' ); - require( - address(strategy.ADDRESSES_PROVIDER()) == expectedStrategyValues.addressesProvider, - '_validateInterestRateStrategy() : INVALID_ADDRESSES_PROVIDER' - ); require( strategy.getBaseVariableBorrowRate(reserve) == expectedStrategyValues.baseVariableBorrowRate, '_validateInterestRateStrategy() : INVALID_BASE_VARIABLE_BORROW' diff --git a/tests/utils/TestnetProcedures.sol b/tests/utils/TestnetProcedures.sol index db95ed2f..480c091b 100644 --- a/tests/utils/TestnetProcedures.sol +++ b/tests/utils/TestnetProcedures.sol @@ -9,18 +9,18 @@ import {DeployUtils} from '../../src/deployments/contracts/utilities/DeployUtils import {FfiUtils} from '../../src/deployments/contracts/utilities/FfiUtils.sol'; import {DefaultMarketInput} from '../../src/deployments/inputs/DefaultMarketInput.sol'; import {AaveV3BatchOrchestration} from '../../src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol'; -import {IPoolAddressesProvider} from 'aave-v3-core/contracts/interfaces/IPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../src/contracts/interfaces/IPoolAddressesProvider.sol'; import {AaveV3TestListing} from '../mocks/AaveV3TestListing.sol'; -import {ACLManager, Errors} from 'aave-v3-core/contracts/protocol/configuration/ACLManager.sol'; -import {WETH9} from 'aave-v3-core/contracts/dependencies/weth/WETH9.sol'; -import {TestnetERC20} from 'aave-v3-periphery/contracts/mocks/testnet-helpers/TestnetERC20.sol'; -import {PoolConfigurator} from 'aave-v3-core/contracts/protocol/pool/PoolConfigurator.sol'; -import {DefaultReserveInterestRateStrategyV2} from 'aave-v3-core/contracts/protocol/pool/DefaultReserveInterestRateStrategyV2.sol'; -import {ReserveConfiguration} from 'aave-v3-core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; -import {PercentageMath} from 'aave-v3-core/contracts/protocol/libraries/math/PercentageMath.sol'; -import {AaveProtocolDataProvider} from 'aave-v3-core/contracts/misc/AaveProtocolDataProvider.sol'; +import {ACLManager, Errors} from '../../src/contracts/protocol/configuration/ACLManager.sol'; +import {WETH9} from '../../src/contracts/dependencies/weth/WETH9.sol'; +import {TestnetERC20} from '../../src/contracts/mocks/testnet-helpers/TestnetERC20.sol'; +import {PoolConfigurator} from '../../src/contracts/protocol/pool/PoolConfigurator.sol'; +import {DefaultReserveInterestRateStrategyV2} from '../../src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol'; +import {ReserveConfiguration} from '../../src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol'; +import {PercentageMath} from '../../src/contracts/protocol/libraries/math/PercentageMath.sol'; +import {AaveProtocolDataProvider} from '../../src/contracts/helpers/AaveProtocolDataProvider.sol'; import {MarketReportUtils} from '../../src/deployments/contracts/utilities/MarketReportUtils.sol'; -import {AaveV3ConfigEngine, IAaveV3ConfigEngine} from 'aave-v3-periphery/contracts/v3-config-engine/AaveV3ConfigEngine.sol'; +import {AaveV3ConfigEngine, IAaveV3ConfigEngine} from '../../src/contracts/extensions/v3-config-engine/AaveV3ConfigEngine.sol'; struct TestVars { uint8 underlyingDecimals; @@ -324,7 +324,7 @@ contract TestnetProcedures is Test, DeployUtils, FfiUtils, DefaultMarketInput { input.variableDebtTokenImpl = r.variableDebtToken; input.underlyingAssetDecimals = t.underlyingDecimals; input.useVirtualBalance = t.useVirtualBalance; - input.interestRateStrategyAddress = r.defaultInterestRateStrategyV2; + input.interestRateStrategyAddress = r.defaultInterestRateStrategy; input.treasury = t.treasury; input.incentivesController = r.rewardsControllerProxy; input.aTokenName = t.aTokenName;