GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Pancake and BSC fork · Issue #90 · uniswap-python/uniswap-python

Pancake and BSC fork #90

New issue
Copy link
New issue
Copy link
Closed
Closed
Pancake and BSC fork#90
Copy link
Labels
forks

Description

@alb2001
alb2001
opened on Apr 27, 2021
Issue body actions

Hello

This wrapper is pretty good when interacting with Uniswap. However, BSC and Pancake share almost everything from the eth network. (even the functions are the same

So I wonder, is there a fork already which works with PancakeSwap and BSC? What would need to be changed to add support for Pancake?

Network ID, and pancake router contracts?

Thanks

Activity

  1. ErikBjare commented on Apr 27, 2021

    @ErikBjare
    ErikBjare
    on Apr 27, 2021
    Member
    More actions

    See #62 (comment) and #58.

    Some work required but should be easy to implement, please make a PR if you get around to it!

  2. alb2001 commented on Apr 28, 2021

    @alb2001
    alb2001
    on Apr 28, 2021
    Author
    More actions

    Hello

    Thanks for your response. Unfortunately my knowledge is limited. But I could try. However, do you know of any pancakeswap wrapper for python?

  3. wahid commented on May 2, 2021

    @wahid
    wahid
    on May 2, 2021
    More actions

    I think patching line 121 and line 184 in uniswap.py would do it.

    _netid_to_name = {1: "mainnet", 3: "ropsten", 4: "rinkeby", 56: "BSC"}
    
    elif self.version == 2:
        if self.network == "BSC":
            factory_contract_address_v2 = _str_to_addr("0xca143ce32fe78f1f7019d7d551a6402fc5350c73")
            self.router_address: AddressLike = _str_to_addr("0x10ed43c718714eb63d5aa57b78b54704e256024e")
        else:
            factory_contract_address_v2 = _str_to_addr(
                "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"
            )
    
            self.router_address: AddressLike = _str_to_addr(
                "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
            )
        self.factory_contract = self._load_contract(abi_name="uniswap-v2/factory", address=factory_contract_address_v2)
        self.router = self._load_contract(abi_name="uniswap-v2/router02", address=self.router_address)
  4. ErikBjare commented on May 4, 2021

    @ErikBjare
    ErikBjare
    on May 4, 2021
    Member
    More actions

    I adapted #58 to allow for overriding the factory and router contract addresses in the constructor. Should work, feedback/testing welcome.

  5. ErikBjare commented on May 4, 2021

    @ErikBjare
    ErikBjare
    on May 4, 2021
    Member
    More actions

    Closing. Please open a new issue if you stumble into problems.

  6. ErikBjare
    closed this as completedon May 4, 2021
  7. ErikBjare
    added
    forks
    on May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    forks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.