Uniswap / Uniswap/interface

Crash report: `RangeError: Division by zero`

Open
#3,604 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?outputCurrency=0x9cc2eE94a0daC9E6cEC38E73cc51B35e1bcCbdA1

swap state

{
  "INPUT": {
    "currencyId": "ETH"
  },
  "OUTPUT": {
    "currencyId": "0x9cc2eE94a0daC9E6cEC38E73cc51B35e1bcCbdA1"
  },
  "independentField": "OUTPUT",
  "typedValue": "0.",
  "recipient": null
}

Error

RangeError: Division by zero

Stacktrace

RangeError: Division by zero
    at Function.value (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:37715)
    at t.get (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:64839)
    at new t (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:65184)
    at Function.t.fromFractionalAmount (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:65401)
    at t.n.divide (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:66003)
    at https://app.uniswap.org/static/js/main.d86699df.chunk.js:1:729905
    at Array.map (<anonymous>)
    at iS (https://app.uniswap.org/static/js/main.d86699df.chunk.js:1:729754)
    at https://app.uniswap.org/static/js/main.d86699df.chunk.js:1:729399
    at ua (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:1348185)

Device data

{
  "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "99.0.4844.74",
    "major": "99"
  },
  "engine": {
    "name": "Blink",
    "version": "99.0.4844.74"
  },
  "os": {
    "name": "Windows",
    "version": "10"
  },
  "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 provided app URL using the recorded swap state, then inspect the stack trace entries in the deployed static JavaScript chunks, especially the call through fromFractionalAmount and divide. Done means this zero-valued input no longer crashes the swap interface; the payload names no source files or tests to run.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.