Skip to content

Commit

Permalink
pause/unpause inside migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
zajck committed Oct 3, 2023
1 parent 84dc84d commit 384455a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions scripts/migrations/migrate_2.3.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ async function migrate(env) {

const protocolAddress = contracts.find((c) => c.name === "ProtocolDiamond")?.address;

console.log("Pausing the Seller region...");
let pauseHandler = await getContractAt("IBosonPauseHandler", protocolAddress);
const pauseTransaction = await pauseHandler.pause([PausableRegion.Sellers], await getFees(maxPriorityFeePerGas));

// await 1 block to ensure the pause is effective
await pauseTransaction.wait(confirmations);

if (env != "upgrade-test") {
// Checking old version contracts to get selectors to remove
console.log("Checking out contracts on version 2.2.1");
Expand All @@ -110,6 +103,19 @@ async function migrate(env) {
await hre.run("compile");
}


console.log("Pausing the Seller region...");
let pauseHandler = await getContractAt("IBosonPauseHandler", protocolAddress);

const unPauseTransaction = await pauseHandler.unpause(await getFees(maxPriorityFeePerGas));
await unPauseTransaction.wait(confirmations);

const pauseTransaction = await pauseHandler.pause([PausableRegion.Twins, PausableRegion.Sellers], await getFees(maxPriorityFeePerGas));

// await 1 block to ensure the pause is effective
await pauseTransaction.wait(confirmations);


let functionNamesToSelector = {};

for (const facet of config.addOrUpgrade) {
Expand Down

0 comments on commit 384455a

Please sign in to comment.