diff --git a/script/dependencies/phase-1b/UsdsNgtFarmingInit.sol b/script/dependencies/phase-1b/UsdsSkyFarmingInit.sol similarity index 79% rename from script/dependencies/phase-1b/UsdsNgtFarmingInit.sol rename to script/dependencies/phase-1b/UsdsSkyFarmingInit.sol index 9c5f0ea..fdf7f7b 100644 --- a/script/dependencies/phase-1b/UsdsNgtFarmingInit.sol +++ b/script/dependencies/phase-1b/UsdsSkyFarmingInit.sol @@ -19,9 +19,9 @@ import {StakingRewardsInit, StakingRewardsInitParams} from "../StakingRewardsIni import {VestedRewardsDistributionInit, VestedRewardsDistributionInitParams} from "../VestedRewardsDistributionInit.sol"; import {VestInit, VestCreateParams} from "../VestInit.sol"; -struct UsdsNgtFarmingInitParams { +struct UsdsSkyFarmingInitParams { address usds; - address ngt; + address sky; address rewards; bytes32 rewardsKey; // Chainlog key address dist; @@ -32,38 +32,38 @@ struct UsdsNgtFarmingInitParams { uint256 vestTau; } -struct UsdsNgtFarmingInitResult { +struct UsdsSkyFarmingInitResult { uint256 vestId; } -library UsdsNgtFarmingInit { +library UsdsSkyFarmingInit { ChainlogLike internal constant chainlog = ChainlogLike(0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F); - function init(UsdsNgtFarmingInitParams memory p) internal returns (UsdsNgtFarmingInitResult memory r) { + function init(UsdsSkyFarmingInitParams memory p) internal returns (UsdsSkyFarmingInitResult memory r) { address stakingToken = StakingRewardsLike(p.rewards).stakingToken(); address rewardsToken = StakingRewardsLike(p.rewards).rewardsToken(); - require(stakingToken != rewardsToken, "UsdsNgtFarmingInit/rewards-token-same-as-staking-token"); + require(stakingToken != rewardsToken, "UsdsSkyFarmingInit/rewards-token-same-as-staking-token"); - require(DssVestWithGemLike(p.vest).gem() == p.ngt, "UsdsNgtFarmingInit/vest-gem-mismatch"); + require(DssVestWithGemLike(p.vest).gem() == p.sky, "UsdsSkyFarmingInit/vest-gem-mismatch"); - require(stakingToken == p.usds, "UsdsNgtFarmingInit/rewards-staking-token-mismatch"); - require(rewardsToken == p.ngt, "UsdsNgtFarmingInit/rewards-rewards-token-mismatch"); + require(stakingToken == p.usds, "UsdsSkyFarmingInit/rewards-staking-token-mismatch"); + require(rewardsToken == p.sky, "UsdsSkyFarmingInit/rewards-rewards-token-mismatch"); require( StakingRewardsLike(p.rewards).lastUpdateTime() == 0, - "UsdsNgtFarmingInit/rewards-last-update-time-invalid" + "UsdsSkyFarmingInit/rewards-last-update-time-invalid" ); - require(VestedRewardsDistributionLike(p.dist).gem() == p.ngt, "UsdsNgtFarmingInit/dist-gem-mismatch"); - require(VestedRewardsDistributionLike(p.dist).dssVest() == p.vest, "UsdsNgtFarmingInit/dist-dss-vest-mismatch"); + require(VestedRewardsDistributionLike(p.dist).gem() == p.sky, "UsdsSkyFarmingInit/dist-gem-mismatch"); + require(VestedRewardsDistributionLike(p.dist).dssVest() == p.vest, "UsdsSkyFarmingInit/dist-dss-vest-mismatch"); require( VestedRewardsDistributionLike(p.dist).stakingRewards() == p.rewards, - "UsdsNgtFarmingInit/dist-staking-rewards-mismatch" + "UsdsSkyFarmingInit/dist-staking-rewards-mismatch" ); // `vest` is expected to be an instance of `DssVestMintable`. - // Check if minting rights on `ngt` were granted to `vest`. - require(WardsLike(p.ngt).wards(p.vest) == 1, "UsdsNgtFarmingInit/missing-ngt-rely-vest"); + // Check if minting rights on `sky` were granted to `vest`. + require(WardsLike(p.sky).wards(p.vest) == 1, "UsdsSkyFarmingInit/missing-sky-rely-vest"); // Set `dist` with `rewardsDistribution` role in `rewards`. StakingRewardsInit.init(p.rewards, StakingRewardsInitParams({dist: p.dist})); diff --git a/script/input/1/phase-1b/template-usds-ngt-farming-deploy.json b/script/input/1/phase-1b/template-usds-sky-farming-deploy.json similarity index 85% rename from script/input/1/phase-1b/template-usds-ngt-farming-deploy.json rename to script/input/1/phase-1b/template-usds-sky-farming-deploy.json index c1f383f..77ffcbd 100644 --- a/script/input/1/phase-1b/template-usds-ngt-farming-deploy.json +++ b/script/input/1/phase-1b/template-usds-sky-farming-deploy.json @@ -1,7 +1,7 @@ { - "ngt": "address: the address of NGT", + "sky": "address: the address of SKY", "usds": "address: the address of USDS", - "vest": "address: the address of a DssVestMintable contract for NGT", + "vest": "address: the address of a DssVestMintable contract for SKY", "rewards": "[OPTIONAL] address: the address of the StakingRewards contract", "dist": "[OPTIONAL ]address: the address of the VestedRewardsDistrubution contract" } diff --git a/script/input/314311/phase-1b/template-usds-ngt-farming-deploy.json b/script/input/314311/phase-1b/template-usds-sky-farming-deploy.json similarity index 85% rename from script/input/314311/phase-1b/template-usds-ngt-farming-deploy.json rename to script/input/314311/phase-1b/template-usds-sky-farming-deploy.json index c1f383f..77ffcbd 100644 --- a/script/input/314311/phase-1b/template-usds-ngt-farming-deploy.json +++ b/script/input/314311/phase-1b/template-usds-sky-farming-deploy.json @@ -1,7 +1,7 @@ { - "ngt": "address: the address of NGT", + "sky": "address: the address of SKY", "usds": "address: the address of USDS", - "vest": "address: the address of a DssVestMintable contract for NGT", + "vest": "address: the address of a DssVestMintable contract for SKY", "rewards": "[OPTIONAL] address: the address of the StakingRewards contract", "dist": "[OPTIONAL ]address: the address of the VestedRewardsDistrubution contract" } diff --git a/script/phase-1b/01-UsdsNgtFarmingDeploy.s.sol b/script/phase-1b/01-UsdsSkyFarmingDeploy.s.sol similarity index 90% rename from script/phase-1b/01-UsdsNgtFarmingDeploy.s.sol rename to script/phase-1b/01-UsdsSkyFarmingDeploy.s.sol index 87a6bbc..b7df52b 100644 --- a/script/phase-1b/01-UsdsNgtFarmingDeploy.s.sol +++ b/script/phase-1b/01-UsdsSkyFarmingDeploy.s.sol @@ -25,17 +25,17 @@ import { VestedRewardsDistributionDeployParams } from "../dependencies/VestedRewardsDistributionDeploy.sol"; -contract Phase1b_UsdsNgtFarmingDeployScript is Script { +contract Phase1b_UsdsSkyFarmingDeployScript is Script { ChainlogLike internal constant chainlog = ChainlogLike(0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F); - string internal constant NAME = "phase-1b/usds-ngt-farming-deploy"; + string internal constant NAME = "phase-1b/usds-sky-farming-deploy"; function run() external { Reader reader = new Reader(ScriptTools.loadConfig()); address admin = chainlog.getAddress("MCD_PAUSE_PROXY"); - address ngt = reader.envOrReadAddress("FOUNDRY_NGT", ".ngt"); + address sky = reader.envOrReadAddress("FOUNDRY_SKY", ".sky"); address usds = reader.envOrReadAddress("FOUNDRY_USDS", ".usds"); address vest = reader.envOrReadAddress("FOUNDRY_VEST", ".vest"); address dist = reader.readAddressOptional(".dist"); @@ -45,7 +45,7 @@ contract Phase1b_UsdsNgtFarmingDeployScript is Script { if (rewards == address(0)) { rewards = StakingRewardsDeploy.deploy( - StakingRewardsDeployParams({owner: admin, stakingToken: usds, rewardsToken: ngt}) + StakingRewardsDeployParams({owner: admin, stakingToken: usds, rewardsToken: sky}) ); } @@ -63,7 +63,7 @@ contract Phase1b_UsdsNgtFarmingDeployScript is Script { vm.stopBroadcast(); ScriptTools.exportContract(NAME, "admin", admin); - ScriptTools.exportContract(NAME, "ngt", ngt); + ScriptTools.exportContract(NAME, "sky", sky); ScriptTools.exportContract(NAME, "usds", usds); ScriptTools.exportContract(NAME, "dist", dist); ScriptTools.exportContract(NAME, "rewards", rewards); diff --git a/script/phase-1b/02-UsdsNgtFarmingInit.s.sol b/script/phase-1b/02-UsdsSkyFarmingInit.s.sol similarity index 77% rename from script/phase-1b/02-UsdsNgtFarmingInit.s.sol rename to script/phase-1b/02-UsdsSkyFarmingInit.s.sol index 4c1d226..437e258 100644 --- a/script/phase-1b/02-UsdsNgtFarmingInit.s.sol +++ b/script/phase-1b/02-UsdsSkyFarmingInit.s.sol @@ -21,17 +21,17 @@ import {ScriptTools} from "dss-test/ScriptTools.sol"; import {Reader} from "../helpers/Reader.sol"; import {VestInit, VestInitParams} from "../dependencies/VestInit.sol"; import { - UsdsNgtFarmingInit, - UsdsNgtFarmingInitParams, - UsdsNgtFarmingInitResult -} from "../dependencies/phase-1b/UsdsNgtFarmingInit.sol"; + UsdsSkyFarmingInit, + UsdsSkyFarmingInitParams, + UsdsSkyFarmingInitResult +} from "../dependencies/phase-1b/UsdsSkyFarmingInit.sol"; -contract Phase1b_UsdsNgtFarmingInitScript is Script { +contract Phase1b_UsdsSkyFarmingInitScript is Script { using ScriptTools for string; ChainlogLike internal constant chainlog = ChainlogLike(0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F); - string internal constant NAME = "phase-1b/usds-ngt-farming-init"; + string internal constant NAME = "phase-1b/usds-sky-farming-init"; function run() external { Reader config = new Reader(ScriptTools.loadConfig()); @@ -41,19 +41,19 @@ contract Phase1b_UsdsNgtFarmingInitScript is Script { uint256 vestBgn = config.envOrReadUint("FOUNDRY_VEST_BGN", ".vestBgn"); uint256 vestTau = config.envOrReadUint("FOUNDRY_VEST_TAU", ".vestTau"); - address ngt = deps.envOrReadAddress("FOUNDRY_NGT", ".ngt"); + address sky = deps.envOrReadAddress("FOUNDRY_SKY", ".sky"); address usds = deps.envOrReadAddress("FOUNDRY_USDS", ".usds"); address dist = deps.envOrReadAddress("FOUNDRY_DIST", ".dist"); address rewards = deps.envOrReadAddress("FOUNDRY_FARM", ".rewards"); address vest = deps.envOrReadAddress("FOUNDRY_VEST", ".vest"); - UsdsNgtFarmingInitParams memory farmingCfg = UsdsNgtFarmingInitParams({ - ngt: ngt, + UsdsSkyFarmingInitParams memory farmingCfg = UsdsSkyFarmingInitParams({ + sky: sky, usds: usds, dist: dist, - distKey: "REWARDS_DISTRIBUTION_USDS_NGT", + distKey: "REWARDS_DISTRIBUTION_USDS_SKY", rewards: rewards, - rewardsKey: "FARM_USDS_NGT", + rewardsKey: "FARM_USDS_SKY", vest: vest, vestTot: vestTot, vestBgn: vestBgn, @@ -66,7 +66,7 @@ contract Phase1b_UsdsNgtFarmingInitScript is Script { vm.startBroadcast(); - UsdsNgtFarmingInitSpell spell = new UsdsNgtFarmingInitSpell(); + UsdsSkyFarmingInitSpell spell = new UsdsSkyFarmingInitSpell(); bytes memory out = ProxyLike(pauseProxy).exec( address(spell), abi.encodeCall(spell.cast, (farmingCfg, vestInitCfg)) @@ -74,9 +74,9 @@ contract Phase1b_UsdsNgtFarmingInitScript is Script { vm.stopBroadcast(); - UsdsNgtFarmingInitResult memory res = abi.decode(out, (UsdsNgtFarmingInitResult)); + UsdsSkyFarmingInitResult memory res = abi.decode(out, (UsdsSkyFarmingInitResult)); - ScriptTools.exportContract(NAME, "ngt", ngt); + ScriptTools.exportContract(NAME, "sky", sky); ScriptTools.exportContract(NAME, "dist", dist); ScriptTools.exportContract(NAME, "rewards", rewards); ScriptTools.exportContract(NAME, "vest", vest); @@ -84,13 +84,13 @@ contract Phase1b_UsdsNgtFarmingInitScript is Script { } } -contract UsdsNgtFarmingInitSpell { +contract UsdsSkyFarmingInitSpell { function cast( - UsdsNgtFarmingInitParams memory farmingCfg, + UsdsSkyFarmingInitParams memory farmingCfg, VestInitParams calldata vestInitCfg - ) public returns (UsdsNgtFarmingInitResult memory) { + ) public returns (UsdsSkyFarmingInitResult memory) { VestInit.init(farmingCfg.vest, vestInitCfg); - return UsdsNgtFarmingInit.init(farmingCfg); + return UsdsSkyFarmingInit.init(farmingCfg); } } diff --git a/script/phase-1b/03-UsdsNgtFarmingCheck.s.sol b/script/phase-1b/03-UsdsSkyFarmingCheck.s.sol similarity index 89% rename from script/phase-1b/03-UsdsNgtFarmingCheck.s.sol rename to script/phase-1b/03-UsdsSkyFarmingCheck.s.sol index 99d2a9f..a755385 100644 --- a/script/phase-1b/03-UsdsNgtFarmingCheck.s.sol +++ b/script/phase-1b/03-UsdsSkyFarmingCheck.s.sol @@ -18,13 +18,13 @@ pragma solidity ^0.8.16; import {Script} from "forge-std/Script.sol"; import {Reader} from "../helpers/Reader.sol"; -contract Phase1b_UsdsNgtFarmingCheckScript is Script { +contract Phase1b_UsdsSkyFarmingCheckScript is Script { function run() external returns (bool) { Reader deps = new Reader(""); deps.loadDependenciesOrConfig(); address admin = deps.envOrReadAddress("FOUNDRY_ADMIN", ".admin"); - address ngt = deps.envOrReadAddress("FOUNDRY_NGT", ".ngt"); + address sky = deps.envOrReadAddress("FOUNDRY_SKY", ".sky"); address usds = deps.envOrReadAddress("FOUNDRY_USDS", ".usds"); address dist = deps.readAddress(".dist"); address rewards = deps.readAddress(".rewards"); @@ -33,23 +33,23 @@ contract Phase1b_UsdsNgtFarmingCheckScript is Script { require(VestedRewardsDistributionLike(dist).dssVest() == vest, "VestedRewardsDistribution/invalid-vest"); require(VestedRewardsDistributionLike(dist).vestId() == vestId, "VestedRewardsDistribution/invalid-vest-id"); - require(VestedRewardsDistributionLike(dist).gem() == ngt, "VestedRewardsDistribution/invalid-gem"); + require(VestedRewardsDistributionLike(dist).gem() == sky, "VestedRewardsDistribution/invalid-gem"); require( VestedRewardsDistributionLike(dist).stakingRewards() == rewards, "VestedRewardsDistribution/invalid-staking-rewards" ); require(StakingRewardsLike(rewards).owner() == admin, "StakingRewards/admin-not-owner"); - require(StakingRewardsLike(rewards).rewardsToken() == ngt, "StakingRewards/invalid-rewards-token"); + require(StakingRewardsLike(rewards).rewardsToken() == sky, "StakingRewards/invalid-rewards-token"); require(StakingRewardsLike(rewards).stakingToken() == usds, "StakingRewards/invalid-rewards-token"); require( StakingRewardsLike(rewards).rewardsDistribution() == dist, "StakingRewards/invalid-rewards-distribution" ); - require(WardsLike(ngt).wards(vest) == 1, "Ngt/dss-vest-not-ward"); + require(WardsLike(sky).wards(vest) == 1, "Sky/dss-vest-not-ward"); - require(DssVestWithGemLike(vest).gem() == ngt, "DssVest/invalid-gem"); + require(DssVestWithGemLike(vest).gem() == sky, "DssVest/invalid-gem"); require(DssVestWithGemLike(vest).valid(vestId), "DssVest/invalid-vest-id"); require(DssVestWithGemLike(vest).res(vestId) == 1, "DssVest/invalid-vest-res"); require(DssVestWithGemLike(vest).usr(vestId) == dist, "DssVest/wrong-dist");