blockchainethereumsmart-contractssoliditytutorialdappweb3ethtruffleweb3jstransactionsigntransactionsignaturesign-datasignpublickeyprivatekeyethereum-identityencryptioncipher
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
380 B
7 lines
380 B
import { generateAddress, toChecksumAddress, toBuffer } from 'ethereumjs-util';
|
|
import { addLeading0x } from './util';
|
|
export function calculateContractAddress(creatorAddress, nonce) {
|
|
var addressBuffer = generateAddress(toBuffer(addLeading0x(creatorAddress)), toBuffer(nonce));
|
|
var address = addressBuffer.toString('hex');
|
|
return toChecksumAddress(addLeading0x(address));
|
|
} |