Last active
June 19, 2022 12:04
-
-
Save an-ivannikov/a02e187b8b2961e86880d8ff9764f107 to your computer and use it in GitHub Desktop.
Get Uniswap Init Code Hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ValueswapV2Pair = artifacts.require('ValueswapV2Pair.sol'); | |
module.exports = async (callback) => { | |
console.log( | |
'ValueswapV2Pair bytecode hash (Look for INIT_CODE_HASH):\n%s', | |
(web3.utils.keccak256(ValueswapV2Pair.bytecode)).substring(2) | |
); | |
callback(); | |
} | |
/* | |
pragma solidity =0.5.16; | |
import './UniswapV2Pair.sol'; | |
contract CalHash { | |
function getInitHash() public pure returns(bytes32){ | |
bytes memory bytecode = type(UniswapV2Pair).creationCode; | |
return keccak256(abi.encodePacked(bytecode)); | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment