Revert unwanted breaking change in the Clones library (#3456)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
Hadrien Croubois
2022-06-06 22:41:48 +02:00
committed by GitHub
parent 54ce38c2e5
commit 051cc9e446
5 changed files with 43 additions and 26 deletions

12
test/helpers/create2.js Normal file
View File

@ -0,0 +1,12 @@
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,
};