pancake-swap-interface-v1 icon indicating copy to clipboard operation
pancake-swap-interface-v1 copied to clipboard

Division by 0 on liquidity pool

Open Joimer opened this issue 3 years ago • 3 comments

Bug Description When trying to create a new Liquidity Pool, first adding the token for the pairing, there's a division by zero and the frontend crashes.

Steps to Reproduce

  1. Go to https://exchange.pancakeswap.finance/#/add/0x new token address/BNB
  2. Click on adding the token on the pairing
  3. Page gets blank with the following errors:
rangeError: Division by zero
    value jsbi-umd.js:1
    get fraction.ts:37
    quote price.ts:64
    R hooks.ts:86
    React 2
    L hooks.ts:71
    Ol index.tsx:72
    React 8
    unstable_runWithPriority scheduler.production.min.js:18
    React 5
Uncaught RangeError: Division by zero
    value jsbi-umd.js:1
    get fraction.ts:37
    quote price.ts:64
    R hooks.ts:86
    React 2
    L hooks.ts:71
    Ol index.tsx:72
    React 8
    unstable_runWithPriority scheduler.production.min.js:18
    React 5

Expected Behavior The page not to turn white, to show the pairing, and to allow me to add the new LP pairing.

Joimer avatar Apr 26 '21 06:04 Joimer

Does it happen to some specific token? Just tried with random token from BSCscan (0x49277cc5be56b519901e561096bfd416277b4f6d) and it didn't go blank 🤔

Chef-Cheems avatar Apr 26 '21 06:04 Chef-Cheems

Yep, I am testing with this token 0x49bb32eBdBD70468f809c434746c2Fc2Af1fF9e7 that has the V2 router

Joimer avatar Apr 26 '21 06:04 Joimer

I cloned to test in local using mainnet and I could interact with the UI without this problem, so it may be something that's not happening on master upstream.

Joimer avatar Apr 26 '21 14:04 Joimer