Uniswap / Uniswap/interface

Crash report: `RangeError: Division by zero`

Open
#3,249 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": "0xaD6D458402F60fD3Bd25163575031ACDce07538D"
  },
  "OUTPUT": {
    "currencyId": "0x74424a1E4cE41229401f38cE7c3e69a6A190e857"
  },
  "independentField": "OUTPUT",
  "typedValue": "10",
  "recipient": null
}

Error

RangeError: Division by zero

Stacktrace

value@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:38198
get@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:64873
t@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:65196
t.fromFractionalAmount@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:65441
n.divide@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:66055
939/Jf</c<@https://app.uniswap.org/static/js/main.ee9b8398.chunk.js:1:765380
939/Jf</c<@https://app.uniswap.org/static/js/main.ee9b8398.chunk.js:1:765213
939/Jf<@https://app.uniswap.org/static/js/main.ee9b8398.chunk.js:1:765579
oa@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3008935
Ha@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3018502
za@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3017834
Ua@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3017489
Ko@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3064486
Cu@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3048478
Pu@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3048406
xu@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3048267
wu@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3045233
Qf/<@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:2994727
t.unstable_runWithPriority@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3071964
Xf@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:2994504
Qf@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:2994674
Kf@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:2994607
bu@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3042610
Ca@https://app.uniswap.org/static/js/35.8c2ca95e.chunk.js:2:3014262
130/o/</n<@https://app.uniswap.org/static/js/main.ee9b8398.chunk.js:1:29355

Device data

{
  "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:96.0) Gecko/20100101 Firefox/96.0",
  "browser": {
    "name": "Firefox",
    "version": "96.0",
    "major": "96"
  },
  "engine": {
    "name": "Gecko",
    "version": "96.0"
  },
  "os": {
    "name": "Mac OS",
    "version": "10.15"
  },
  "device": {},
  "cpu": {}
}

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 provided Uniswap swap URL using the recorded swap state, browser, and Ropsten chain. Start by tracing the minified stack frames in static/js/35.8c2ca95e.chunk.js and main.ee9b8398.chunk.js back to the swap calculation path. Done means this state no longer throws a division-by-zero error and the affected swap flow remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, 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.