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.
feat: deploy scripts for new harvesters
- Loading branch information
1 parent
737b96c
commit b7e1a89
Showing
9 changed files
with
89 additions
and
180 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
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,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(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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