diff --git a/protocol/reseed/dataConverts/convertGlobal.js b/protocol/reseed/dataConverts/convertGlobal.js index 161077a8f..16c355d8e 100644 --- a/protocol/reseed/dataConverts/convertGlobal.js +++ b/protocol/reseed/dataConverts/convertGlobal.js @@ -128,52 +128,7 @@ function parseGlobals(inputFilePath, outputFilePath) { data.rain?.roots ? convertToBigNum(data.rain.roots) : "0", Array(4).fill("0x0000000000000000000000000000000000000000000000000000000000000000") ], - // seedGaugeSettings - // [ - // data.seedGaugeSettings?.maxBeanMaxLpGpPerBdvRatio - // ? convertToBigNum(data.seedGaugeSettings.maxBeanMaxLpGpPerBdvRatio) - // : "0", - // data.seedGaugeSettings?.minBeanMaxLpGpPerBdvRatio - // ? convertToBigNum(data.seedGaugeSettings.minBeanMaxLpGpPerBdvRatio) - // : "0", - // data.seedGaugeSettings?.targetSeasonsToCatchUp - // ? convertToBigNum(data.seedGaugeSettings.targetSeasonsToCatchUp) - // : "0", - // data.seedGaugeSettings?.podRateLowerBound - // ? convertToBigNum(data.seedGaugeSettings.podRateLowerBound) - // : "0", - // data.seedGaugeSettings?.podRateOptimal - // ? convertToBigNum(data.seedGaugeSettings.podRateOptimal) - // : "0", - // data.seedGaugeSettings?.podRateUpperBound - // ? convertToBigNum(data.seedGaugeSettings.podRateUpperBound) - // : "0", - // data.seedGaugeSettings?.deltaPodDemandLowerBound - // ? convertToBigNum(data.seedGaugeSettings.deltaPodDemandLowerBound) - // : "0", - // data.seedGaugeSettings?.deltaPodDemandUpperBound - // ? convertToBigNum(data.seedGaugeSettings.deltaPodDemandUpperBound) - // : "0", - // data.seedGaugeSettings?.lpToSupplyRatioUpperBound - // ? convertToBigNum(data.seedGaugeSettings.lpToSupplyRatioUpperBound) - // : "0", - // data.seedGaugeSettings?.lpToSupplyRatioOptimal - // ? convertToBigNum(data.seedGaugeSettings.lpToSupplyRatioOptimal) - // : "0", - // data.seedGaugeSettings?.lpToSupplyRatioLowerBound - // ? convertToBigNum(data.seedGaugeSettings.lpToSupplyRatioLowerBound) - // : "0", - // data.seedGaugeSettings?.excessivePriceThreshold - // ? convertToBigNum(data.seedGaugeSettings.excessivePriceThreshold) - // : "0", - // data.seedGaugeSettings?.soilCoefficientHigh - // ? convertToBigNum(data.seedGaugeSettings.soilCoefficientHigh) - // : "0", - // data.seedGaugeSettings?.baseReward ? convertToBigNum(data.seedGaugeSettings.baseReward) : "0", - // data.seedGaugeSettings?.excessivePriceThreshold - // ? convertToBigNum(data.seedGaugeSettings.excessivePriceThreshold) - // : "0" - // ], + // Evaluation Parameters [ "100000000000000000000", "50000000000000000000", @@ -194,7 +149,7 @@ function parseGlobals(inputFilePath, outputFilePath) { // ShipmentRoute data.shipmentRoutes.length ? data.shipmentRoutes.map((route) => [ - route.planContract || "0x0000000000000000000000000000000000000000", + "0x555555987d98079b9f43CDcDBD52DbB24FfEEef5", // l2 shipment planner route.planSelector || "0x00000000", route.recipient ? convertToBigNum(route.recipient) : "0", route.data || "0x" diff --git a/protocol/reseed/reseed2.js b/protocol/reseed/reseed2.js index ee65f0911..52f44eb4d 100644 --- a/protocol/reseed/reseed2.js +++ b/protocol/reseed/reseed2.js @@ -1,7 +1,7 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js"); const fs = require("fs"); const { retryOperation } = require("../utils/read.js"); -const { L2_FERTILIZER } = require("../test/hardhat/utils/constants.js"); +const { L2_FERTILIZER, L2_RESEED_BEAN } = require("../test/hardhat/utils/constants.js"); // Files const INIT_SUPPLY = "./reseed/data/r2/L2_initial_supply.json"; @@ -10,10 +10,8 @@ const EXTERNAL_UNRIPE_BEAN = "./reseed/data/r2/L2_external_unripe_balances.json" const EXTERNAL_UNRIPE_BEAN_LP = "./reseed/data/r2/L2_external_unripe_lp_balances.json"; /** - * reseed8 approves beanstalk to use the BCM's wsteth, eth, and a stablecoin, - * where it will 1) transfer to a well 2) sync and add liquidity, upon deployment. - * note: for testing purposes, the L2 is on base, and the stablecoin is USDC, but can be switched based on the discretion of the DAO. - */ + * reseed2 re-initializes the bean tokens mints beans to the bcm and deploys the upgradeable wells +**/ async function reseed2(account, L2Beanstalk, mock, verbose) { verbose = true; console.log("-----------------------------------"); @@ -36,6 +34,7 @@ async function reseed2(account, L2Beanstalk, mock, verbose) { diamondAddress: L2Beanstalk, facetNames: [], initFacetName: "ReseedBean", + initFacetAddress: L2_RESEED_BEAN, initArgs: [ beanSupply, unripeBeanSupply, diff --git a/protocol/reseed/reseed3.js b/protocol/reseed/reseed3.js index 389e3528f..54019b3c8 100644 --- a/protocol/reseed/reseed3.js +++ b/protocol/reseed/reseed3.js @@ -2,6 +2,7 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js"); const fs = require("fs"); const { splitEntriesIntoChunksOptimized, updateProgress } = require("../utils/read.js"); const { retryOperation } = require("../utils/read.js"); +const { L2_RESEED_FIELD } = require("../test/hardhat/utils/constants.js"); async function reseed3(account, L2Beanstalk, mock, verbose = false) { console.log("-----------------------------------"); @@ -19,8 +20,6 @@ async function reseed3(account, L2Beanstalk, mock, verbose = false) { targetEntriesPerChunk = 500; plotChunks = await splitEntriesIntoChunksOptimized(accountPlots, targetEntriesPerChunk); - const InitFacet = await (await ethers.getContractFactory("ReseedField", account)).deploy(); - await InitFacet.deployed(); console.log(`Starting to process ${plotChunks.length} chunks...`); for (let i = 0; i < plotChunks.length; i++) { await updateProgress(i + 1, plotChunks.length); @@ -33,7 +32,7 @@ async function reseed3(account, L2Beanstalk, mock, verbose = false) { diamondAddress: L2Beanstalk, facetNames: [], initFacetName: "ReseedField", - initFacetAddress: InitFacet.address, + initFacetAddress: L2_RESEED_FIELD, initArgs: [plotChunks[i]], bip: false, verbose: verbose, diff --git a/protocol/reseed/reseed4.js b/protocol/reseed/reseed4.js index f4cf238aa..f14101f18 100644 --- a/protocol/reseed/reseed4.js +++ b/protocol/reseed/reseed4.js @@ -1,5 +1,6 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js"); const fs = require("fs"); +const { L2_RESEED_POD_MARKETPLACE } = require("../test/hardhat/utils/constants.js"); async function reseed4(account, L2Beanstalk, mock, verbose = false) { console.log("-----------------------------------"); @@ -21,6 +22,7 @@ async function reseed4(account, L2Beanstalk, mock, verbose = false) { diamondAddress: L2Beanstalk, facetNames: [], initFacetName: "ReseedPodMarket", + initFacetAddress: L2_RESEED_POD_MARKETPLACE, initArgs: [podListings, podOrders], bip: false, verbose: verbose, diff --git a/protocol/reseed/reseed5.js b/protocol/reseed/reseed5.js index 36de511d0..f18b69575 100644 --- a/protocol/reseed/reseed5.js +++ b/protocol/reseed/reseed5.js @@ -2,6 +2,7 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js"); const fs = require("fs"); const { splitEntriesIntoChunksOptimized, updateProgress } = require("../utils/read.js"); const { retryOperation } = require("../utils/read.js"); +const { L2_RESEED_BARN } = require("../test/hardhat/utils/constants.js"); async function reseed5(account, L2Beanstalk, mock, verbose = false) { console.log("-----------------------------------"); @@ -19,8 +20,6 @@ async function reseed5(account, L2Beanstalk, mock, verbose = false) { // Keep this lower due to fert id 100663296 targetEntriesPerChunk = 50; fertChunks = await splitEntriesIntoChunksOptimized(fertilizerIds, targetEntriesPerChunk); - const InitFacet = await (await ethers.getContractFactory("ReseedBarn", account)).deploy(); - await InitFacet.deployed(); for (let i = 0; i < fertChunks.length; i++) { await updateProgress(i + 1, fertChunks.length); if (verbose) { @@ -32,7 +31,7 @@ async function reseed5(account, L2Beanstalk, mock, verbose = false) { diamondAddress: L2Beanstalk, facetNames: [], initFacetName: "ReseedBarn", - initFacetAddress: InitFacet.address, + initFacetAddress: L2_RESEED_BARN, initArgs: [fertChunks[i]], bip: false, verbose: verbose, diff --git a/protocol/reseed/reseed6.js b/protocol/reseed/reseed6.js index fc879db68..42713076e 100644 --- a/protocol/reseed/reseed6.js +++ b/protocol/reseed/reseed6.js @@ -2,6 +2,8 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js"); const fs = require("fs"); const { splitEntriesIntoChunksOptimized, updateProgress } = require("../utils/read.js"); const { retryOperation } = require("../utils/read.js"); +const { L2_RESEED_SILO } = require("../test/hardhat/utils/constants.js"); + async function reseed6(account, L2Beanstalk, mock, verbose = false) { console.log("-----------------------------------"); console.log("reseed6: reissue deposits.\n"); @@ -17,8 +19,6 @@ async function reseed6(account, L2Beanstalk, mock, verbose = false) { targetEntriesPerChunk = 400; depositChunks = await splitEntriesIntoChunksOptimized(beanDeposits, targetEntriesPerChunk); - const InitFacet = await (await ethers.getContractFactory("ReseedSilo", account)).deploy(); - await InitFacet.deployed(); for (let i = 0; i < depositChunks.length; i++) { await updateProgress(i + 1, depositChunks.length); if (verbose) { @@ -30,7 +30,7 @@ async function reseed6(account, L2Beanstalk, mock, verbose = false) { diamondAddress: L2Beanstalk, facetNames: [], initFacetName: "ReseedSilo", - initFacetAddress: InitFacet.address, + initFacetAddress: L2_RESEED_SILO, initArgs: [depositChunks[i]], bip: false, verbose: verbose, diff --git a/protocol/reseed/reseed7.js b/protocol/reseed/reseed7.js index 377880fcd..f569646a1 100644 --- a/protocol/reseed/reseed7.js +++ b/protocol/reseed/reseed7.js @@ -2,6 +2,7 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js"); const fs = require("fs"); const { splitEntriesIntoChunksOptimized, updateProgress } = require("../utils/read.js"); const { retryOperation } = require("../utils/read.js"); +const { L2_RESEED_ACCOUNT_STATUS } = require("../test/hardhat/utils/constants.js"); async function reseed7(account, L2Beanstalk, mock, verbose = false) { console.log("-----------------------------------"); @@ -18,10 +19,6 @@ async function reseed7(account, L2Beanstalk, mock, verbose = false) { targetEntriesPerChunk = 400; statusChunks = await splitEntriesIntoChunksOptimized(statuses, targetEntriesPerChunk); - const InitFacet = await ( - await ethers.getContractFactory("ReseedAccountStatus", account) - ).deploy(); - await InitFacet.deployed(); for (let i = 0; i < statusChunks.length; i++) { await updateProgress(i + 1, statusChunks.length); if (verbose) { @@ -33,7 +30,7 @@ async function reseed7(account, L2Beanstalk, mock, verbose = false) { diamondAddress: L2Beanstalk, facetNames: [], initFacetName: "ReseedAccountStatus", - initFacetAddress: InitFacet.address, + initFacetAddress: L2_RESEED_ACCOUNT_STATUS, initArgs: [statusChunks[i]], bip: false, verbose: verbose, diff --git a/protocol/reseed/reseed8.js b/protocol/reseed/reseed8.js index 6663f59e3..5caf76009 100644 --- a/protocol/reseed/reseed8.js +++ b/protocol/reseed/reseed8.js @@ -2,6 +2,7 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js"); const fs = require("fs"); const { splitEntriesIntoChunksOptimized, updateProgress } = require("../utils/read.js"); const { retryOperation } = require("../utils/read.js"); +const { L2_RESEED_INTERNAL_BALANCES } = require("../test/hardhat/utils/constants.js"); async function reseed8(account, L2Beanstalk, mock, verbose = false) { console.log("-----------------------------------"); @@ -19,10 +20,6 @@ async function reseed8(account, L2Beanstalk, mock, verbose = false) { targetEntriesPerChunk = 500; balanceChunks = await splitEntriesIntoChunksOptimized(beanBalances, targetEntriesPerChunk); - const InitFacet = await ( - await ethers.getContractFactory("ReseedInternalBalances", account) - ).deploy(); - await InitFacet.deployed(); for (let i = 0; i < balanceChunks.length; i++) { await updateProgress(i + 1, balanceChunks.length); if (verbose) { @@ -34,7 +31,7 @@ async function reseed8(account, L2Beanstalk, mock, verbose = false) { diamondAddress: L2Beanstalk, facetNames: [], initFacetName: "ReseedInternalBalances", - initFacetAddress: InitFacet.address, + initFacetAddress: L2_RESEED_INTERNAL_BALANCES, initArgs: [balanceChunks[i]], bip: false, verbose: verbose, diff --git a/protocol/reseed/reseed9.js b/protocol/reseed/reseed9.js index 308a03e87..9bfbf3b1a 100644 --- a/protocol/reseed/reseed9.js +++ b/protocol/reseed/reseed9.js @@ -1,6 +1,7 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js"); const fs = require("fs"); const { retryOperation } = require("../utils/read.js"); +const { L2_RESEED_WHITELIST } = require("../test/hardhat/utils/constants.js"); async function reseed9(account, L2Beanstalk, mock = false) { console.log("-----------------------------------"); @@ -26,6 +27,7 @@ async function reseed9(account, L2Beanstalk, mock = false) { diamondAddress: L2Beanstalk, facetNames: [], initFacetName: "ReseedWhitelist", + initFacetAddress: L2_RESEED_WHITELIST, initArgs: [tokens, nonBeanTokens, siloSettings, whitelistStatuses, oracles], bip: false, verbose: true, diff --git a/protocol/reseed/reseedGlobal.js b/protocol/reseed/reseedGlobal.js index d4a3b1d00..7f626668d 100644 --- a/protocol/reseed/reseedGlobal.js +++ b/protocol/reseed/reseedGlobal.js @@ -10,14 +10,6 @@ async function reseedGlobal(account, L2Beanstalk, mock) { let globalsPath = "./reseed/data/global.json"; let settings = JSON.parse(await fs.readFileSync(globalsPath)); - // deploy ShipmentPlanner.sol. - const ShipmentPlanner = await deployContract("ShipmentPlanner", account, true, [L2Beanstalk]); - - // replace the shipment parameter with the deployed shipment address. - settings[9][0][0] = ShipmentPlanner.address; - settings[9][1][0] = ShipmentPlanner.address; - settings[9][2][0] = ShipmentPlanner.address; - await retryOperation(async () => { await upgradeWithNewFacets({ diamondAddress: L2Beanstalk, diff --git a/protocol/reseed/reseedL1.js b/protocol/reseed/reseedL1.js index cb183d2ca..074eb1e0f 100644 --- a/protocol/reseed/reseedL1.js +++ b/protocol/reseed/reseedL1.js @@ -10,7 +10,7 @@ const { printBeanstalk } = require("./reseedL2.js"); * - pausing beanstalk. * - transferring bean LP tokens to BCM. */ -async function reseedL1(account) { +async function reseedL1(account, mock) { await printBeanstalk(); beanstalkSelectors = []; console.log("-----------------------------------"); @@ -47,11 +47,12 @@ async function reseedL1(account) { await upgradeWithNewFacets({ diamondAddress: BEANSTALK, facetNames: ["L2MigrationFacet", "L1TokenFacet"], - facetsToRemove: beanstalkSelectors, + selectorsToRemove: beanstalkSelectors, initFacetName: "ReseedL2Migration", bip: false, verbose: true, - account: account + account: account, + object: !mock }); console.log("Beanstalk is now paused and bean LP tokens are transferred to BCM."); console.log("-----------------------------------"); diff --git a/protocol/reseed/reseedL2.js b/protocol/reseed/reseedL2.js index f7402ef13..6b7e83351 100644 --- a/protocol/reseed/reseedL2.js +++ b/protocol/reseed/reseedL2.js @@ -36,7 +36,6 @@ async function reseedL2({ setState = true, addLiquidity = true, verbose = false, - onlyState = true }) { if (convertData) parseBeanstalkData(); // delete prev gas report diff --git a/protocol/test/hardhat/utils/constants.js b/protocol/test/hardhat/utils/constants.js index a2dee0797..997112ef6 100644 --- a/protocol/test/hardhat/utils/constants.js +++ b/protocol/test/hardhat/utils/constants.js @@ -63,5 +63,15 @@ module.exports = { L2_FERTILIZER: "0xFEFEFE2cfb089aEF0b0578573eF3CFAbC15f1490", L2_BCM: "0xDd5b31E73dB1c566Ca09e1F1f74Df34913DaaF69", + L2_RESEED_BEAN: "0x75C1212d7717f5aAa1179c6a71c9afc56ECddD85", + L2_RESEED_GLOBAL: "0x81D652b45627F699DCA555150B344DF4FC4b2057", + L2_RESEED_FIELD: "0x3EEE6CcbF41173b18C133200B1762A8D714AEA72", + L2_RESEED_POD_MARKETPLACE: "0x242bf5D0eB3aB66D431286a1B2EeA704e9745163", + L2_RESEED_BARN: "0xEA4b9B59a52fEeb98E8Cb7380b791e0126818266", + L2_RESEED_SILO: "0xb85aAA766C8FF08987BaF598e44264122675cD94", + L2_RESEED_ACCOUNT_STATUS: "0x0ee2c983874B4Faf3c1352eA0271c5810ba64B29", + L2_RESEED_INTERNAL_BALANCES: "0x36Afd58C440321fDf14B8311D019814eb94CEA20", + L2_RESEED_WHITELIST: "0xE657b28ba8F9c08Ac6C7efC669C0625Da704E4ef", + ZERO_BYTES: "0x0000000000000000000000000000000000000000000000000000000000000000" };