new deployment scripts

This commit is contained in:
JulesCrown 2024-09-17 15:48:59 +02:00
parent 18a57c0ead
commit b4dfb03590
5 changed files with 54 additions and 31 deletions

View file

@ -0,0 +1,15 @@
pragma solidity ^0.8.19;
import {DeployScript} from "./DeployScript.sol";
contract BaseDeploy is DeployScript {
function setUp() public {
// Sepolia data
feeDest = 0x0000000000000000000000000000000000000000;
weth = 0x4200000000000000000000000000000000000006;
v3Factory = 0x33128a8fC17869897dcE68Ed026d694621f6FDfD;
// comment out if new deployment
// twabc = 0xFCFa3b066981027516121bd27a9B1cBb9C00c5Fd;
}
}

View file

@ -0,0 +1,15 @@
pragma solidity ^0.8.19;
import {DeployScript} from "./DeployScript.sol";
contract BaseSepoliaDeploy is DeployScript {
function setUp() public {
// Base Sepolia data
feeDest = 0xf6a3eef9088A255c32b6aD2025f83E57291D9011;
weth = 0x4200000000000000000000000000000000000006;
v3Factory = 0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24;
// comment out if new deployment
twabc = 0xFCFa3b066981027516121bd27a9B1cBb9C00c5Fd;
}
}

View file

@ -8,22 +8,14 @@ import "../src/Harberg.sol";
import "../src/Stake.sol";
import {LiquidityManager} from "../src/LiquidityManager.sol";
// Base Sepolia data
address constant FEE_DEST = 0xf6a3eef9088A255c32b6aD2025f83E57291D9011;
address constant WETH = 0x4200000000000000000000000000000000000006;
address constant V3_FACTORY = 0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24;
address constant TWABC = 0xFCFa3b066981027516121bd27a9B1cBb9C00c5Fd;
// Sepolia data
// address constant WETH = 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14; //Sepolia
// address constant V3_FACTORY = 0x0227628f3F023bb0B980b67D528571c95c6DaC1c; //Sepolia
// address constant TWABC = 0x64ddA11815B883C589AFeD914666ef2D63C8C338; //new TwabController(60 * 60 * 24, uint32(block.timestamp));
uint24 constant FEE = uint24(10_000);
contract BaseSepoliaScript is Script {
contract DeployScript is Script {
bool token0isWeth;
function setUp() public {}
address feeDest;
address weth;
address v3Factory;
address twabc;
function sqrt(uint256 y) internal pure returns (uint256 z) {
@ -66,19 +58,23 @@ contract BaseSepoliaScript is Script {
address sender = vm.addr(privateKey);
console.log(sender);
TwabController tc = TwabController(TWABC);
// in case you want to deploy an new TwabController
//TwabController tc = new TwabController(60 * 60, uint32(block.timestamp));
TwabController tc;
if (twabc == address(0)) {
tc = TwabController(twabc);
} else {
// in case you want to deploy an new TwabController
tc = new TwabController(60 * 60, uint32(block.timestamp));
}
Harberg harb = new Harberg("Harbergerger Tax", "HARB", tc);
token0isWeth = address(WETH) < address(harb);
token0isWeth = address(weth) < address(harb);
Stake stake = new Stake(address(harb));
harb.setStakingPool(address(stake));
IUniswapV3Factory factory = IUniswapV3Factory(V3_FACTORY);
address liquidityPool = factory.createPool(WETH, address(harb), FEE);
IUniswapV3Factory factory = IUniswapV3Factory(v3Factory);
address liquidityPool = factory.createPool(weth, address(harb), FEE);
initializePoolFor1Cent(liquidityPool);
harb.setLiquidityPool(liquidityPool);
LiquidityManager liquidityManager = new LiquidityManager(V3_FACTORY, WETH, address(harb));
liquidityManager.setFeeDestination(FEE_DEST);
LiquidityManager liquidityManager = new LiquidityManager(v3Factory, weth, address(harb));
liquidityManager.setFeeDestination(feeDest);
// note: this delayed initialization is not a security issue.
harb.setLiquidityManager(address(liquidityManager));
(bool sent, ) = address(liquidityManager).call{value: 0.1 ether}("");