MCPcopy Create free account
hub / github.com/Bot80926/ethers-scripts / createAccount

Function createAccount

script-1-create-wallet/index.js:13–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11const chalk = require("chalk");
12
13const createAccount = () => {
14 let list = "";
15
16 //step1: create wallet
17 for (let i = 0; i < 100; i++) {
18 const wallet = ethers.Wallet.createRandom();
19
20 const pv = wallet.privateKey;
21
22 const address = wallet.address;
23
24 list += '\r "address: ' + address + '", privateKey: "' + pv + '", \r';
25 }
26
27 //step2: create txt file and save wallet
28 fs.writeFile(`./addr_key_book.txt`, list, (error) => {
29 if (error) {
30 return console.log("create wallet failed, error: ", error);
31 }
32 console.log(chalk.green("Successfully created wallets in batches, file name: addr_key_book.txt"));
33 });
34};
35
36const main = async () => {
37 createAccount();

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected