Skip to content

Commit

Permalink
Add testnet to example templates (#223)
Browse files Browse the repository at this point in the history
* move VersionCompatibilityChecker to package

* check if hardhat-tenderly version is outdated

* encapsulate compatibility version checks into functions

* add link-local-hardhat-tenderly command

* add testnet to example templates

* changeset version
  • Loading branch information
dule-git authored Sep 25, 2024
1 parent dbda536 commit 51fc3b8
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 36 deletions.
6 changes: 6 additions & 0 deletions .changeset/silver-windows-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@tenderly/hardhat-integration": patch
"@tenderly/hardhat-tenderly": patch
---

Added alerts if ethers and hardhat-tenderly versions are not compatible for each other (ethersv5 and [email protected], or ethersv6 and [email protected]. Also added alerts if there's a new hardhat-tenderly version available.
5 changes: 3 additions & 2 deletions examples/contract-verification/ethers-v5/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ console.log("Using automatic verification?", automaticVerifications);
const config: HardhatUserConfig = {
solidity: "0.8.23",
networks: {
tenderly: {
url: `${process.env.TENDERLY_FORK_RPC_URL ?? ""}`,
my_tenderly_testnet: {
// or any other custom network name
url: `${process.env.TENDERLY_TESTNET_RPC_URL ?? ""}`,
},
sepolia: {
url: `${process.env.SEPOLIA_URL ?? ""}`,
Expand Down
13 changes: 8 additions & 5 deletions examples/contract-verification/ethers-v5/tpl.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
SEPOLIA_URL= # Provider URL for Sepolia test network
SEPOLIA_URL= # Provider URL for Sepolia test network -> Available through Tenderly Node RPCs
SEPOLIA_PRIVATE_KEY= # optional

# https://dashboard.tenderly.co/{USERNAME}/{PROJECT}/fork/{FORK_ID}
TENDERLY_FORK_RPC_URL=# The RPC_URL of a Tenderly Fork; Found on the fork UI info tab
TENDERLY_PROJECT=# Project Slug; {PROJECT} in the URL
TENDERLY_USERNAME=# Username; {USERNAME} in the URL
TENDERLY_USERNAME=# Username
TENDERLY_PROJECT=# Project Slug -> Available on the dashboard project dropdown

TENDERLY_TESTNET_RPC_URL=# The RPC_URL of a Tenderly VirtualTestnet; Found on the Dashboard UI for Virtual Testnets

# This will automatically populate the `etherscan` field in the hardhat-verify config with the data needed to verify PROXY contracts on Tenderly.
TENDERLY_AUTOMATIC_POPULATE_HARDHAT_VERIFY_CONFIG=true
12 changes: 2 additions & 10 deletions examples/contract-verification/ethers-v6/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,9 @@ console.log(
const config: HardhatUserConfig = {
solidity: "0.8.23",
networks: {
my_tenderly_fork_1: {
my_tenderly_testnet: {
// or any other custom network name
url: `${process.env.TENDERLY_FORK_RPC_URL ?? ""}`,
},
my_tenderly_devnet_1: {
// or any other custom network name
url: `${process.env.TENDERLY_DEVNET_RPC_URL_1 ?? ""}`,
},
my_tenderly_devnet_2: {
// or any other custom network name
url: `${process.env.TENDERLY_DEVNET_RPC_URL_2 ?? ""}`,
url: `${process.env.TENDERLY_TESTNET_RPC_URL ?? ""}`,
},
sepolia: {
url: `${process.env.SEPOLIA_URL ?? ""}`,
Expand Down
12 changes: 5 additions & 7 deletions examples/contract-verification/ethers-v6/tpl.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
SEPOLIA_URL= # Provider URL for Sepolia test network
SEPOLIA_URL= # Provider URL for Sepolia test network -> Available through Tenderly Node RPCs
SEPOLIA_PRIVATE_KEY= # optional

# https://dashboard.tenderly.co/{USERNAME}/{PROJECT}/fork/{FORK_ID}
TENDERLY_FORK_RPC_URL=# The RPC_URL of a Tenderly Fork; Found on the fork UI info tab
TENDERLY_DEVNET_RPC_URL_1=# The RPC_URL of a Tenderly Devnet; Found on the devnet UI info tab
TENDERLY_DEVNET_RPC_URL_2=# The RPC_URL of a Tenderly Devnet; Found on the devnet UI info tab
TENDERLY_PROJECT=# Project Slug; {PROJECT} in the URL
TENDERLY_USERNAME=# Username; {USERNAME} in the URL
TENDERLY_USERNAME=# Username
TENDERLY_PROJECT=# Project Slug -> Available on the dashboard project dropdown

TENDERLY_TESTNET_RPC_URL=# The RPC_URL of a Tenderly VirtualTestnet; Found on the Dashboard UI for Virtual Testnets

# This will automatically populate the `etherscan` field in the hardhat-verify config with the data needed to verify PROXY contracts on Tenderly.
TENDERLY_AUTOMATIC_POPULATE_HARDHAT_VERIFY_CONFIG=true
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ tdly.setup();
const config: HardhatUserConfig = {
solidity: "0.8.24",
networks: {
testnet: {
url: `${process.env.TENDERLY_TESTNET_RPC_URL ?? ""}`
}
my_tenderly_testnet: {
// or any other custom network name
url: `${process.env.TENDERLY_TESTNET_RPC_URL ?? ""}`,
},
sepolia: {
url: `${process.env.SEPOLIA_URL ?? ""}`,
accounts: [process.env.SEPOLIA_PRIVATE_KEY ?? ""],
},
},
tenderly: {
project: process.env.TENDERLY_PROJECT ?? "",
Expand Down
13 changes: 4 additions & 9 deletions examples/contract-verification/hardhat-ignition/tpl.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
SEPOLIA_URL= # Provider URL for Sepolia test network
SEPOLIA_URL= # Provider URL for Sepolia test network -> Available through Tenderly Node RPCs
SEPOLIA_PRIVATE_KEY= # optional

# https://dashboard.tenderly.co/{USERNAME}/{PROJECT}/fork/{FORK_ID}
TENDERLY_FORK_RPC_URL=# The RPC_URL of a Tenderly Fork; Found on the fork UI info tab
TENDERLY_DEVNET_RPC_URL_1=# The RPC_URL of a Tenderly Devnet; Found on the devnet UI info tab
TENDERLY_DEVNET_RPC_URL_2=# The RPC_URL of a Tenderly Devnet; Found on the devnet UI info tab
TENDERLY_PROJECT=# Project Slug; {PROJECT} in the URL
TENDERLY_USERNAME=# Username; {USERNAME} in the URL
TENDERLY_USERNAME=# Username
TENDERLY_PROJECT=# Project Slug -> Available on the dashboard project dropdown

# This will automatically populate the `etherscan` field in the hardhat-verify config with the data needed to verify PROXY contracts on Tenderly.
TENDERLY_AUTOMATIC_POPULATE_HARDHAT_VERIFY_CONFIG=true
TENDERLY_TESTNET_RPC_URL=# The RPC_URL of a Tenderly VirtualTestnet; Found on the Dashboard UI for Virtual Testnets

0 comments on commit 51fc3b8

Please sign in to comment.