Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
[submodule "lib/morpho-blue-irm"]
path = lib/morpho-blue-irm
url = https://github.com/morpho-org/morpho-blue-irm
[submodule "lib/aave-v3-origin"]
path = lib/aave-v3-origin
url = https://github.com/aave-dao/aave-v3-origin
6 changes: 6 additions & 0 deletions foundry.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"lib/aave-v3-origin": {
"tag": {
"name": "v3.6.0",
"rev": "5a230ec82fcb10afc7fe7cffa8978752fb17aa2b"
}
},
"lib/forge-std": {
"rev": "1eea5bae12ae557d589f9f0f0edae2faa47cb262"
},
Expand Down
1 change: 1 addition & 0 deletions lib/aave-v3-origin
Submodule aave-v3-origin added at 5a230e
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils
@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
@foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/
@aave-v3-origin/=lib/aave-v3-origin/src/



2 changes: 1 addition & 1 deletion script/1/CreateLeverageToken.PT-RLP-4DEC2025-USDC-2x.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract CreateLeverageToken is Script {

ILeverageManager public leverageManager = ILeverageManager(DeployConstants.LEVERAGE_MANAGER);
IMorphoLendingAdapterFactory public lendingAdapterFactory =
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY);
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY);

ILeverageTokenDeploymentBatcher public leverageTokenDeploymentBatcher =
ILeverageTokenDeploymentBatcher(DeployConstants.LEVERAGE_TOKEN_DEPLOYMENT_BATCHER);
Expand Down
2 changes: 1 addition & 1 deletion script/1/CreateLeverageToken.RLP-USDC-6.75x.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract CreateLeverageToken is Script {

ILeverageManager public leverageManager = ILeverageManager(DeployConstants.LEVERAGE_MANAGER);
IMorphoLendingAdapterFactory public lendingAdapterFactory =
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY);
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY);

ILeverageTokenDeploymentBatcher public leverageTokenDeploymentBatcher =
ILeverageTokenDeploymentBatcher(DeployConstants.LEVERAGE_TOKEN_DEPLOYMENT_BATCHER);
Expand Down
2 changes: 1 addition & 1 deletion script/1/CreateLeverageToken.sUSDS-USDT-25x.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract CreateLeverageToken is Script {

ILeverageManager public leverageManager = ILeverageManager(DeployConstants.LEVERAGE_MANAGER);
IMorphoLendingAdapterFactory public lendingAdapterFactory =
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY);
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY);

ILeverageTokenDeploymentBatcher public leverageTokenDeploymentBatcher =
ILeverageTokenDeploymentBatcher(DeployConstants.LEVERAGE_TOKEN_DEPLOYMENT_BATCHER);
Expand Down
2 changes: 1 addition & 1 deletion script/1/CreateLeverageToken.siUSD-USDC-11x.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract CreateLeverageToken is Script {

ILeverageManager public leverageManager = ILeverageManager(DeployConstants.LEVERAGE_MANAGER);
IMorphoLendingAdapterFactory public lendingAdapterFactory =
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY);
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY);

ILeverageTokenDeploymentBatcher public leverageTokenDeploymentBatcher =
ILeverageTokenDeploymentBatcher(DeployConstants.LEVERAGE_TOKEN_DEPLOYMENT_BATCHER);
Expand Down
2 changes: 1 addition & 1 deletion script/1/CreateLeverageToken.wstETH-ETH-25x.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract CreateLeverageToken is Script {

ILeverageManager public leverageManager = ILeverageManager(DeployConstants.LEVERAGE_MANAGER);
IMorphoLendingAdapterFactory public lendingAdapterFactory =
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY);
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY);

