Skip to content

Commit

Permalink
Restructure files and get dependencies right.
Browse files Browse the repository at this point in the history
fixed CREATE2 hash

README
  • Loading branch information
laalaguer committed Mar 10, 2021
1 parent f53f65f commit f389b2f
Show file tree
Hide file tree
Showing 131 changed files with 33,542 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This is a fork of several repositories from https://github.com/Uniswap/

All tests passed.

## `main` branch

Change Variable names, CREATE2 hash. But “chainId()” OPCODE call remains the same + Compiler option `istanbul` remain the same.

This will NOT enable to be run on VeChain now because the EVM doesn't support it, yet.

But eventually it is the unified set of code that is deployed on VeChain after the EVM support is in place.

## `testnet` and `mainnet` branch
Based on `tweak` branch.

Specific tweak: “chainId” tweak (fixed value), for different branches “testnet” and “mainnet”, + Constantinpole change for Istanbul + CREATE2 hash change.
1 change: 1 addition & 0 deletions uniswap-lib/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
57 changes: 57 additions & 0 deletions uniswap-lib/.github/workflows/fuzz-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Fuzz Testing

on:
push:
branches:
- master
pull_request:

jobs:
echidna:
name: Echidna
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 12

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install node dependencies
run: yarn

- name: Install slither
run: |
python -m pip install --upgrade pip
pip3 install slither-analyzer
# workaround for https://github.com/crytic/crytic-compile/issues/113
- name: Install solc
run: |
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.6.12/solc-static-linux
sudo chmod +x /usr/bin/solc
- name: Install echidna
run: |
sudo wget -O /tmp/echidna-test.tar.gz https://github.com/crytic/echidna/releases/download/v1.5.1/echidna-test-v1.5.1-Ubuntu-18.04.tar.gz
sudo tar -xf /tmp/echidna-test.tar.gz -C /usr/bin
sudo chmod +x /usr/bin/echidna-test
- name: BabylonianEchidnaTest
run: |
echidna-test . --contract BabylonianEchidnaTest --config echidna.config.yml
- name: BitMathEchidnaTest
run: |
echidna-test . --contract BitMathEchidnaTest --config echidna.config.yml
- name: FullMathEchidnaTest
run: |
echidna-test . --contract FullMathEchidnaTest --config echidna.config.yml
32 changes: 32 additions & 0 deletions uniswap-lib/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint

on:
push:
branches:
- master
pull_request_target:

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: yarn

- name: Run linters
uses: wearerequired/lint-action@feature/pull_request_target
with:
github_token: ${{ secrets.github_token }}
prettier: true
auto_fix: true
prettier_extensions: 'css,html,js,json,jsx,md,sass,scss,ts,tsx,vue,yaml,yml,sol'
43 changes: 43 additions & 0 deletions uniswap-lib/.github/workflows/mythril.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Mythril

on:
push:
branches:
- master
pull_request:

jobs:
mythril:
name: Mythril
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 12

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install node dependencies
run: yarn install --frozen-lockfile

- name: Install solc
run: |
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.6.12/solc-static-linux
sudo chmod +x /usr/bin/solc
- name: Flatten contracts
run: yarn waffle flatten

- name: Install mythril
run: |
pip3 install mythril
- name: Run mythril
run: myth analyze flatten/BabylonianEchidnaTest.sol:BabylonianEchidnaTest
42 changes: 42 additions & 0 deletions uniswap-lib/.github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Static Analysis

on:
push:
branches:
- master
pull_request:

jobs:
slither:
name: Slither
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v1
with:
node-version: 12

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install node dependencies
run: yarn

- name: Install slither
run: |
python -m pip install --upgrade pip
pip3 install slither-analyzer
# workaround for https://github.com/crytic/crytic-compile/issues/113
- name: Install solc
run: |
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.6.12/solc-static-linux
sudo chmod +x /usr/bin/solc
- name: Run slither
run: slither . --waffle-config waffle.json --compile-force-framework Waffle
32 changes: 32 additions & 0 deletions uniswap-lib/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Tests

on:
push:
branches:
- master
pull_request:

jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- uses: actions/setup-node@v1
with:
node-version: 12.x

- id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- run: yarn
- run: yarn test
107 changes: 107 additions & 0 deletions uniswap-lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

build/
flatten/
6 changes: 6 additions & 0 deletions uniswap-lib/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extension": ["ts"],
"spec": "./test/**/*.spec.ts",
"require": "ts-node/register",
"timeout": 12000
}
5 changes: 5 additions & 0 deletions uniswap-lib/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120
}
6 changes: 6 additions & 0 deletions uniswap-lib/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}
Loading

0 comments on commit f389b2f

Please sign in to comment.