From a824ce06a53f45f12d0ffedb51abd756896b29fa Mon Sep 17 00:00:00 2001 From: MathisGD Date: Mon, 19 Feb 2024 11:44:24 +0100 Subject: [PATCH] refactor: repo org --- src/{ => adaptive-curve-irm}/AdaptiveCurveIrm.sol | 12 ++++++------ .../interfaces/IAdaptiveCurveIrm.sol | 4 ++-- .../libraries}/ConstantsLib.sol | 0 src/{ => adaptive-curve-irm}/libraries/ErrorsLib.sol | 0 .../libraries}/ExpLib.sol | 2 +- src/{ => adaptive-curve-irm}/libraries/MathLib.sol | 2 +- src/{ => adaptive-curve-irm}/libraries/UtilsLib.sol | 0 src/{ => fixed-rate-irm}/FixedRateIrm.sol | 6 +++--- .../interfaces/IFixedRateIrm.sol | 4 ++-- test/forge/AdaptiveCurveIrmTest.sol | 2 +- test/forge/ExpLibTest.sol | 6 +++--- test/forge/FixedRateIrmTest.sol | 2 +- test/forge/UtilsLibTest.sol | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) rename src/{ => adaptive-curve-irm}/AdaptiveCurveIrm.sol (93%) rename src/{ => adaptive-curve-irm}/interfaces/IAdaptiveCurveIrm.sol (77%) rename src/{libraries/adaptive-curve => adaptive-curve-irm/libraries}/ConstantsLib.sol (100%) rename src/{ => adaptive-curve-irm}/libraries/ErrorsLib.sol (100%) rename src/{libraries/adaptive-curve => adaptive-curve-irm/libraries}/ExpLib.sol (98%) rename src/{ => adaptive-curve-irm}/libraries/MathLib.sol (90%) rename src/{ => adaptive-curve-irm}/libraries/UtilsLib.sol (100%) rename src/{ => fixed-rate-irm}/FixedRateIrm.sol (89%) rename src/{ => fixed-rate-irm}/interfaces/IFixedRateIrm.sol (69%) diff --git a/src/AdaptiveCurveIrm.sol b/src/adaptive-curve-irm/AdaptiveCurveIrm.sol similarity index 93% rename from src/AdaptiveCurveIrm.sol rename to src/adaptive-curve-irm/AdaptiveCurveIrm.sol index f19ec822..3ecf1cb8 100644 --- a/src/AdaptiveCurveIrm.sol +++ b/src/adaptive-curve-irm/AdaptiveCurveIrm.sol @@ -1,17 +1,17 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; -import {IIrm} from "../lib/morpho-blue/src/interfaces/IIrm.sol"; +import {IIrm} from "../../lib/morpho-blue/src/interfaces/IIrm.sol"; import {IAdaptiveCurveIrm} from "./interfaces/IAdaptiveCurveIrm.sol"; import {UtilsLib} from "./libraries/UtilsLib.sol"; import {ErrorsLib} from "./libraries/ErrorsLib.sol"; -import {ExpLib} from "./libraries/adaptive-curve/ExpLib.sol"; +import {ExpLib} from "./libraries/ExpLib.sol"; import {MathLib, WAD_INT as WAD} from "./libraries/MathLib.sol"; -import {ConstantsLib} from "./libraries/adaptive-curve/ConstantsLib.sol"; -import {MarketParamsLib} from "../lib/morpho-blue/src/libraries/MarketParamsLib.sol"; -import {Id, MarketParams, Market} from "../lib/morpho-blue/src/interfaces/IMorpho.sol"; -import {MathLib as MorphoMathLib} from "../lib/morpho-blue/src/libraries/MathLib.sol"; +import {ConstantsLib} from "./libraries/ConstantsLib.sol"; +import {MarketParamsLib} from "../../lib/morpho-blue/src/libraries/MarketParamsLib.sol"; +import {Id, MarketParams, Market} from "../../lib/morpho-blue/src/interfaces/IMorpho.sol"; +import {MathLib as MorphoMathLib} from "../../lib/morpho-blue/src/libraries/MathLib.sol"; /// @title AdaptiveCurveIrm /// @author Morpho Labs diff --git a/src/interfaces/IAdaptiveCurveIrm.sol b/src/adaptive-curve-irm/interfaces/IAdaptiveCurveIrm.sol similarity index 77% rename from src/interfaces/IAdaptiveCurveIrm.sol rename to src/adaptive-curve-irm/interfaces/IAdaptiveCurveIrm.sol index 0f2659a4..087c2db8 100644 --- a/src/interfaces/IAdaptiveCurveIrm.sol +++ b/src/adaptive-curve-irm/interfaces/IAdaptiveCurveIrm.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0; -import {IIrm} from "../../lib/morpho-blue/src/interfaces/IIrm.sol"; -import {Id} from "../../lib/morpho-blue/src/interfaces/IMorpho.sol"; +import {IIrm} from "../../../lib/morpho-blue/src/interfaces/IIrm.sol"; +import {Id} from "../../../lib/morpho-blue/src/interfaces/IMorpho.sol"; /// @title IAdaptiveCurveIrm /// @author Morpho Labs diff --git a/src/libraries/adaptive-curve/ConstantsLib.sol b/src/adaptive-curve-irm/libraries/ConstantsLib.sol similarity index 100% rename from src/libraries/adaptive-curve/ConstantsLib.sol rename to src/adaptive-curve-irm/libraries/ConstantsLib.sol diff --git a/src/libraries/ErrorsLib.sol b/src/adaptive-curve-irm/libraries/ErrorsLib.sol similarity index 100% rename from src/libraries/ErrorsLib.sol rename to src/adaptive-curve-irm/libraries/ErrorsLib.sol diff --git a/src/libraries/adaptive-curve/ExpLib.sol b/src/adaptive-curve-irm/libraries/ExpLib.sol similarity index 98% rename from src/libraries/adaptive-curve/ExpLib.sol rename to src/adaptive-curve-irm/libraries/ExpLib.sol index 27110d31..e6732f54 100644 --- a/src/libraries/adaptive-curve/ExpLib.sol +++ b/src/adaptive-curve-irm/libraries/ExpLib.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {WAD_INT} from "../MathLib.sol"; +import {WAD_INT} from "./MathLib.sol"; /// @title ExpLib /// @author Morpho Labs diff --git a/src/libraries/MathLib.sol b/src/adaptive-curve-irm/libraries/MathLib.sol similarity index 90% rename from src/libraries/MathLib.sol rename to src/adaptive-curve-irm/libraries/MathLib.sol index f9cfe3d9..9421c780 100644 --- a/src/libraries/MathLib.sol +++ b/src/adaptive-curve-irm/libraries/MathLib.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {WAD} from "../../lib/morpho-blue/src/libraries/MathLib.sol"; +import {WAD} from "../../../lib/morpho-blue/src/libraries/MathLib.sol"; int256 constant WAD_INT = int256(WAD); diff --git a/src/libraries/UtilsLib.sol b/src/adaptive-curve-irm/libraries/UtilsLib.sol similarity index 100% rename from src/libraries/UtilsLib.sol rename to src/adaptive-curve-irm/libraries/UtilsLib.sol diff --git a/src/FixedRateIrm.sol b/src/fixed-rate-irm/FixedRateIrm.sol similarity index 89% rename from src/FixedRateIrm.sol rename to src/fixed-rate-irm/FixedRateIrm.sol index 04f8114b..cc95d46f 100644 --- a/src/FixedRateIrm.sol +++ b/src/fixed-rate-irm/FixedRateIrm.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.24; -import {IIrm} from "../lib/morpho-blue/src/interfaces/IIrm.sol"; +import {IIrm} from "../../lib/morpho-blue/src/interfaces/IIrm.sol"; import {IFixedRateIrm} from "./interfaces/IFixedRateIrm.sol"; -import {MarketParamsLib} from "../lib/morpho-blue/src/libraries/MarketParamsLib.sol"; -import {Id, MarketParams, Market} from "../lib/morpho-blue/src/interfaces/IMorpho.sol"; +import {MarketParamsLib} from "../../lib/morpho-blue/src/libraries/MarketParamsLib.sol"; +import {Id, MarketParams, Market} from "../../lib/morpho-blue/src/interfaces/IMorpho.sol"; /* ERRORS */ diff --git a/src/interfaces/IFixedRateIrm.sol b/src/fixed-rate-irm/interfaces/IFixedRateIrm.sol similarity index 69% rename from src/interfaces/IFixedRateIrm.sol rename to src/fixed-rate-irm/interfaces/IFixedRateIrm.sol index f4800e9f..8dbba4e8 100644 --- a/src/interfaces/IFixedRateIrm.sol +++ b/src/fixed-rate-irm/interfaces/IFixedRateIrm.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0; -import {IIrm} from "../../lib/morpho-blue/src/interfaces/IIrm.sol"; -import {Id} from "../../lib/morpho-blue/src/interfaces/IMorpho.sol"; +import {IIrm} from "../../../lib/morpho-blue/src/interfaces/IIrm.sol"; +import {Id} from "../../../lib/morpho-blue/src/interfaces/IMorpho.sol"; /// @title IAdaptiveCurveIrm /// @author Morpho Labs diff --git a/test/forge/AdaptiveCurveIrmTest.sol b/test/forge/AdaptiveCurveIrmTest.sol index 8d821340..8b510bc6 100644 --- a/test/forge/AdaptiveCurveIrmTest.sol +++ b/test/forge/AdaptiveCurveIrmTest.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../src/AdaptiveCurveIrm.sol"; +import "../../src/adaptive-curve-irm/AdaptiveCurveIrm.sol"; import "../../lib/forge-std/src/Test.sol"; diff --git a/test/forge/ExpLibTest.sol b/test/forge/ExpLibTest.sol index ee61ce06..2e27fa14 100644 --- a/test/forge/ExpLibTest.sol +++ b/test/forge/ExpLibTest.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {MathLib, WAD_INT} from "../../src/libraries/MathLib.sol"; -import {ExpLib} from "../../src/libraries/adaptive-curve/ExpLib.sol"; +import {MathLib, WAD_INT} from "../../src/adaptive-curve-irm/libraries/MathLib.sol"; +import {ExpLib} from "../../src/adaptive-curve-irm/libraries/ExpLib.sol"; import {wadExp} from "../../lib/solmate/src/utils/SignedWadMath.sol"; -import {ConstantsLib} from "../../src/libraries/adaptive-curve/ConstantsLib.sol"; +import {ConstantsLib} from "../../src/adaptive-curve-irm/libraries/ConstantsLib.sol"; import {MathLib as MorphoMathLib} from "../../lib/morpho-blue/src/libraries/MathLib.sol"; import "../../lib/forge-std/src/Test.sol"; diff --git a/test/forge/FixedRateIrmTest.sol b/test/forge/FixedRateIrmTest.sol index 27e823aa..730360a1 100644 --- a/test/forge/FixedRateIrmTest.sol +++ b/test/forge/FixedRateIrmTest.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../src/FixedRateIrm.sol"; +import "../../src/fixed-rate-irm/FixedRateIrm.sol"; import "../../lib/forge-std/src/Test.sol"; diff --git a/test/forge/UtilsLibTest.sol b/test/forge/UtilsLibTest.sol index 89d10824..ecde91ac 100644 --- a/test/forge/UtilsLibTest.sol +++ b/test/forge/UtilsLibTest.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "../../src/libraries/UtilsLib.sol"; +import "../../src/adaptive-curve-irm/libraries/UtilsLib.sol"; import "../../lib/forge-std/src/Test.sol";