ILeverageTokenDeploymentBatcher public leverageTokenDeploymentBatcher =
ILeverageTokenDeploymentBatcher(DeployConstants.LEVERAGE_TOKEN_DEPLOYMENT_BATCHER);
Expand Down
2 changes: 1 addition & 1 deletion script/1/CreateLeverageToken.wstETH-WETH-2x.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract CreateLeverageToken is Script {

ILeverageManager public leverageManager = ILeverageManager(DeployConstants.LEVERAGE_MANAGER);
IMorphoLendingAdapterFactory public lendingAdapterFactory =
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY);
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY);

ILeverageTokenDeploymentBatcher public leverageTokenDeploymentBatcher =
ILeverageTokenDeploymentBatcher(DeployConstants.LEVERAGE_TOKEN_DEPLOYMENT_BATCHER);
Expand Down
8 changes: 7 additions & 1 deletion script/1/DeployConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ library DeployConstants {

address public constant MORPHO = 0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb;

address public constant AAVE_POOL = 0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2;

address public constant LEVERAGE_MANAGER = 0x5C37EB148D4a261ACD101e2B997A0F163Fb3E351;
address public constant LENDING_ADAPTER_FACTORY = 0xce05FbEd9260810Bdded179ADfdaf737BE7ded71;
address public constant MORPHO_LENDING_ADAPTER_FACTORY = 0xce05FbEd9260810Bdded179ADfdaf737BE7ded71;
address public constant AAVE_LENDING_ADAPTER_FACTORY = address(0); // TODO: Deploy and set address
address public constant LEVERAGE_TOKEN_FACTORY = 0x603Da735780e6bC7D04f3FB85C26dccCd4Ff0a82;
address public constant LEVERAGE_ROUTER = 0xb0764dE7eeF0aC69855C431334B7BC51A96E6DbA;
address public constant LEVERAGE_ROUTER_V2 = address(0); // TODO: Deploy and set address
address public constant MULTICALL_EXECUTOR = 0x16D02Ebd89988cAd1Ce945807b963aB7A9Fd22E1;
address public constant LEVERAGE_TOKEN_DEPLOYMENT_BATCHER = 0x4466D52b714Ef32657db89ec61FAB1b7E30A0352;
address public constant LEVERAGE_TOKEN_DEPLOYMENT_BATCHER_V2 = address(0); // TODO: Deploy and set address


address public constant DUTCH_AUCTION_PRE_LIQUIDATION_COLLATERAL_RATIOS_REBALANCE_ADAPTER_IMPLEMENTATION =
0x1d0c191a0fe2917e244826D3a8d0a64503efAec8;
Expand Down
10 changes: 6 additions & 4 deletions script/1/DeployLeverageTokenDeploymentBatcher.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ pragma solidity ^0.8.26;
import {Script, console} from "forge-std/Script.sol";

/// Internal imports
import {LeverageTokenDeploymentBatcher} from "src/periphery/LeverageTokenDeploymentBatcher.sol";
import {LeverageTokenDeploymentBatcherV2} from "src/periphery/LeverageTokenDeploymentBatcherV2.sol";
import {ILeverageManager} from "src/interfaces/ILeverageManager.sol";
import {IMorphoLendingAdapterFactory} from "src/interfaces/IMorphoLendingAdapterFactory.sol";
import {IAaveLendingAdapterFactory} from "src/interfaces/IAaveLendingAdapterFactory.sol";
import {DeployConstants} from "./DeployConstants.sol";

contract DeployLeverageTokenDeploymentBatcher is Script {
Expand All @@ -22,11 +23,12 @@ contract DeployLeverageTokenDeploymentBatcher is Script {
address deployerAddress = msg.sender;
console.log("DeployerAddress: ", deployerAddress);

LeverageTokenDeploymentBatcher leverageTokenDeploymentBatcher = new LeverageTokenDeploymentBatcher(
LeverageTokenDeploymentBatcherV2 leverageTokenDeploymentBatcherV2 = new LeverageTokenDeploymentBatcherV2(
ILeverageManager(DeployConstants.LEVERAGE_MANAGER),
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY)
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY),
IAaveLendingAdapterFactory(DeployConstants.AAVE_LENDING_ADAPTER_FACTORY)
);
console.log("LeverageTokenDeploymentBatcher deployed at: ", address(leverageTokenDeploymentBatcher));
console.log("LeverageTokenDeploymentBatcherV2 deployed at: ", address(leverageTokenDeploymentBatcherV2));

vm.stopBroadcast();
}
Expand Down
22 changes: 14 additions & 8 deletions script/1/Periphery.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import {Script, console} from "forge-std/Script.sol";

/// Dependency imports
import {IMorpho} from "@morpho-blue/interfaces/IMorpho.sol";
import {IPool} from "@aave-v3-origin/contracts/interfaces/IPool.sol";

/// Internal imports
import {MulticallExecutor} from "src/periphery/MulticallExecutor.sol";
import {VeloraAdapter} from "src/periphery/VeloraAdapter.sol";
import {LeverageRouter} from "src/periphery/LeverageRouter.sol";
import {LeverageTokenDeploymentBatcher} from "src/periphery/LeverageTokenDeploymentBatcher.sol";
import {LeverageRouterV2} from "src/periphery/LeverageRouterV2.sol";
import {LeverageTokenDeploymentBatcherV2} from "src/periphery/LeverageTokenDeploymentBatcherV2.sol";
import {ILeverageManager} from "src/interfaces/ILeverageManager.sol";
import {IMorphoLendingAdapterFactory} from "src/interfaces/IMorphoLendingAdapterFactory.sol";
import {IAaveLendingAdapterFactory} from "src/interfaces/IAaveLendingAdapterFactory.sol";
import {DeployConstants} from "./DeployConstants.sol";

contract PeripheryDeploy is Script {
Expand All @@ -34,15 +36,19 @@ contract PeripheryDeploy is Script {
VeloraAdapter veloraAdapter = new VeloraAdapter(DeployConstants.AUGUSTUS_REGISTRY);
console.log("VeloraAdapter deployed at: ", address(veloraAdapter));

LeverageRouter leverageRouter =
new LeverageRouter(ILeverageManager(DeployConstants.LEVERAGE_MANAGER), IMorpho(DeployConstants.MORPHO));
console.log("LeverageRouter deployed at: ", address(leverageRouter));
LeverageRouterV2 leverageRouterV2 = new LeverageRouterV2(
ILeverageManager(DeployConstants.LEVERAGE_MANAGER),
IMorpho(DeployConstants.MORPHO),
IPool(DeployConstants.AAVE_POOL)
);
console.log("LeverageRouterV2 deployed at: ", address(leverageRouterV2));

LeverageTokenDeploymentBatcher leverageTokenDeploymentBatcher = new LeverageTokenDeploymentBatcher(
LeverageTokenDeploymentBatcherV2 leverageTokenDeploymentBatcherV2 = new LeverageTokenDeploymentBatcherV2(
ILeverageManager(DeployConstants.LEVERAGE_MANAGER),
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY)
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY),
IAaveLendingAdapterFactory(DeployConstants.AAVE_LENDING_ADAPTER_FACTORY)
);
console.log("LeverageTokenDeploymentBatcher deployed at: ", address(leverageTokenDeploymentBatcher));
console.log("LeverageTokenDeploymentBatcherV2 deployed at: ", address(leverageTokenDeploymentBatcherV2));

vm.stopBroadcast();
}
Expand Down
2 changes: 1 addition & 1 deletion script/8453/CreateLeverageToken.WEETH-WETH-17x.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract CreateLeverageToken is Script {

ILeverageManager public leverageManager = ILeverageManager(DeployConstants.LEVERAGE_MANAGER);
IMorphoLendingAdapterFactory public lendingAdapterFactory =
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY);
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY);
ILeverageRouter public leverageRouter = ILeverageRouter(DeployConstants.LEVERAGE_ROUTER);
IMulticallExecutor public multicallExecutor = IMulticallExecutor(DeployConstants.MULTICALL_EXECUTOR);

Expand Down
2 changes: 1 addition & 1 deletion script/8453/CreateLeverageToken.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contract CreateLeverageToken is Script {

ILeverageManager public leverageManager = ILeverageManager(DeployConstants.LEVERAGE_MANAGER);
IMorphoLendingAdapterFactory public lendingAdapterFactory =
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY);
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY);

/// @dev Market ID for Morpho market that LT will be created on top of
Id public MORPHO_MARKET_ID = Id.wrap(0x8793cf302b8ffd655ab97bd1c695dbd967807e8367a65cb2f4edaf1380ba1bda);
Expand Down
7 changes: 6 additions & 1 deletion script/8453/DeployConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ pragma solidity ^0.8.26;

library DeployConstants {
address public constant MORPHO = 0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb;
address public constant AAVE_POOL = 0xA238Dd80C259a72e81d7e4664a9801593F98d1c5;

address public constant SEAMLESS_TIMELOCK_SHORT = 0x639d2dD24304aC2e6A691d8c1cFf4a2665925fee;
address public constant SEAMLESS_TREASURY = 0x639d2dD24304aC2e6A691d8c1cFf4a2665925fee;
address public constant ETHERFI_L2_MODE_SYNC_POOL = 0xc38e046dFDAdf15f7F56853674242888301208a5;
Expand All @@ -12,10 +14,13 @@ library DeployConstants {
address public constant WEETH = 0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A;

address public constant LEVERAGE_MANAGER = 0x38Ba21C6Bf31dF1b1798FCEd07B4e9b07C5ec3a8;
address public constant LENDING_ADAPTER_FACTORY = 0xDd33419F0c01879a23051edbcdA997A0f9E68e61;
address public constant MORPHO_LENDING_ADAPTER_FACTORY = 0xDd33419F0c01879a23051edbcdA997A0f9E68e61;
address public constant AAVE_LENDING_ADAPTER_FACTORY = address(0); // TODO: Deploy and set address
address public constant LEVERAGE_ROUTER = 0xDbA92fC3dc10a17b96b6E807a908155C389A887C;
address public constant LEVERAGE_ROUTER_V2 = address(0); // TODO: Deploy and set address
address public constant MULTICALL_EXECUTOR = 0x0000000000000000000000000000000000000000;
address public constant LEVERAGE_TOKEN_DEPLOYMENT_BATCHER = 0x0000000000000000000000000000000000000000;
address public constant LEVERAGE_TOKEN_DEPLOYMENT_BATCHER_V2 = address(0); // TODO: Deploy and set address

address public constant DUTCH_AUCTION_PRE_LIQUIDATION_COLLATERAL_RATIOS_REBALANCE_ADAPTER_IMPLEMENTATION =
0x0000000000000000000000000000000000000000;
Expand Down
10 changes: 6 additions & 4 deletions script/8453/DeployLeverageTokenDeploymentBatcher.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ pragma solidity ^0.8.26;
import {Script, console} from "forge-std/Script.sol";

/// Internal imports
import {LeverageTokenDeploymentBatcher} from "src/periphery/LeverageTokenDeploymentBatcher.sol";
import {LeverageTokenDeploymentBatcherV2} from "src/periphery/LeverageTokenDeploymentBatcherV2.sol";
import {ILeverageManager} from "src/interfaces/ILeverageManager.sol";
import {IMorphoLendingAdapterFactory} from "src/interfaces/IMorphoLendingAdapterFactory.sol";
import {IAaveLendingAdapterFactory} from "src/interfaces/IAaveLendingAdapterFactory.sol";
import {DeployConstants} from "./DeployConstants.sol";

contract DeployLeverageTokenDeploymentBatcher is Script {
Expand All @@ -22,11 +23,12 @@ contract DeployLeverageTokenDeploymentBatcher is Script {
address deployerAddress = msg.sender;
console.log("DeployerAddress: ", deployerAddress);

LeverageTokenDeploymentBatcher leverageTokenDeploymentBatcher = new LeverageTokenDeploymentBatcher(
LeverageTokenDeploymentBatcherV2 leverageTokenDeploymentBatcherV2 = new LeverageTokenDeploymentBatcherV2(
ILeverageManager(DeployConstants.LEVERAGE_MANAGER),
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY)
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY),
IAaveLendingAdapterFactory(DeployConstants.AAVE_LENDING_ADAPTER_FACTORY)
);
console.log("LeverageTokenDeploymentBatcher deployed at: ", address(leverageTokenDeploymentBatcher));
console.log("LeverageTokenDeploymentBatcherV2 deployed at: ", address(leverageTokenDeploymentBatcherV2));

vm.stopBroadcast();
}
Expand Down
22 changes: 14 additions & 8 deletions script/8453/Periphery.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import {Script, console} from "forge-std/Script.sol";

/// Dependency imports
import {IMorpho} from "@morpho-blue/interfaces/IMorpho.sol";
import {IPool} from "@aave-v3-origin/contracts/interfaces/IPool.sol";

/// Internal imports
import {MulticallExecutor} from "src/periphery/MulticallExecutor.sol";
import {VeloraAdapter} from "src/periphery/VeloraAdapter.sol";
import {LeverageRouter} from "src/periphery/LeverageRouter.sol";
import {LeverageTokenDeploymentBatcher} from "src/periphery/LeverageTokenDeploymentBatcher.sol";
import {LeverageRouterV2} from "src/periphery/LeverageRouterV2.sol";
import {LeverageTokenDeploymentBatcherV2} from "src/periphery/LeverageTokenDeploymentBatcherV2.sol";
import {ILeverageManager} from "src/interfaces/ILeverageManager.sol";
import {IMorphoLendingAdapterFactory} from "src/interfaces/IMorphoLendingAdapterFactory.sol";
import {IAaveLendingAdapterFactory} from "src/interfaces/IAaveLendingAdapterFactory.sol";
import {DeployConstants} from "./DeployConstants.sol";

contract PeripheryDeploy is Script {
Expand All @@ -34,15 +36,19 @@ contract PeripheryDeploy is Script {
VeloraAdapter veloraAdapter = new VeloraAdapter(DeployConstants.AUGUSTUS_REGISTRY);
console.log("VeloraAdapter deployed at: ", address(veloraAdapter));

LeverageRouter leverageRouter =
new LeverageRouter(ILeverageManager(DeployConstants.LEVERAGE_MANAGER), IMorpho(DeployConstants.MORPHO));
console.log("LeverageRouter deployed at: ", address(leverageRouter));
LeverageRouterV2 leverageRouterV2 = new LeverageRouterV2(
ILeverageManager(DeployConstants.LEVERAGE_MANAGER),
IMorpho(DeployConstants.MORPHO),
IPool(DeployConstants.AAVE_POOL)
);
console.log("LeverageRouterV2 deployed at: ", address(leverageRouterV2));

LeverageTokenDeploymentBatcher leverageTokenDeploymentBatcher = new LeverageTokenDeploymentBatcher(
LeverageTokenDeploymentBatcherV2 leverageTokenDeploymentBatcherV2 = new LeverageTokenDeploymentBatcherV2(
ILeverageManager(DeployConstants.LEVERAGE_MANAGER),
IMorphoLendingAdapterFactory(DeployConstants.LENDING_ADAPTER_FACTORY)
IMorphoLendingAdapterFactory(DeployConstants.MORPHO_LENDING_ADAPTER_FACTORY),
IAaveLendingAdapterFactory(DeployConstants.AAVE_LENDING_ADAPTER_FACTORY)
);
console.log("LeverageTokenDeploymentBatcher deployed at: ", address(leverageTokenDeploymentBatcher));
console.log("LeverageTokenDeploymentBatcherV2 deployed at: ", address(leverageTokenDeploymentBatcherV2));

vm.stopBroadcast();
}
Expand Down
Loading
Loading