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.
13 lines
316 B
13 lines
316 B
3 years ago
|
function computeCreate2Address (saltHex, bytecode, deployer) {
|
||
|
return web3.utils.toChecksumAddress(`0x${web3.utils.sha3(`0x${[
|
||
|
'ff',
|
||
|
deployer,
|
||
|
saltHex,
|
||
|
web3.utils.soliditySha3(bytecode),
|
||
|
].map(x => x.replace(/0x/, '')).join('')}`).slice(-40)}`);
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
computeCreate2Address,
|
||
|
};
|