harb/onchain/script/Deploy.sol

34 lines
1.4 KiB
Solidity
Raw Normal View History

pragma solidity ^0.8.19;
2023-11-21 21:06:21 +01:00
import "forge-std/Script.sol";
2024-03-12 20:22:10 +01:00
import {TwabController} from "pt-v5-twab-controller/TwabController.sol";
2024-03-14 17:31:16 +01:00
import "@uniswap-v3-core/interfaces/IUniswapV3Factory.sol";
2024-02-23 22:01:23 +01:00
import "../src/Harb.sol";
import "../src/Stake.sol";
import {BaseLineLP} from "../src/BaseLineLP.sol";
2023-11-21 21:06:21 +01:00
2024-03-14 12:40:57 +01:00
address constant WETH = 0xb16F35c0Ae2912430DAc15764477E179D9B9EbEa; //Sepolia
address constant V3_FACTORY = 0x0227628f3F023bb0B980b67D528571c95c6DaC1c; //Sepolia
address constant TWABC = 0x79Deda2d38A3232fE9b68DcB7d6b461d793A7236; //new TwabController(60 * 60 * 24, uint32(block.timestamp));
2024-03-14 12:48:14 +01:00
uint24 constant FEE = uint24(10_000);
2024-03-14 12:40:57 +01:00
2024-03-12 20:22:10 +01:00
contract SepoliaScript is Script {
2023-11-21 21:06:21 +01:00
function setUp() public {}
function run() public {
string memory seedPhrase = vm.readFile(".secret");
uint256 privateKey = vm.deriveKey(seedPhrase, 0);
vm.startBroadcast(privateKey);
TwabController tc = TwabController(TWABC);
2024-03-14 12:40:57 +01:00
Harb harb = new Harb("Harberger Tax", "HARB", V3_FACTORY, WETH, tc);
2024-03-12 11:38:16 +01:00
Stake stake = new Stake(address(harb));
harb.setStakingPool(address(stake));
2024-03-14 17:31:16 +01:00
IUniswapV3Factory factory = IUniswapV3Factory(V3_FACTORY);
factory.createPool(WETH, address(harb), FEE);
2024-04-11 22:32:47 +02:00
BaseLineLP liquidityManager = new BaseLineLP(V3_FACTORY, WETH, address(harb));
harb.setLiquidityManager(address(liquidityManager));
2023-11-21 21:06:21 +01:00
vm.stopBroadcast();
}
2024-03-12 20:22:10 +01:00
}