Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tenderly-hardhat verification #844

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Visit your app on: `http://localhost:3000`. You can interact with your smart con

- Edit your smart contract `YourContract.sol` in `packages/hardhat/contracts`
- Edit your frontend homepage at `packages/nextjs/app/page.tsx`. For guidance on [routing](https://nextjs.org/docs/app/building-your-application/routing/defining-routes) and configuring [pages/layouts](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts) checkout the Next.js documentation.
- Edit `packates/hardhat/hardhat.config.ts` to enable [verification on Tenderly](https://docs.tenderly.co/contract-verification/hardhat) (`automaticVerifications: true`).
- Edit your deployment scripts in `packages/hardhat/deploy`
- Edit your smart contract test in: `packages/hardhat/test`. To run test use `yarn hardhat:test`

Expand Down
12 changes: 12 additions & 0 deletions packages/hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as dotenv from "dotenv";

dotenv.config();
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-ethers";
Expand All @@ -9,6 +10,7 @@ import "solidity-coverage";
import "@nomicfoundation/hardhat-verify";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
import * as tenderly from "@tenderly/hardhat-tenderly";

// If not set, it uses ours Alchemy's default API key.
// You can get your own at https://dashboard.alchemyapi.io
Expand All @@ -19,6 +21,11 @@ const deployerPrivateKey =
// If not set, it uses ours Etherscan default API key.
const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW";

// https://docs.tenderly.co/contract-verification/hardhat
// To enable Tenderly verification, set automaticVerifications to true
// Then update config.tenderly below
tenderly.setup({ automaticVerifications: false });

const config: HardhatUserConfig = {
solidity: {
version: "0.8.17",
Expand Down Expand Up @@ -132,6 +139,11 @@ const config: HardhatUserConfig = {
sourcify: {
enabled: false,
},
tenderly: {
// https://docs.tenderly.co/account/projects/account-project-slug
project: "PROJECT SLUG HERE",
username: "USERNAME HERE",
},
};

export default config;
1 change: 1 addition & 0 deletions packages/hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomicfoundation/hardhat-network-helpers": "^1.0.6",
"@nomicfoundation/hardhat-verify": "^2.0.3",
"@tenderly/hardhat-tenderly": "^2.2.2",
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^9.1.0",
"@types/eslint": "^8",
Expand Down
Loading