generated from AngleProtocol/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1db5568
commit afccf93
Showing
9 changed files
with
294 additions
and
9 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
|
||
import "forge-std/Script.sol"; | ||
import "stringutils/strings.sol"; | ||
import { CommonUtils } from "utils/src/CommonUtils.sol"; | ||
import "utils/src/Constants.sol"; | ||
|
||
/// @title Utils | ||
/// @author Angle Labs, Inc. | ||
contract Helpers is CommonUtils, Script { | ||
mapping(uint256 => uint256) internal forkIdentifier; | ||
uint256 public arbitrumFork; | ||
uint256 public avalancheFork; | ||
uint256 public ethereumFork; | ||
uint256 public optimismFork; | ||
uint256 public polygonFork; | ||
uint256 public gnosisFork; | ||
uint256 public bnbFork; | ||
uint256 public celoFork; | ||
uint256 public polygonZkEVMFork; | ||
uint256 public baseFork; | ||
uint256 public lineaFork; | ||
|
||
address public alice; | ||
address public bob; | ||
address public charlie; | ||
address public dylan; | ||
address public sweeper; | ||
|
||
function setUp() public virtual { | ||
arbitrumFork = vm.createFork(vm.envString("ETH_NODE_URI_ARBITRUM")); | ||
avalancheFork = vm.createFork(vm.envString("ETH_NODE_URI_AVALANCHE")); | ||
ethereumFork = vm.createFork(vm.envString("ETH_NODE_URI_MAINNET")); | ||
optimismFork = vm.createFork(vm.envString("ETH_NODE_URI_OPTIMISM")); | ||
polygonFork = vm.createFork(vm.envString("ETH_NODE_URI_POLYGON")); | ||
gnosisFork = vm.createFork(vm.envString("ETH_NODE_URI_GNOSIS")); | ||
bnbFork = vm.createFork(vm.envString("ETH_NODE_URI_BSC")); | ||
celoFork = vm.createFork(vm.envString("ETH_NODE_URI_CELO")); | ||
polygonZkEVMFork = vm.createFork(vm.envString("ETH_NODE_URI_POLYGON_ZKEVM")); | ||
baseFork = vm.createFork(vm.envString("ETH_NODE_URI_BASE")); | ||
lineaFork = vm.createFork(vm.envString("ETH_NODE_URI_LINEA")); | ||
|
||
forkIdentifier[CHAIN_ARBITRUM] = arbitrumFork; | ||
forkIdentifier[CHAIN_AVALANCHE] = avalancheFork; | ||
forkIdentifier[CHAIN_ETHEREUM] = ethereumFork; | ||
forkIdentifier[CHAIN_OPTIMISM] = optimismFork; | ||
forkIdentifier[CHAIN_POLYGON] = polygonFork; | ||
forkIdentifier[CHAIN_GNOSIS] = gnosisFork; | ||
forkIdentifier[CHAIN_BNB] = bnbFork; | ||
forkIdentifier[CHAIN_CELO] = celoFork; | ||
forkIdentifier[CHAIN_POLYGONZKEVM] = polygonZkEVMFork; | ||
forkIdentifier[CHAIN_BASE] = baseFork; | ||
forkIdentifier[CHAIN_LINEA] = lineaFork; | ||
|
||
alice = vm.addr(1); | ||
bob = vm.addr(2); | ||
charlie = vm.addr(3); | ||
dylan = vm.addr(4); | ||
sweeper = address(uint160(uint256(keccak256(abi.encodePacked("sweeper"))))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.17; | ||
|
||
import "forge-std/Script.sol"; | ||
import { console } from "forge-std/console.sol"; | ||
import "borrow/interfaces/ICoreBorrow.sol"; | ||
import "borrow/interfaces/IAngleRouterSidechain.sol"; | ||
import "borrow/interfaces/external/uniswap/IUniswapRouter.sol"; | ||
import { SwapType, BaseLevSwapper, PendleLevSwapperMorphoWeETH, PendleLevSwapperMorpho, Swapper } from "contracts/swapper/LevSwapper/morpho/implementations/PendleLevSwapperMorphoWeETH.sol"; | ||
import "./MainnetConstants.s.sol"; | ||
import { IMorphoBase } from "morpho-blue/interfaces/IMorpho.sol"; | ||
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; | ||
|
||
contract SwapperLevMorpho is Script, MainnetConstants { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
PendleLevSwapperMorphoWeETH swapperMorphoPTWeETH = new PendleLevSwapperMorphoWeETH( | ||
ICoreBorrow(CORE_BORROW), | ||
IUniswapV3Router(UNI_V3_ROUTER), | ||
ONE_INCH, | ||
IAngleRouterSidechain(ANGLE_ROUTER), | ||
IMorphoBase(MORPHO_BLUE) | ||
); | ||
|
||
console.log("Successfully deployed swapper Morpho PT-weETH Pendle: ", address(swapperMorphoPTWeETH)); | ||
|
||
// Set oracles to have liquidable positions | ||
// vm.mockCall( | ||
// address(0x986b5E1e1755e3C2440e960477f25201B0a8bbD4), | ||
// abi.encodeWithSelector(AggregatorV3Interface.latestRoundData.selector), | ||
// abi.encode(0, 0.001 ether, 0, 0, 0) | ||
// ); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |