Skip to content

Commit

Permalink
feat: deploy scripts for new harvesters
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Sep 20, 2024
1 parent 737b96c commit b7e1a89
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 180 deletions.
14 changes: 11 additions & 3 deletions scripts/AdjustYieldExposure.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { stdJson } from "forge-std/StdJson.sol";
import "stringutils/strings.sol";
import "./Constants.s.sol";

import { RebalancerFlashloanVault } from "contracts/helpers/RebalancerFlashloanVault.sol";
import { GenericHarvester, SwapType } from "contracts/helpers/GenericHarvester.sol";

contract AdjustYieldExposure is Utils {
function run() external {
Expand All @@ -17,8 +17,16 @@ contract AdjustYieldExposure is Utils {
console.log(deployer.balance);
vm.startBroadcast(deployerPrivateKey);

RebalancerFlashloanVault rebalancer = RebalancerFlashloanVault(0x22604C0E5633A9810E01c9cb469B23Eee17AC411);
rebalancer.adjustYieldExposure(1300000 * 1 ether, 0, USDC, STEAK_USDC, 1200000 * 1 ether, new bytes(0));
GenericHarvester rebalancer = GenericHarvester(0x22604C0E5633A9810E01c9cb469B23Eee17AC411);
rebalancer.adjustYieldExposure(
1300000 * 1 ether,
0,
USDC,
STEAK_USDC,
1200000 * 1 ether,
SwapType.VAULT,
new bytes(0)
);

vm.stopBroadcast();
}
Expand Down
42 changes: 42 additions & 0 deletions scripts/DeployGenericHarvester.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;

import "./utils/Utils.s.sol";
import { console } from "forge-std/console.sol";
import { GenericHarvester } from "contracts/helpers/GenericHarvester.sol";
import { IAccessControlManager } from "contracts/utils/AccessControl.sol";
import { IAgToken } from "contracts/interfaces/IAgToken.sol";
import { ITransmuter } from "contracts/interfaces/ITransmuter.sol";
import { IERC3156FlashLender } from "oz/interfaces/IERC3156FlashLender.sol";
import "./Constants.s.sol";

contract DeployGenericHarvester 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);
uint256 maxMintAmount = 1000000e18;
uint96 maxSlippage = 1e9 / 100;
uint32 maxSwapSlippage = 100; // 1%
IERC3156FlashLender flashloan = IERC3156FlashLender(_chainToContract(CHAIN_SOURCE, ContractType.FlashLoan));
IAgToken agToken = IAgToken(_chainToContract(CHAIN_SOURCE, ContractType.AgEUR));
ITransmuter transmuter = ITransmuter(_chainToContract(CHAIN_SOURCE, ContractType.TransmuterAgEUR));
IAccessControlManager accessControlManager = transmuter.accessControlManager();

GenericHarvester harvester = new GenericHarvester(
maxSlippage,
ONEINCH_ROUTER,
ONEINCH_ROUTER,
maxSwapSlippage,
agToken,
transmuter,
accessControlManager,
flashloan
);
console.log("HarvesterVault deployed at: ", address(harvester));

vm.stopBroadcast();
}
}
36 changes: 0 additions & 36 deletions scripts/DeployHarvesterSwap.s.sol

This file was deleted.

34 changes: 0 additions & 34 deletions scripts/DeployHarvesterVault.s.sol

This file was deleted.

36 changes: 36 additions & 0 deletions scripts/DeployMultiBlockRebalancer.s.sol
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 { MultiBlockRebalancer } from "contracts/helpers/MultiBlockRebalancer.sol";
import { IAccessControlManager } from "contracts/utils/AccessControl.sol";
import { IAgToken } from "contracts/interfaces/IAgToken.sol";
import { ITransmuter } from "contracts/interfaces/ITransmuter.sol";
import "./Constants.s.sol";

contract DeployMultiBlockRebalancer 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);
uint256 maxMintAmount = 1000000e18;
uint96 maxSlippage = 1e9 / 100;
address agToken = _chainToContract(CHAIN_SOURCE, ContractType.AgEUR);
address transmuter = _chainToContract(CHAIN_SOURCE, ContractType.TransmuterAgEUR);
IAccessControlManager accessControlManager = ITransmuter(transmuter).accessControlManager();

MultiBlockRebalancer harvester = new MultiBlockRebalancer(
maxMintAmount,
maxSlippage,
accessControlManager,
IAgToken(agToken),
ITransmuter(transmuter)
);
console.log("HarvesterVault deployed at: ", address(harvester));

vm.stopBroadcast();
}
}
28 changes: 0 additions & 28 deletions scripts/DeployRebalancer.s.sol

This file was deleted.

36 changes: 0 additions & 36 deletions scripts/DeployRebalancerFlashloanSwap.s.sol

This file was deleted.

39 changes: 0 additions & 39 deletions scripts/DeployRebalancerFlashloanVault.s.sol

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/test/UpdateTransmuterFacetsUSDATest.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ interface OldTransmuter {
contract UpdateTransmuterFacetsUSDATest is Helpers, Test {
using stdJson for string;

uint256 public CHAIN_SOURCE;

address constant WHALE_USDA = 0xA9DdD91249DFdd450E81E1c56Ab60E1A62651701;

string[] replaceFacetNames;
Expand All @@ -51,8 +49,6 @@ contract UpdateTransmuterFacetsUSDATest is Helpers, Test {
function setUp() public override {
super.setUp();

CHAIN_SOURCE = CHAIN_ETHEREUM;

ethereumFork = vm.createSelectFork("mainnet", 19499622);

governor = DEPLOYER;
Expand Down

0 comments on commit b7e1a89

Please sign in to comment.