-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVanityAddress.php
27 lines (23 loc) · 931 Bytes
/
VanityAddress.php
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
<?php
// Change the value below
$checkString = 'Ab';
// Change the value above
function startsWith ($string, $startString) {
$len = strlen($startString);
return (substr($string, 0, $len) === $startString);
}
include_once 'api/vendor/autoload.php';
$matched = false;
$tron = new \IEXBase\TronAPI\Tron();
while(!$matched) {
$generateAddress = $tron->generateAddress();
//$tempadd = strtolower(substr($generateAddress->getAddress(true), 1));
$tempadd = substr($generateAddress->getAddress(true), 1);
$matched = startsWith($tempadd, $checkString);
//echo $generateAddress->getAddress(true) . "\n";
}
echo "\n\n ----------Found----------- \n\n";
echo($generateAddress->getAddress(true) . " - " . $generateAddress->getPrivateKey());
$filename = trim($generateAddress->getAddress(true)) . ".txt";
file_put_contents($filename, $generateAddress->getAddress(true) . " - " . $generateAddress->getPrivateKey());
?>