Skip to content

Instantly share code, notes, and snippets.

@lucko515
Last active Sep 6, 2022
Embed
What would you like to do?
Exanple of a Hardhat config file including Tenderly import and config
import * as dotenv from "dotenv";
import { HardhatUserConfig, task } from "hardhat/config";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "solidity-coverage";
dotenv.config();
import * as tdly from "@tenderly/hardhat-tenderly";
tdly.setup();
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
const config: HardhatUserConfig = {
solidity: "0.8.4",
networks: {
ropsten: {
url: process.env.ROPSTEN_URL || "",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
rinkeby:{
url: "https://rinkeby.infura.io/v3/INFURA_KEY", //Infura url with projectId
accounts: [""]
},
tenderly:{
chainId:1,
url: "https://rpc.tenderly.co/fork/<UNIQUE_TENDERLY_FORK_ID>"
}
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
tenderly: {
project: "<PROJECT_NAME>",
username: "<TENDERLY_USERNAME>",
forkNetwork: "<FORKED_CHAIN_ID>",
privateVerification: true,
},
};
export default config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment