Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit

Permalink
Public release
Browse files Browse the repository at this point in the history
  • Loading branch information
webthethird committed Jul 5, 2023
1 parent dc71090 commit fbcd675
Show file tree
Hide file tree
Showing 817 changed files with 243,827 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
body:
-
attributes:
value: |
Please check the issues tab to avoid duplicates.
If you are having difficulty installing diffusc,
please head over to the "Discussions" page.
Thanks for taking the time to fill out this bug report!
type: markdown
-
attributes:
label: "Describe the issue:"
id: what-happened
type: textarea
validations:
required: true
-
attributes:
description: "It can be a github repo, etherscan link, or code snippet."
label: "Code example to reproduce the issue:"
placeholder: "`contract V1 {}`\n`contract V2 {}`\n"
id: reproduce
type: textarea
validations:
required: true
-
attributes:
description: |
What version of diffusc are you running?
Run `diffusc --version`
label: "Version:"
id: version
type: textarea
validations:
required: true
-
attributes:
description: |
Please copy and paste any relevant log output. This
will be automatically formatted into code, so no need for backticks.
render: shell
label: "Relevant log output:"
id: logs
type: textarea
description: "File a bug report"
labels:
- bug-candidate
name: "Bug Report"
title: "[Bug-Candidate]: "
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
description: Suggest a feature
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Please check the issues tab to avoid duplicates.
Thanks for providing feedback on Diffusc!
- type: textarea
attributes:
label: Describe the desired feature
description: Explain what the feature solves/ improves.
validations:
required: true
30 changes: 30 additions & 0 deletions .github/actions/upload-coverage/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Derived from <https://github.com/pyca/cryptography/blob/SOME_REF/.github/actions/upload-coverage/action.yml>
# Originally authored by the PyCA Cryptography maintainers, and licensed under
# the terms of the BSD license:
# <https://github.com/pyca/cryptography/blob/main/LICENSE.BSD>

name: Upload Coverage
description: Upload coverage files

runs:
using: "composite"

steps:
# FIXME(jl): codecov has the option of including machine information in filename that would solve this unique naming
# issue more completely.
# This method has the limitation of 1 coverage file per run, limiting some coverage between online/offline tests.
- run: |
COVERAGE_UUID=$(python3 -c "import uuid; print(uuid.uuid4())")
echo "COVERAGE_UUID=${COVERAGE_UUID}" >> $GITHUB_OUTPUT
if [ -f .coverage ]; then
mv .coverage .coverage.${COVERAGE_UUID}
fi
id: coverage-uuid
shell: bash
- uses: actions/[email protected]
with:
name: coverage-data
path: |
.coverage.*
*.lcov
if-no-files-found: ignore
13 changes: 13 additions & 0 deletions .github/scripts/unit_test_runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# used to pass --cov=$path and --cov-append to pytest
if [ "$1" != "" ]; then
pytest "$1" diffusc/tests/
status_code=$?
python -m coverage report
else
pytest diffusc/tests/
status_code=$?
fi

exit "$status_code"
55 changes: 55 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Run black

defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}

on:
pull_request:
branches: [main, dev]
paths:
- "**/*.py"
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Black
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
mkdir -p .github/linters
cp pyproject.toml .github/linters
- name: Black
uses: github/super-linter/[email protected]
if: always()
env:
# run linter on everything to catch preexisting problems
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Run only black
VALIDATE_PYTHON_BLACK: true
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
FILTER_REGEX_EXCLUDE: .*tests/.*.(json|zip|sol)
94 changes: 94 additions & 0 deletions .github/workflows/ci-fork-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Diffusc (fork mode)

on:
push:
paths-ignore:
- "**.md"
- "**.rs"
branches:
- main
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- name: Safemoon
args: 0x0296201bfdfb410c29ef30bcae1b395537aeeb31 0xEb11a0a0beF1AC028B8C2d4CD64138DD5938cA7A -p 0x42981d0bfbAf196529376EE702F2a9Eb9092fcB5 -n bsc -v 0.8.11
block: 26857408
rpckey: BSC_RPC_URL
apikey: BSC_API_KEY

# - name: Compound
# args: 0x75442Ac771a7243433e033F3F8EaB2631e22938f 0x374ABb8cE19A73f2c4EFAd642bda76c797f19233 -t 0x6C8c6b02E7b2BE14d4fA6022Dfd6d75921D90E4E,0xc00e94Cb662C3520282E6f5717214004A7f26888 -p 0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B -u -v 0.8.10 -T --token-holder 0x309d413391e975B553B7B8D19bC11F8a6c2eB889
# block: 13322797
# rpckey: ETHEREUM_RPC_URL
# apikey: ETHEREUM_API_KEY

