-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (26 loc) · 819 Bytes
/
Copy pathindex.js
File metadata and controls
31 lines (26 loc) · 819 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
// IMPORTANT
// Ledger device must be unlocked, and Ethereum application opened.
// Edit the PREFIX variable to whatever you're looking for.
const PREFIX = "0xf00";
(async () => {
const hw = require("@ethersproject/hardware-wallets");
const ledger = new hw.LedgerSigner();
const eth = await ledger._eth;
let vanityAddress = null;
let index = 0;
let output;
while (vanityAddress === null) {
const path = `m/44'/60'/0'/0/${index}`;
const address = await eth.getAddress(path)
output = { path, address: address.address };
console.log(output);
if (address.address.toLowerCase().startsWith(PREFIX.toLowerCase())) {
vanityAddress = address;
} else {
index++;
}
}
console.log("");
console.log(`FOUND ADDRESS WITH PREFIX ${PREFIX}`);
console.log(output);
})();