Skip to content

Commit

Permalink
review tool change minDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
laisolizq committed Dec 5, 2024
1 parent 959a81a commit a5ead63
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion tools/changeDelayTimelock/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
change_delay_output.json
change_delay_output-*
change_delay_timelock.json
2 changes: 0 additions & 2 deletions tools/changeDelayTimelock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ npm i
- `maxFeePerGas`: set custom gas
- `maxPriorityFeePerGas`: set custom gas
- `multiplierGas`: set custom gas
- `sendSchedule`: true to send schedule tx
- `sendExecute`: true to send execute tx
- A network should be selected when running the script
- examples: `--network sepolia` or `--network mainnet`
- This uses variables set in `hardhat.config.ts`
Expand Down
31 changes: 2 additions & 29 deletions tools/changeDelayTimelock/changeDelayTimelock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {ethers, network, upgrades} from "hardhat";
import { PolygonZkEVMTimelock } from "../../typechain-types";

const parameters = require("./change_delay_timelock.json");
const pathOutputJson = path.resolve(__dirname, "./change_delay_output.json");
const dateStr = new Date().toISOString();
const pathOutputJson = path.resolve(__dirname, `./change_delay_output-${dateStr}.json`);

async function main() {

Expand Down Expand Up @@ -118,34 +119,6 @@ async function main() {
parameters: parameters.newMinDelay
}

if(parameters.sendSchedule) {
const txScheduled = await timelockContract.schedule(
operation.target,
operation.value,
operation.data,
operation.predecessor,
operation.salt,
timelockDelay,
);
await txScheduled.wait();
console.log("SEND SCHEDULE")
}
if (parameters.sendSchedule && parameters.sendExecute) {
await wait(timelockDelay);
}
if(parameters.sendExecute) {
const txExecute = await timelockContract.execute(
operation.target,
operation.value,
operation.data,
operation.predecessor,
operation.salt
);
await txExecute.wait();
console.log("SEND EXECUTE")
console.log("newMinDelay: ", await timelockContract.getMinDelay())
}

await fs.writeFileSync(pathOutputJson, JSON.stringify(outputJson, null, 1));
}

Expand Down
4 changes: 1 addition & 3 deletions tools/changeDelayTimelock/change_delay_timelock.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
"deployerPvtKey": "",
"maxFeePerGas": "",
"maxPriorityFeePerGas": "",
"multiplierGas": "",
"sendSchedule": false,
"sendExecute": false
"multiplierGas": ""
}

0 comments on commit a5ead63

Please sign in to comment.