Skip to content

Commit

Permalink
update the reseedL1 to remove siloFacet first.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brean0 committed Sep 30, 2024
1 parent 0368e0c commit 639cf8f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions protocol/reseed/data/SiloFacetSelectors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
"0x97Fc5eEF1a02A2c5bcB3a04997ebA7E0d3074f15",
[
"0x45947ba9",
"0xf19ed6be",
"0x150d5173",
"0x7d44f5bb",
"0x779b3c5c",
"0x2eb2c2d6",
"0xf242432a",
"0x081d77ba",
"0xc56411f6",
"0xe348f82b",
"0x27e047f1"
]
]
17 changes: 17 additions & 0 deletions protocol/reseed/reseedL1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { upgradeWithNewFacets } = require("../scripts/diamond.js");
const fs = require("fs");
const { BEANSTALK } = require("../test/hardhat/utils/constants.js");
const SELECTORS = require("./data/beanstalkSelectors.json");
const SILO_SELECTORS = require("./data/SiloFacetSelectors.json");
const { printBeanstalk } = require("./reseedL2.js");

/**
Expand Down Expand Up @@ -34,6 +35,7 @@ async function reseedL1(account, mock) {
"0x5f504a82", // ownerCandidate
"0xf2fde38b" // transferOwnership
];

for (let i = 0; i < SELECTORS.length; i++) {
selectors = SELECTORS[i][1];
for (let j = 0; j < selectors.length; j++) {
Expand All @@ -43,7 +45,22 @@ async function reseedL1(account, mock) {
}
}
}

// remove only the siloFacet:
console.log("Stage 1: Remove siloFacet");
await upgradeWithNewFacets({
diamondAddress: BEANSTALK,
selectorsToRemove: SILO_SELECTORS[1],
bip: false,
verbose: true,
account: account,
object: !mock
});

// add the BeanL2MigrationFacet, L1TokenFacet, remove all selectors other than the diamond functionality.
console.log(
"Stage 2: Add L2MigrationFacet, L1TokenFacet, remove all selectors other than the diamond functionality."
);
await upgradeWithNewFacets({
diamondAddress: BEANSTALK,
facetNames: ["L2MigrationFacet", "L1TokenFacet"],
Expand Down

0 comments on commit 639cf8f

Please sign in to comment.