Skip to content

Commit a6ab575

Browse files
committed
Use dummy PK when missing
1 parent 006b830 commit a6ab575

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

ts/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import dotenv from "dotenv";
2-
import { createWalletClient, http, parseEther, encodeFunctionData } from "viem";
2+
import { createWalletClient, http, parseEther, encodeFunctionData, zeroAddress } from "viem";
33
import { sepolia } from "viem/chains";
44
import { privateKeyToAccount } from "viem/accounts";
55
import { batchCallerABI, contractAddress } from "./contract";
66

77
dotenv.config();
8-
const privateKey = process.env.PK;
8+
let privateKey = process.env.PK;
99
if (!privateKey) {
10-
console.error("Missing PK!");
10+
console.warn("Missing PK, using dummy account");
11+
privateKey = "0xe4dc8cbe94cbc139084c9c7adc5c2a829d3246f76282679e0c067147a47eb3f8"
1112
}
1213
const account = privateKeyToAccount(privateKey as `0x${string}`);
1314

@@ -31,13 +32,13 @@ const run = async (): Promise<void> => {
3132
args: [
3233
[
3334
{
34-
to: "0xcb98643b8786950F0461f3B0edf99D88F274574D",
35-
value: parseEther("0.001"),
35+
to: zeroAddress,
36+
value: 1n,
3637
data: "0x",
3738
},
3839
{
39-
to: "0xd2135CfB216b74109775236E36d4b433F1DF507B",
40-
value: parseEther("0.002"),
40+
to: "0x1111111111111111111111111111111111111111",
41+
value: 2n,
4142
data: "0x",
4243
},
4344
],

0 commit comments

Comments
 (0)