- name: AnkrRewardEarningBNB
args: 0xE380B02b16e050c2801CcA83461916FEca652ecF 0x952398318838b4915ee5E800622a9613887759f5 -p 0xfe39985D7eFF914c50A06bA0cFfcCA8361e00C0e -t 0x52F24a5e03aee338Da5fd9Df68D2b6FAe1178827:0x2c00CE1a935FF8c9e78580533e2E17c36281c26E -T -n bsc -v 0.8.16
block: 28261629
rpckey: BSC_RPC_URL
apikey: BSC_API_KEY

- name: DeusFinanceDEI
args: 0x1472b3081d81b792e697aea90accbbc4adc5baf9 0xbc1b62db243b51dabcd9540473324f36e094ec55 -p 0xde1e704dae0b4051e80dabb26ab6ad6c12262da0 -n arbi -v 0.8.4
block: 87626025
rpckey: ARBITRUM_RPC_URL
apikey: ARBITRUM_API_KEY

# - name: ExactlyRewardController
# args: 0x3a31a7e94b30bd92151b4711522f118902977c3c 0xc91dc7a797cd5fbcf6f334c792a2b24eff55292c -p 0xBd1ba78A3976cAB420A9203E6ef14D18C2B2E031 -t 0x81C9A7B55A4df39A9B7B5F781ec0e53539694873:0xaec84eac74981ab22905919cb282b78c7ca782df,0xc4d4500326981eacD020e20A81b1c479c161c7EF:0xbd9c70db872fdd9029ee5fa2a0ea30eabf7a1583 -n optim -v 0.8.11
# block: 99811370
# rpckey: OPTIMISM_RPC_URL
# apikey: OPTIMISM_API_KEY

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install diffusc
run: |
pip3 install .
sudo cp bin/echidna /usr/local/bin
solc-select install 0.8.17
solc-select use 0.8.17
- name: Restore cached contracts/slots
id: cache-restore
uses: actions/cache/restore@v3
with:
path: |
${{ matrix.name }}/corpus/cache
${{ matrix.name }}/crytic-cache
key: cache=${{ matrix.name }}

- name: Run diffusc
id: prepare
run: |
#rm -rf crytic-export contracts
diffusc ${{ matrix.args }} -d ${{ matrix.name }} -L 200000 -r
env:
ECHIDNA_RPC_BLOCK: ${{ matrix.block }}
ECHIDNA_RPC_URL: ${{ secrets[matrix.rpckey] }}
ETHERSCAN_API_KEY: ${{ secrets[matrix.apikey] }}

# - name: Save cache
# uses: actions/cache/save@v3
# if: ${{ always() }}
# with:
# path: ${{ matrix.name }}/corpus/cache
# key: ${{ steps.cache-restore.outputs.cache-primary-key }}
51 changes: 51 additions & 0 deletions .github/workflows/ci-path-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Diffusc (path mode)

on:
push:
paths-ignore:
- "**.md"
- "**.rs"
branches:
- main
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- name: Safemoon
out: ./contracts/test/safemoon/
args: ./diffusc/tests/test_data/safemoon/SafemoonV2.sol ./diffusc/tests/test_data/safemoon/SafemoonV3.sol -p ./diffusc/tests/test_data/safemoon/TransparentProxyTestHarness.sol -v 0.8.11 --run-custom ./contracts/test/safemoon/DiffFuzzCustomInit.sol DiffFuzzInit

- name: Compound
out: ./contracts/test/compound
args: ./contracts/implementation/compound/compound-0.8.10/ComptrollerHarnessV1.sol ./contracts/implementation/compound/compound-0.8.10/ComptrollerHarnessV2.sol -t ./contracts/implementation/compound/compound-0.8.10/CErc20.sol,./contracts/implementation/compound/compound-0.8.10/CompHarness.sol -p ./contracts/implementation/compound/compound-0.8.10/Unitroller.sol -u -v 0.8.10 --run-custom ./contracts/test/compound/DiffFuzzCustomInit.sol DiffFuzzCustomInit

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install diffusc
run: |
pip3 install .
sudo cp bin/echidna /usr/local/bin
solc-select install 0.8.11
solc-select use 0.8.11
- name: Run diffusc
id: prepare
run: |
diffusc ${{ matrix.args }} -d ${{ matrix.out }} -L 200000 -r
37 changes: 37 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: mypy

on:
push:
paths-ignore:
- "**.md"
- "**.rs"
branches:
- main
- dev
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'

jobs:
build:
name: Run mypy type checking
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install mypy
run: python3 -m pip install mypy==1.2.0 types-requests

- name: Install dependencies
run: pip3 install -r requirements.txt

- name: Check types
run: mypy diffusc/diffusc.py
Loading

0 comments on commit fbcd675

Please sign in to comment.