Image: github.com · Differential results and gas table
Uniswap v2 rebuilt clean-room from bytecode
Specs recovered from mainnet bytecode with REA, and the Solidity proven equivalent by tests.
Credits
- Repository account devtechedge Source ↗
The full story
This project recovered the Uniswap v2 exchange contracts (factory, pair and Router02) from the code actually running on Ethereum mainnet, using REA. They were then rebuilt clean-room, both as a TypeScript reference model and as Solidity 0.8 contracts. The two were proven to behave the same as the original through 4,800 randomised operations with zero mismatches and 426 replayed real swaps. There's a browser simulator with a price-average chart and a live read-only quote check.
How it was done
Tools
Themes
Loading themes…
Sources
From the maker's own write-up or code. We summarise what they report; we haven't tested it ourselves.
- Awesome REA list: uniswap-v2-rebornRepository account: devtechedge
Source, the equivalence tests and a link to the simulator.