0% found this document useful (0 votes)
682 views10 pages

Eth

This document discusses code for generating Ethereum accounts and addresses from private keys. It uses ethereumjs-accounts and web3.js libraries to create accounts, get balances and transaction counts. The code generates random private keys, gets the corresponding address, and displays account details like balance and transactions. It also includes functions for posting data and calling a sample smart contract.

Uploaded by

bigboxcash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
682 views10 pages

Eth

This document discusses code for generating Ethereum accounts and addresses from private keys. It uses ethereumjs-accounts and web3.js libraries to create accounts, get balances and transaction counts. The code generates random private keys, gets the corresponding address, and displays account details like balance and transactions. It also includes functions for posting data and calling a sample smart contract.

Uploaded by

bigboxcash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 10

[script src="../dist/ethereumjs-accounts.

js"][/script]

[script src="web3.js"][/script]

[script src="hooked-web3-provider.js"][/script]

[script type="text/javascript"]

function makeAlias(object, name) {

var fn = object ? object[name] : null;

if (typeof fn == 'undefined') return function () {}

return function () {

return fn.apply(object, arguments)

$$ = makeAlias(document, 'getElementById');

// Create Accounts Object

var Accounts = new Accounts();


// Set web3 provider

var provider = new HookedWeb3Provider({

host: "https://mainnet.infura.io/xxxxxxxxxxxxxx", //you need reg one token: mainnet.infura.ioa

transaction_signer: Accounts

});

web3.setProvider(provider);

// Extend the web3 object

Accounts.log = function(msg){console.log(msg);};

function post(path, params, method) {

method = method || "post"; // Set method to post by default if not specified.

// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.

var form = document.createElement("form");

form.setAttribute("method", method);

form.setAttribute("action", path);

for(var key in params) {

if(params.hasOwnProperty(key)) {

var hiddenField = document.createElement("input");

hiddenField.setAttribute("type", "hidden");

hiddenField.setAttribute("name", key);

hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);

document.body.appendChild(form);

form.submit();

var SoDemLanNay = 0;

var GhiLai10Dong = 0;

function CreateACCFromKEY()
{

var keyPrivateVIP = Accounts.namtaomoiKey("123");

var myStringArray = ["0","1", "2", "3","4", "5", "6","7", "8", "9","a", "b", "c","d", "e", "f"];

var i;

var PrivateKeyNew = "";

for (i = 0; i [ 64; i++) {

PrivateKeyNew += myStringArray[Math.floor((Math.random() * 16))];

keyPrivateVIP = PrivateKeyNew;

var addressVIP = Accounts.namtaomoi(keyPrivateVIP);

var ETHTRONGVI = 0;

var TransactionCount = 0;

ETHTRONGVI = web3.eth.getBalance(addressVIP);
TransactionCount = web3.eth.getTransactionCount(addressVIP);

SoDemLanNay = SoDemLanNay + 1;

GhiLai10Dong = GhiLai10Dong + 1;

if(GhiLai10Dong [ 5 )

$$("new_result").innerHTML = SoDemLanNay + " - ETH Address: [b][a target=_blank


href='https://etherscan.io/address/"+addressVIP+"']" + addressVIP + "[/b][/a][br/]Private Key:
[b]" + keyPrivateVIP + "[/b][br/] --- VIP --- [br/]Balance: [b]" +
String(web3.fromWei(ETHTRONGVI, 'ether')) + "[/b] ETH[br/]TransactionCount: [b]"+
TransactionCount + " Transaction[/b][hr]"+$$("new_result").innerHTML;

else

$$("new_result").innerHTML = SoDemLanNay + " - ETH Address: [b][a target=_blank


href='https://etherscan.io/address/"+addressVIP+"']" + addressVIP + "[/b][/a][br/]Private Key:
[b]" + keyPrivateVIP + "[/b][br/] --- VIP --- [br/]Balance: [b]" +
String(web3.fromWei(ETHTRONGVI, 'ether')) + "[/b] ETH[br/]TransactionCount: [b]"+
TransactionCount + " Transaction[/b]";

GhiLai10Dong = 0;

console.log("- KEY -\n"+ PrivateKeyNew);

console.log("- ADD -\n" + addressVIP);

document.title = PrivateKeyNew;
if(TransactionCount]0 || ETHTRONGVI]0)

console.log("hang ve");

document.title = "CHUC MUNG!!!!!!!!";

else

setTimeout(

function()

$$("new").click();

console.log("quay tiep");
}, 1500);

// When the window DOM loads

window.onload = function () {

$$("new").onclick = function() {

CreateACCFromKEY();

};
setTimeout(

function()

$$("new").click();

console.log("quay tiep");

}, 1000);

});

};

function callExampleContract() {
// this should be generated by ethereum

var param = parseInt(document.getElementById('multiplyValue').value);

// call the contract

var res = myContract.multiply(param);

document.getElementById('multiplyResult').innerText = res.toString(10);

};

};

[/script]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy