Uniswap / v2-sdk

🛠 An SDK for building applications on top of Uniswap V2
https://uniswap.org/docs/v2/SDK/getting-started
MIT License
428 stars 1.09k forks source link

Different versions between documentation and github code #119

Open Noe315 opened 1 year ago

Noe315 commented 1 year ago

I was installing the SDK using this guide and realized that the FACTORY_ADDRESS and INIT_CODE_HASH is only for Uniswap. I have deployed my own contracts (source code here) on KardiaChain, so I needed to replace the FACTORY_ADDRESS and INIT_CODE_HASH with my own.

I tried to clone this repository and modified the FACTORY_ADDRESS and INIT_CODE_HASH, then build again, but it seems that the repository (which is of version 3.0.1) does not match with the documentation (which is of version 3.0.3). This makes it a bit difficult to follow the documentation.

I have not found the code for version 3.0.3 anywhere, so if you guys could share the source for version 3.0.3 (to match with the documentation), that would be much appreciated.

Thank you.

Noe315 commented 1 year ago

I found a workaround (which is kind of bad, but it works for now), that is to search and replace the original FACTORY_ADDRESS and INIT_CODE_HASH with that of my own.

Florian-S-A-W commented 1 year ago

Hi @Noe315

Parts of the documentation are for the deprecated "uniswap-sdk" package, which was re-released as the "v2-sdk" and updated from there. Version 1.0.0 of this sdk, the uniswap "v2-sdk", is version 3.0.3 of "uniswap-sdk", which you are referring to. So version 3.0.1 is actually 2 major versions ahead of 3.0.3 so some functionalities may have been removed or updated.

If you are using a fork of Uniswap V2 on a different chain, you can fork this repository and replace the factory address and init code hash in the constants class.