Skip to content

Commit

Permalink
refactor prepare upgrade scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
a17 committed Jan 8, 2025
1 parent d8f2c8d commit 3b32a58
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ pragma solidity ^0.8.23;

import {console} from "forge-std/Test.sol";
import "forge-std/Script.sol";
import "../../chains/PolygonLib.sol";
import "../../src/core/Factory.sol";
import "../../src/core/Zap.sol";
import "../../src/core/vaults/CVault.sol";
import "../../src/core/vaults/RVault.sol";
import "../../src/core/vaults/RMVault.sol";

contract PrepareUpgrade1Polygon is Script {
contract PrepareUpgrade1 is Script {
function run() external {
uint deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
Expand All @@ -31,5 +30,5 @@ contract PrepareUpgrade1Polygon is Script {
vm.stopBroadcast();
}

function testDeployPolygon() external {}
function testPrepareUpgrade() external {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@ import "../../src/adapters/AlgebraAdapter.sol";
import "../../src/adapters/UniswapV3Adapter.sol";
import "../../src/adapters/KyberAdapter.sol";
import "../../src/core/Zap.sol";
// import "../../src/strategies/QuickswapV3StaticFarmStrategy.sol";

contract PrepareUpgrade2Polygon is Script {
contract PrepareUpgrade2 is Script {
function run() external {
uint deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
new AlgebraAdapter();
new UniswapV3Adapter();
new KyberAdapter();
new Zap();
// new QuickSwapV3StaticFarmStrategy();
vm.stopBroadcast();
}

function testDeployPolygon() external {}
function testPrepareUpgrade() external {}
}
75 changes: 0 additions & 75 deletions script/upgrade-core/PrepareUpgrade.24.01.0-alpha.Polygon.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import "../../src/core/Factory.sol";
import "../../src/core/vaults/CVault.sol";
import "../../src/core/vaults/RVault.sol";
import "../../src/core/vaults/RMVault.sol";
// import "../../src/strategies/QuickswapV3StaticFarmStrategy.sol";

contract PrepareUpgrade3Polygon is Script {
address public constant PLATFORM = 0xb2a0737ef27b5Cc474D24c779af612159b1c3e60;
string public constant ALGEBRA = "Algebra";
string internal constant COMPOUNDING = "Compounding";
string internal constant REWARDING = "Rewarding";
string internal constant REWARDING_MANAGED = "Rewarding Managed";
// string public constant QUICKSWAPV3_STATIC_FARM = "QuickSwapV3 Static Farm";
address public constant TOKEN_USDCe = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174;
address public constant TOKEN_USDC = 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359;
address public constant TOKEN_dQUICK = 0x958d208Cdf087843e9AD98d23823d32E17d723A1;
Expand All @@ -25,58 +23,15 @@ contract PrepareUpgrade3Polygon is Script {

function run() external {
uint deployerPrivateKey = vm.envUint("PRIVATE_KEY");
// IFactory factory = IFactory(IPlatform(PLATFORM).factory());

vm.startBroadcast(deployerPrivateKey);

// Factory 1.0.2: setVaultStatus updated
new Factory();

// QSF 1.0.2: getRevenue fixed
// new QuickSwapV3StaticFarmStrategy();
// factory.setStrategyLogicConfig(
// IFactory.StrategyLogicConfig({
// id: QUICKSWAPV3_STATIC_FARM,
// implementation: impl,
// deployAllowed: true,
// upgradeAllowed: true,
// farming: true,
// tokenId: 0
// }),
// address(0)
// );

// Vaults 1.1.0: setName, setSymbol, gas optimization
new CVault();
// factory.setVaultConfig(
// IFactory.VaultConfig({
// vaultType: COMPOUNDING,
// implementation: impl,
// deployAllowed: true,
// upgradeAllowed: true,
// buildingPrice: 50_000e18
// })
// );
new RVault();
// factory.setVaultConfig(
// IFactory.VaultConfig({
// vaultType: REWARDING,
// implementation: impl,
// deployAllowed: true,
// upgradeAllowed: true,
// buildingPrice: 50_000e18
// })
// );
new RMVault();
// factory.setVaultConfig(
// IFactory.VaultConfig({
// vaultType: REWARDING_MANAGED,
// implementation: impl,
// deployAllowed: false,
// upgradeAllowed: false,
// buildingPrice: 100_000e18
// })
// );

// route for native USDC
ISwapper.AddPoolData[] memory pools = new ISwapper.AddPoolData[](1);
Expand All @@ -94,36 +49,6 @@ contract PrepareUpgrade3Polygon is Script {
thresholdAmount[0] = 1e3;
swapper.setThresholds(tokenIn, thresholdAmount);

// new farm for QSF
// IFactory.Farm[] memory _farms = new IFactory.Farm[](1);
// address[] memory rewardAssets;
// address[] memory addresses;
// uint[] memory nums;
// int24[] memory ticks;
// [17] Earn dQUICK, WMATIC by static position in USDCe/USDC pool on QuickSwap V3
// rewardAssets = new address[](2);
// rewardAssets[0] = TOKEN_dQUICK;
// rewardAssets[1] = TOKEN_WMATIC;
// addresses = new address[](2);
// addresses[0] = QUICKSWAP_POSITION_MANAGER;
// addresses[1] = QUICKSWAP_FARMING_CENTER;
// nums = new uint[](2);
// nums[0] = 1700454552;
// nums[1] = 4104559500;
// ticks = new int24[](2);
// ticks[0] = -60;
// ticks[1] = 60;
// _farms[0] = IFactory.Farm({
// status: 0,
// pool: POOL_QUICKSWAPV3_USDCe_USDC,
// strategyLogicId: StrategyIdLib.QUICKSWAPV3_STATIC_FARM,
// rewardAssets: rewardAssets,
// addresses: addresses,
// nums: nums,
// ticks: ticks
// });
// factory.addFarms(_farms);

vm.stopBroadcast();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "../../src/core/vaults/RVault.sol";
import "../../src/core/vaults/RMVault.sol";
import "../../src/strategies/YearnStrategy.sol";

contract PrepareUpgrade5Polygon is Script {
contract PrepareUpgrade5 is Script {
function run() external {
uint deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
Expand All @@ -31,5 +31,5 @@ contract PrepareUpgrade5Polygon is Script {
vm.stopBroadcast();
}

function testDeployPolygon() external {}
function testPrepareUpgrade() external {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ pragma solidity ^0.8.23;

import "forge-std/Script.sol";
import "../../src/core/Factory.sol";
import "../../src/core/vaults/CVault.sol";
import "../../src/core/vaults/RVault.sol";
import "../../src/core/vaults/RMVault.sol";
import "../../src/strategies/YearnStrategy.sol";

contract PrepareUpgrade5Polygon is Script {
contract PrepareUpgrade6 is Script {
function run() external {
uint deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
Expand All @@ -19,5 +15,5 @@ contract PrepareUpgrade5Polygon is Script {
vm.stopBroadcast();
}

function testDeployPolygon() external {}
function testPrepareUpgrade() external {}
}

0 comments on commit 3b32a58

Please sign in to comment.