From fe93efd0592c4542709f0a071b53f1243221036f Mon Sep 17 00:00:00 2001 From: Antonio Guilherme Ferreira Viggiano Date: Wed, 5 Jun 2024 16:54:12 -0300 Subject: [PATCH] Remove src/core/ directory --- script/BaseScript.sol | 4 +- script/BuyCreditLimit.s.sol | 6 +-- script/BuyCreditMarket.s.sol | 6 +-- script/Claim.s.sol | 4 +- script/Compensate.s.sol | 4 +- script/Deploy.s.sol | 2 +- script/Deploy.sol | 8 +-- script/DepositUSDC.s.sol | 4 +- script/DepositWETH.s.sol | 2 +- script/GetUserView.s.sol | 4 +- script/GrantRole.s.sol | 2 +- script/Liquidate.s.sol | 4 +- script/LiquidateWithReplacement.s.sol | 6 +-- script/Repay.s.sol | 4 +- script/SellCreditLimit.s.sol | 6 +-- script/UpdateConfig.s.sol | 4 +- script/prepare_crytic.sh | 2 +- src/{core => }/Size.sol | 51 +++++++++---------- src/{core => }/SizeStorage.sol | 12 ++--- src/{core => }/SizeView.sol | 22 ++++---- src/{core => }/SizeViewData.sol | 6 +-- src/{core => }/interfaces/IMulticall.sol | 0 src/{core => }/interfaces/ISize.sol | 34 ++++++------- src/{core => }/interfaces/ISizeAdmin.sol | 2 +- src/{core => }/interfaces/ISizeView.sol | 6 +-- src/{core => }/interfaces/IWETH.sol | 0 src/{core => }/libraries/Errors.sol | 2 +- src/{core => }/libraries/Events.sol | 4 +- src/{core => }/libraries/Math.sol | 0 src/{core => }/libraries/Multicall.sol | 6 +-- .../libraries/fixed/AccountingLibrary.sol | 12 ++--- .../libraries/fixed/CapsLibrary.sol | 4 +- .../libraries/fixed/DepositTokenLibrary.sol | 2 +- .../libraries/fixed/LoanLibrary.sol | 8 +-- .../libraries/fixed/OfferLibrary.sol | 10 ++-- .../libraries/fixed/RiskLibrary.sol | 8 +-- .../libraries/fixed/YieldCurveLibrary.sol | 4 +- .../fixed/actions/BuyCreditLimit.sol | 10 ++-- .../fixed/actions/BuyCreditMarket.sol | 18 +++---- .../libraries/fixed/actions/Claim.sol | 12 ++--- .../libraries/fixed/actions/Compensate.sol | 22 ++++---- .../libraries/fixed/actions/Liquidate.sol | 16 +++--- .../actions/LiquidateWithReplacement.sol | 18 +++---- .../libraries/fixed/actions/Repay.sol | 12 ++--- .../libraries/fixed/actions/SelfLiquidate.sol | 14 ++--- .../fixed/actions/SellCreditLimit.sol | 8 +-- .../fixed/actions/SellCreditMarket.sol | 18 +++---- .../fixed/actions/SetUserConfiguration.sol | 8 +-- .../libraries/general/actions/Deposit.sol | 12 ++--- .../libraries/general/actions/Initialize.sol | 20 ++++---- .../general/actions/UpdateConfig.sol | 14 ++--- .../libraries/general/actions/Withdraw.sol | 10 ++-- src/{core => }/oracle/IPriceFeed.sol | 0 src/{core => }/oracle/PriceFeed.sol | 4 +- .../token/NonTransferrableScaledToken.sol | 6 +-- .../token/NonTransferrableToken.sol | 2 +- test/BaseTestFixed.sol | 37 ++++++-------- test/BaseTestGeneral.sol | 6 +-- test/Logger.sol | 8 +-- test/fork/Deploy.t.sol | 6 +-- test/helpers/AssertsHelper.sol | 4 +- test/helpers/libraries/YieldCurveHelper.sol | 2 +- test/invariants/ExpectedErrors.sol | 2 +- test/invariants/Ghosts.sol | 6 +-- test/invariants/Helper.sol | 6 +-- test/invariants/Properties.sol | 6 +-- test/invariants/TargetFunctions.sol | 40 +++++++-------- test/libraries/Math.t.sol | 2 +- test/libraries/Multicall.t.sol | 18 +++---- test/libraries/OfferLibrary.t.sol | 2 +- test/libraries/YieldCurveLibrary.t.sol | 12 ++--- test/local/fixed/BuyCreditLimit.t.sol | 12 ++--- .../fixed/BuyCreditLimitValidation.t.sol | 8 +-- test/local/fixed/BuyCreditMarket.t.sol | 14 ++--- .../fixed/BuyCreditMarketValidation.t.sol | 14 ++--- test/local/fixed/Claim.t.sol | 2 +- test/local/fixed/ClaimValidation.t.sol | 8 +-- test/local/fixed/Compensate.t.sol | 16 +++--- test/local/fixed/CompensateValidation.t.sol | 8 +-- test/local/fixed/Deposit.t.sol | 4 +- test/local/fixed/DepositValidation.t.sol | 4 +- test/local/fixed/Liquidate.t.sol | 8 +-- test/local/fixed/LiquidateValidation.t.sol | 6 +-- .../fixed/LiquidateWithReplacement.t.sol | 12 ++--- .../LiquidateWithReplacementValidation.t.sol | 8 +-- test/local/fixed/Repay.t.sol | 8 +-- test/local/fixed/RepayValidation.t.sol | 8 +-- test/local/fixed/SelfLiquidate.t.sol | 4 +- .../local/fixed/SelfLiquidateValidation.t.sol | 6 +-- test/local/fixed/SellCreditLimit.t.sol | 12 ++--- .../fixed/SellCreditLimitValidation.t.sol | 8 +-- test/local/fixed/SellCreditMarket.t.sol | 19 +++---- .../fixed/SellCreditMarketValidation.t.sol | 6 +-- test/local/fixed/SetUserConfiguration.t.sol | 6 +-- .../SetUserConfigurationValidation.t.sol | 6 +-- test/local/fixed/Withdraw.t.sol | 12 ++--- test/local/fixed/WithdrawValidation.t.sol | 4 +- test/local/general/Initialize.t.sol | 2 +- test/local/general/InitializeValidation.t.sol | 4 +- test/local/general/Pause.t.sol | 4 +- test/local/general/SizeView.t.sol | 2 +- test/local/general/UpdateConfig.t.sol | 6 +-- .../general/UpdateConfigValidation.t.sol | 4 +- test/local/general/Upgrade.t.sol | 2 +- test/local/oracle/PriceFeed.t.sol | 6 +-- .../token/NonTransferrableScaledToken.t.sol | 4 +- test/local/token/NonTransferrableToken.t.sol | 4 +- test/mocks/PriceFeedMock.sol | 2 +- test/mocks/SizeMock.sol | 6 +-- 109 files changed, 445 insertions(+), 470 deletions(-) rename src/{core => }/Size.sol (80%) rename src/{core => }/SizeStorage.sol (88%) rename src/{core => }/SizeView.sol (88%) rename src/{core => }/SizeViewData.sol (83%) rename src/{core => }/interfaces/IMulticall.sol (100%) rename src/{core => }/interfaces/ISize.sol (90%) rename src/{core => }/interfaces/ISizeAdmin.sol (93%) rename src/{core => }/interfaces/ISizeView.sol (95%) rename src/{core => }/interfaces/IWETH.sol (100%) rename src/{core => }/libraries/Errors.sol (98%) rename src/{core => }/libraries/Events.sol (96%) rename src/{core => }/libraries/Math.sol (100%) rename src/{core => }/libraries/Multicall.sol (91%) rename src/{core => }/libraries/fixed/AccountingLibrary.sol (97%) rename src/{core => }/libraries/fixed/CapsLibrary.sol (97%) rename src/{core => }/libraries/fixed/DepositTokenLibrary.sol (98%) rename src/{core => }/libraries/fixed/LoanLibrary.sol (96%) rename src/{core => }/libraries/fixed/OfferLibrary.sol (93%) rename src/{core => }/libraries/fixed/RiskLibrary.sol (97%) rename src/{core => }/libraries/fixed/YieldCurveLibrary.sol (98%) rename src/{core => }/libraries/fixed/actions/BuyCreditLimit.sol (87%) rename src/{core => }/libraries/fixed/actions/BuyCreditMarket.sol (92%) rename src/{core => }/libraries/fixed/actions/Claim.sol (86%) rename src/{core => }/libraries/fixed/actions/Compensate.sol (93%) rename src/{core => }/libraries/fixed/actions/Liquidate.sol (91%) rename src/{core => }/libraries/fixed/actions/LiquidateWithReplacement.sol (91%) rename src/{core => }/libraries/fixed/actions/Repay.sol (80%) rename src/{core => }/libraries/fixed/actions/SelfLiquidate.sol (85%) rename src/{core => }/libraries/fixed/actions/SellCreditLimit.sol (86%) rename src/{core => }/libraries/fixed/actions/SellCreditMarket.sol (92%) rename src/{core => }/libraries/fixed/actions/SetUserConfiguration.sol (91%) rename src/{core => }/libraries/general/actions/Deposit.sol (88%) rename src/{core => }/libraries/general/actions/Initialize.sol (94%) rename src/{core => }/libraries/general/actions/UpdateConfig.sol (94%) rename src/{core => }/libraries/general/actions/Withdraw.sol (86%) rename src/{core => }/oracle/IPriceFeed.sol (100%) rename src/{core => }/oracle/PriceFeed.sol (97%) rename src/{core => }/token/NonTransferrableScaledToken.sol (96%) rename src/{core => }/token/NonTransferrableToken.sol (97%) diff --git a/script/BaseScript.sol b/script/BaseScript.sol index ca85c459..21b933b5 100644 --- a/script/BaseScript.sol +++ b/script/BaseScript.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.19; import {IPool} from "@aave/interfaces/IPool.sol"; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; -import {IPriceFeed} from "@src/core/oracle/IPriceFeed.sol"; +import {IPriceFeed} from "@src/oracle/IPriceFeed.sol"; import {SizeMock} from "@test/mocks/SizeMock.sol"; import {USDC} from "@test/mocks/USDC.sol"; import {WETH} from "@test/mocks/WETH.sol"; diff --git a/script/BuyCreditLimit.s.sol b/script/BuyCreditLimit.s.sol index b8f940a0..28acc7d8 100644 --- a/script/BuyCreditLimit.s.sol +++ b/script/BuyCreditLimit.s.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; -import {BuyCreditLimitParams} from "@src/core/libraries/fixed/actions/BuyCreditLimit.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; +import {BuyCreditLimitParams} from "@src/libraries/fixed/actions/BuyCreditLimit.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/BuyCreditMarket.s.sol b/script/BuyCreditMarket.s.sol index 66293db5..25de4dfe 100644 --- a/script/BuyCreditMarket.s.sol +++ b/script/BuyCreditMarket.s.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; import {Logger} from "@test/Logger.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/Claim.s.sol b/script/Claim.s.sol index 141fa8bb..aa87e9d6 100644 --- a/script/Claim.s.sol +++ b/script/Claim.s.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; -import {ClaimParams} from "@src/core/libraries/fixed/actions/Claim.sol"; +import {Size} from "@src/Size.sol"; +import {ClaimParams} from "@src/libraries/fixed/actions/Claim.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/Compensate.s.sol b/script/Compensate.s.sol index d7c42cb7..33cd56e9 100644 --- a/script/Compensate.s.sol +++ b/script/Compensate.s.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; -import {CompensateParams} from "@src/core/libraries/fixed/actions/Compensate.sol"; +import {Size} from "@src/Size.sol"; +import {CompensateParams} from "@src/libraries/fixed/actions/Compensate.sol"; import {Logger} from "@test/Logger.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 6fd56da6..4b662654 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -5,7 +5,7 @@ import {IPool} from "@aave/interfaces/IPool.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {console2 as console} from "forge-std/Script.sol"; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; import {Addresses, Contracts} from "./Addresses.sol"; import {BaseScript, Deployment, Parameter} from "./BaseScript.sol"; diff --git a/script/Deploy.sol b/script/Deploy.sol index cd3141ab..31ac8209 100644 --- a/script/Deploy.sol +++ b/script/Deploy.sol @@ -7,13 +7,13 @@ import {WadRayMath} from "@aave/protocol/libraries/math/WadRayMath.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {PoolMock} from "@test/mocks/PoolMock.sol"; -import {IPriceFeed} from "@src/core/oracle/IPriceFeed.sol"; +import {IPriceFeed} from "@src/oracle/IPriceFeed.sol"; -import {PriceFeed} from "@src/core/oracle/PriceFeed.sol"; +import {PriceFeed} from "@src/oracle/PriceFeed.sol"; import {PriceFeedMock} from "@test/mocks/PriceFeedMock.sol"; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; import { Initialize, @@ -21,7 +21,7 @@ import { InitializeFeeConfigParams, InitializeOracleParams, InitializeRiskConfigParams -} from "@src/core/libraries/general/actions/Initialize.sol"; +} from "@src/libraries/general/actions/Initialize.sol"; import {SizeMock} from "@test/mocks/SizeMock.sol"; import {USDC} from "@test/mocks/USDC.sol"; import {WETH} from "@test/mocks/WETH.sol"; diff --git a/script/DepositUSDC.s.sol b/script/DepositUSDC.s.sol index 88a954ac..f73f1446 100644 --- a/script/DepositUSDC.s.sol +++ b/script/DepositUSDC.s.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/DepositWETH.s.sol b/script/DepositWETH.s.sol index e4b7689f..7bb67a79 100644 --- a/script/DepositWETH.s.sol +++ b/script/DepositWETH.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import "@src/core/Size.sol"; +import "@src/Size.sol"; import "forge-std/Script.sol"; contract DepositWETHScript is Script { diff --git a/script/GetUserView.s.sol b/script/GetUserView.s.sol index 2a257db5..1df38c9f 100644 --- a/script/GetUserView.s.sol +++ b/script/GetUserView.s.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {SizeView} from "@src/core/SizeView.sol"; +import {SizeView} from "@src/SizeView.sol"; import {Logger} from "@test/Logger.sol"; -import {LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; +import {LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/GrantRole.s.sol b/script/GrantRole.s.sol index a7bba635..f747df48 100644 --- a/script/GrantRole.s.sol +++ b/script/GrantRole.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/Liquidate.s.sol b/script/Liquidate.s.sol index 668ee28e..5ab75207 100644 --- a/script/Liquidate.s.sol +++ b/script/Liquidate.s.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; -import {LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; +import {Size} from "@src/Size.sol"; +import {LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; import {Logger} from "@test/Logger.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/LiquidateWithReplacement.s.sol b/script/LiquidateWithReplacement.s.sol index 1c227724..0300c564 100644 --- a/script/LiquidateWithReplacement.s.sol +++ b/script/LiquidateWithReplacement.s.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; import {Logger} from "@test/Logger.sol"; -import {DebtPosition} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {LiquidateWithReplacementParams} from "@src/core/libraries/fixed/actions/LiquidateWithReplacement.sol"; +import {DebtPosition} from "@src/libraries/fixed/LoanLibrary.sol"; +import {LiquidateWithReplacementParams} from "@src/libraries/fixed/actions/LiquidateWithReplacement.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/Repay.s.sol b/script/Repay.s.sol index 00ef2f46..9a3cfdd9 100644 --- a/script/Repay.s.sol +++ b/script/Repay.s.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; -import {RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; +import {Size} from "@src/Size.sol"; +import {RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; import {Logger} from "@test/Logger.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/SellCreditLimit.s.sol b/script/SellCreditLimit.s.sol index f8530133..366e8156 100644 --- a/script/SellCreditLimit.s.sol +++ b/script/SellCreditLimit.s.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; -import {SellCreditLimitParams} from "@src/core/libraries/fixed/actions/SellCreditLimit.sol"; +import {Size} from "@src/Size.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; +import {SellCreditLimitParams} from "@src/libraries/fixed/actions/SellCreditLimit.sol"; import {Logger} from "@test/Logger.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/UpdateConfig.s.sol b/script/UpdateConfig.s.sol index f818b37a..b6c83e66 100644 --- a/script/UpdateConfig.s.sol +++ b/script/UpdateConfig.s.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; -import {UpdateConfigParams} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +import {Size} from "@src/Size.sol"; +import {UpdateConfigParams} from "@src/libraries/general/actions/UpdateConfig.sol"; import {Script} from "forge-std/Script.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/script/prepare_crytic.sh b/script/prepare_crytic.sh index d9f91ef7..0e420794 100755 --- a/script/prepare_crytic.sh +++ b/script/prepare_crytic.sh @@ -3,7 +3,7 @@ set -ux j=$((0x10)); -SOLIDITY_FILES=$(find src/core/libraries test/helpers/libraries -type f | sed 's/.*\///' | sed 's/\.sol//') +SOLIDITY_FILES=$(find src/libraries test/helpers/libraries -type f | sed 's/.*\///' | sed 's/\.sol//') rm COMPILE_LIBRARIES.txt || true rm DEPLOY_CONTRACTS.txt || true diff --git a/src/core/Size.sol b/src/Size.sol similarity index 80% rename from src/core/Size.sol rename to src/Size.sol index f8a6672e..1c7e49ef 100644 --- a/src/core/Size.sol +++ b/src/Size.sol @@ -13,45 +13,42 @@ import { InitializeFeeConfigParams, InitializeOracleParams, InitializeRiskConfigParams -} from "@src/core/libraries/general/actions/Initialize.sol"; -import {UpdateConfig, UpdateConfigParams} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +} from "@src/libraries/general/actions/Initialize.sol"; +import {UpdateConfig, UpdateConfigParams} from "@src/libraries/general/actions/UpdateConfig.sol"; -import {SellCreditLimit, SellCreditLimitParams} from "@src/core/libraries/fixed/actions/SellCreditLimit.sol"; -import {SellCreditMarket, SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; +import {SellCreditLimit, SellCreditLimitParams} from "@src/libraries/fixed/actions/SellCreditLimit.sol"; +import {SellCreditMarket, SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; -import {Claim, ClaimParams} from "@src/core/libraries/fixed/actions/Claim.sol"; -import {Deposit, DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; +import {Claim, ClaimParams} from "@src/libraries/fixed/actions/Claim.sol"; +import {Deposit, DepositParams} from "@src/libraries/general/actions/Deposit.sol"; -import {BuyCreditMarket, BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; -import { - SetUserConfiguration, - SetUserConfigurationParams -} from "@src/core/libraries/fixed/actions/SetUserConfiguration.sol"; +import {BuyCreditMarket, BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; +import {SetUserConfiguration, SetUserConfigurationParams} from "@src/libraries/fixed/actions/SetUserConfiguration.sol"; -import {BuyCreditLimit, BuyCreditLimitParams} from "@src/core/libraries/fixed/actions/BuyCreditLimit.sol"; -import {Liquidate, LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; +import {BuyCreditLimit, BuyCreditLimitParams} from "@src/libraries/fixed/actions/BuyCreditLimit.sol"; +import {Liquidate, LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; -import {Multicall} from "@src/core/libraries/Multicall.sol"; -import {Compensate, CompensateParams} from "@src/core/libraries/fixed/actions/Compensate.sol"; +import {Multicall} from "@src/libraries/Multicall.sol"; +import {Compensate, CompensateParams} from "@src/libraries/fixed/actions/Compensate.sol"; import { LiquidateWithReplacement, LiquidateWithReplacementParams -} from "@src/core/libraries/fixed/actions/LiquidateWithReplacement.sol"; -import {Repay, RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; -import {SelfLiquidate, SelfLiquidateParams} from "@src/core/libraries/fixed/actions/SelfLiquidate.sol"; -import {Withdraw, WithdrawParams} from "@src/core/libraries/general/actions/Withdraw.sol"; +} from "@src/libraries/fixed/actions/LiquidateWithReplacement.sol"; +import {Repay, RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; +import {SelfLiquidate, SelfLiquidateParams} from "@src/libraries/fixed/actions/SelfLiquidate.sol"; +import {Withdraw, WithdrawParams} from "@src/libraries/general/actions/Withdraw.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {CapsLibrary} from "@src/core/libraries/fixed/CapsLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; +import {CapsLibrary} from "@src/libraries/fixed/CapsLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; -import {SizeView} from "@src/core/SizeView.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {SizeView} from "@src/SizeView.sol"; +import {Events} from "@src/libraries/Events.sol"; -import {IMulticall} from "@src/core/interfaces/IMulticall.sol"; -import {ISize} from "@src/core/interfaces/ISize.sol"; -import {ISizeAdmin} from "@src/core/interfaces/ISizeAdmin.sol"; +import {IMulticall} from "@src/interfaces/IMulticall.sol"; +import {ISize} from "@src/interfaces/ISize.sol"; +import {ISizeAdmin} from "@src/interfaces/ISizeAdmin.sol"; bytes32 constant KEEPER_ROLE = keccak256("KEEPER_ROLE"); bytes32 constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); diff --git a/src/core/SizeStorage.sol b/src/SizeStorage.sol similarity index 88% rename from src/core/SizeStorage.sol rename to src/SizeStorage.sol index 2009695a..27114689 100644 --- a/src/core/SizeStorage.sol +++ b/src/SizeStorage.sol @@ -3,15 +3,15 @@ pragma solidity 0.8.23; import {IPool} from "@aave/interfaces/IPool.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import {IWETH} from "@src/core/interfaces/IWETH.sol"; +import {IWETH} from "@src/interfaces/IWETH.sol"; -import {CreditPosition, DebtPosition} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {BorrowOffer, LoanOffer} from "@src/core/libraries/fixed/OfferLibrary.sol"; +import {CreditPosition, DebtPosition} from "@src/libraries/fixed/LoanLibrary.sol"; +import {BorrowOffer, LoanOffer} from "@src/libraries/fixed/OfferLibrary.sol"; -import {IPriceFeed} from "@src/core/oracle/IPriceFeed.sol"; +import {IPriceFeed} from "@src/oracle/IPriceFeed.sol"; -import {NonTransferrableScaledToken} from "@src/core/token/NonTransferrableScaledToken.sol"; -import {NonTransferrableToken} from "@src/core/token/NonTransferrableToken.sol"; +import {NonTransferrableScaledToken} from "@src/token/NonTransferrableScaledToken.sol"; +import {NonTransferrableToken} from "@src/token/NonTransferrableToken.sol"; struct User { // The user's loan offer diff --git a/src/core/SizeView.sol b/src/SizeView.sol similarity index 88% rename from src/core/SizeView.sol rename to src/SizeView.sol index e7c0f986..2df93f42 100644 --- a/src/core/SizeView.sol +++ b/src/SizeView.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {SizeStorage, State, User} from "@src/core/SizeStorage.sol"; -import {VariablePoolBorrowRateParams} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {SizeStorage, State, User} from "@src/SizeStorage.sol"; +import {VariablePoolBorrowRateParams} from "@src/libraries/fixed/YieldCurveLibrary.sol"; import { CREDIT_POSITION_ID_START, @@ -12,23 +12,23 @@ import { LoanLibrary, LoanStatus, RESERVED_ID -} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {UpdateConfig} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +} from "@src/libraries/fixed/LoanLibrary.sol"; +import {UpdateConfig} from "@src/libraries/general/actions/UpdateConfig.sol"; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; -import {DataView, UserView} from "@src/core/SizeViewData.sol"; +import {DataView, UserView} from "@src/SizeViewData.sol"; -import {ISizeView} from "@src/core/interfaces/ISizeView.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {BorrowOffer, LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; +import {ISizeView} from "@src/interfaces/ISizeView.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {BorrowOffer, LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; import { InitializeDataParams, InitializeFeeConfigParams, InitializeOracleParams, InitializeRiskConfigParams -} from "@src/core/libraries/general/actions/Initialize.sol"; +} from "@src/libraries/general/actions/Initialize.sol"; /// @title SizeView /// @custom:security-contact security@size.credit diff --git a/src/core/SizeViewData.sol b/src/SizeViewData.sol similarity index 83% rename from src/core/SizeViewData.sol rename to src/SizeViewData.sol index 1d7a057c..ef4e0f80 100644 --- a/src/core/SizeViewData.sol +++ b/src/SizeViewData.sol @@ -4,9 +4,9 @@ pragma solidity 0.8.23; import {IPool} from "@aave/interfaces/IPool.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import {User} from "@src/core/SizeStorage.sol"; -import {NonTransferrableScaledToken} from "@src/core/token/NonTransferrableScaledToken.sol"; -import {NonTransferrableToken} from "@src/core/token/NonTransferrableToken.sol"; +import {User} from "@src/SizeStorage.sol"; +import {NonTransferrableScaledToken} from "@src/token/NonTransferrableScaledToken.sol"; +import {NonTransferrableToken} from "@src/token/NonTransferrableToken.sol"; struct UserView { // The user struct diff --git a/src/core/interfaces/IMulticall.sol b/src/interfaces/IMulticall.sol similarity index 100% rename from src/core/interfaces/IMulticall.sol rename to src/interfaces/IMulticall.sol diff --git a/src/core/interfaces/ISize.sol b/src/interfaces/ISize.sol similarity index 90% rename from src/core/interfaces/ISize.sol rename to src/interfaces/ISize.sol index 514797db..2df72cb5 100644 --- a/src/core/interfaces/ISize.sol +++ b/src/interfaces/ISize.sol @@ -1,34 +1,34 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {SellCreditLimitParams} from "@src/core/libraries/fixed/actions/SellCreditLimit.sol"; -import {SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; +import {SellCreditLimitParams} from "@src/libraries/fixed/actions/SellCreditLimit.sol"; +import {SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; -import {ClaimParams} from "@src/core/libraries/fixed/actions/Claim.sol"; +import {ClaimParams} from "@src/libraries/fixed/actions/Claim.sol"; -import {BuyCreditLimitParams} from "@src/core/libraries/fixed/actions/BuyCreditLimit.sol"; -import {LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; +import {BuyCreditLimitParams} from "@src/libraries/fixed/actions/BuyCreditLimit.sol"; +import {LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; -import {WithdrawParams} from "@src/core/libraries/general/actions/Withdraw.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; +import {WithdrawParams} from "@src/libraries/general/actions/Withdraw.sol"; -import {LiquidateWithReplacementParams} from "@src/core/libraries/fixed/actions/LiquidateWithReplacement.sol"; -import {RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; -import {SelfLiquidateParams} from "@src/core/libraries/fixed/actions/SelfLiquidate.sol"; +import {LiquidateWithReplacementParams} from "@src/libraries/fixed/actions/LiquidateWithReplacement.sol"; +import {RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; +import {SelfLiquidateParams} from "@src/libraries/fixed/actions/SelfLiquidate.sol"; -import {CompensateParams} from "@src/core/libraries/fixed/actions/Compensate.sol"; +import {CompensateParams} from "@src/libraries/fixed/actions/Compensate.sol"; import { InitializeFeeConfigParams, InitializeOracleParams, InitializeRiskConfigParams -} from "@src/core/libraries/general/actions/Initialize.sol"; +} from "@src/libraries/general/actions/Initialize.sol"; -import {IMulticall} from "@src/core/interfaces/IMulticall.sol"; -import {ISizeView} from "@src/core/interfaces/ISizeView.sol"; -import {BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; -import {SetUserConfigurationParams} from "@src/core/libraries/fixed/actions/SetUserConfiguration.sol"; +import {IMulticall} from "@src/interfaces/IMulticall.sol"; +import {ISizeView} from "@src/interfaces/ISizeView.sol"; +import {BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; +import {SetUserConfigurationParams} from "@src/libraries/fixed/actions/SetUserConfiguration.sol"; -import {ISizeAdmin} from "@src/core/interfaces/ISizeAdmin.sol"; +import {ISizeAdmin} from "@src/interfaces/ISizeAdmin.sol"; /// @title ISize /// @custom:security-contact security@size.credit diff --git a/src/core/interfaces/ISizeAdmin.sol b/src/interfaces/ISizeAdmin.sol similarity index 93% rename from src/core/interfaces/ISizeAdmin.sol rename to src/interfaces/ISizeAdmin.sol index 9399eb85..0c4d073a 100644 --- a/src/core/interfaces/ISizeAdmin.sol +++ b/src/interfaces/ISizeAdmin.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {UpdateConfigParams} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +import {UpdateConfigParams} from "@src/libraries/general/actions/UpdateConfig.sol"; /// @title ISizeAdmin /// @custom:security-contact security@size.credit diff --git a/src/core/interfaces/ISizeView.sol b/src/interfaces/ISizeView.sol similarity index 95% rename from src/core/interfaces/ISizeView.sol rename to src/interfaces/ISizeView.sol index 8311c246..f7c092dc 100644 --- a/src/core/interfaces/ISizeView.sol +++ b/src/interfaces/ISizeView.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {DataView, UserView} from "@src/core/SizeViewData.sol"; -import {CreditPosition, DebtPosition, LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {DataView, UserView} from "@src/SizeViewData.sol"; +import {CreditPosition, DebtPosition, LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; import { InitializeFeeConfigParams, InitializeOracleParams, InitializeRiskConfigParams -} from "@src/core/libraries/general/actions/Initialize.sol"; +} from "@src/libraries/general/actions/Initialize.sol"; /// @title ISizeView /// @custom:security-contact security@size.credit diff --git a/src/core/interfaces/IWETH.sol b/src/interfaces/IWETH.sol similarity index 100% rename from src/core/interfaces/IWETH.sol rename to src/interfaces/IWETH.sol diff --git a/src/core/libraries/Errors.sol b/src/libraries/Errors.sol similarity index 98% rename from src/core/libraries/Errors.sol rename to src/libraries/Errors.sol index 75232222..e0a7214d 100644 --- a/src/core/libraries/Errors.sol +++ b/src/libraries/Errors.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; /// @title Errors /// @custom:security-contact security@size.credit diff --git a/src/core/libraries/Events.sol b/src/libraries/Events.sol similarity index 96% rename from src/core/libraries/Events.sol rename to src/libraries/Events.sol index 2b951343..fea4ad3d 100644 --- a/src/core/libraries/Events.sol +++ b/src/libraries/Events.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; import { InitializeDataParams, InitializeFeeConfigParams, InitializeOracleParams, InitializeRiskConfigParams -} from "@src/core/libraries/general/actions/Initialize.sol"; +} from "@src/libraries/general/actions/Initialize.sol"; /// @title Events /// @custom:security-contact security@size.credit diff --git a/src/core/libraries/Math.sol b/src/libraries/Math.sol similarity index 100% rename from src/core/libraries/Math.sol rename to src/libraries/Math.sol diff --git a/src/core/libraries/Multicall.sol b/src/libraries/Multicall.sol similarity index 91% rename from src/core/libraries/Multicall.sol rename to src/libraries/Multicall.sol index 473005b1..40e84576 100644 --- a/src/core/libraries/Multicall.sol +++ b/src/libraries/Multicall.sol @@ -3,9 +3,9 @@ pragma solidity 0.8.23; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; -import {State} from "@src/core/SizeStorage.sol"; -import {CapsLibrary} from "@src/core/libraries/fixed/CapsLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; +import {State} from "@src/SizeStorage.sol"; +import {CapsLibrary} from "@src/libraries/fixed/CapsLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; /// @notice Provides a function to batch together multiple calls in a single external call. /// @custom:security-contact security@size.credit diff --git a/src/core/libraries/fixed/AccountingLibrary.sol b/src/libraries/fixed/AccountingLibrary.sol similarity index 97% rename from src/core/libraries/fixed/AccountingLibrary.sol rename to src/libraries/fixed/AccountingLibrary.sol index 9132a347..3f021c17 100644 --- a/src/core/libraries/fixed/AccountingLibrary.sol +++ b/src/libraries/fixed/AccountingLibrary.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; -import {Math, PERCENT, YEAR} from "@src/core/libraries/Math.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; +import {Math, PERCENT, YEAR} from "@src/libraries/Math.sol"; -import {CreditPosition, DebtPosition, LoanLibrary, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; +import {CreditPosition, DebtPosition, LoanLibrary, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; /// @title AccountingLibrary /// @custom:security-contact security@size.credit diff --git a/src/core/libraries/fixed/CapsLibrary.sol b/src/libraries/fixed/CapsLibrary.sol similarity index 97% rename from src/core/libraries/fixed/CapsLibrary.sol rename to src/libraries/fixed/CapsLibrary.sol index ffb011bf..7e35e90f 100644 --- a/src/core/libraries/fixed/CapsLibrary.sol +++ b/src/libraries/fixed/CapsLibrary.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State} from "@src/core/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {State} from "@src/SizeStorage.sol"; +import {Errors} from "@src/libraries/Errors.sol"; /// @title CapsLibrary /// @custom:security-contact security@size.credit diff --git a/src/core/libraries/fixed/DepositTokenLibrary.sol b/src/libraries/fixed/DepositTokenLibrary.sol similarity index 98% rename from src/core/libraries/fixed/DepositTokenLibrary.sol rename to src/libraries/fixed/DepositTokenLibrary.sol index e2195934..945564e6 100644 --- a/src/core/libraries/fixed/DepositTokenLibrary.sol +++ b/src/libraries/fixed/DepositTokenLibrary.sol @@ -5,7 +5,7 @@ import {IAToken} from "@aave/interfaces/IAToken.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; /// @title DepositTokenLibrary /// @custom:security-contact security@size.credit diff --git a/src/core/libraries/fixed/LoanLibrary.sol b/src/libraries/fixed/LoanLibrary.sol similarity index 96% rename from src/core/libraries/fixed/LoanLibrary.sol rename to src/libraries/fixed/LoanLibrary.sol index 8c040949..779a5f8e 100644 --- a/src/core/libraries/fixed/LoanLibrary.sol +++ b/src/libraries/fixed/LoanLibrary.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Math} from "@src/core/libraries/Math.sol"; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; uint256 constant DEBT_POSITION_ID_START = 0; uint256 constant CREDIT_POSITION_ID_START = type(uint256).max / 2; diff --git a/src/core/libraries/fixed/OfferLibrary.sol b/src/libraries/fixed/OfferLibrary.sol similarity index 93% rename from src/core/libraries/fixed/OfferLibrary.sol rename to src/libraries/fixed/OfferLibrary.sol index afffe59c..eb8f90d9 100644 --- a/src/core/libraries/fixed/OfferLibrary.sol +++ b/src/libraries/fixed/OfferLibrary.sol @@ -1,13 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Math} from "@src/core/libraries/Math.sol"; -import { - VariablePoolBorrowRateParams, - YieldCurve, - YieldCurveLibrary -} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {VariablePoolBorrowRateParams, YieldCurve, YieldCurveLibrary} from "@src/libraries/fixed/YieldCurveLibrary.sol"; struct LoanOffer { // The maximum due date of the loan offer diff --git a/src/core/libraries/fixed/RiskLibrary.sol b/src/libraries/fixed/RiskLibrary.sol similarity index 97% rename from src/core/libraries/fixed/RiskLibrary.sol rename to src/libraries/fixed/RiskLibrary.sol index e4f43361..3c1ff393 100644 --- a/src/core/libraries/fixed/RiskLibrary.sol +++ b/src/libraries/fixed/RiskLibrary.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; -import {Math} from "@src/core/libraries/Math.sol"; -import {CreditPosition, DebtPosition, LoanLibrary, LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {CreditPosition, DebtPosition, LoanLibrary, LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; /// @title RiskLibrary /// @custom:security-contact security@size.credit diff --git a/src/core/libraries/fixed/YieldCurveLibrary.sol b/src/libraries/fixed/YieldCurveLibrary.sol similarity index 98% rename from src/core/libraries/fixed/YieldCurveLibrary.sol rename to src/libraries/fixed/YieldCurveLibrary.sol index d8687ad6..0a872e13 100644 --- a/src/core/libraries/fixed/YieldCurveLibrary.sol +++ b/src/libraries/fixed/YieldCurveLibrary.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.23; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Math, PERCENT} from "@src/core/libraries/Math.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Math, PERCENT} from "@src/libraries/Math.sol"; struct YieldCurve { // array of tenors in seconds diff --git a/src/core/libraries/fixed/actions/BuyCreditLimit.sol b/src/libraries/fixed/actions/BuyCreditLimit.sol similarity index 87% rename from src/core/libraries/fixed/actions/BuyCreditLimit.sol rename to src/libraries/fixed/actions/BuyCreditLimit.sol index cf33e90e..ff61ae2b 100644 --- a/src/core/libraries/fixed/actions/BuyCreditLimit.sol +++ b/src/libraries/fixed/actions/BuyCreditLimit.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {YieldCurve, YieldCurveLibrary} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {YieldCurve, YieldCurveLibrary} from "@src/libraries/fixed/YieldCurveLibrary.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct BuyCreditLimitParams { // The maximum due date of the loan offer diff --git a/src/core/libraries/fixed/actions/BuyCreditMarket.sol b/src/libraries/fixed/actions/BuyCreditMarket.sol similarity index 92% rename from src/core/libraries/fixed/actions/BuyCreditMarket.sol rename to src/libraries/fixed/actions/BuyCreditMarket.sol index bb85b59e..5eec5fe8 100644 --- a/src/core/libraries/fixed/actions/BuyCreditMarket.sol +++ b/src/libraries/fixed/actions/BuyCreditMarket.sol @@ -1,17 +1,17 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State, User} from "@src/core/SizeStorage.sol"; +import {State, User} from "@src/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; -import {Math, PERCENT} from "@src/core/libraries/Math.sol"; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; -import {CreditPosition, DebtPosition, LoanLibrary, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {BorrowOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; +import {Math, PERCENT} from "@src/libraries/Math.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; +import {CreditPosition, DebtPosition, LoanLibrary, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {BorrowOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; -import {VariablePoolBorrowRateParams} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; +import {VariablePoolBorrowRateParams} from "@src/libraries/fixed/YieldCurveLibrary.sol"; struct BuyCreditMarketParams { // The borrower diff --git a/src/core/libraries/fixed/actions/Claim.sol b/src/libraries/fixed/actions/Claim.sol similarity index 86% rename from src/core/libraries/fixed/actions/Claim.sol rename to src/libraries/fixed/actions/Claim.sol index d1ec6c3f..a8fb416f 100644 --- a/src/core/libraries/fixed/actions/Claim.sol +++ b/src/libraries/fixed/actions/Claim.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Math} from "@src/core/libraries/Math.sol"; -import {CreditPosition, DebtPosition, LoanLibrary, LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {CreditPosition, DebtPosition, LoanLibrary, LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct ClaimParams { // The credit position ID to claim diff --git a/src/core/libraries/fixed/actions/Compensate.sol b/src/libraries/fixed/actions/Compensate.sol similarity index 93% rename from src/core/libraries/fixed/actions/Compensate.sol rename to src/libraries/fixed/actions/Compensate.sol index 695d7d69..ca7d9773 100644 --- a/src/core/libraries/fixed/actions/Compensate.sol +++ b/src/libraries/fixed/actions/Compensate.sol @@ -1,23 +1,19 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; import { - CreditPosition, - DebtPosition, - LoanLibrary, - LoanStatus, - RESERVED_ID -} from "@src/core/libraries/fixed/LoanLibrary.sol"; - -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; + CreditPosition, DebtPosition, LoanLibrary, LoanStatus, RESERVED_ID +} from "@src/libraries/fixed/LoanLibrary.sol"; + +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; struct CompensateParams { // The credit position ID with debt to repay diff --git a/src/core/libraries/fixed/actions/Liquidate.sol b/src/libraries/fixed/actions/Liquidate.sol similarity index 91% rename from src/core/libraries/fixed/actions/Liquidate.sol rename to src/libraries/fixed/actions/Liquidate.sol index 9f8215c0..a1551ff3 100644 --- a/src/core/libraries/fixed/actions/Liquidate.sol +++ b/src/libraries/fixed/actions/Liquidate.sol @@ -1,19 +1,19 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; -import {DebtPosition, LoanLibrary, LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {DebtPosition, LoanLibrary, LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct LiquidateParams { // The debt position ID to liquidate diff --git a/src/core/libraries/fixed/actions/LiquidateWithReplacement.sol b/src/libraries/fixed/actions/LiquidateWithReplacement.sol similarity index 91% rename from src/core/libraries/fixed/actions/LiquidateWithReplacement.sol rename to src/libraries/fixed/actions/LiquidateWithReplacement.sol index 5648d5a2..de6e80fb 100644 --- a/src/core/libraries/fixed/actions/LiquidateWithReplacement.sol +++ b/src/libraries/fixed/actions/LiquidateWithReplacement.sol @@ -1,20 +1,20 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; -import {CreditPosition, DebtPosition, LoanLibrary, LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {BorrowOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {VariablePoolBorrowRateParams} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {CreditPosition, DebtPosition, LoanLibrary, LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; +import {BorrowOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {VariablePoolBorrowRateParams} from "@src/libraries/fixed/YieldCurveLibrary.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Liquidate, LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; +import {Liquidate, LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct LiquidateWithReplacementParams { // The debt position ID to liquidate diff --git a/src/core/libraries/fixed/actions/Repay.sol b/src/libraries/fixed/actions/Repay.sol similarity index 80% rename from src/core/libraries/fixed/actions/Repay.sol rename to src/libraries/fixed/actions/Repay.sol index baf07efa..a736fd73 100644 --- a/src/core/libraries/fixed/actions/Repay.sol +++ b/src/libraries/fixed/actions/Repay.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; -import {DebtPosition, LoanLibrary, LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {DebtPosition, LoanLibrary, LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct RepayParams { uint256 debtPositionId; diff --git a/src/core/libraries/fixed/actions/SelfLiquidate.sol b/src/libraries/fixed/actions/SelfLiquidate.sol similarity index 85% rename from src/core/libraries/fixed/actions/SelfLiquidate.sol rename to src/libraries/fixed/actions/SelfLiquidate.sol index 52e9c382..ab899f24 100644 --- a/src/core/libraries/fixed/actions/SelfLiquidate.sol +++ b/src/libraries/fixed/actions/SelfLiquidate.sol @@ -1,16 +1,16 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; -import {CreditPosition, DebtPosition, LoanLibrary} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; +import {CreditPosition, DebtPosition, LoanLibrary} from "@src/libraries/fixed/LoanLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct SelfLiquidateParams { // The credit position ID diff --git a/src/core/libraries/fixed/actions/SellCreditLimit.sol b/src/libraries/fixed/actions/SellCreditLimit.sol similarity index 86% rename from src/core/libraries/fixed/actions/SellCreditLimit.sol rename to src/libraries/fixed/actions/SellCreditLimit.sol index 5568a8cc..f6a39e69 100644 --- a/src/core/libraries/fixed/actions/SellCreditLimit.sol +++ b/src/libraries/fixed/actions/SellCreditLimit.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State} from "@src/core/SizeStorage.sol"; -import {BorrowOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {YieldCurve, YieldCurveLibrary} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {State} from "@src/SizeStorage.sol"; +import {BorrowOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {YieldCurve, YieldCurveLibrary} from "@src/libraries/fixed/YieldCurveLibrary.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Events} from "@src/libraries/Events.sol"; struct SellCreditLimitParams { // The yield curve of the borrow offer diff --git a/src/core/libraries/fixed/actions/SellCreditMarket.sol b/src/libraries/fixed/actions/SellCreditMarket.sol similarity index 92% rename from src/core/libraries/fixed/actions/SellCreditMarket.sol rename to src/libraries/fixed/actions/SellCreditMarket.sol index c04ff193..fc0ff35a 100644 --- a/src/core/libraries/fixed/actions/SellCreditMarket.sol +++ b/src/libraries/fixed/actions/SellCreditMarket.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Math, PERCENT} from "@src/core/libraries/Math.sol"; -import {CreditPosition, DebtPosition, LoanLibrary, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {VariablePoolBorrowRateParams} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {Math, PERCENT} from "@src/libraries/Math.sol"; +import {CreditPosition, DebtPosition, LoanLibrary, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {VariablePoolBorrowRateParams} from "@src/libraries/fixed/YieldCurveLibrary.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {AccountingLibrary} from "@src/core/libraries/fixed/AccountingLibrary.sol"; -import {RiskLibrary} from "@src/core/libraries/fixed/RiskLibrary.sol"; +import {AccountingLibrary} from "@src/libraries/fixed/AccountingLibrary.sol"; +import {RiskLibrary} from "@src/libraries/fixed/RiskLibrary.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct SellCreditMarketParams { // The lender diff --git a/src/core/libraries/fixed/actions/SetUserConfiguration.sol b/src/libraries/fixed/actions/SetUserConfiguration.sol similarity index 91% rename from src/core/libraries/fixed/actions/SetUserConfiguration.sol rename to src/libraries/fixed/actions/SetUserConfiguration.sol index d48cc14d..0980a184 100644 --- a/src/core/libraries/fixed/actions/SetUserConfiguration.sol +++ b/src/libraries/fixed/actions/SetUserConfiguration.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State, User} from "@src/core/SizeStorage.sol"; +import {State, User} from "@src/SizeStorage.sol"; -import {CreditPosition, LoanLibrary, LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {CreditPosition, LoanLibrary, LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct SetUserConfigurationParams { // The opening limit borrow CR diff --git a/src/core/libraries/general/actions/Deposit.sol b/src/libraries/general/actions/Deposit.sol similarity index 88% rename from src/core/libraries/general/actions/Deposit.sol rename to src/libraries/general/actions/Deposit.sol index 79c22b11..c8245a23 100644 --- a/src/core/libraries/general/actions/Deposit.sol +++ b/src/libraries/general/actions/Deposit.sol @@ -3,15 +3,15 @@ pragma solidity 0.8.23; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import {IWETH} from "@src/core/interfaces/IWETH.sol"; -import {CapsLibrary} from "@src/core/libraries/fixed/CapsLibrary.sol"; +import {IWETH} from "@src/interfaces/IWETH.sol"; +import {CapsLibrary} from "@src/libraries/fixed/CapsLibrary.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {DepositTokenLibrary} from "@src/core/libraries/fixed/DepositTokenLibrary.sol"; +import {DepositTokenLibrary} from "@src/libraries/fixed/DepositTokenLibrary.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct DepositParams { // The token to deposit diff --git a/src/core/libraries/general/actions/Initialize.sol b/src/libraries/general/actions/Initialize.sol similarity index 94% rename from src/core/libraries/general/actions/Initialize.sol rename to src/libraries/general/actions/Initialize.sol index afe8c72e..63200c6d 100644 --- a/src/core/libraries/general/actions/Initialize.sol +++ b/src/libraries/general/actions/Initialize.sol @@ -3,22 +3,22 @@ pragma solidity 0.8.23; import {IPool} from "@aave/interfaces/IPool.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import {IWETH} from "@src/core/interfaces/IWETH.sol"; +import {IWETH} from "@src/interfaces/IWETH.sol"; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; -import {CREDIT_POSITION_ID_START, DEBT_POSITION_ID_START} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; +import {CREDIT_POSITION_ID_START, DEBT_POSITION_ID_START} from "@src/libraries/fixed/LoanLibrary.sol"; -import {IPriceFeed} from "@src/core/oracle/IPriceFeed.sol"; +import {IPriceFeed} from "@src/oracle/IPriceFeed.sol"; -import {NonTransferrableScaledToken} from "@src/core/token/NonTransferrableScaledToken.sol"; -import {NonTransferrableToken} from "@src/core/token/NonTransferrableToken.sol"; +import {NonTransferrableScaledToken} from "@src/token/NonTransferrableScaledToken.sol"; +import {NonTransferrableToken} from "@src/token/NonTransferrableToken.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; // See SizeStorage.sol for the definitions of the structs below struct InitializeFeeConfigParams { diff --git a/src/core/libraries/general/actions/UpdateConfig.sol b/src/libraries/general/actions/UpdateConfig.sol similarity index 94% rename from src/core/libraries/general/actions/UpdateConfig.sol rename to src/libraries/general/actions/UpdateConfig.sol index 3a17d497..fd6e10c8 100644 --- a/src/core/libraries/general/actions/UpdateConfig.sol +++ b/src/libraries/general/actions/UpdateConfig.sol @@ -2,21 +2,21 @@ pragma solidity 0.8.23; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; -import {State} from "@src/core/SizeStorage.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {State} from "@src/SizeStorage.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; -import {Math, PERCENT, YEAR} from "@src/core/libraries/Math.sol"; -import {Initialize} from "@src/core/libraries/general/actions/Initialize.sol"; +import {Math, PERCENT, YEAR} from "@src/libraries/Math.sol"; +import {Initialize} from "@src/libraries/general/actions/Initialize.sol"; -import {IPriceFeed} from "@src/core/oracle/IPriceFeed.sol"; +import {IPriceFeed} from "@src/oracle/IPriceFeed.sol"; import { InitializeDataParams, InitializeFeeConfigParams, InitializeOracleParams, InitializeRiskConfigParams -} from "@src/core/libraries/general/actions/Initialize.sol"; +} from "@src/libraries/general/actions/Initialize.sol"; struct UpdateConfigParams { // The key of the configuration parameter to update diff --git a/src/core/libraries/general/actions/Withdraw.sol b/src/libraries/general/actions/Withdraw.sol similarity index 86% rename from src/core/libraries/general/actions/Withdraw.sol rename to src/libraries/general/actions/Withdraw.sol index cae6ddd6..47fad4ff 100644 --- a/src/core/libraries/general/actions/Withdraw.sol +++ b/src/libraries/general/actions/Withdraw.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {State} from "@src/core/SizeStorage.sol"; +import {State} from "@src/SizeStorage.sol"; -import {Math} from "@src/core/libraries/Math.sol"; -import {DepositTokenLibrary} from "@src/core/libraries/fixed/DepositTokenLibrary.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {DepositTokenLibrary} from "@src/libraries/fixed/DepositTokenLibrary.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {Events} from "@src/core/libraries/Events.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {Events} from "@src/libraries/Events.sol"; struct WithdrawParams { // The token to withdraw diff --git a/src/core/oracle/IPriceFeed.sol b/src/oracle/IPriceFeed.sol similarity index 100% rename from src/core/oracle/IPriceFeed.sol rename to src/oracle/IPriceFeed.sol diff --git a/src/core/oracle/PriceFeed.sol b/src/oracle/PriceFeed.sol similarity index 97% rename from src/core/oracle/PriceFeed.sol rename to src/oracle/PriceFeed.sol index 619a40f1..bbc6d7d3 100644 --- a/src/core/oracle/PriceFeed.sol +++ b/src/oracle/PriceFeed.sol @@ -3,10 +3,10 @@ pragma solidity 0.8.23; import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; import {IPriceFeed} from "./IPriceFeed.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; /// @title PriceFeed /// @custom:security-contact security@size.credit diff --git a/src/core/token/NonTransferrableScaledToken.sol b/src/token/NonTransferrableScaledToken.sol similarity index 96% rename from src/core/token/NonTransferrableScaledToken.sol rename to src/token/NonTransferrableScaledToken.sol index 4178cdf2..fa74c12b 100644 --- a/src/core/token/NonTransferrableScaledToken.sol +++ b/src/token/NonTransferrableScaledToken.sol @@ -5,10 +5,10 @@ import {IPool} from "@aave/interfaces/IPool.sol"; import {WadRayMath} from "@aave/protocol/libraries/math/WadRayMath.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/interfaces/IERC20Metadata.sol"; -import {Math} from "@src/core/libraries/Math.sol"; -import {NonTransferrableToken} from "@src/core/token/NonTransferrableToken.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {NonTransferrableToken} from "@src/token/NonTransferrableToken.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; /// @title NonTransferrableScaledToken /// @custom:security-contact security@size.credit diff --git a/src/core/token/NonTransferrableToken.sol b/src/token/NonTransferrableToken.sol similarity index 97% rename from src/core/token/NonTransferrableToken.sol rename to src/token/NonTransferrableToken.sol index 0588e36e..9e7253d2 100644 --- a/src/core/token/NonTransferrableToken.sol +++ b/src/token/NonTransferrableToken.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.23; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; /// @title NonTransferrableToken /// @custom:security-contact security@size.credit diff --git a/test/BaseTestFixed.sol b/test/BaseTestFixed.sol index b90ae222..76fa9443 100644 --- a/test/BaseTestFixed.sol +++ b/test/BaseTestFixed.sol @@ -5,35 +5,30 @@ import {Test} from "forge-std/Test.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import {Size} from "@src/core/Size.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {Size} from "@src/Size.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; -import {WithdrawParams} from "@src/core/libraries/general/actions/Withdraw.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; +import {WithdrawParams} from "@src/libraries/general/actions/Withdraw.sol"; -import {SellCreditLimitParams} from "@src/core/libraries/fixed/actions/SellCreditLimit.sol"; -import {SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; +import {SellCreditLimitParams} from "@src/libraries/fixed/actions/SellCreditLimit.sol"; +import {SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; -import { - CreditPosition, - DEBT_POSITION_ID_START, - DebtPosition, - RESERVED_ID -} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {CreditPosition, DEBT_POSITION_ID_START, DebtPosition, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; -import {BuyCreditLimitParams} from "@src/core/libraries/fixed/actions/BuyCreditLimit.sol"; -import {ClaimParams} from "@src/core/libraries/fixed/actions/Claim.sol"; -import {LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; +import {BuyCreditLimitParams} from "@src/libraries/fixed/actions/BuyCreditLimit.sol"; +import {ClaimParams} from "@src/libraries/fixed/actions/Claim.sol"; +import {LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; -import {CompensateParams} from "@src/core/libraries/fixed/actions/Compensate.sol"; -import {LiquidateWithReplacementParams} from "@src/core/libraries/fixed/actions/LiquidateWithReplacement.sol"; -import {RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; -import {SelfLiquidateParams} from "@src/core/libraries/fixed/actions/SelfLiquidate.sol"; +import {CompensateParams} from "@src/libraries/fixed/actions/Compensate.sol"; +import {LiquidateWithReplacementParams} from "@src/libraries/fixed/actions/LiquidateWithReplacement.sol"; +import {RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; +import {SelfLiquidateParams} from "@src/libraries/fixed/actions/SelfLiquidate.sol"; -import {BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; -import {SetUserConfigurationParams} from "@src/core/libraries/fixed/actions/SetUserConfiguration.sol"; +import {BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; +import {SetUserConfigurationParams} from "@src/libraries/fixed/actions/SetUserConfiguration.sol"; import {BaseTestGeneral} from "@test/BaseTestGeneral.sol"; diff --git a/test/BaseTestGeneral.sol b/test/BaseTestGeneral.sol index 6f0bb295..06e70c2d 100644 --- a/test/BaseTestGeneral.sol +++ b/test/BaseTestGeneral.sol @@ -5,12 +5,12 @@ import {Test} from "forge-std/Test.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import {UpdateConfigParams} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +import {UpdateConfigParams} from "@src/libraries/general/actions/UpdateConfig.sol"; import {PriceFeedMock} from "@test/mocks/PriceFeedMock.sol"; -import {KEEPER_ROLE} from "@src/core/Size.sol"; -import {UserView} from "@src/core/SizeView.sol"; +import {KEEPER_ROLE} from "@src/Size.sol"; +import {UserView} from "@src/SizeView.sol"; import {Deploy} from "@script/Deploy.sol"; diff --git a/test/Logger.sol b/test/Logger.sol index fa410192..3a821a1b 100644 --- a/test/Logger.sol +++ b/test/Logger.sol @@ -2,16 +2,16 @@ pragma solidity 0.8.23; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; -import {Size} from "@src/core/Size.sol"; -import {UserView} from "@src/core/SizeView.sol"; +import {Size} from "@src/Size.sol"; +import {UserView} from "@src/SizeView.sol"; import { CREDIT_POSITION_ID_START, CreditPosition, DEBT_POSITION_ID_START, DebtPosition, LoanLibrary -} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {BorrowOffer, LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; +} from "@src/libraries/fixed/LoanLibrary.sol"; +import {BorrowOffer, LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; import {console2 as console} from "forge-std/console2.sol"; diff --git a/test/fork/Deploy.t.sol b/test/fork/Deploy.t.sol index 0690b8db..44008491 100644 --- a/test/fork/Deploy.t.sol +++ b/test/fork/Deploy.t.sol @@ -5,10 +5,10 @@ import {WadRayMath} from "@aave/protocol/libraries/math/WadRayMath.sol"; import {ForkTest} from "@test/fork/ForkTest.sol"; import {DeployScript} from "@script/Deploy.s.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; -import {SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; +import {SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; import {Test} from "forge-std/Test.sol"; contract DeployScriptTest is ForkTest { diff --git a/test/helpers/AssertsHelper.sol b/test/helpers/AssertsHelper.sol index 5b5c1e20..73c4d1d6 100644 --- a/test/helpers/AssertsHelper.sol +++ b/test/helpers/AssertsHelper.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.23; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; -import {UserView} from "@src/core/SizeView.sol"; -import {LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {UserView} from "@src/SizeView.sol"; +import {LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; import {Test} from "forge-std/Test.sol"; diff --git a/test/helpers/libraries/YieldCurveHelper.sol b/test/helpers/libraries/YieldCurveHelper.sol index 6cc00c37..3f69f6ba 100644 --- a/test/helpers/libraries/YieldCurveHelper.sol +++ b/test/helpers/libraries/YieldCurveHelper.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.23; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; library YieldCurveHelper { // ----------- CURVES ------------- diff --git a/test/invariants/ExpectedErrors.sol b/test/invariants/ExpectedErrors.sol index e0cb9507..2e016edb 100644 --- a/test/invariants/ExpectedErrors.sol +++ b/test/invariants/ExpectedErrors.sol @@ -6,7 +6,7 @@ import {IERC20Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.so import {Deploy} from "@script/Deploy.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; import {Properties} from "@test/invariants/Properties.sol"; abstract contract ExpectedErrors is Deploy, Properties { diff --git a/test/invariants/Ghosts.sol b/test/invariants/Ghosts.sol index 04b05f75..25cb3c27 100644 --- a/test/invariants/Ghosts.sol +++ b/test/invariants/Ghosts.sol @@ -4,9 +4,9 @@ pragma solidity 0.8.23; import {Asserts} from "@chimera/Asserts.sol"; import {PropertiesConstants} from "@crytic/properties/contracts/util/PropertiesConstants.sol"; -import {UserView} from "@src/core/SizeView.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {CreditPosition, DebtPosition, LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {UserView} from "@src/SizeView.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {CreditPosition, DebtPosition, LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; import {Deploy} from "@script/Deploy.sol"; diff --git a/test/invariants/Helper.sol b/test/invariants/Helper.sol index 6d37db22..0289d7bb 100644 --- a/test/invariants/Helper.sol +++ b/test/invariants/Helper.sol @@ -2,14 +2,14 @@ pragma solidity 0.8.23; import {PropertiesConstants} from "@crytic/properties/contracts/util/PropertiesConstants.sol"; -import {CREDIT_POSITION_ID_START, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {CREDIT_POSITION_ID_START, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; import {Deploy} from "@script/Deploy.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; import {Bounds} from "@test/invariants/Bounds.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; abstract contract Helper is Deploy, PropertiesConstants, Bounds { function _getRandomUser(address user) internal pure returns (address) { diff --git a/test/invariants/Properties.sol b/test/invariants/Properties.sol index 4396eebb..f93a5443 100644 --- a/test/invariants/Properties.sol +++ b/test/invariants/Properties.sol @@ -3,12 +3,12 @@ pragma solidity 0.8.23; import {Ghosts} from "./Ghosts.sol"; -import {Math, PERCENT} from "@src/core/libraries/Math.sol"; +import {Math, PERCENT} from "@src/libraries/Math.sol"; import {PropertiesSpecifications} from "@test/invariants/PropertiesSpecifications.sol"; import {ITargetFunctions} from "@test/invariants/interfaces/ITargetFunctions.sol"; -import {UserView} from "@src/core/SizeView.sol"; +import {UserView} from "@src/SizeView.sol"; import { CREDIT_POSITION_ID_START, @@ -17,7 +17,7 @@ import { DebtPosition, LoanLibrary, LoanStatus -} from "@src/core/libraries/fixed/LoanLibrary.sol"; +} from "@src/libraries/fixed/LoanLibrary.sol"; abstract contract Properties is Ghosts, PropertiesSpecifications { using LoanLibrary for DebtPosition; diff --git a/test/invariants/TargetFunctions.sol b/test/invariants/TargetFunctions.sol index e94d7b96..8b8017d3 100644 --- a/test/invariants/TargetFunctions.sol +++ b/test/invariants/TargetFunctions.sol @@ -7,7 +7,7 @@ import {BaseTargetFunctions} from "@chimera/BaseTargetFunctions.sol"; import "@crytic/properties/contracts/util/Hevm.sol"; -import {Math, PERCENT} from "@src/core/libraries/Math.sol"; +import {Math, PERCENT} from "@src/libraries/Math.sol"; import {WadRayMath} from "@aave/protocol/libraries/math/WadRayMath.sol"; import {PoolMock} from "@test/mocks/PoolMock.sol"; @@ -15,38 +15,36 @@ import {PoolMock} from "@test/mocks/PoolMock.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import {PriceFeedMock} from "@test/mocks/PriceFeedMock.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; -import {LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {SellCreditLimitParams} from "@src/core/libraries/fixed/actions/SellCreditLimit.sol"; -import {SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; +import {LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; +import {SellCreditLimitParams} from "@src/libraries/fixed/actions/SellCreditLimit.sol"; +import {SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; -import {ClaimParams} from "@src/core/libraries/fixed/actions/Claim.sol"; +import {ClaimParams} from "@src/libraries/fixed/actions/Claim.sol"; -import {CompensateParams} from "@src/core/libraries/fixed/actions/Compensate.sol"; +import {CompensateParams} from "@src/libraries/fixed/actions/Compensate.sol"; -import {BuyCreditLimitParams} from "@src/core/libraries/fixed/actions/BuyCreditLimit.sol"; -import {BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; -import {LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; +import {BuyCreditLimitParams} from "@src/libraries/fixed/actions/BuyCreditLimit.sol"; +import {BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; +import {LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; -import {LiquidateWithReplacementParams} from "@src/core/libraries/fixed/actions/LiquidateWithReplacement.sol"; -import {RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; -import {SelfLiquidateParams} from "@src/core/libraries/fixed/actions/SelfLiquidate.sol"; -import {WithdrawParams} from "@src/core/libraries/general/actions/Withdraw.sol"; +import {LiquidateWithReplacementParams} from "@src/libraries/fixed/actions/LiquidateWithReplacement.sol"; +import {RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; +import {SelfLiquidateParams} from "@src/libraries/fixed/actions/SelfLiquidate.sol"; +import {WithdrawParams} from "@src/libraries/general/actions/Withdraw.sol"; -import {SetUserConfigurationParams} from "@src/core/libraries/fixed/actions/SetUserConfiguration.sol"; +import {SetUserConfigurationParams} from "@src/libraries/fixed/actions/SetUserConfiguration.sol"; -import {UpdateConfigParams} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +import {UpdateConfigParams} from "@src/libraries/general/actions/UpdateConfig.sol"; -import {KEEPER_ROLE} from "@src/core/Size.sol"; +import {KEEPER_ROLE} from "@src/Size.sol"; import {ExpectedErrors} from "@test/invariants/ExpectedErrors.sol"; import {ITargetFunctions} from "@test/invariants/interfaces/ITargetFunctions.sol"; -import { - CREDIT_POSITION_ID_START, DEBT_POSITION_ID_START, RESERVED_ID -} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {CREDIT_POSITION_ID_START, DEBT_POSITION_ID_START, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; abstract contract TargetFunctions is Helper, ExpectedErrors, BaseTargetFunctions, ITargetFunctions { function setup() internal override { diff --git a/test/libraries/Math.t.sol b/test/libraries/Math.t.sol index cda1bac3..61bbc8ea 100644 --- a/test/libraries/Math.t.sol +++ b/test/libraries/Math.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; import {AssertsHelper} from "@test/helpers/AssertsHelper.sol"; import {Test} from "forge-std/Test.sol"; diff --git a/test/libraries/Multicall.t.sol b/test/libraries/Multicall.t.sol index 61ee1f83..c1446c37 100644 --- a/test/libraries/Multicall.t.sol +++ b/test/libraries/Multicall.t.sol @@ -5,19 +5,19 @@ import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import {DebtPosition} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; +import {DebtPosition} from "@src/libraries/fixed/LoanLibrary.sol"; +import {RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; -import {BuyCreditLimitParams} from "@src/core/libraries/fixed/actions/BuyCreditLimit.sol"; -import {LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; -import {SellCreditLimitParams} from "@src/core/libraries/fixed/actions/SellCreditLimit.sol"; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; -import {WithdrawParams} from "@src/core/libraries/general/actions/Withdraw.sol"; +import {BuyCreditLimitParams} from "@src/libraries/fixed/actions/BuyCreditLimit.sol"; +import {LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; +import {SellCreditLimitParams} from "@src/libraries/fixed/actions/SellCreditLimit.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; +import {WithdrawParams} from "@src/libraries/general/actions/Withdraw.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; diff --git a/test/libraries/OfferLibrary.t.sol b/test/libraries/OfferLibrary.t.sol index 862d5849..85f34c9f 100644 --- a/test/libraries/OfferLibrary.t.sol +++ b/test/libraries/OfferLibrary.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {BorrowOffer, LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; +import {BorrowOffer, LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; import {Test} from "forge-std/Test.sol"; contract OfferLibraryTest is Test { diff --git a/test/libraries/YieldCurveLibrary.t.sol b/test/libraries/YieldCurveLibrary.t.sol index b99c15fd..3bf83f10 100644 --- a/test/libraries/YieldCurveLibrary.t.sol +++ b/test/libraries/YieldCurveLibrary.t.sol @@ -2,14 +2,10 @@ pragma solidity 0.8.23; import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; - -import {Math} from "@src/core/libraries/Math.sol"; -import { - VariablePoolBorrowRateParams, - YieldCurve, - YieldCurveLibrary -} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {Errors} from "@src/libraries/Errors.sol"; + +import {Math} from "@src/libraries/Math.sol"; +import {VariablePoolBorrowRateParams, YieldCurve, YieldCurveLibrary} from "@src/libraries/fixed/YieldCurveLibrary.sol"; import {AssertsHelper} from "@test/helpers/AssertsHelper.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; diff --git a/test/local/fixed/BuyCreditLimit.t.sol b/test/local/fixed/BuyCreditLimit.t.sol index 2fd524c0..c5f3fc62 100644 --- a/test/local/fixed/BuyCreditLimit.t.sol +++ b/test/local/fixed/BuyCreditLimit.t.sol @@ -3,16 +3,16 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {BuyCreditLimitParams} from "@src/core/libraries/fixed/actions/BuyCreditLimit.sol"; +import {BuyCreditLimitParams} from "@src/libraries/fixed/actions/BuyCreditLimit.sol"; -import {SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; +import {SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; contract BuyCreditLimitTest is BaseTest { using OfferLibrary for LoanOffer; diff --git a/test/local/fixed/BuyCreditLimitValidation.t.sol b/test/local/fixed/BuyCreditLimitValidation.t.sol index 7a2f1ade..6f337afe 100644 --- a/test/local/fixed/BuyCreditLimitValidation.t.sol +++ b/test/local/fixed/BuyCreditLimitValidation.t.sol @@ -3,11 +3,11 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; -import {BuyCreditLimitParams} from "@src/core/libraries/fixed/actions/BuyCreditLimit.sol"; +import {LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; +import {BuyCreditLimitParams} from "@src/libraries/fixed/actions/BuyCreditLimit.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract BuyCreditLimitValidationTest is BaseTest { using OfferLibrary for LoanOffer; diff --git a/test/local/fixed/BuyCreditMarket.t.sol b/test/local/fixed/BuyCreditMarket.t.sol index c299e330..e69fb821 100644 --- a/test/local/fixed/BuyCreditMarket.t.sol +++ b/test/local/fixed/BuyCreditMarket.t.sol @@ -4,17 +4,17 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; -import {LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {YieldCurve, YieldCurveLibrary} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; -import {BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; +import {LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {YieldCurve, YieldCurveLibrary} from "@src/libraries/fixed/YieldCurveLibrary.sol"; +import {BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; contract BuyCreditMarketLendTest is BaseTest { using OfferLibrary for LoanOffer; diff --git a/test/local/fixed/BuyCreditMarketValidation.t.sol b/test/local/fixed/BuyCreditMarketValidation.t.sol index ba1126d0..a2f5ddbf 100644 --- a/test/local/fixed/BuyCreditMarketValidation.t.sol +++ b/test/local/fixed/BuyCreditMarketValidation.t.sol @@ -1,16 +1,16 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; import {BaseTest} from "@test/BaseTest.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; -import {LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {YieldCurve, YieldCurveLibrary} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; -import {BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; +import {LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {YieldCurve, YieldCurveLibrary} from "@src/libraries/fixed/YieldCurveLibrary.sol"; +import {BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; diff --git a/test/local/fixed/Claim.t.sol b/test/local/fixed/Claim.t.sol index 7ad178f5..291d6984 100644 --- a/test/local/fixed/Claim.t.sol +++ b/test/local/fixed/Claim.t.sol @@ -5,7 +5,7 @@ import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {CreditPosition, DebtPosition, LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {CreditPosition, DebtPosition, LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; contract ClaimTest is BaseTest { function test_Claim_claim_gets_loan_FV_back() public { diff --git a/test/local/fixed/ClaimValidation.t.sol b/test/local/fixed/ClaimValidation.t.sol index 5a4857b0..10ead6ac 100644 --- a/test/local/fixed/ClaimValidation.t.sol +++ b/test/local/fixed/ClaimValidation.t.sol @@ -3,12 +3,12 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {ClaimParams} from "@src/core/libraries/fixed/actions/Claim.sol"; -import {RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {ClaimParams} from "@src/libraries/fixed/actions/Claim.sol"; +import {RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract ClaimValidationTest is BaseTest { function test_Claim_validation() public { diff --git a/test/local/fixed/Compensate.t.sol b/test/local/fixed/Compensate.t.sol index 8c52b379..784285eb 100644 --- a/test/local/fixed/Compensate.t.sol +++ b/test/local/fixed/Compensate.t.sol @@ -1,21 +1,21 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; -import {BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; -import {CompensateParams} from "@src/core/libraries/fixed/actions/Compensate.sol"; +import {BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; +import {CompensateParams} from "@src/libraries/fixed/actions/Compensate.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {CreditPosition, DebtPosition, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {CreditPosition, DebtPosition, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; contract CompensateTest is BaseTest { function test_Compensate_compensate_reduces_repaid_loan_debt_and_compensated_loan_credit() public { diff --git a/test/local/fixed/CompensateValidation.t.sol b/test/local/fixed/CompensateValidation.t.sol index 5a47dcd0..181c3c7d 100644 --- a/test/local/fixed/CompensateValidation.t.sol +++ b/test/local/fixed/CompensateValidation.t.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {LoanStatus} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {LoanStatus} from "@src/libraries/fixed/LoanLibrary.sol"; import {BaseTest} from "@test/BaseTest.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {CompensateParams} from "@src/core/libraries/fixed/actions/Compensate.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {CompensateParams} from "@src/libraries/fixed/actions/Compensate.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract CompensateValidationTest is BaseTest { function test_Compensate_validation() public { diff --git a/test/local/fixed/Deposit.t.sol b/test/local/fixed/Deposit.t.sol index e292807a..fa86b417 100644 --- a/test/local/fixed/Deposit.t.sol +++ b/test/local/fixed/Deposit.t.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {UserView} from "@src/core/SizeView.sol"; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; +import {UserView} from "@src/SizeView.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; import {BaseTest} from "@test/BaseTest.sol"; contract DepositTest is BaseTest { diff --git a/test/local/fixed/DepositValidation.t.sol b/test/local/fixed/DepositValidation.t.sol index 510c910d..0143025e 100644 --- a/test/local/fixed/DepositValidation.t.sol +++ b/test/local/fixed/DepositValidation.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; import {BaseTest} from "@test/BaseTest.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract DepositValidationTest is BaseTest { function test_Deposit_validation() public { diff --git a/test/local/fixed/Liquidate.t.sol b/test/local/fixed/Liquidate.t.sol index d6b0ebdb..d48ee84c 100644 --- a/test/local/fixed/Liquidate.t.sol +++ b/test/local/fixed/Liquidate.t.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; +import {LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; -import {Math} from "@src/core/libraries/Math.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; -import {LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; +import {LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; contract LiquidateTest is BaseTest { diff --git a/test/local/fixed/LiquidateValidation.t.sol b/test/local/fixed/LiquidateValidation.t.sol index f2bc3770..1915f445 100644 --- a/test/local/fixed/LiquidateValidation.t.sol +++ b/test/local/fixed/LiquidateValidation.t.sol @@ -3,11 +3,11 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {LiquidateParams} from "@src/core/libraries/fixed/actions/Liquidate.sol"; +import {LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {LiquidateParams} from "@src/libraries/fixed/actions/Liquidate.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract LiquidateValidationTest is BaseTest { function test_Liquidate_validation() public { diff --git a/test/local/fixed/LiquidateWithReplacement.t.sol b/test/local/fixed/LiquidateWithReplacement.t.sol index f647490c..8c3f286a 100644 --- a/test/local/fixed/LiquidateWithReplacement.t.sol +++ b/test/local/fixed/LiquidateWithReplacement.t.sol @@ -4,15 +4,15 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; -import {Math} from "@src/core/libraries/Math.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; -import {LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {DebtPosition} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; +import {LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {DebtPosition} from "@src/libraries/fixed/LoanLibrary.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {LiquidateWithReplacementParams} from "@src/core/libraries/fixed/actions/LiquidateWithReplacement.sol"; +import {LiquidateWithReplacementParams} from "@src/libraries/fixed/actions/LiquidateWithReplacement.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract LiquidateWithReplacementTest is BaseTest { function setUp() public override { diff --git a/test/local/fixed/LiquidateWithReplacementValidation.t.sol b/test/local/fixed/LiquidateWithReplacementValidation.t.sol index 8961883f..82fe9fcf 100644 --- a/test/local/fixed/LiquidateWithReplacementValidation.t.sol +++ b/test/local/fixed/LiquidateWithReplacementValidation.t.sol @@ -3,11 +3,11 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; -import {LiquidateWithReplacementParams} from "@src/core/libraries/fixed/actions/LiquidateWithReplacement.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; +import {LiquidateWithReplacementParams} from "@src/libraries/fixed/actions/LiquidateWithReplacement.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract LiquidateWithReplacementValidationTest is BaseTest { function setUp() public override { diff --git a/test/local/fixed/Repay.t.sol b/test/local/fixed/Repay.t.sol index b3b176e0..d9c854cf 100644 --- a/test/local/fixed/Repay.t.sol +++ b/test/local/fixed/Repay.t.sol @@ -4,11 +4,11 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; -import {LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; -import {RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; +import {LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; +import {RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; contract RepayTest is BaseTest { diff --git a/test/local/fixed/RepayValidation.t.sol b/test/local/fixed/RepayValidation.t.sol index 375607d6..10b5e756 100644 --- a/test/local/fixed/RepayValidation.t.sol +++ b/test/local/fixed/RepayValidation.t.sol @@ -4,12 +4,12 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; import {IERC20Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {RepayParams} from "@src/core/libraries/fixed/actions/Repay.sol"; -import {WithdrawParams} from "@src/core/libraries/general/actions/Withdraw.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {RepayParams} from "@src/libraries/fixed/actions/Repay.sol"; +import {WithdrawParams} from "@src/libraries/general/actions/Withdraw.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract RepayValidationTest is BaseTest { function test_Repay_validation() public { diff --git a/test/local/fixed/SelfLiquidate.t.sol b/test/local/fixed/SelfLiquidate.t.sol index 36f61811..f0b372e7 100644 --- a/test/local/fixed/SelfLiquidate.t.sol +++ b/test/local/fixed/SelfLiquidate.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; diff --git a/test/local/fixed/SelfLiquidateValidation.t.sol b/test/local/fixed/SelfLiquidateValidation.t.sol index 7fb620ae..cf81b13d 100644 --- a/test/local/fixed/SelfLiquidateValidation.t.sol +++ b/test/local/fixed/SelfLiquidateValidation.t.sol @@ -3,11 +3,11 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {SelfLiquidateParams} from "@src/core/libraries/fixed/actions/SelfLiquidate.sol"; +import {LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {SelfLiquidateParams} from "@src/libraries/fixed/actions/SelfLiquidate.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract SelfLiquidateValidationTest is BaseTest { function test_SelfLiquidate_validation() public { diff --git a/test/local/fixed/SellCreditLimit.t.sol b/test/local/fixed/SellCreditLimit.t.sol index f4a38ef4..14230169 100644 --- a/test/local/fixed/SellCreditLimit.t.sol +++ b/test/local/fixed/SellCreditLimit.t.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; -import {DebtPosition} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {BuyCreditMarketParams} from "@src/core/libraries/fixed/actions/BuyCreditMarket.sol"; +import {DebtPosition} from "@src/libraries/fixed/LoanLibrary.sol"; +import {BuyCreditMarketParams} from "@src/libraries/fixed/actions/BuyCreditMarket.sol"; import {BaseTest} from "@test/BaseTest.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {BorrowOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {BorrowOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; contract SellCreditLimitTest is BaseTest { using OfferLibrary for BorrowOffer; diff --git a/test/local/fixed/SellCreditLimitValidation.t.sol b/test/local/fixed/SellCreditLimitValidation.t.sol index 4156da3e..7945a15b 100644 --- a/test/local/fixed/SellCreditLimitValidation.t.sol +++ b/test/local/fixed/SellCreditLimitValidation.t.sol @@ -3,12 +3,12 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {BorrowOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {YieldCurve} from "@src/core/libraries/fixed/YieldCurveLibrary.sol"; +import {BorrowOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {YieldCurve} from "@src/libraries/fixed/YieldCurveLibrary.sol"; -import {SellCreditLimitParams} from "@src/core/libraries/fixed/actions/SellCreditLimit.sol"; +import {SellCreditLimitParams} from "@src/libraries/fixed/actions/SellCreditLimit.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract SellCreditLimitValidationTest is BaseTest { using OfferLibrary for BorrowOffer; diff --git a/test/local/fixed/SellCreditMarket.t.sol b/test/local/fixed/SellCreditMarket.t.sol index c485eb52..1bcc3b12 100644 --- a/test/local/fixed/SellCreditMarket.t.sol +++ b/test/local/fixed/SellCreditMarket.t.sol @@ -1,24 +1,21 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {Vars} from "@test/BaseTestGeneral.sol"; -import {PERCENT} from "@src/core/libraries/Math.sol"; +import {PERCENT} from "@src/libraries/Math.sol"; import { - CREDIT_POSITION_ID_START, - CreditPosition, - DebtPosition, - LoanStatus -} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {LoanOffer, OfferLibrary} from "@src/core/libraries/fixed/OfferLibrary.sol"; -import {SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; + CREDIT_POSITION_ID_START, CreditPosition, DebtPosition, LoanStatus +} from "@src/libraries/fixed/LoanLibrary.sol"; +import {LoanOffer, OfferLibrary} from "@src/libraries/fixed/OfferLibrary.sol"; +import {SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Math} from "@src/core/libraries/Math.sol"; +import {Math} from "@src/libraries/Math.sol"; contract SellCreditMarketTest is BaseTest { using OfferLibrary for LoanOffer; diff --git a/test/local/fixed/SellCreditMarketValidation.t.sol b/test/local/fixed/SellCreditMarketValidation.t.sol index 146f5228..30f514c2 100644 --- a/test/local/fixed/SellCreditMarketValidation.t.sol +++ b/test/local/fixed/SellCreditMarketValidation.t.sol @@ -3,11 +3,11 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {LoanStatus, RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {SellCreditMarketParams} from "@src/core/libraries/fixed/actions/SellCreditMarket.sol"; +import {LoanStatus, RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {SellCreditMarketParams} from "@src/libraries/fixed/actions/SellCreditMarket.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract SellCreditMarketValidationTest is BaseTest { function test_SellCreditMarket_validation() public { diff --git a/test/local/fixed/SetUserConfiguration.t.sol b/test/local/fixed/SetUserConfiguration.t.sol index ed2a6d1f..969ff617 100644 --- a/test/local/fixed/SetUserConfiguration.t.sol +++ b/test/local/fixed/SetUserConfiguration.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; -import {CreditPosition, DebtPosition} from "@src/core/libraries/fixed/LoanLibrary.sol"; +import {CreditPosition, DebtPosition} from "@src/libraries/fixed/LoanLibrary.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; diff --git a/test/local/fixed/SetUserConfigurationValidation.t.sol b/test/local/fixed/SetUserConfigurationValidation.t.sol index cfac2c20..2c1b9b90 100644 --- a/test/local/fixed/SetUserConfigurationValidation.t.sol +++ b/test/local/fixed/SetUserConfigurationValidation.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {SetUserConfigurationParams} from "@src/core/libraries/fixed/actions/SetUserConfiguration.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {SetUserConfigurationParams} from "@src/libraries/fixed/actions/SetUserConfiguration.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract SetUserConfigurationValidationTest is BaseTest { function test_SetUserConfiguration_validation() public { diff --git a/test/local/fixed/Withdraw.t.sol b/test/local/fixed/Withdraw.t.sol index f3e8d62e..dd723c0d 100644 --- a/test/local/fixed/Withdraw.t.sol +++ b/test/local/fixed/Withdraw.t.sol @@ -6,13 +6,13 @@ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IER import {BaseTest} from "@test/BaseTest.sol"; -import {UserView} from "@src/core/SizeView.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {UserView} from "@src/SizeView.sol"; +import {Errors} from "@src/libraries/Errors.sol"; -import {Math, PERCENT} from "@src/core/libraries/Math.sol"; -import {RESERVED_ID} from "@src/core/libraries/fixed/LoanLibrary.sol"; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; -import {WithdrawParams} from "@src/core/libraries/general/actions/Withdraw.sol"; +import {Math, PERCENT} from "@src/libraries/Math.sol"; +import {RESERVED_ID} from "@src/libraries/fixed/LoanLibrary.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; +import {WithdrawParams} from "@src/libraries/general/actions/Withdraw.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; contract WithdrawTest is BaseTest { diff --git a/test/local/fixed/WithdrawValidation.t.sol b/test/local/fixed/WithdrawValidation.t.sol index c82cea34..e7068e58 100644 --- a/test/local/fixed/WithdrawValidation.t.sol +++ b/test/local/fixed/WithdrawValidation.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {WithdrawParams} from "@src/core/libraries/general/actions/Withdraw.sol"; +import {WithdrawParams} from "@src/libraries/general/actions/Withdraw.sol"; import {BaseTest} from "@test/BaseTest.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract WithdrawValidationTest is BaseTest { function test_Withdraw_validation() public { diff --git a/test/local/general/Initialize.t.sol b/test/local/general/Initialize.t.sol index 5b28c644..b763dba0 100644 --- a/test/local/general/Initialize.t.sol +++ b/test/local/general/Initialize.t.sol @@ -5,7 +5,7 @@ import {BaseTest} from "@test/BaseTest.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; contract InitializeTest is BaseTest { function test_Initialize_implementation_cannot_be_initialized() public { diff --git a/test/local/general/InitializeValidation.t.sol b/test/local/general/InitializeValidation.t.sol index 016e081b..60ee4494 100644 --- a/test/local/general/InitializeValidation.t.sol +++ b/test/local/general/InitializeValidation.t.sol @@ -6,12 +6,12 @@ import {Test} from "forge-std/Test.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {YAMv2} from "@test/mocks/YAMv2.sol"; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {USDC} from "@test/mocks/USDC.sol"; import {WETH} from "@test/mocks/WETH.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract InitializeValidationTest is Test, BaseTest { function test_Initialize_validation() public { diff --git a/test/local/general/Pause.t.sol b/test/local/general/Pause.t.sol index 2249631a..d144c50a 100644 --- a/test/local/general/Pause.t.sol +++ b/test/local/general/Pause.t.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.23; import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol"; -import {DepositParams} from "@src/core/libraries/general/actions/Deposit.sol"; -import {UpdateConfigParams} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +import {DepositParams} from "@src/libraries/general/actions/Deposit.sol"; +import {UpdateConfigParams} from "@src/libraries/general/actions/UpdateConfig.sol"; import {BaseTest} from "@test/BaseTest.sol"; contract PauseTest is BaseTest { diff --git a/test/local/general/SizeView.t.sol b/test/local/general/SizeView.t.sol index 62d5aa21..36d9c5f9 100644 --- a/test/local/general/SizeView.t.sol +++ b/test/local/general/SizeView.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {YieldCurveHelper} from "@test/helpers/libraries/YieldCurveHelper.sol"; diff --git a/test/local/general/UpdateConfig.t.sol b/test/local/general/UpdateConfig.t.sol index 3fdb96d1..a77d76a1 100644 --- a/test/local/general/UpdateConfig.t.sol +++ b/test/local/general/UpdateConfig.t.sol @@ -2,13 +2,13 @@ pragma solidity 0.8.23; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; import {BaseTest} from "@test/BaseTest.sol"; import {PriceFeedMock} from "@test/mocks/PriceFeedMock.sol"; -import {UpdateConfigParams} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +import {UpdateConfigParams} from "@src/libraries/general/actions/UpdateConfig.sol"; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; contract UpdateConfigTest is BaseTest { function test_UpdateConfig_updateConfig_reverts_if_not_owner() public { diff --git a/test/local/general/UpdateConfigValidation.t.sol b/test/local/general/UpdateConfigValidation.t.sol index 7b0255dd..201617b7 100644 --- a/test/local/general/UpdateConfigValidation.t.sol +++ b/test/local/general/UpdateConfigValidation.t.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.23; import {BaseTest} from "@test/BaseTest.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; -import {UpdateConfigParams} from "@src/core/libraries/general/actions/UpdateConfig.sol"; +import {Errors} from "@src/libraries/Errors.sol"; +import {UpdateConfigParams} from "@src/libraries/general/actions/UpdateConfig.sol"; contract UpdateConfigValidationTest is BaseTest { function test_UpdateConfig_validation() public { diff --git a/test/local/general/Upgrade.t.sol b/test/local/general/Upgrade.t.sol index 72e95c6e..b7eb22bf 100644 --- a/test/local/general/Upgrade.t.sol +++ b/test/local/general/Upgrade.t.sol @@ -8,7 +8,7 @@ import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.s import {SizeMock} from "@test/mocks/SizeMock.sol"; -import {Size} from "@src/core/Size.sol"; +import {Size} from "@src/Size.sol"; import {BaseTest} from "@test/BaseTest.sol"; contract UpgradeTest is Test, BaseTest { diff --git a/test/local/oracle/PriceFeed.t.sol b/test/local/oracle/PriceFeed.t.sol index 7a3a8e91..76817bd3 100644 --- a/test/local/oracle/PriceFeed.t.sol +++ b/test/local/oracle/PriceFeed.t.sol @@ -4,11 +4,11 @@ pragma solidity 0.8.23; import {Test} from "forge-std/Test.sol"; import {MockV3Aggregator} from "@chainlink/contracts/src/v0.8/tests/MockV3Aggregator.sol"; -import {Math} from "@src/core/libraries/Math.sol"; -import {PriceFeed} from "@src/core/oracle/PriceFeed.sol"; +import {Math} from "@src/libraries/Math.sol"; +import {PriceFeed} from "@src/oracle/PriceFeed.sol"; import {AssertsHelper} from "@test/helpers/AssertsHelper.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract PriceFeedTest is Test, AssertsHelper { PriceFeed public priceFeed; diff --git a/test/local/token/NonTransferrableScaledToken.t.sol b/test/local/token/NonTransferrableScaledToken.t.sol index cc0ff743..ba71747d 100644 --- a/test/local/token/NonTransferrableScaledToken.t.sol +++ b/test/local/token/NonTransferrableScaledToken.t.sol @@ -5,13 +5,13 @@ import {IPool} from "@aave/interfaces/IPool.sol"; import {WadRayMath} from "@aave/protocol/libraries/math/WadRayMath.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/interfaces/IERC20Metadata.sol"; -import {NonTransferrableScaledToken} from "@src/core/token/NonTransferrableScaledToken.sol"; +import {NonTransferrableScaledToken} from "@src/token/NonTransferrableScaledToken.sol"; import {PoolMock} from "@test/mocks/PoolMock.sol"; import {USDC} from "@test/mocks/USDC.sol"; import {Test} from "forge-std/Test.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract NonTransferrableScaledTokenTest is Test { NonTransferrableScaledToken public token; diff --git a/test/local/token/NonTransferrableToken.t.sol b/test/local/token/NonTransferrableToken.t.sol index a3f59c9d..b0c9f7c1 100644 --- a/test/local/token/NonTransferrableToken.t.sol +++ b/test/local/token/NonTransferrableToken.t.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.23; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {NonTransferrableToken} from "@src/core/token/NonTransferrableToken.sol"; +import {NonTransferrableToken} from "@src/token/NonTransferrableToken.sol"; import {Test} from "forge-std/Test.sol"; -import {Errors} from "@src/core/libraries/Errors.sol"; +import {Errors} from "@src/libraries/Errors.sol"; contract NonTransferrableTokenTest is Test { NonTransferrableToken public token; diff --git a/test/mocks/PriceFeedMock.sol b/test/mocks/PriceFeedMock.sol index cf8b3da7..f01ad514 100644 --- a/test/mocks/PriceFeedMock.sol +++ b/test/mocks/PriceFeedMock.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.23; import "@openzeppelin/contracts/access/Ownable.sol"; -import "@src/core/oracle/IPriceFeed.sol"; +import "@src/oracle/IPriceFeed.sol"; contract PriceFeedMock is IPriceFeed, Ownable { uint256 public price; diff --git a/test/mocks/SizeMock.sol b/test/mocks/SizeMock.sol index aeea2d88..65b31a56 100644 --- a/test/mocks/SizeMock.sol +++ b/test/mocks/SizeMock.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.23; -import {Size} from "@src/core/Size.sol"; -import {State} from "@src/core/SizeStorage.sol"; +import {Size} from "@src/Size.sol"; +import {State} from "@src/SizeStorage.sol"; import { CREDIT_POSITION_ID_START, @@ -11,7 +11,7 @@ import { DebtPosition, LoanLibrary, LoanStatus -} from "@src/core/libraries/fixed/LoanLibrary.sol"; +} from "@src/libraries/fixed/LoanLibrary.sol"; contract SizeMock is Size { using LoanLibrary for DebtPosition;