Uniswap / Uniswap/interface

Crash report: `RangeError: Division by zero`

Open
#3,308 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.uniswap.org/#/swap?chain=ropsten

swap state

{
  "INPUT": {
    "currencyId": "0xb1c39C8D4c284f7bfCb839fb551e0ee49c8Afb81"
  },
  "OUTPUT": {
    "currencyId": "ETH"
  },
  "independentField": "OUTPUT",
  "typedValue": "0.001",
  "recipient": null
}

Error

RangeError: Division by zero

Stacktrace

RangeError: Division by zero
    at Function.value (https://app.uniswap.org/static/js/35.f1b0d140.chunk.js:2:38473)
    at t.get (https://app.uniswap.org/static/js/35.f1b0d140.chunk.js:2:65149)
    at new t (https://app.uniswap.org/static/js/35.f1b0d140.chunk.js:2:65494)
    at Function.fromFractionalAmount (https://app.uniswap.org/static/js/35.f1b0d140.chunk.js:2:65717)
    at t.divide (https://app.uniswap.org/static/js/35.f1b0d140.chunk.js:2:66331)
    at https://app.uniswap.org/static/js/main.0c7dbedf.chunk.js:1:754932
    at Array.map (<anonymous>)
    at https://app.uniswap.org/static/js/main.0c7dbedf.chunk.js:1:754765
    at https://app.uniswap.org/static/js/main.0c7dbedf.chunk.js:1:755131
    at oi (https://app.uniswap.org/static/js/35.f1b0d140.chunk.js:2:3427941)

Device data

{
  "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "98.0.4758.80",
    "major": "98"
  },
  "engine": {
    "name": "Blink",
    "version": "98.0.4758.80"
  },
  "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

Reproduce the crash at the reported swap URL with the supplied swap state, then trace the minified stack through static/js/35.f1b0d140.chunk.js and static/js/main.0c7dbedf.chunk.js. Done means the reported swap state no longer raises Division by zero.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.