Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions docs/get-started/build/block-explorers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ As users take actions on the network, there are changes to those accounts and to
<td>https://explorer.linea.build</td>
<td>`https://explorer.linea.build/api`</td>
</tr>
<tr>
<td>Tenderly</td>
<td>https://dashboard.tenderly.co/explorer</td>
<td>`https://dashboard.tenderly.co/explorer?mtm_campaign=ext-docs&mtm_kwd=linea`</td>
</tr>
<tr>
<td>OKLink</td>
<td>https://www.oklink.com/linea</td>
Expand Down Expand Up @@ -102,6 +107,11 @@ As users take actions on the network, there are changes to those accounts and to
<td>https://explorer.sepolia.linea.build/</td>
<td>`https://explorer.sepolia.linea.build/api`</td>
</tr>
<tr>
<td>Tenderly</td>
<td>https://dashboard.tenderly.co/explorer</td>
<td>`https://dashboard.tenderly.co/explorer?mtm_campaign=ext-docs&mtm_kwd=linea`</td>
</tr>
</tbody>
</table>
</TabItem>
Expand Down
143 changes: 143 additions & 0 deletions docs/get-started/how-to/verify-smart-contract/tenderly.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
title: Tenderly
description: Tenderly is a comprehensive Web3 development infrastructure that enables developers to build, test, and monitor decentralized applications with support for Virtual TestNets and contract verification using both Hardhat and Foundry frameworks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Tenderly is a comprehensive Web3 development infrastructure that enables developers to build, test, and monitor decentralized applications with support for Virtual TestNets and contract verification using both Hardhat and Foundry frameworks.
description: Development infrastructure for building, testing, and monitoring dapps.

Descriptions need to be shorter in order to fit onto social cards, this is a suggestion, so feel free to modify

---

# Tenderly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line — Docusaurus will pull the title from the front matter (line 2)


