v1-contracts icon indicating copy to clipboard operation
v1-contracts copied to clipboard

Uniswap on Testnet

Open nitika-goel opened this issue 6 years ago • 10 comments

Hi, Great work @Uniswap! Tried writing a mail but did not get a response there. Hence, trying to reach out here.

We are interested in integrating Uniswap for our project Nexus Mutual. Just 2 quick questions here:

  1. Which testnet are you guys on?
  2. We are interested in an exchange between ETH and DAI and vice versa. What is the best way to implement this?

nitika-goel avatar Nov 20 '18 05:11 nitika-goel

Hi Nitika,

To answer your questions:

  1. The front end app can be run on Rinkeby. But you can also redeploy the contracts using Ganache or other testnet tools too.

I have tested both swaps and liquidity functions using Rinkeby. Just fork https://github.com/Uniswap/uniswap-frontend and run it with yarn start:rinkeby.

  1. Calling the createExchange method from the Factory contract.

rossbulat avatar Dec 23 '18 05:12 rossbulat

@rossbulat , can you provide more detail on how to compile and deploy the contracts to ganache?

BlinkyStitt avatar Jan 07 '19 04:01 BlinkyStitt

@WyseNynja my testnet deploy steps were:

  1. Install uniswap as specified in the README. Make sure to switch to the Vyper compiler version specified.
  2. use vyper uniswap_factory.vy to get bytecode and vyper -f abi uniswap_factory.vy to get the ABI. Do the same for uniswap_exchange.vy
  3. Deploy both contracts separately from their bytecode using https://mycrypto.com/contracts/deploy
  4. Use factory ABI (step 2) + factory address (step 3) and https://mycrypto.com/contracts/interact to open an interface to the uniswap factory
  5. call initializeFactory(templateAddress) and pass in the address of the deployed uniswap_exchange.vy contract (step 2)

haydenadams avatar Jan 08 '19 04:01 haydenadams

Hello, in step 5, when i choose initializeFactory(templateAddress) and paste exchange deploy address, and about Value, what i should input in Value??

bboynam99 avatar Jan 14 '19 13:01 bboynam99

@bboynam99

leave it at 0

haydenadams avatar Jan 14 '19 19:01 haydenadams

thank you

bboynam99 avatar Jan 16 '19 02:01 bboynam99

@haydenadams i don't understand which address in step 4 and step 5, 4.Use factory ABI (step 2) + factory address (step 3) and https://mycrypto.com/contracts/interact to open an interface to the uniswap factory ==> [factory address] means the [factory contract address] or [factory address] use to deploy contract? 5.call initializeFactory(templateAddress) and pass in the address of the deployed uniswap_exchange.vy contract (step 2) ==>what is [address of the deployed]? the [exchange contract address] or [exchange address]?

bboynam99 avatar Jan 16 '19 02:01 bboynam99

@bboynam99

  1. factory contract address
  2. exchange contract address

haydenadams avatar Jan 16 '19 02:01 haydenadams

@haydenadams i will replace with my contracts here in addesses.js right?

const MAIN = { factoryAddress: '0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95', exchangeAddresses: { addresses: [ ['BNB', '0x255e60c9d597dCAA66006A904eD36424F7B26286'], ['DAI', '0x09cabEC1eAd1c0Ba254B09efb3EE13841712bE14'], ['KNC', '0x49c4f9bc14884f6210F28342ceD592A633801a8b'], ...

if it is, i wondering why so many exchange contract addresses for each tokens like that? is it ok if i use same 1 exchange contract address for those tokens??

bboynam99 avatar Jan 16 '19 03:01 bboynam99

https://github.com/shakeib98/uniswap-exchange-setup

This is the script to setup uniswap on testnet. :)

shakeib98 avatar Mar 02 '20 14:03 shakeib98