-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic-simulation.js
More file actions
32 lines (28 loc) · 836 Bytes
/
basic-simulation.js
File metadata and controls
32 lines (28 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { Tenderly, Network } = require("@tenderly/sdk");
const tenderly = new Tenderly({
accountName: "your-account-name",
projectName: "your-project-name",
accessKey: "your-access-key",
network: Network.Mainnet,
});
const transactionParameters = {
from: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
to: "0x742d35Cc6634C0532925a3b844Bc454e4438f44f",
input: "0x606060...",
value: "1000000000000000000",
gas: 21000,
gas_price: "20000000000",
};
const simulationDetails = {
transaction: transactionParameters,
blockNumber: 12000000,
override: {},
};
(async () => {
try {
const simulationResult = await tenderly.simulator.simulateTransaction(simulationDetails);
console.log("Simulation result:", simulationResult);
} catch (error) {
console.error("Error running simulation:", error);
}
})();