feat: Verify contracts on etherscan
--- don't change below this line --- ENG-4260 Took 31 minutes
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
## Deploy on a Tenderly fork
|
||||
|
||||
1. Make a new [fork](https://dashboard.tenderly.co/) in tenderly dashboard for the
|
||||
1. Make a new [fork](https://dashboard.tenderly.co/) in tenderly dashboard for the
|
||||
chain that you wish to deploy on.
|
||||
2. Set the following environment variables:
|
||||
|
||||
@@ -25,6 +25,7 @@ export PRIVATE_KEY=<private-key>
|
||||
export RPC_URL=<chain-rpc-url>
|
||||
export DEPLOY_WALLET=<wallet-address>
|
||||
export PRIVATE_KEY=<private-key>
|
||||
export ETHERSCAN_API_KEY=<etherscan-api-key>
|
||||
```
|
||||
|
||||
Make sure to run `unset HISTFILE` in your terminal before setting the private key. This will prevent the private key
|
||||
|
||||
@@ -25,15 +25,29 @@ async function main() {
|
||||
await deployedExecutor.deployed();
|
||||
console.log(`${exchange} deployed to: ${deployedExecutor.address}`);
|
||||
|
||||
// Verify on Tenderly
|
||||
try {
|
||||
await hre.tenderly.verify({
|
||||
name: exchange,
|
||||
address: deployedExecutor.address,
|
||||
address: address,
|
||||
});
|
||||
console.log("Contract verified successfully on Tenderly");
|
||||
} catch (error) {
|
||||
console.error("Error during contract verification:", error);
|
||||
}
|
||||
|
||||
console.log("Waiting for 1 minute before verifying the contract...");
|
||||
await new Promise(resolve => setTimeout(resolve, 60000));
|
||||
// Verify on Etherscan
|
||||
try {
|
||||
await hre.run("verify:verify", {
|
||||
address: address,
|
||||
constructorArguments: args,
|
||||
});
|
||||
console.log(`${exchange} verified successfully on Etherscan!`);
|
||||
} catch (error) {
|
||||
console.error(`Error during Etherscan verification:`, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,17 +20,19 @@ async function main() {
|
||||
console.log(`Deploying TychoRouter to ${network} with:`);
|
||||
console.log(`- permit2: ${permit2}`);
|
||||
console.log(`- weth: ${weth}`);
|
||||
const args = [permit2, weth];
|
||||
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log(`Deploying with account: ${deployer.address}`);
|
||||
console.log(`Account balance: ${ethers.utils.formatEther(await deployer.getBalance())} ETH`);
|
||||
|
||||
const TychoRouter = await ethers.getContractFactory("TychoRouter");
|
||||
const router = await TychoRouter.deploy(permit2, weth);
|
||||
const router = await TychoRouter.deploy(args);
|
||||
|
||||
await router.deployed();
|
||||
console.log(`TychoRouter deployed to: ${router.address}`);
|
||||
|
||||
// Verify on Tenderly
|
||||
try {
|
||||
console.log("Verifying contract on Tenderly...");
|
||||
await hre.tenderly.verify({
|
||||
@@ -41,6 +43,21 @@ async function main() {
|
||||
} catch (error) {
|
||||
console.error("Error during contract verification:", error);
|
||||
}
|
||||
|
||||
console.log("Waiting for 1 minute before verifying the contract...");
|
||||
await new Promise(resolve => setTimeout(resolve, 60000));
|
||||
|
||||
// Verify on Etherscan
|
||||
try {
|
||||
await hre.run("verify:verify", {
|
||||
address: router.address,
|
||||
constructorArguments: args,
|
||||
});
|
||||
console.log(`TychoRouter verified successfully on Etherscan!`);
|
||||
} catch (error) {
|
||||
console.error(`Error during Etherscan verification:`, error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user