generated from AngleProtocol/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 13
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
a37f003
commit aa1fea0
Showing
7 changed files
with
96 additions
and
69 deletions.
There are no files selected for viewing
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
Submodule forge-std
updated
42 files
Submodule utils
updated
8 files
+12 −0 | helpers/common.sh | |
+1 −1 | lib/forge-std | |
+199 −48 | src/CommonUtils.sol | |
+6 −1 | src/Constants.sol | |
+142 −0 | src/Swapper.sol | |
+2 −0 | utils/contractAddress.js | |
+40 −40 | utils/getAllContracts.js | |
+8 −8 | utils/getConnectedChains.js |
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,36 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.19; | ||
|
||
import "./utils/Utils.s.sol"; | ||
import { console } from "forge-std/console.sol"; | ||
import { HarvesterSwap } from "contracts/helpers/HarvesterSwap.sol"; | ||
import "./Constants.s.sol"; | ||
|
||
contract DeployHarvester is Utils { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
address deployer = vm.addr(deployerPrivateKey); | ||
console.log("Deployer address: ", deployer); | ||
address rebalancer = 0x22604C0E5633A9810E01c9cb469B23Eee17AC411; | ||
address asset = USDM; | ||
address collateral = USDC; | ||
uint64 targetExposure = (13 * 1e9) / 100; | ||
uint64 overrideExposures = 0; | ||
uint96 maxSlippage = 1e9 / 100; | ||
HarvesterSwap HarvesterSwap = new HarvesterSwap( | ||
rebalancer, | ||
collateral, | ||
asset, | ||
targetExposure, | ||
overrideExposures, | ||
0, | ||
0, | ||
maxSlippage | ||
); | ||
console.log("HarvesterSwap deployed at: ", address(HarvesterSwap)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
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,36 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.19; | ||
|
||
import "./utils/Utils.s.sol"; | ||
import { console } from "forge-std/console.sol"; | ||
import { RebalancerFlashloanSwap } from "contracts/helpers/RebalancerFlashloanSwap.sol"; | ||
import { IAccessControlManager } from "contracts/utils/AccessControl.sol"; | ||
import { ITransmuter } from "contracts/interfaces/ITransmuter.sol"; | ||
import { IERC3156FlashLender } from "oz/interfaces/IERC3156FlashLender.sol"; | ||
import "./Constants.s.sol"; | ||
import "oz/interfaces/IERC20.sol"; | ||
import "oz-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; | ||
|
||
contract DeployRebalancerFlashloanSwapSwap is Utils { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
address deployer = vm.addr(deployerPrivateKey); | ||
console.log("Deployer address: ", deployer); | ||
console.log(address(IAccessControlManager(_chainToContract(CHAIN_SOURCE, ContractType.CoreBorrow)))); | ||
console.log(address(ITransmuter(_chainToContract(CHAIN_SOURCE, ContractType.TransmuterAgUSD)))); | ||
RebalancerFlashloanSwap rebalancer = new RebalancerFlashloanSwap( | ||
IAccessControlManager(_chainToContract(CHAIN_SOURCE, ContractType.CoreBorrow)), | ||
ITransmuter(_chainToContract(CHAIN_SOURCE, ContractType.TransmuterAgUSD)), | ||
IERC3156FlashLender(_chainToContract(CHAIN_SOURCE, ContractType.FlashLoan)), | ||
ONEINCH_ROUTER, | ||
ONEINCH_ROUTER, | ||
50 // 0.5% | ||
); | ||
|
||
console.log("Rebalancer deployed at: ", address(rebalancer)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
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