Uniswap / Uniswap/interface

[BUG] Uniswap can not work with 256bit unsigned int tokens

Open
#7,825 5 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

Ive been playing around with some tokens and tried making a token where the total supply is 1 with 76 decimal places. (The maxium amount that can be stored in a 256 uint)
10000000000000000000000000000000000000000000000000000000000000000000000000000

Upon attempting to create a pool on uniswap for this, it would not work, kept giving invalid price errors, price out of range or just unknown error.

I did some further investigating and found 38 decimal places worked find, this convineantly is the maximum amount in a 128 bit uint.
100000000000000000000000000000000000000

As smart contracts and the ERC20 token standard uses the 256uint, uniswap should fully support 256bit uints. But it looks like you guys decided to only support 128bit uints.

I checked V2 and V3 both cant handle a full 256bit uint token.

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 pool creation with the reported 76-decimal and 38-decimal token supplies, then trace the invalid-price, out-of-range, and unknown-error paths in the interface. Compare behavior for Uniswap V2 and V3; done means a token using the full 256-bit unsigned range can create a pool without these errors.

Written by the indexing model from the issue text.

Assessment

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