Skip to content

Commit

Permalink
update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhou committed Jul 28, 2023
1 parent e907f4e commit 7d93f2f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function getFeeOverrides(): Promise<Overrides> {
const network = await ethers.provider.getNetwork();
if (network.chainId == 59144) {
// for linea
return { maxFeePerGas: 5000000000, maxPriorityFeePerGas: 4900000000};
return { maxFeePerGas: 5000000000, maxPriorityFeePerGas: 4900000000 };
}
if (feeData.maxFeePerGas) {
return { maxFeePerGas: feeData.maxFeePerGas, maxPriorityFeePerGas: feeData.maxPriorityFeePerGas || 0 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getDeployerSigner, getFeeOverrides } from '../common';

dotenv.config();

async function updateGuardState(): Promise<void> {
async function guard(): Promise<void> {
const deployerSigner = await getDeployerSigner();
const feeOverrides = await getFeeOverrides();

Expand All @@ -16,9 +16,7 @@ async function updateGuardState(): Promise<void> {
return;
}
const sentinel = Sentinel__factory.connect(sentinelAddr, deployerSigner);
const guardState = process.env.SENTINEL_GUARD_STATE as string;
await (await sentinel.updateGuardState(guardState, feeOverrides)).wait();

await (await sentinel.guard(feeOverrides)).wait();
}

updateGuardState();
guard();
22 changes: 22 additions & 0 deletions scripts/sentinel/sentinel_relax.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'hardhat-deploy';

import * as dotenv from 'dotenv';

import { Sentinel__factory } from '../../typechain';
import { getDeployerSigner, getFeeOverrides } from '../common';

dotenv.config();

async function relax(): Promise<void> {
const deployerSigner = await getDeployerSigner();
const feeOverrides = await getFeeOverrides();

const sentinelAddr = process.env.SENTINEL as string;
if (!sentinelAddr) {
return;
}
const sentinel = Sentinel__factory.connect(sentinelAddr, deployerSigner);
await (await sentinel.relax(feeOverrides)).wait();
}

relax();

0 comments on commit 7d93f2f

Please sign in to comment.