Merge branch 'main' into audit/dc/one-transfer-from-only
This commit is contained in:
@@ -52,14 +52,14 @@ module.exports = {
|
|||||||
etherscan: {
|
etherscan: {
|
||||||
apiKey: process.env.BLOCKCHAIN_EXPLORER_API_KEY,
|
apiKey: process.env.BLOCKCHAIN_EXPLORER_API_KEY,
|
||||||
customChains: [
|
customChains: [
|
||||||
{
|
{
|
||||||
network: "unichain",
|
network: "unichain",
|
||||||
chainId: 130,
|
chainId: 130,
|
||||||
urls: {
|
urls: {
|
||||||
apiURL: "https://api.uniscan.xyz/api",
|
apiURL: "https://api.uniscan.xyz/api",
|
||||||
browserURL: "https://www.uniscan.xyz/"
|
browserURL: "https://www.uniscan.xyz/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,3 +48,9 @@ For each of the following, you must select one of `tenderly_ethereum`, `tenderly
|
|||||||
1. In `scripts/deploy-executors.js` define the executors to be deployed
|
1. In `scripts/deploy-executors.js` define the executors to be deployed
|
||||||
2. Deploy executors: `npx hardhat run scripts/deploy-executors.js --network NETWORK`
|
2. Deploy executors: `npx hardhat run scripts/deploy-executors.js --network NETWORK`
|
||||||
3. Fill in the executor addresses in `config/executor_addresses.json`
|
3. Fill in the executor addresses in `config/executor_addresses.json`
|
||||||
|
|
||||||
|
### Remove executors
|
||||||
|
|
||||||
|
1. If you set a new executor for the same protocol, you need to remove the old one.
|
||||||
|
2. Run: `npx hardhat run scripts/remove-executor.js --network NETWORK`
|
||||||
|
3. There will be a prompt for you to insert the executor address you want to remove.
|
||||||
38
foundry/scripts/remove-executor.js
Normal file
38
foundry/scripts/remove-executor.js
Normal 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);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user