Skip to content

Commit

Permalink
Remove src/core/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
aviggiano committed Jun 5, 2024
1 parent b365732 commit fe93efd
Show file tree
Hide file tree
Showing 109 changed files with 445 additions and 470 deletions.
4 changes: 2 additions & 2 deletions script/BaseScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions script/BuyCreditLimit.s.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
6 changes: 3 additions & 3 deletions script/BuyCreditMarket.s.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
4 changes: 2 additions & 2 deletions script/Claim.s.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
4 changes: 2 additions & 2 deletions script/Compensate.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
8 changes: 4 additions & 4 deletions script/Deploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ 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,
InitializeDataParams,
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";
Expand Down
4 changes: 2 additions & 2 deletions script/DepositUSDC.s.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion script/DepositWETH.s.sol
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions script/GetUserView.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/GrantRole.s.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
4 changes: 2 additions & 2 deletions script/Liquidate.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
6 changes: 3 additions & 3 deletions script/LiquidateWithReplacement.s.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
4 changes: 2 additions & 2 deletions script/Repay.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
6 changes: 3 additions & 3 deletions script/SellCreditLimit.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions script/UpdateConfig.s.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion script/prepare_crytic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 24 additions & 27 deletions src/core/Size.sol → src/Size.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
12 changes: 6 additions & 6 deletions src/core/SizeStorage.sol → src/SizeStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions src/core/SizeView.sol → src/SizeView.sol
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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 [email protected]
Expand Down
6 changes: 3 additions & 3 deletions src/core/SizeViewData.sol → src/SizeViewData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
Loading

0 comments on commit fe93efd

Please sign in to comment.