Skip to content

ilovejs/uniswap-v1-mz

Repository files navigation

Warnings [how to run]

branch mathc-v1 utilize vyper 0.2.12

If pip can't find 0.2.12, just git clone then python setup.py install locally.

Env:

mac
python3.6

I'm in 2021, Why I upgrade uniswap that was written in 2019 ?

Because:

Old toolchain not compile, 1.x vyper has lots of bugs, missing types when run..

My mac won't install old version 0.1.x vyper...

There is not easy sandbox to test contract in python DSL (vyper...)

I can practice rewriting ERC20, Uniswap a bit like I did here !

Why v1 is bad

In whitepaper,

"Uniswap can be frontrun to some extent. This is bounded by user set minimum/maximum values and transaction deadlines"

Future

read pdf in root dir

VB original idea with my comments.

whitepaper has more examples

reading best sol practice

formal-verification proof, math


Installation:

Requires Python 3

  1. Clone Uniswap
$ git clone https://github.com/Uniswap/contracts-vyper
$ cd contracts-vyper
  1. Setup virtual environment
$ pip3 install virtualenv
$ virtualenv -p python3 env
$ source env/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. (Optional) Switch Vyper compiler to version used in Uniswap verification
cd vyper
git reset --hard 35038d20bd9946a35261c4c4fbcb27fe61e65f78
cd ..
  1. Run tests
$ pytest -v tests/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published