Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate lst and lrt contracts into folders #62

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions script/__TestFlashLeverage.s.sol

This file was deleted.

2 changes: 1 addition & 1 deletion script/deploy-test/08_DeployHandlers.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.21;

import { DeployTestBase } from "./00_DeployTestBase.t.sol";
import { DeployHandlersScript } from "../deploy/08_DeployHandlers.s.sol";
import { IonHandlerBase } from "../../src/flash/handlers/base/IonHandlerBase.sol";
import { IonHandlerBase } from "../../src/flash/IonHandlerBase.sol";

contract DeployHandlersTest is DeployTestBase, DeployHandlersScript {
function checkState(IonHandlerBase handler) public {
Expand Down
4 changes: 2 additions & 2 deletions script/deploy/05_DeployInitialReserveAndSpotOracles.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity 0.8.21;

import { DeployScript } from "../Deploy.s.sol";
import { RAY } from "../../src/libraries/math/WadRayMath.sol";
import { RsEthWstEthReserveOracle } from "../../src/oracles/reserve/RsEthWstEthReserveOracle.sol";
import { RsEthWstEthSpotOracle } from "../../src/oracles/spot/RsEthWstEthSpotOracle.sol";
import { RsEthWstEthReserveOracle } from "../../src/oracles/reserve/lrt/RsEthWstEthReserveOracle.sol";
import { RsEthWstEthSpotOracle } from "../../src/oracles/spot/lrt/RsEthWstEthSpotOracle.sol";

import { stdJson as StdJson } from "forge-std/StdJson.sol";

Expand Down
4 changes: 2 additions & 2 deletions script/deploy/08_DeployHandlers.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { DeployScript } from "../Deploy.s.sol";
import { IonPool } from "../../src/IonPool.sol";
import { GemJoin } from "../../src/join/GemJoin.sol";
import { Whitelist } from "../../src/Whitelist.sol";
import { IonHandlerBase } from "../../src/flash/handlers/base/IonHandlerBase.sol";
import { RsEthHandler } from "../../src/flash/handlers/RsEthHandler.sol";
import { IonHandlerBase } from "../../src/flash/IonHandlerBase.sol";
import { RsEthHandler } from "../../src/flash/lrt/RsEthHandler.sol";

import { stdJson as StdJson } from "forge-std/StdJson.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.21;

import { IonHandlerBase } from "./IonHandlerBase.sol";
import { IWETH9 } from "../../../interfaces/IWETH9.sol";
import { IWETH9 } from "../interfaces/IWETH9.sol";

import { IVault, IERC20 as IERC20Balancer } from "@balancer-labs/v2-interfaces/contracts/vault/IVault.sol";
import { IFlashLoanRecipient } from "@balancer-labs/v2-interfaces/contracts/vault/IFlashLoanRecipient.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;

import { IonPool } from "../../../IonPool.sol";
import { IWETH9 } from "../../../interfaces/IWETH9.sol";
import { GemJoin } from "../../../join/GemJoin.sol";
import { WadRayMath, RAY } from "../../../libraries/math/WadRayMath.sol";
import { Whitelist } from "../../../Whitelist.sol";
import { WETH_ADDRESS } from "../../../Constants.sol";
import { IonPool } from "../IonPool.sol";
import { IWETH9 } from "../interfaces/IWETH9.sol";
import { GemJoin } from "../join/GemJoin.sol";
import { WadRayMath, RAY } from "../libraries/math/WadRayMath.sol";
import { Whitelist } from "../Whitelist.sol";
import { WETH_ADDRESS } from "../Constants.sol";

import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;

import { IWETH9 } from "../../../interfaces/IWETH9.sol";
import { IWETH9 } from "../interfaces/IWETH9.sol";
import { IonHandlerBase } from "./IonHandlerBase.sol";
import { IWETH9 } from "../../../interfaces/IWETH9.sol";
import { IWETH9 } from "../interfaces/IWETH9.sol";

import { IUniswapV3Pool } from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import { IUniswapV3FlashCallback } from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.21;

import { IonHandlerBase } from "./IonHandlerBase.sol";
import { IWETH9 } from "../../../interfaces/IWETH9.sol";
import { IWETH9 } from "../interfaces/IWETH9.sol";

import { IUniswapV3Pool } from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import { IUniswapV3SwapCallback } from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.21;

import { IonHandlerBase } from "./IonHandlerBase.sol";
import { WadRayMath } from "../../../libraries/math/WadRayMath.sol";
import { WadRayMath } from "../libraries/math/WadRayMath.sol";

import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { IonPool } from "../../IonPool.sol";
import { GemJoin } from "../../join/GemJoin.sol";
import { IRsEth } from "../../interfaces/ProviderInterfaces.sol";
import { Whitelist } from "../../Whitelist.sol";
import { UniswapFlashswapDirectMintHandler } from "./base/UniswapFlashswapDirectMintHandler.sol";
import { IonHandlerBase } from "./base/IonHandlerBase.sol";
import { UniswapFlashswapDirectMintHandler } from "../UniswapFlashswapDirectMintHandler.sol";
import { IonHandlerBase } from "../IonHandlerBase.sol";
import { RSETH, WETH_ADDRESS } from "../../Constants.sol";
import { KelpDaoLibrary } from "./../../libraries/KelpDaoLibrary.sol";
import { KelpDaoLibrary } from "../../libraries/lrt/KelpDaoLibrary.sol";

import { IUniswapV3Pool } from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { IonPool } from "../../IonPool.sol";
import { GemJoin } from "../../join/GemJoin.sol";
import { IWeEth } from "../../interfaces/ProviderInterfaces.sol";
import { Whitelist } from "../../Whitelist.sol";
import { UniswapFlashswapDirectMintHandler } from "./base/UniswapFlashswapDirectMintHandler.sol";
import { IonHandlerBase } from "./base/IonHandlerBase.sol";
import { EtherFiLibrary } from "../../libraries/EtherFiLibrary.sol";
import { UniswapFlashswapDirectMintHandler } from "../UniswapFlashswapDirectMintHandler.sol";
import { IonHandlerBase } from "../IonHandlerBase.sol";
import { EtherFiLibrary } from "../../libraries/lrt/EtherFiLibrary.sol";
import { WEETH_ADDRESS, WETH_ADDRESS, EETH_ADDRESS } from "../../Constants.sol";

import { IUniswapV3Pool } from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ pragma solidity 0.8.21;
import { IonPool } from "../../IonPool.sol";
import { GemJoin } from "../../join/GemJoin.sol";
import { Whitelist } from "../../Whitelist.sol";
import { StaderLibrary } from "../../libraries/StaderLibrary.sol";
import { StaderLibrary } from "../../libraries/lst/StaderLibrary.sol";
import { IStaderStakePoolsManager } from "../../interfaces/ProviderInterfaces.sol";
import { IonHandlerBase } from "./base/IonHandlerBase.sol";
import { UniswapFlashloanBalancerSwapHandler } from "./base/UniswapFlashloanBalancerSwapHandler.sol";
import { BalancerFlashloanDirectMintHandler } from "./base/BalancerFlashloanDirectMintHandler.sol";
import { UniswapFlashswapHandler } from "./base/UniswapFlashswapHandler.sol";
import { IonHandlerBase } from "../IonHandlerBase.sol";
import { UniswapFlashloanBalancerSwapHandler } from "../UniswapFlashloanBalancerSwapHandler.sol";
import { BalancerFlashloanDirectMintHandler } from "../BalancerFlashloanDirectMintHandler.sol";
import { UniswapFlashswapHandler } from "../UniswapFlashswapHandler.sol";

import { IUniswapV3Pool } from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ pragma solidity 0.8.21;

import { IonPool } from "../../IonPool.sol";
import { GemJoin } from "../../join/GemJoin.sol";
import { IonHandlerBase } from "./base/IonHandlerBase.sol";
import { UniswapFlashswapHandler } from "./base/UniswapFlashswapHandler.sol";
import { BalancerFlashloanDirectMintHandler } from "./base/BalancerFlashloanDirectMintHandler.sol";
import { IonHandlerBase } from "../IonHandlerBase.sol";
import { UniswapFlashswapHandler } from "../UniswapFlashswapHandler.sol";
import { BalancerFlashloanDirectMintHandler } from "../BalancerFlashloanDirectMintHandler.sol";
import { ISwEth } from "../../interfaces/ProviderInterfaces.sol";
import { SwellLibrary } from "../../libraries/SwellLibrary.sol";
import { SwellLibrary } from "../../libraries/lst/SwellLibrary.sol";
import { WadRayMath } from "../../libraries/math/WadRayMath.sol";
import { Whitelist } from "../../Whitelist.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
pragma solidity 0.8.21;

import { IonPool } from "../../IonPool.sol";
import { IonHandlerBase } from "./base/IonHandlerBase.sol";
import { IonHandlerBase } from "../IonHandlerBase.sol";
import { GemJoin } from "../../join/GemJoin.sol";
import { UniswapFlashswapHandler } from "./base/UniswapFlashswapHandler.sol";
import { BalancerFlashloanDirectMintHandler } from "./base/BalancerFlashloanDirectMintHandler.sol";
import { UniswapFlashswapHandler } from "../UniswapFlashswapHandler.sol";
import { BalancerFlashloanDirectMintHandler } from "../BalancerFlashloanDirectMintHandler.sol";
import { IWstEth } from "../../interfaces/ProviderInterfaces.sol";
import { LidoLibrary } from "../../libraries/LidoLibrary.sol";
import { LidoLibrary } from "../../libraries/lst/LidoLibrary.sol";
import { Whitelist } from "../../Whitelist.sol";

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { IWeEth, IEEth, IEtherFiLiquidityPool } from "../interfaces/ProviderInterfaces.sol";
import { IWeEth, IEEth, IEtherFiLiquidityPool } from "../../interfaces/ProviderInterfaces.sol";
import { WadRayMath } from "../math/WadRayMath.sol";

import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { WadRayMath } from "./math/WadRayMath.sol";

using Math for uint256;
using WadRayMath for uint256;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { IRsEth } from "../interfaces/ProviderInterfaces.sol";
import { RSETH_LRT_DEPOSIT_POOL, RSETH_LRT_ORACLE, ETH_ADDRESS } from "../Constants.sol";
import { IRsEth } from "../../interfaces/ProviderInterfaces.sol";
import { RSETH_LRT_DEPOSIT_POOL, RSETH_LRT_ORACLE, ETH_ADDRESS } from "../../Constants.sol";
import { WadRayMath, WAD } from "../math/WadRayMath.sol";

import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { WadRayMath, WAD } from "./math/WadRayMath.sol";

using WadRayMath for uint256;
using Math for uint256;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { IStEth } from "../interfaces/ProviderInterfaces.sol";
import { IWstEth } from "../interfaces/ProviderInterfaces.sol";
import { WadRayMath } from "../libraries/math/WadRayMath.sol";
import { IStEth } from "../../interfaces/ProviderInterfaces.sol";
import { IWstEth } from "../../interfaces/ProviderInterfaces.sol";
import { WadRayMath } from "../../libraries/math/WadRayMath.sol";

/**
* @title LidoLibrary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { IStaderStakePoolsManager, IStaderOracle } from "../interfaces/ProviderInterfaces.sol";
import { IStaderStakePoolsManager, IStaderOracle } from "../../interfaces/ProviderInterfaces.sol";

import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { WadRayMath } from "../libraries/math/WadRayMath.sol";
import { ISwEth } from "../interfaces/ProviderInterfaces.sol";
import { WadRayMath } from "../../libraries/math/WadRayMath.sol";
import { ISwEth } from "../../interfaces/ProviderInterfaces.sol";

/**
* @title SwellLibrary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { IWstEth } from "../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "./ReserveOracle.sol";
import { WSTETH_ADDRESS, RSETH_LRT_ORACLE } from "../../Constants.sol";
import { WadRayMath } from "../../libraries/math/WadRayMath.sol";
import { IWstEth } from "../../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "../ReserveOracle.sol";
import { WSTETH_ADDRESS, RSETH_LRT_ORACLE } from "../../../Constants.sol";
import { WadRayMath } from "../../../libraries/math/WadRayMath.sol";

/**
* @notice Reserve oracle for rsETH.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { IWeEth, IWstEth } from "../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "./ReserveOracle.sol";
import { WEETH_ADDRESS, WSTETH_ADDRESS } from "../../Constants.sol";
import { WadRayMath } from "../../libraries/math/WadRayMath.sol";
import { IWeEth, IWstEth } from "../../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "../ReserveOracle.sol";
import { WEETH_ADDRESS, WSTETH_ADDRESS } from "../../../Constants.sol";
import { WadRayMath } from "../../../libraries/math/WadRayMath.sol";

/**
* @notice Reserve oracle for weETH.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { IStaderStakePoolsManager } from "../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "./ReserveOracle.sol";
import { IStaderStakePoolsManager } from "../../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "../ReserveOracle.sol";

/**
* @notice Reserve oracle for ETHx.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import { ISwEth } from "../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "./ReserveOracle.sol";
import { ISwEth } from "../../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "../ReserveOracle.sol";

/**
* @notice Reserve oracle for swETH.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

pragma solidity 0.8.21;

import { IWstEth } from "../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "./ReserveOracle.sol";
import { IWstEth } from "../../../interfaces/ProviderInterfaces.sol";
import { ReserveOracle } from "../ReserveOracle.sol";

/**
* @notice Reserve oracle for wstETH.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

pragma solidity 0.8.21;

import { SpotOracle } from "../../oracles/spot/SpotOracle.sol";
import { WadRayMath } from "../../libraries/math/WadRayMath.sol";
import { SpotOracle } from "../../../oracles/spot/SpotOracle.sol";
import { WadRayMath } from "../../../libraries/math/WadRayMath.sol";
import {
WSTETH_ADDRESS,
REDSTONE_RSETH_ETH_PRICE_FEED,
ETH_PER_STETH_CHAINLINK,
REDSTONE_DECIMALS
} from "../../Constants.sol";
import { IWstEth } from "../../interfaces/ProviderInterfaces.sol";
} from "../../../Constants.sol";
import { IWstEth } from "../../../interfaces/ProviderInterfaces.sol";

import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

pragma solidity 0.8.21;

import { SpotOracle } from "../../oracles/spot/SpotOracle.sol";
import { WadRayMath } from "../../libraries/math/WadRayMath.sol";
import { SpotOracle } from "../../../oracles/spot/SpotOracle.sol";
import { WadRayMath } from "../../../libraries/math/WadRayMath.sol";
import {
WSTETH_ADDRESS,
REDSTONE_WEETH_ETH_PRICE_FEED,
ETH_PER_STETH_CHAINLINK,
REDSTONE_DECIMALS
} from "../../Constants.sol";
import { IWstEth } from "../../interfaces/ProviderInterfaces.sol";
} from "../../../Constants.sol";
import { IWstEth } from "../../../interfaces/ProviderInterfaces.sol";

import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

pragma solidity 0.8.21;

import { SpotOracle } from "../../oracles/spot/SpotOracle.sol";
import { IChainlink } from "../../interfaces/IChainlink.sol";
import { WadRayMath } from "../../libraries/math/WadRayMath.sol";
import { SpotOracle } from "../SpotOracle.sol";
import { IChainlink } from "../../../interfaces/IChainlink.sol";
import { WadRayMath } from "../../../libraries/math/WadRayMath.sol";

interface IRedstonePriceFeed {
function latestRoundData()
Expand Down
Loading
Loading