[Tenderly](https://tenderly.co?mtm_campaign=ext-docs&mtm_kwd=linea) is a full-stack Web3 development infrastructure that helps developers build, stage, test, and monitor decentralized applications. It provides Virtual TestNets for staging and testing in mainnet-like environments, with public and private verification support for both Hardhat and Foundry.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Tenderly](https://tenderly.co?mtm_campaign=ext-docs&mtm_kwd=linea) is a full-stack Web3 development infrastructure that helps developers build, stage, test, and monitor decentralized applications. It provides Virtual TestNets for staging and testing in mainnet-like environments, with public and private verification support for both Hardhat and Foundry.
[Tenderly](https://tenderly.co?mtm_campaign=ext-docs&mtm_kwd=linea) is a full-stack web3 development infrastructure that helps developers build, stage, test, and monitor decentralized applications. It provides Virtual TestNets for staging and testing in mainnet-like environments, with public and private verification support for both Hardhat and Foundry.


## Create a Virtual TestNet
Both Hardhat and Foundry examples will use a Virtual TestNet as contract deployment and staging infrastructure.

Provision a [new Virtual TestNet](https://docs.tenderly.co/virtual-testnets/quickstart?mtm_campaign=ext-docs&mtm_kwd=linea) and place the RPC URL in the variable:

```bash
export TENDERLY_VIRTUAL_TESTNET_RPC_URL=...
```

## Foundry verification

To verify contracts with Foundry, follow the instructions in the [Tenderly documentation](https://docs.tenderly.co/contract-verification/foundry?mtm_campaign=ext-docs&mtm_kwd=linea). Tenderly offers etherscan-like verification API so all you need to do is use the correct [verification url](https://docs.tenderly.co/contract-verification#verification-on-tenderly-development-infrastructure??mtm_campaign=ext-docs&mtm_kwd=linea).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To verify contracts with Foundry, follow the instructions in the [Tenderly documentation](https://docs.tenderly.co/contract-verification/foundry?mtm_campaign=ext-docs&mtm_kwd=linea). Tenderly offers etherscan-like verification API so all you need to do is use the correct [verification url](https://docs.tenderly.co/contract-verification#verification-on-tenderly-development-infrastructure??mtm_campaign=ext-docs&mtm_kwd=linea).
To verify contracts with Foundry, follow the instructions in the [Tenderly documentation](https://docs.tenderly.co/contract-verification/foundry?mtm_campaign=ext-docs&mtm_kwd=linea). Tenderly offers etherscan-like verification API so all you need to do is use the correct [verification URL](https://docs.tenderly.co/contract-verification#verification-on-tenderly-development-infrastructure??mtm_campaign=ext-docs&mtm_kwd=linea).


:::note

When working with Virtual TestNets, in case you use a custom chain ID, you also must [extend `foundry.toml`](https://docs.tenderly.co/contract-verification/foundry#extend-foundrytoml?mtm_campaign=ext-docs&mtm_kwd=linea) with information for the custom chain.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When working with Virtual TestNets, in case you use a custom chain ID, you also must [extend `foundry.toml`](https://docs.tenderly.co/contract-verification/foundry#extend-foundrytoml?mtm_campaign=ext-docs&mtm_kwd=linea) with information for the custom chain.
When working with Virtual TestNets, if you use a custom chain ID, you must also [extend `foundry.toml`](https://docs.tenderly.co/contract-verification/foundry#extend-foundrytoml?mtm_campaign=ext-docs&mtm_kwd=linea) with information for the custom chain.


:::

**1. `forge create` verification**
```bash
TENDERLY_VERIFIER_URL=$TENDERLY_VIRTUAL_TESTNET_RPC_URL/verify/etherscan

forge create Counter \
--rpc-url $TENDERLY_VIRTUAL_TESTNET_RPC_URL \
--etherscan-api-key $TENDERLY_ACCESS_TOKEN \
--private-key $DEPLOYER_PRIVATE_KEY \
--verify \
--verifier-url $TENDERLY_VERIFIER_URL

```

**2. `forge script` verification**
```bash
TENDERLY_VERIFIER_URL=$TENDERLY_VIRTUAL_TESTNET_RPC_URL/verify/etherscan

forge script script/Counter.s.sol:CounterScript \
--rpc-url $TENDERLY_VIRTUAL_TESTNET_RPC_URL \
--private-key $DEPLOYER_PRIVATE_KEY \
--etherscan-api-key $TENDERLY_ACCESS_TOKEN \
--broadcast \
--verify \
--verifier-url $TENDERLY_VERIFIER_URL \
--slow
```

**3. `forge verify` verification**
```bash
TENDERLY_VERIFIER_URL=$TENDERLY_VIRTUAL_TESTNET_RPC_URL/verify/etherscan

forge verify-contract $COUNTER_ADDRESS \
Counter \
--etherscan-api-key $TENDERLY_ACCESS_TOKEN \
--verifier-url $TENDERLY_VERIFIER_URL \
--watch
```

## Hardhat verification

To verify contracts with both `hardhat-verify` and `hardhat-ignition`, follow the instructions in the [Tenderly documentation](https://docs.tenderly.co/contract-verification/hardhat?mtm_campaign=ext-docs&mtm_kwd=linea).

**1. Install Tenderly CLI**

Install the [Tenderly CLI](https://github.com/Tenderly/tenderly-cli) and follow the prompts of `tenderly login`:

```bash
brew tap tenderly/tenderly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be useful to add instructions for non-MacOS users to install

brew install tenderly
tenderly login
```

**2. Set up hardhat**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**2. Set up hardhat**
**2. Set up Hardhat**


Extend `hardhat.config.ts` with following configuration:
- Add the `@tenderly/hardhat-tenderly` plugin
- Add the `tenderly_linea` network
- Add the `etherscan` plugin and configure it with the Tenderly
- Add the `tenderly` plugin configuration, and set up the Tenderly [`access key`](https://docs.tenderly.co/account/projects/how-to-generate-api-access-token?mtm_campaign=ext-docs&mtm_kwd=linea) and [`project` and `username`](https://docs.tenderly.co/account/projects/account-project-slug?mtm_campaign=ext-docs&mtm_kwd=linea)

```typescript
import { HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox';
import '@tenderly/hardhat-tenderly';

import * as dotenv from 'dotenv';

dotenv.config();

const config: HardhatUserConfig = {
solidity: '0.8.27',
networks: {
tenderly_linea: {
url: process.env.TENDERLY_ADMIN_RPC_URL_LINEA || "",
chainId: parseInt(process.env.TENDERLY_CHAIN_ID_LINEA || "-1"),
}
},
etherscan: {
apiKey: {
tenderly_1: process.env.TENDERLY_ACCESS_KEY!,
tenderly_8453: process.env.TENDERLY_ACCESS_KEY!,
},
customChains: [
{
network: 'tenderly_linea',
chainId: parseInt(process.env.TENDERLY_CHAIN_ID!),
urls: {
apiURL: `${process.env.TENDERLY_ADMIN_RPC_URL}/verify/etherscan`,
browserURL: process.env.TENDERLY_ADMIN_RPC_URL!,
},
},
],
},
tenderly: {
project: process.env.TENDERLY_PROJECT_NAME!,
username: process.env.TENDERLY_ACCOUNT_NAME!,
accessKey: process.env.TENDERLY_ACCESS_KEY!,
}
};

export default config;
```

**3. Verify the contract**

For `hardhat-ignition`, run the following command:
```bash
npx hardhat ignition deploy ./ignition/modules/Counter.ts --network tenderly_linea --deployment-id deploy-1
```

For `hardhat-verify`, run the following command:

```bash
npx hardhat deploy --network tenderly_linea
```
47 changes: 47 additions & 0 deletions docs/get-started/tooling/gas/tenderly.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Tenderly
description: Tenderly offers specialized RPC methods for Linea blockchain developers to accurately estimate gas usage and predict optimal gas prices for upcoming blocks with probability-based transaction inclusion rates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Tenderly offers specialized RPC methods for Linea blockchain developers to accurately estimate gas usage and predict optimal gas prices for upcoming blocks with probability-based transaction inclusion rates.
description: Specialized RPC methods for accurate gas estimation and gas price prediction.

Again, just a suggestion, feel free to modify!

---

Tenderly provides RPC methods to help developers estimate gas usage for a transaction, and predict gas price for the next block:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tenderly provides RPC methods to help developers estimate gas usage for a transaction, and predict gas price for the next block:
Tenderly provides RPC methods to help developers estimate gas usage for a transaction and predict gas price for the next block:


- estimate gas on Linea with 100% accuracy with [`tenderly_estimateGas`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_estimateGas?mtm_campaign=ext-docs&mtm_kwd=linea) RPC method. This method estimates gas by profiling the transaction, and Tenderly ensures entire transaction runs fully, regardless of the initially provided gas for said transaction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- estimate gas on Linea with 100% accuracy with [`tenderly_estimateGas`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_estimateGas?mtm_campaign=ext-docs&mtm_kwd=linea) RPC method. This method estimates gas by profiling the transaction, and Tenderly ensures entire transaction runs fully, regardless of the initially provided gas for said transaction.
- Estimate gas on Linea with 100% accuracy with the [`tenderly_estimateGas`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_estimateGas?mtm_campaign=ext-docs&mtm_kwd=linea) RPC method. This method estimates gas by profiling the transaction, and Tenderly ensures the entire transaction runs fully regardless of the gas provided initially.

- predict gas prices for the next block using [`tenderly_gasPrice`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_gasPrice?mtm_campaign=ext-docs&mtm_kwd=linea) RPC method. Gas price prediction is based on historical data and statistical analysis, and it comes in 3 probability levels for transaction inclusion in the next block, including `maxFeePerGas`, `maxPriorityFeePerGas`, and transaction `waitTime`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- predict gas prices for the next block using [`tenderly_gasPrice`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_gasPrice?mtm_campaign=ext-docs&mtm_kwd=linea) RPC method. Gas price prediction is based on historical data and statistical analysis, and it comes in 3 probability levels for transaction inclusion in the next block, including `maxFeePerGas`, `maxPriorityFeePerGas`, and transaction `waitTime`.
- Predict gas prices for the next block using the [`tenderly_gasPrice`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_gasPrice?mtm_campaign=ext-docs&mtm_kwd=linea) RPC method. Gas price prediction is based on historical data and statistical analysis, and it comes in three probability levels for transaction inclusion in the next block, including `maxFeePerGas`, `maxPriorityFeePerGas`, and transaction `waitTime`.


## Use the Tenderly Gas API

To leverage Tenderly's Gas API, create an RPC Node and call the RPC methods:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded line here


**`tenderly_estimateGas`**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**`tenderly_estimateGas`**
### `tenderly_estimateGas`

```bash
curl https://linea.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 0,
"method": "tenderly_estimateGas",
"params": [
{
"from": "0x8516feaea147ea0db64d1c5b97bb651ca5435155",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"data": "0xa9059cbb0000000000000000000000003fc3c4c84bdd2db5ab2cc62f93b2a9a347de25fb00000000000000000000000000000000000000000000001869c36187f3430000",
"value": "0x0"
},
"21285787"
]
}'
```

**`tenderly_gasPrice`**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**`tenderly_gasPrice`**
###`tenderly_gasPrice`

```bash
curl https://linea.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 0,
"method": "tenderly_gasPrice"
}'
```
5 changes: 5 additions & 0 deletions docs/get-started/tooling/node-providers/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ image: /img/socialCards/node-providers.jpg
<td>:x:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td><a href="https://tenderly.co/?mtm_campaign=ext-docs&mtm_kwd=linea">Tenderly</a></td>
<td>:x:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td><a href="https://unifra.io/">Unifra</a></td>
<td>:x:</td>
Expand Down
52 changes: 52 additions & 0 deletions docs/get-started/tooling/security/tenderly.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Tenderly
description: Tenderly offers robust monitoring and security solutions for Linea blockchain with features including configurable alerts, automated Web3 Actions, and simulation capabilities to predict transaction outcomes before execution.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Tenderly offers robust monitoring and security solutions for Linea blockchain with features including configurable alerts, automated Web3 Actions, and simulation capabilities to predict transaction outcomes before execution.
description: Monitoring and security solutions including configurable alerts, automated Web3 Actions, and transaction simulation.

---

Tenderly provides comprehensive monitoring and security solutions for Linea, allowing you to stay informed about on-chain events, and respond proactively to potential issues.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tenderly provides comprehensive monitoring and security solutions for Linea, allowing you to stay informed about on-chain events, and respond proactively to potential issues.
Tenderly provides comprehensive monitoring and security solutions for Linea, allowing you to stay informed about onchain events and respond proactively to potential issues.


- Configure [**Tenderly Alerts**](https://docs.tenderly.co/alerts/intro-to-alerts?mtm_campaign=ext-docs&mtm_kwd=linea) to get notifications on transactions and contract events, allowing you to stay aware of critical issues and to signal problems to external webhooks. Use the [Alert API](https://docs.tenderly.co/reference/api#/operations/createAlert?mtm_campaign=ext-docs&mtm_kwd=linea) for dynamic configuration and building more powerful triggering criteria.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Configure [**Tenderly Alerts**](https://docs.tenderly.co/alerts/intro-to-alerts?mtm_campaign=ext-docs&mtm_kwd=linea) to get notifications on transactions and contract events, allowing you to stay aware of critical issues and to signal problems to external webhooks. Use the [Alert API](https://docs.tenderly.co/reference/api#/operations/createAlert?mtm_campaign=ext-docs&mtm_kwd=linea) for dynamic configuration and building more powerful triggering criteria.
- Configure [**Tenderly Alerts**](https://docs.tenderly.co/alerts/intro-to-alerts?mtm_campaign=ext-docs&mtm_kwd=linea) to get notifications on transactions and contract events, allowing you to stay aware of critical issues and to signal problems to external webhooks. Use the [Alert API](https://docs.tenderly.co/reference/api#/operations/createAlert?mtm_campaign=ext-docs&mtm_kwd=linea) for dynamic configuration and building more powerful triggering criteria.

- Use [**Web3 Actions**](https://docs.tenderly.co/web3-actions/intro-to-web3-actions?mtm_campaign=ext-docs&mtm_kwd=linea) to automate predefined responses, improving security and user experience.
- Leverage [**Simulation RPC**](https://docs.tenderly.co/simulations/single-simulations#simulate-via-rpc?mtm_campaign=ext-docs&mtm_kwd=linea) to predict transaction execution beforehand, and get insights about asset changes, state changes, and gas usage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Leverage [**Simulation RPC**](https://docs.tenderly.co/simulations/single-simulations#simulate-via-rpc?mtm_campaign=ext-docs&mtm_kwd=linea) to predict transaction execution beforehand, and get insights about asset changes, state changes, and gas usage.
- Leverage [**Simulation RPC**](https://docs.tenderly.co/simulations/single-simulations#simulate-via-rpc?mtm_campaign=ext-docs&mtm_kwd=linea) to predict transaction execution, and get insights about asset changes, state changes, and gas usage.

- It's possible to simulate single transactions with [`tenderly_simulateTransaction`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_simulateTransaction?mtm_campaign=ext-docs&mtm_kwd=linea)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- It's possible to simulate single transactions with [`tenderly_simulateTransaction`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_simulateTransaction?mtm_campaign=ext-docs&mtm_kwd=linea)
- You can simulate single transactions with [`tenderly_simulateTransaction`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_simulateTransaction?mtm_campaign=ext-docs&mtm_kwd=linea)

- Simulate batches of interconnected transactions with [`tenderly_simulateBundle`](https://docs.tenderly.co/node/rpc-reference/linea/tenderly_simulateBundle?mtm_campaign=ext-docs&mtm_kwd=linea)

```
curl https://linea.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 0,
"method": "tenderly_simulateBundle",
"params": [
[
{
"from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"data": "0x40c10f19000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce10000000000000000000000000000000000000000000000001bc16d674ec80000"
},
{
"from": "0xe58b9ee93700a616b50509c8292977fa7a0f8ce1",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"gas": "0x7a1200",
"data": "0x095ea7b3000000000000000000000000f7ddedc66b1d482e5c38e4730b3357d32411e5dd0000000000000000000000000000000000000000000000000de0b6b3a7640000"
},
{
"from": "0xf7ddedc66b1d482e5c38e4730b3357d32411e5dd",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"gas": "0x7a1200",
"data": "0x23b872dd000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce1000000000000000000000000bd8daa414fda8a8a129f7035e7496759c5af8570000000000000000000000000000000000000000000000000006a94d74f430000"
}
],
"latest",
{
"0x6b175474e89094c44da98b954eedeac495271d0f": {
"stateDiff": {
"0xedd7d04419e9c48ceb6055956cbb4e2091ae310313a4d1fa7cbcfe7561616e03": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
}
}
]
}' | jq
```
3 changes: 3 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const sidebars = {
"get-started/how-to/verify-smart-contract/atlas",
"get-started/how-to/verify-smart-contract/foundry",
"get-started/how-to/verify-smart-contract/hardhat",
"get-started/how-to/verify-smart-contract/tenderly",
],
},
"get-started/how-to/migrate-dapp",
Expand Down Expand Up @@ -255,6 +256,7 @@ const sidebars = {
},
items: [
"get-started/tooling/gas/blocknative",
"get-started/tooling/gas/tenderly",
],
},
{
Expand Down Expand Up @@ -347,6 +349,7 @@ const sidebars = {
"get-started/tooling/security/hypernative",
"get-started/tooling/security/scamfari",
"get-started/tooling/security/spherex",
"get-started/tooling/security/tenderly",
],
},
{
Expand Down