Uniswap / Uniswap/interface

Crash report: `Error: Could not parse fraction`

Open
#6,798 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

URL

https://app.cbswap.io/#/swap

swap state

{
  "INPUT": {
    "currencyId": "ETH"
  },
  "OUTPUT": {
    "currencyId": "0xd79C2210E3C925C054deA19A228a813954B193eA"
  },
  "independentField": "INPUT",
  "typedValue": "0.5",
  "recipient": null
}

Error

Error: Could not parse fraction

Stacktrace

Error: Could not parse fraction
    at e.tryParseFraction (https://app.cbswap.io/static/js/35.d07a2196.chunk.js:2:61996)
    at t.lessThan (https://app.cbswap.io/static/js/35.d07a2196.chunk.js:2:62779)
    at e.maximumAmountIn (https://app.cbswap.io/static/js/35.d07a2196.chunk.js:2:325953)
    at ee (https://app.cbswap.io/static/js/main.e85514f8.chunk.js:1:971098)
    at el (https://app.cbswap.io/static/js/main.e85514f8.chunk.js:1:867617)
    at ua (https://app.cbswap.io/static/js/35.d07a2196.chunk.js:2:1441766)
    at Ha (https://app.cbswap.io/static/js/35.d07a2196.chunk.js:2:1451333)
    at Xu (https://app.cbswap.io/static/js/35.d07a2196.chunk.js:2:1495057)
    at Ms (https://app.cbswap.io/static/js/35.d07a2196.chunk.js:2:1481307)
    at As (https://app.cbswap.io/static/js/35.d07a2196.chunk.js:2:1481235)

Device data

{
  "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "112.0.0.0",
    "major": "112"
  },
  "engine": {
    "name": "Blink",
    "version": "112.0.0.0"
  },
  "os": {
    "name": "Linux",
    "version": "x86_64"
  },
  "device": {},
  "cpu": {
    "architecture": "amd64"
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the swap state at https://app.cbswap.io/#/swap with ETH, the listed output currency, and typed value 0.5. Then locate the source equivalents of tryParseFraction, lessThan, and maximumAmountIn referenced by the stack trace; done means the same swap no longer crashes and a regression test covers the failing case.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.