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

Commit fbcd675

Browse files
committed
Public release
1 parent dc71090 commit fbcd675

File tree

817 files changed

+243827
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

817 files changed

+243827
-1
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
body:
3+
-
4+
attributes:
5+
value: |
6+
Please check the issues tab to avoid duplicates.
7+
If you are having difficulty installing diffusc,
8+
please head over to the "Discussions" page.
9+
Thanks for taking the time to fill out this bug report!
10+
type: markdown
11+
-
12+
attributes:
13+
label: "Describe the issue:"
14+
id: what-happened
15+
type: textarea
16+
validations:
17+
required: true
18+
-
19+
attributes:
20+
description: "It can be a github repo, etherscan link, or code snippet."
21+
label: "Code example to reproduce the issue:"
22+
placeholder: "`contract V1 {}`\n`contract V2 {}`\n"
23+
id: reproduce
24+
type: textarea
25+
validations:
26+
required: true
27+
-
28+
attributes:
29+
description: |
30+
What version of diffusc are you running?
31+
Run `diffusc --version`
32+
label: "Version:"
33+
id: version
34+
type: textarea
35+
validations:
36+
required: true
37+
-
38+
attributes:
39+
description: |
40+
Please copy and paste any relevant log output. This
41+
will be automatically formatted into code, so no need for backticks.
42+
render: shell
43+
label: "Relevant log output:"
44+
id: logs
45+
type: textarea
46+
description: "File a bug report"
47+
labels:
48+
- bug-candidate
49+
name: "Bug Report"
50+
title: "[Bug-Candidate]: "
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
description: Suggest a feature
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please check the issues tab to avoid duplicates.
10+
11+
Thanks for providing feedback on Diffusc!
12+
- type: textarea
13+
attributes:
14+
label: Describe the desired feature
15+
description: Explain what the feature solves/ improves.
16+
validations:
17+
required: true
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Derived from <https://github.com/pyca/cryptography/blob/SOME_REF/.github/actions/upload-coverage/action.yml>
2+
# Originally authored by the PyCA Cryptography maintainers, and licensed under
3+
# the terms of the BSD license:
4+
# <https://github.com/pyca/cryptography/blob/main/LICENSE.BSD>
5+
6+
name: Upload Coverage
7+
description: Upload coverage files
8+
9+
runs:
10+
using: "composite"
11+
12+
steps:
13+
# FIXME(jl): codecov has the option of including machine information in filename that would solve this unique naming
14+
# issue more completely.
15+
# This method has the limitation of 1 coverage file per run, limiting some coverage between online/offline tests.
16+
- run: |
17+
COVERAGE_UUID=$(python3 -c "import uuid; print(uuid.uuid4())")
18+
echo "COVERAGE_UUID=${COVERAGE_UUID}" >> $GITHUB_OUTPUT
19+
if [ -f .coverage ]; then
20+
mv .coverage .coverage.${COVERAGE_UUID}
21+
fi
22+
id: coverage-uuid
23+
shell: bash
24+
- uses: actions/[email protected]
25+
with:
26+
name: coverage-data
27+
path: |
28+
.coverage.*
29+
*.lcov
30+
if-no-files-found: ignore

.github/scripts/unit_test_runner.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# used to pass --cov=$path and --cov-append to pytest
4+
if [ "$1" != "" ]; then
5+
pytest "$1" diffusc/tests/
6+
status_code=$?
7+
python -m coverage report
8+
else
9+
pytest diffusc/tests/
10+
status_code=$?
11+
fi
12+
13+
exit "$status_code"

.github/workflows/black.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: Run black
3+
4+
defaults:
5+
run:
6+
# To load bashrc
7+
shell: bash -ieo pipefail {0}
8+
9+
on:
10+
pull_request:
11+
branches: [main, dev]
12+
paths:
13+
- "**/*.py"
14+
schedule:
15+
# run CI every day even if no PRs/merges occur
16+
- cron: '0 12 * * *'
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
build:
24+
name: Black
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout Code
29+
uses: actions/checkout@v3
30+
with:
31+
# Full git history is needed to get a proper list of changed files within `super-linter`
32+
fetch-depth: 0
33+
34+
- name: Setup Python 3.10
35+
uses: actions/setup-python@v4
36+
with:
37+
python-version: '3.10'
38+
39+
- name: Install dependencies
40+
run: |
41+
mkdir -p .github/linters
42+
cp pyproject.toml .github/linters
43+
44+
- name: Black
45+
uses: github/super-linter/[email protected]
46+
if: always()
47+
env:
48+
# run linter on everything to catch preexisting problems
49+
VALIDATE_ALL_CODEBASE: true
50+
DEFAULT_BRANCH: main
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
# Run only black
53+
VALIDATE_PYTHON_BLACK: true
54+
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
55+
FILTER_REGEX_EXCLUDE: .*tests/.*.(json|zip|sol)

.github/workflows/ci-fork-mode.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Diffusc (fork mode)
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- "**.md"
7+
- "**.rs"
8+
branches:
9+
- main
10+
pull_request:
11+
schedule:
12+
# run CI every day even if no PRs/merges occur
13+
- cron: '0 12 * * *'
14+
15+
jobs:
16+
tests:
17+
name: ${{ matrix.name }}
18+
runs-on: ubuntu-22.04
19+
strategy:
20+
fail-fast: false
21+
max-parallel: 2
22+
matrix:
23+
include:
24+
- name: Safemoon
25+
args: 0x0296201bfdfb410c29ef30bcae1b395537aeeb31 0xEb11a0a0beF1AC028B8C2d4CD64138DD5938cA7A -p 0x42981d0bfbAf196529376EE702F2a9Eb9092fcB5 -n bsc -v 0.8.11
26+
block: 26857408
27+
rpckey: BSC_RPC_URL
28+
apikey: BSC_API_KEY
29+
30+
# - name: Compound
31+
# args: 0x75442Ac771a7243433e033F3F8EaB2631e22938f 0x374ABb8cE19A73f2c4EFAd642bda76c797f19233 -t 0x6C8c6b02E7b2BE14d4fA6022Dfd6d75921D90E4E,0xc00e94Cb662C3520282E6f5717214004A7f26888 -p 0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B -u -v 0.8.10 -T --token-holder 0x309d413391e975B553B7B8D19bC11F8a6c2eB889
32+
# block: 13322797
33+
# rpckey: ETHEREUM_RPC_URL
34+
# apikey: ETHEREUM_API_KEY
35+
36+
- name: AnkrRewardEarningBNB
37+
args: 0xE380B02b16e050c2801CcA83461916FEca652ecF 0x952398318838b4915ee5E800622a9613887759f5 -p 0xfe39985D7eFF914c50A06bA0cFfcCA8361e00C0e -t 0x52F24a5e03aee338Da5fd9Df68D2b6FAe1178827:0x2c00CE1a935FF8c9e78580533e2E17c36281c26E -T -n bsc -v 0.8.16
38+
block: 28261629
39+
rpckey: BSC_RPC_URL
40+
apikey: BSC_API_KEY
41+
42+
- name: DeusFinanceDEI
43+
args: 0x1472b3081d81b792e697aea90accbbc4adc5baf9 0xbc1b62db243b51dabcd9540473324f36e094ec55 -p 0xde1e704dae0b4051e80dabb26ab6ad6c12262da0 -n arbi -v 0.8.4
44+
block: 87626025
45+
rpckey: ARBITRUM_RPC_URL
46+
apikey: ARBITRUM_API_KEY
47+
48+
# - name: ExactlyRewardController
49+
# args: 0x3a31a7e94b30bd92151b4711522f118902977c3c 0xc91dc7a797cd5fbcf6f334c792a2b24eff55292c -p 0xBd1ba78A3976cAB420A9203E6ef14D18C2B2E031 -t 0x81C9A7B55A4df39A9B7B5F781ec0e53539694873:0xaec84eac74981ab22905919cb282b78c7ca782df,0xc4d4500326981eacD020e20A81b1c479c161c7EF:0xbd9c70db872fdd9029ee5fa2a0ea30eabf7a1583 -n optim -v 0.8.11
50+
# block: 99811370
51+
# rpckey: OPTIMISM_RPC_URL
52+
# apikey: OPTIMISM_API_KEY
53+
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v3
57+
58+
- name: Setup Python 3.10
59+
uses: actions/setup-python@v4
60+
with:
61+
python-version: '3.10'
62+
63+
- name: Install diffusc
64+
run: |
65+
pip3 install .
66+
sudo cp bin/echidna /usr/local/bin
67+
solc-select install 0.8.17
68+
solc-select use 0.8.17
69+
70+
- name: Restore cached contracts/slots
71+
id: cache-restore
72+
uses: actions/cache/restore@v3
73+
with:
74+
path: |
75+
${{ matrix.name }}/corpus/cache
76+
${{ matrix.name }}/crytic-cache
77+
key: cache=${{ matrix.name }}
78+
79+
- name: Run diffusc
80+
id: prepare
81+
run: |
82+
#rm -rf crytic-export contracts
83+
diffusc ${{ matrix.args }} -d ${{ matrix.name }} -L 200000 -r
84+
env:
85+
ECHIDNA_RPC_BLOCK: ${{ matrix.block }}
86+
ECHIDNA_RPC_URL: ${{ secrets[matrix.rpckey] }}
87+
ETHERSCAN_API_KEY: ${{ secrets[matrix.apikey] }}
88+
89+
# - name: Save cache
90+
# uses: actions/cache/save@v3
91+
# if: ${{ always() }}
92+
# with:
93+
# path: ${{ matrix.name }}/corpus/cache
94+
# key: ${{ steps.cache-restore.outputs.cache-primary-key }}

.github/workflows/ci-path-mode.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Diffusc (path mode)
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- "**.md"
7+
- "**.rs"
8+
branches:
9+
- main
10+
pull_request:
11+
schedule:
12+
# run CI every day even if no PRs/merges occur
13+
- cron: '0 12 * * *'
14+
15+
jobs:
16+
tests:
17+
name: ${{ matrix.name }}
18+
runs-on: ubuntu-22.04
19+
strategy:
20+
fail-fast: false
21+
max-parallel: 2
22+
matrix:
23+
include:
24+
- name: Safemoon
25+
out: ./contracts/test/safemoon/
26+
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
27+
28+
- name: Compound
29+
out: ./contracts/test/compound
30+
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
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v3
35+
36+
- name: Setup Python 3.10
37+
uses: actions/setup-python@v4
38+
with:
39+
python-version: '3.10'
40+
41+
- name: Install diffusc
42+
run: |
43+
pip3 install .
44+
sudo cp bin/echidna /usr/local/bin
45+
solc-select install 0.8.11
46+
solc-select use 0.8.11
47+
48+
- name: Run diffusc
49+
id: prepare
50+
run: |
51+
diffusc ${{ matrix.args }} -d ${{ matrix.out }} -L 200000 -r

.github/workflows/mypy.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: mypy
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- "**.md"
7+
- "**.rs"
8+
branches:
9+
- main
10+
- dev
11+
pull_request:
12+
schedule:
13+
# run CI every day even if no PRs/merges occur
14+
- cron: '0 12 * * *'
15+
16+
jobs:
17+
build:
18+
name: Run mypy type checking
19+
runs-on: ubuntu-22.04
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v3
24+
25+
- name: Setup Python 3.10
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: '3.10'
29+
30+
- name: Install mypy
31+
run: python3 -m pip install mypy==1.2.0 types-requests
32+
33+
- name: Install dependencies
34+
run: pip3 install -r requirements.txt
35+
36+
- name: Check types
37+
run: mypy diffusc/diffusc.py

0 commit comments

Comments
 (0)