I am working with pancakeswap and I was following a tutorial which just said that we need to calculated the INIT_HASH and that we can follow this link enter link description here for guidance. The link gives the following solution

import { INIT_CODE_HASH } from '../src/constants'

import { bytecode } from '@uniswap/v2-core/build/UniswapV2Pair.json'
import { keccak256 } from '@ethersproject/solidity'

const COMPUTED_INIT_CODE_HASH = keccak256(['bytes'], [`0x${bytecode}`])

which I do not understand because there is no ../src/constants folder in my truffle project. Secondly, the link also mentions pre-compiled smart contracts below which I totally do not understand as I am learning myself. So can someone guide as to what is init_hash, how will i calculate it, what is this src folder mentioned in the link, what and where are the precompiled contracts that are being mentioned and can I use the above solution in the same file where hash is needed/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.