chore: Add script to remove executor addresses from Tycho Router

--- don't change below this line ---
ENG-4454 Took 1 hour 6 minutes
This commit is contained in:
Diana Carvalho
2025-05-08 15:11:07 +01:00
parent 5ee9d79a15
commit 30b8f9dd19
3 changed files with 51 additions and 7 deletions

View File

@@ -0,0 +1,38 @@
require('dotenv').config();
const {ethers} = require("hardhat");
const hre = require("hardhat");
const prompt = require('prompt-sync')();
async function main() {
const network = hre.network.name;
const routerAddress = process.env.ROUTER_ADDRESS;
console.log(`Removing executors on TychoRouter at ${routerAddress} on ${network}`);
const [deployer] = await ethers.getSigners();
console.log(`Removing executors with account: ${deployer.address}`);
console.log(`Account balance: ${ethers.utils.formatEther(await deployer.getBalance())} ETH`);
const TychoRouter = await ethers.getContractFactory("TychoRouter");
const router = TychoRouter.attach(routerAddress);
const executorAddress = prompt("Enter executor address to remove: ");
if (!executorAddress) {
console.error("Please provide the executorAddress as an argument.");
process.exit(1);
}
// Remove executor
const tx = await router.removeExecutor(executorAddress, {
gasLimit: 50000
});
await tx.wait(); // Wait for the transaction to be mined
console.log(`Executor removed at transaction: ${tx.hash}`);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error("Error removing executor:", error);
process.exit(1);
});