[BUG] Uniswap can not work with 256bit unsigned int tokens
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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