Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronise master with dev #343

Merged
merged 103 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
e1966fa
contracts file path must be first for transform
japerk Apr 25, 2022
81ad88c
auto-clean: first draft implementation
elopez Nov 27, 2022
30c8e55
Split CompilationUnit into CompilationUnit + SourceUnit
montyly Dec 5, 2022
b2b264c
Merge branch 'dev-38' into dev-source-unit
montyly Dec 5, 2022
256f04d
Fix darglint
montyly Dec 5, 2022
7e47170
Merge branch 'dev' into dev-source-unit
montyly Dec 6, 2022
ab436a3
hardhat: revert changes
elopez Dec 13, 2022
02cc1df
auto-clean: clean up dapp and hardhat implementations with a helper
elopez Dec 13, 2022
9e786ac
Merge remote-tracking branch 'upstream/dev' into dev-auto-clean
elopez Dec 13, 2022
1dc0cbf
ci: update actions to the latest versions
elopez Dec 13, 2022
70752e3
Actions: enable dependabot version updates
elopez Nov 23, 2022
cf3bfd0
auto-clean: fix typing errors and lint warnings
elopez Dec 13, 2022
7f7047b
lint scripts
Dec 15, 2022
be1fdb9
add test for monorepops
Dec 15, 2022
04d6733
add some test artifacts to gitignore
Dec 15, 2022
ed9a6f8
implement hacky fix for monorepo issue
Dec 15, 2022
82dce8a
cryticparser: add missing brownie and foundry arguments
elopez Dec 16, 2022
69cf42c
cryticparser: rename misleading variables
elopez Dec 16, 2022
cb067dd
cryticparser: start names with caps
elopez Dec 16, 2022
d920853
implement correct fix for node_modules resolution
Dec 16, 2022
9dc45fd
bump version
Dec 16, 2022
32c03dd
Revert "lint scripts"
Dec 16, 2022
b05bb0a
use python 3.8 in CI
Dec 16, 2022
570176a
Merge branch 'dev' into node-module-resolution
Dec 16, 2022
f995aec
Merge branch 'dev' into node-module-resolution
Dec 16, 2022
5afa62c
check cwd node_modules
Dec 16, 2022
3ca1c8c
harden monorepo tests
Dec 16, 2022
98db0cb
refactor fix to use fewer statements
Dec 16, 2022
8172da5
Merge pull request #322 from crytic/dev-misc-actions
montyly Dec 20, 2022
28ce1e7
Merge pull request #323 from crytic/dev-fix-foundry-options
montyly Dec 20, 2022
6c13bcc
add metadata parsing + removal from bytecode
Oct 28, 2022
f3994a1
rerun black
Oct 31, 2022
661539e
fix pylint error
Nov 2, 2022
cf148ea
fix comments
Nov 4, 2022
ff92c5a
add ci test for metadata parsing
Dec 21, 2022
36d73e9
fix
Dec 21, 2022
f16340e
use separate python file
Dec 21, 2022
8612a25
fix
Dec 21, 2022
b002639
try fix
Dec 21, 2022
80276e5
test
Dec 21, 2022
a468802
Merge branch 'dev' into node-module-resolution
Dec 21, 2022
d14f59f
rm unnecessary elif
Dec 21, 2022
cdadc24
disable too-many-statements pylint rule
Dec 21, 2022
bc7c024
Fix pylint
montyly Dec 22, 2022
1a3c98d
Merge branch 'dev' into dev-source-unit
montyly Dec 22, 2022
9d52a5f
Merge pull request #316 from crytic/dev-source-unit
montyly Dec 22, 2022
3e55744
Merge branch 'dev' into fix-metadata-issue
montyly Dec 22, 2022
bebe2e9
Use pytest + minor improvements
montyly Dec 22, 2022
56fd5f5
Minor
montyly Dec 22, 2022
567ffb0
Merge pull request #324 from crytic/node-module-resolution
montyly Dec 22, 2022
99c0288
Merge pull request #304 from crytic/fix-metadata-issue
montyly Dec 22, 2022
e726dd0
support multiple compilation units for foundry
0xalpharush Jan 2, 2023
6708c58
pylint
0xalpharush Jan 2, 2023
4b7e6fa
Refactor filenames/filenames_lookup
montyly Jan 3, 2023
80b2848
Merge pull request #336 from crytic/dev-filenames-lookup
montyly Jan 3, 2023
1bde2bf
Actions: replace deprecated set-output
elopez Jan 3, 2023
bbaf905
Actions: update setup-node, setup-python, checkout
elopez Jan 3, 2023
69e6f18
Fix linting warnings and errors
elopez Jan 3, 2023
7e830e0
Fix incorrect import of 0.0.2 format
montyly Jan 3, 2023
74c0c8d
Add test
montyly Jan 4, 2023
d60119c
Minor
montyly Jan 4, 2023
43d9f41
Minor
montyly Jan 4, 2023
4ee6d3b
Refactor copy/paste logic
montyly Jan 4, 2023
d890670
pylint
montyly Jan 4, 2023
ba44500
Merge pull request #337 from crytic/dev-actions-dep-warning-cleanup
montyly Jan 5, 2023
2cd29fc
Fix darglint
montyly Jan 5, 2023
7a7c56b
ci: etherscan: sleep briefly when the API key is not available
elopez Jan 5, 2023
30333e5
ci: pass GITHUB_TOKEN to tests
elopez Jan 5, 2023
94a80d6
Merge pull request #340 from crytic/dev-fix-import-0.0.2
montyly Jan 5, 2023
9c52b54
Merge branch 'dev' into dev-auto-clean
Jan 5, 2023
3ea6558
ci: etherscan: de-randomize sleep
elopez Jan 5, 2023
fd9cdc6
set check=true on subprocess cmd runner
Jan 5, 2023
08f1f79
auto-clean: improve subprocess handling
elopez Dec 14, 2022
ee3cbeb
auto-clean: expose skip_clean config
elopez Dec 14, 2022
0b03f41
Merge branch 'master' into dev
montyly Jan 6, 2023
1b08cef
Merge remote-tracking branch 'upstream/dev' into dev-auto-clean
elopez Jan 6, 2023
441cabd
Merge pull request #342 from elopez/dev-fix-etherscan-brownie
montyly Jan 6, 2023
23f5694
Merge branch 'dev' into creyzies_fix
Jan 6, 2023
bc07da5
rm trailing whitespace
Jan 6, 2023
6a18ffb
Fixed solc
joevanloon Jan 2, 2023
4b4de6d
Update solc.py
joevanloon Jan 3, 2023
ca1296e
Fixed linter issues
joevanloon Jan 4, 2023
cd52336
reformat via black
Jan 6, 2023
aebea8d
Merge pull request #345 from bohendo/creyzies_fix
montyly Jan 9, 2023
5af9cbb
Merge pull request #346 from bohendo/master
montyly Jan 9, 2023
8b12dce
Update doc
montyly Jan 9, 2023
25c1245
Try to help mypy
montyly Jan 9, 2023
6e2f404
Merge branch 'dev' into foundry-multiple-compilation-units-mypy
montyly Jan 9, 2023
fe7aadf
Merge pull request #312 from crytic/dev-auto-clean
montyly Jan 9, 2023
570baea
:Merge branch 'dev' into foundry-multiple-compilation-units-mypy
montyly Jan 9, 2023
7a15010
Improve support for new standard format
montyly Jan 9, 2023
f464090
Fix pylint
montyly Jan 9, 2023
6041a51
Minor
montyly Jan 9, 2023
b94bdac
Minor
montyly Jan 9, 2023
5466633
Change priority hardhat <> foundry
montyly Jan 9, 2023
719ffe3
Decode debugging and error output with backslashreplace
elopez Jan 9, 2023
a2662cb
Merge pull request #351 from crytic/dev-fix-error-decode
montyly Jan 10, 2023
2e5b7ca
surface stderr/ errors from solc-select
0xalpharush Jan 10, 2023
82320e1
remove print
0xalpharush Jan 10, 2023
fe27372
Merge pull request #348 from crytic/foundry-multiple-compilation-unit…
montyly Jan 10, 2023
bcc4293
Merge pull request #353 from crytic/output-solc-stderr
montyly Jan 10, 2023
29b6c9d
Merge pull request #350 from crytic/hardhat-foundry
montyly Jan 11, 2023
aad5d41
Merge pull request #349 from crytic/dev-standard-fix
montyly Jan 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

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

Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-2022"]
type: ["brownie", "buidler", "dapp", "embark", "etherlime", "hardhat", "solc", "truffle", "waffle", "foundry"]
type: ["brownie", "buidler", "dapp", "embark", "etherlime", "hardhat", "solc", "truffle", "waffle", "foundry", "standard"]
exclude:
# Currently broken, tries to pull git:// which is blocked by GH
- type: embark
Expand All @@ -39,17 +39,17 @@ jobs:
id: node
shell: bash
run: |
if [ ${{ matrix.type }} = etherlime ]; then
echo '::set-output name=version::10.17.0'
if [ "${{ matrix.type }}" = "etherlime" ]; then
echo 'version=10.17.0' >> "$GITHUB_OUTPUT"
else
echo '::set-output name=version::lts/*'
echo 'version=lts/*' >> "$GITHUB_OUTPUT"
fi
- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ steps.node.outputs.version }}
- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
Expand All @@ -59,16 +59,17 @@ jobs:
pip install .
- name: Set up nix
if: matrix.type == 'dapp'
uses: cachix/install-nix-action@v16
uses: cachix/install-nix-action@v18
- name: Set up cachix
if: matrix.type == 'dapp'
uses: cachix/cachix-action@v10
uses: cachix/cachix-action@v12
with:
name: dapp
- name: Run Tests
env:
TEST_TYPE: ${{ matrix.type }}
GITHUB_ETHERSCAN: ${{ secrets.GITHUB_ETHERSCAN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
bash "scripts/ci_test_${TEST_TYPE}.sh"
4 changes: 2 additions & 2 deletions .github/workflows/darglint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Run Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/etherscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
echo 'C:\msys64\mingw64\bin' >> "$GITHUB_PATH"
echo 'C:\msys64\usr\bin' >> "$GITHUB_PATH"
- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

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

Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Pytest

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

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

jobs:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8

# Used by ci_test.sh
- name: Install dependencies
run: |
python setup.py install
pip install pytest
pip install solc-select
- name: Run Tests
run: |
pytest tests/test_metadata.py
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
*.nix
*.pyc
.idea/
crytic_compile.egg-info/
__pycache__/
*.pyc
artifacts
build/
dist/
cache
crytic_compile.egg-info/
dist/
node_modules
package-lock.json
result
7 changes: 4 additions & 3 deletions crytic_compile/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from crytic_compile.crytic_compile import compile_all, get_platforms
from crytic_compile.cryticparser import DEFAULTS_FLAG_IN_CONFIG, cryticparser
from crytic_compile.platform import InvalidCompilation
from crytic_compile.platform.all_export import PLATFORMS_EXPORT
from crytic_compile.utils.zip import ZIP_TYPES_ACCEPTED, save_to_zip

if TYPE_CHECKING:
Expand Down Expand Up @@ -50,8 +51,8 @@ def parse_args() -> argparse.Namespace:

parser.add_argument(
"--export-format",
help="""Export json with non crytic-compile format
(default None. Accepted: standard, solc, truffle)""",
help=f"""Export json with non crytic-compile format
(default None. Accepted: ({", ".join(list(PLATFORMS_EXPORT))})""",
action="store",
dest="export_format",
default=None,
Expand Down Expand Up @@ -172,7 +173,7 @@ def _print_filenames(compilation: "CryticCompile") -> None:
"""
for compilation_id, compilation_unit in compilation.compilation_units.items():
print(
f"Compilation unit: {compilation_id} ({len(compilation_unit.contracts_names)} files, solc {compilation_unit.compiler_version.version})"
f"Compilation unit: {compilation_id} solc {compilation_unit.compiler_version.version})"
)
for filename, contracts in compilation_unit.filename_to_contracts.items():
for contract in contracts:
Expand Down
Loading