Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nvitorovic committed Apr 23, 2024
1 parent ba32644 commit 0b00196
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const vMainnet = defineChain({
name: 'Virtual Ethereum Mainnet',
nativeCurrency: { name: 'vEther', symbol: 'vETH', decimals: 18 },
rpcUrls: {
default: { http: ['https://virtual.mainnet.rpc.tenderly.co/0455d83d-fa26-4e8e-a89c-d12121985f8a'] }
default: { http: [process.env.VIRTUAL_MAINNET_RPC_URL!] }
},
blockExplorers: {
default: {
Expand Down
2 changes: 2 additions & 0 deletions virtual-testnets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ npx ts-node src/ethers-6-https.ts
```

```bash
source .env
npx ts-node src/viem.ts
```

```bash
source .env
npx ts-node src/viem-simulate.ts
```

Expand Down
5 changes: 3 additions & 2 deletions virtual-testnets/src/ethers-send-tx.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// file: ethers-6-https.ts`
import * as ethers from "ethers";
import { Mnemonic, Wallet } from "ethers";
import { basename } from "./utils";

const RPC_URL = `https://virtual.mainnet.rpc.tenderly.co/0455d83d-fa26-4e8e-a89c-d12121985f8a`;
const EXPLORER_BASE_URL = "https://dashboard.tenderly.co/explorer/vnet/47cdac98-cda3-431a-8fce-9f31037a3d0c";
const RPC_URL = process.env.VIRTUAL_MAINNET_RPC_URL!;
const EXPLORER_BASE_URL = `https://dashboard.tenderly.co/explorer/vnet/${basename(RPC_URL)}`;

await (async () => {
const provider = new ethers.JsonRpcProvider(RPC_URL);
Expand Down
18 changes: 3 additions & 15 deletions virtual-testnets/src/tenderly.config.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
import { defineChain } from "viem";
import { basename } from "./utils";
export const vMainnet = defineChain({
id: 73571,
name: 'Virtual Ethereum Mainnet',
nativeCurrency: { name: 'vEther', symbol: 'vETH', decimals: 18 },
rpcUrls: {
default: { http: ['https://virtual.mainnet.rpc.tenderly.co/0455d83d-fa26-4e8e-a89c-d12121985f8a'] }
default: { http: [process.env.VIRTUAL_MAINNET_RPC_URL!] }
},
blockExplorers: {
default: {
name: 'Tenderly Explorer',
url: 'https://dashboard.tenderly.co/explorer/vnet/47cdac98-cda3-431a-8fce-9f31037a3d0c'
}
},
contracts: {
ensRegistry: {
address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e'
},
ensUniversalResolver: {
address: '0xE4Acdd618deED4e6d2f03b9bf62dc6118FC9A4da',
blockCreated: 16773775
},
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 14353601
url: `https://dashboard.tenderly.co/explorer/vnet/${basename(process.env.VIRTUAL_MAINNET_RPC_URL!)}`
}
}
})
2 changes: 1 addition & 1 deletion virtual-testnets/src/viem-send-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { vMainnet } from "./tenderly.config";
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";


const EXPLORER_BASE_URL = "https://dashboard.tenderly.co/explorer/vnet/47cdac98-cda3-431a-8fce-9f31037a3d0c";
const EXPLORER_BASE_URL = vMainnet.blockExplorers.default;

const account = privateKeyToAccount(generatePrivateKey());
(async () => {
Expand Down
5 changes: 3 additions & 2 deletions virtual-testnets/src/viem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { vMainnet } from "./tenderly.config";

async function example() {

const EXPLORER_BASE_URL = "https://dashboard.tenderly.co/explorer/vnet/47cdac98-cda3-431a-8fce-9f31037a3d0c";
const EXPLORER_BASE_URL = vMainnet.blockExplorers.default;

const client = createPublicClient({
chain: vMainnet,
Expand Down Expand Up @@ -37,7 +37,8 @@ async function example() {
params: [erc20, to, value],
});
}
``

``;

const balanceTxs = await Promise.all([
tenderly_setBalance(strings),
Expand Down

0 comments on commit 0b00196

Please sign in to comment.