Skip to content

Commit

Permalink
Merge pull request #177 from stabilitydao/deploy-system-refactoring
Browse files Browse the repository at this point in the history
refactor deploy scripts, fix project setup, fix tests
  • Loading branch information
a17 authored Oct 21, 2024
2 parents 0bb8684 + c195f8d commit 8bfd2f5
Show file tree
Hide file tree
Showing 42 changed files with 244 additions and 377 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Compiler files
cache/
out/
tmp/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
/broadcast

# Docs
docs/
Expand Down
10 changes: 5 additions & 5 deletions chains/PolygonLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ library PolygonLib {
farm.pool = IHypervisor(hypervisor).pool();
farm.strategyLogicId = StrategyIdLib.GAMMA_QUICKSWAP_MERKL_FARM;
farm.rewardAssets = new address[](1);
farm.rewardAssets[0] = TOKEN_dQUICK;
farm.rewardAssets[0] = TOKEN_QUICK;
farm.addresses = new address[](2);
farm.addresses[0] = GAMMA_QUICKSWAP_UNIPROXY;
farm.addresses[1] = hypervisor;
Expand All @@ -609,7 +609,7 @@ library PolygonLib {
farm.pool = IHypervisor(hypervisor).pool();
farm.strategyLogicId = StrategyIdLib.STEER_QUICKSWAP_MERKL_FARM;
farm.rewardAssets = new address[](2);
farm.rewardAssets[0] = TOKEN_dQUICK;
farm.rewardAssets[0] = TOKEN_QUICK;
farm.rewardAssets[1] = TOKEN_WMATIC;
farm.addresses = new address[](1);
farm.addresses[0] = hypervisor;
Expand Down Expand Up @@ -652,7 +652,7 @@ library PolygonLib {
farm.pool = IDefiEdgeStrategy(underlyingDefiEdge).pool();
farm.strategyLogicId = StrategyIdLib.DEFIEDGE_QUICKSWAP_MERKL_FARM;
farm.rewardAssets = new address[](1);
farm.rewardAssets[0] = TOKEN_dQUICK;
farm.rewardAssets[0] = TOKEN_QUICK;
farm.addresses = new address[](1);
farm.addresses[0] = underlyingDefiEdge;
farm.nums = new uint[](1);
Expand All @@ -667,7 +667,7 @@ library PolygonLib {
farm.pool = IICHIVault(underlyingIchi).pool();
farm.strategyLogicId = StrategyIdLib.ICHI_QUICKSWAP_MERKL_FARM;
farm.rewardAssets = new address[](2);
farm.rewardAssets[0] = TOKEN_dQUICK;
farm.rewardAssets[0] = TOKEN_QUICK;
farm.rewardAssets[1] = TOKEN_ICHI;
farm.addresses = new address[](1);
farm.addresses[0] = underlyingIchi;
Expand Down Expand Up @@ -705,7 +705,7 @@ library PolygonLib {
farm.pool = pool;
farm.strategyLogicId = StrategyIdLib.QUICKSWAP_STATIC_MERKL_FARM;
farm.rewardAssets = new address[](1);
farm.rewardAssets[0] = TOKEN_dQUICK;
farm.rewardAssets[0] = TOKEN_QUICK;
farm.addresses = new address[](1);
farm.addresses[0] = QUICKSWAP_POSITION_MANAGER;
farm.nums = new uint[](0);
Expand Down
38 changes: 0 additions & 38 deletions script/DeployUpdateRetroStrategies.Polygon.sol

This file was deleted.

32 changes: 0 additions & 32 deletions script/DeployUpdateStrategies.Polygon.s.sol

This file was deleted.

94 changes: 0 additions & 94 deletions script/DeployUpdateStrategyIRMF.Polygon.s.sol

This file was deleted.

34 changes: 0 additions & 34 deletions script/DeployUpdateVaultsAndStrategy.Polygon.s.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.23;

import "forge-std/Script.sol";
import "../chains/ArbitrumLib.sol";
import {DeployCore} from "./base/DeployCore.sol";
import "../../chains/ArbitrumLib.sol";
import {DeployCore} from "../base/DeployCore.sol";

contract DeployArbitrum is Script, DeployCore {
function run() external {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.23;

import "forge-std/Script.sol";
import "../chains/BaseLib.sol";
import {DeployCore} from "./base/DeployCore.sol";
import "../../chains/BaseLib.sol";
import {DeployCore} from "../base/DeployCore.sol";

contract DeployBase is Script, DeployCore {
function run() external {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.23;

import "forge-std/Script.sol";
import "../chains/EthereumLib.sol";
import {DeployCore} from "./base/DeployCore.sol";
import "../../chains/EthereumLib.sol";
import {DeployCore} from "../base/DeployCore.sol";

contract DeployEthereum is Script, DeployCore {
function run() external {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.23;

import "forge-std/Script.sol";
import "../chains/PolygonLib.sol";
import {DeployCore} from "./base/DeployCore.sol";
import "../../chains/PolygonLib.sol";
import {DeployCore} from "../base/DeployCore.sol";

contract DeployPolygon is Script, DeployCore {
function run() external {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
pragma solidity ^0.8.23;

import "forge-std/Script.sol";
import "../src/core/proxy/Proxy.sol";
import "../src/adapters/CurveAdapter.sol";
import "../src/strategies/CurveConvexFarmStrategy.sol";
//import "../src/core/proxy/Proxy.sol";
//import "../src/adapters/CurveAdapter.sol";
import "../../src/strategies/CurveConvexFarmStrategy.sol";

contract DeployStrategyCCFPolygon is Script {
address public constant PLATFORM = 0xb2a0737ef27b5Cc474D24c779af612159b1c3e60;
address public constant POOL_CURVE_crvUSD_USDCe = 0x864490Cf55dc2Dee3f0ca4D06F5f80b2BB154a03;
/*address public constant POOL_CURVE_crvUSD_USDCe = 0x864490Cf55dc2Dee3f0ca4D06F5f80b2BB154a03;
address public constant POOL_CURVE_crvUSD_USDT = 0xA70Af99bFF6b168327f9D1480e29173e757c7904;
address public constant POOL_CURVE_crvUSD_DAI = 0x62c949ee985b125Ff2d7ddcf4Fe7AEcB0a040E2a;
address public constant POOL_CURVE_crvUSD_USDC = 0x5225010A0AE133B357861782B0B865a48471b2C5;
Expand All @@ -21,10 +21,10 @@ contract DeployStrategyCCFPolygon is Script {
address public constant CONVEX_REWARD_POOL_crvUSD_USDT = 0xd2D8BEB901f90163bE4667A85cDDEbB7177eb3E3;
address public constant CONVEX_REWARD_POOL_crvUSD_DAI = 0xaCb744c7e7C95586DB83Eda3209e6483Fb1FCbA4;
address public constant CONVEX_REWARD_POOL_crvUSD_USDC = 0x11F2217fa1D5c44Eae310b9b985E2964FC47D8f9;
address public constant DEV = 0x88888887C3ebD4a33E34a15Db4254C74C75E5D4A;
address public constant DEV = 0x88888887C3ebD4a33E34a15Db4254C74C75E5D4A;*/

function run() external {
// prepare pools
/*// prepare pools
ISwapper swapper = ISwapper(IPlatform(PLATFORM).swapper());
ISwapper.AddPoolData[] memory pools = new ISwapper.AddPoolData[](2);
pools[0] = ISwapper.AddPoolData({
Expand Down Expand Up @@ -55,21 +55,23 @@ contract DeployStrategyCCFPolygon is Script {
_farms[i++] = _makeCurveConvexFarm(POOL_CURVE_crvUSD_USDCe, CONVEX_REWARD_POOL_crvUSD_USDCe);
_farms[i++] = _makeCurveConvexFarm(POOL_CURVE_crvUSD_USDT, CONVEX_REWARD_POOL_crvUSD_USDT);
_farms[i++] = _makeCurveConvexFarm(POOL_CURVE_crvUSD_DAI, CONVEX_REWARD_POOL_crvUSD_DAI);
_farms[i++] = _makeCurveConvexFarm(POOL_CURVE_crvUSD_USDC, CONVEX_REWARD_POOL_crvUSD_USDC);
_farms[i++] = _makeCurveConvexFarm(POOL_CURVE_crvUSD_USDC, CONVEX_REWARD_POOL_crvUSD_USDC);;
*/

// start deploy
uint deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);

// add AMM adapter
/*// add AMM adapter
Proxy proxy = new Proxy();
proxy.initProxy(address(new CurveAdapter()));
IPlatform(PLATFORM).addAmmAdapter(AmmAdapterIdLib.CURVE, address(proxy));
IPlatform(PLATFORM).addAmmAdapter(AmmAdapterIdLib.CURVE, address(proxy));*/

// deploy strategy implementation
address implementation = address(new CurveConvexFarmStrategy());
/*address implementation = address(*/
new CurveConvexFarmStrategy(); /*)*/

// add routes and thresholds
/*// add routes and thresholds
swapper.addPools(pools, false);
swapper.setThresholds(tokenIn, thresholdAmount);
Expand All @@ -87,13 +89,15 @@ contract DeployStrategyCCFPolygon is Script {
tokenId: type(uint).max
}),
DEV
);
);*/

vm.stopBroadcast();
}

function testDeployPolygon() external {}

/*
function _makeCurveConvexFarm(
address curvePool,
address convexRewardPool
Expand All @@ -114,5 +118,5 @@ contract DeployStrategyCCFPolygon is Script {
farm.nums = new uint[](0);
farm.ticks = new int24[](0);
return farm;
}
}*/
}
Loading

0 comments on commit 8bfd2f5

Please sign in to comment.