Addresses

找到錢包的地址 知道幾乎所有的字母

  • April 17, 2022

我想找到乙太坊地址,我幾乎有所有的字母。錢包開頭:0xb6b2ceb624a6b667e67af1893b16706baec21 但是怎麼才能找到剩餘的字母呢?

使用 web3.js 1.0-beta 的程式碼,未能找到任何餘額為正的賬戶:

const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io');

const start = '0xb6b2ceb624a6b667e67af1893b16706baec21';

async function main() {
   for (var i = 0; i < 4096; i++) {
       const end = web3.utils.padLeft(web3.utils.toHex(i).substring(2), 3);
       const address = start + end;
       const balance = parseInt(await web3.eth.getBalance(address), 10);

       if (balance > 0) {
           console.log(`${address} has a balance of ${balance} wei.`);
       }
   }
}

main();

引用自:https://ethereum.stackexchange.com/questions/66050