Desired overflow in Uniswap pair
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 218
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
### What is wrong?
There is a [section](https://github.com/Uniswap/uniswap-v2-core/blob/4dd59067c76dea4a0e8e4bfdda41877a6b16dedc/contracts/UniswapV2Pair.sol#L76-L80) of the Uniswap pair contract that claims to desire overflow. Numbers in Fe revert on over/underflow
by default, so our implementation may not be correct.
### How can it be fixed
- understand what's going on here
- either a.) do what's described [here](https://github.com/ethereum/fe/pull/179#discussion_r586568120) or b.) use modulo arithmetic to reproduce overflow.
Contributor guide
No contributing guide indexed for this repository
Research direction
Read the referenced UniswapV2Pair.sol section at lines 76-80 and the linked Fe pull request discussion. Trace how Fe handles arithmetic overflow and underflow, then determine whether the implementation should support the described behavior or modulo arithmetic, with tests demonstrating the chosen semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, solidity
- Domain
- blockchain, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100