0

I am trying to fork uniswap. I have successfully deployed uniswap-core and uniswap-periphery on my local machine (ganache).For this, I could get many tutorials and articles. But could not find a single article that helps me to connect the locally deployed contracts with the uniswap-interface. I could fork the uniswap-interface and run on HTTP://localhost:3000 using

npm install
npm start

But don't know how to connect it with the locally deployed contracts. Any help ??

5
  • yeah, run geth locally with your own chainId, deploy uniswap contracts, add some pairs, and do all the test you want.
    – Nulik
    Jul 13 at 11:12
  • Done that, I am stuck with Interfcace Jul 14 at 7:06
  • 2
    unfortunately your question is not clear, and you won't likely to get any help on this matter
    – Nulik
    Jul 14 at 15:09
  • Hi @Nulik , I have deployed the smart contracts (Both Core and Periphery), but I don't know how to connect them with the uniswap interface. Jul 16 at 4:47
  • Hey @AmalnathSathyan, I recommend you go through the Hardhat tutorial. Your question is very broad and cannot be answered succinctly. I also recommend you take a look at create-eth-app, which is a CLI tool for building Ethereum frontends with one command (disclaimer: I'm the author). Sep 6 at 12:18
0

Here are step by step things to deploy uniswap fork successfully

  1. deploy core contract - uniswap factory

  2. Deploy WETH contract

  3. Before moving to periphery get the init code from UniswapV2Pair.sol(in uniswap core repo). For that, compile it and copy the byte code and use this service to get the init code. Change the init code in router with new value.

  4. Now its time to deploy UniswapV2Router02.sol. Before deploying, change the original values to your own contract values. You may global search the contract addresses and replace it with your contract values.

//uniswap official deployment information

Factory

0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f

WETH

0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

Routing

0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D

initCode

96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f

Replace the above 4 information with the contract address deployed by yourself

Now interface:-

  1. Download the uniswap interface repo. Open in vscode

Then install dependencies using terminal

yarn install

Now change the values containing official uniswap deployment details. Replace it with yours

Then Run

yarn start

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.