Skip to content

Commit

Permalink
♻️ Refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio committed Aug 27, 2024
1 parent 83e9139 commit 14576fc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/venom-halmos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
schedule:
- cron: "30 3 * * *"
workflow_dispatch:
# To be removed before merging.
# To be removed before merging!
push:

concurrency:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.architecture }}

- name: Activate `venom` backend
- name: Activate Venom backend
run: python scripts/insert_venom_pragma.py

- name: Install Vyper
Expand Down Expand Up @@ -69,24 +69,24 @@ jobs:
- name: Show the Foundry Halmos config
run: forge config
env:
FOUNDRY_PROFILE: venom-halmos
FOUNDRY_PROFILE: halmos-venom

- name: Run Halmos ERC-20 symbolic tests
run: halmos --contract ERC20TestHalmos ${{ matrix.halmos }}
env:
FOUNDRY_PROFILE: venom-halmos
FOUNDRY_PROFILE: halmos-venom

- name: Run Halmos ERC-721 symbolic tests
run: halmos --contract ERC721TestHalmos ${{ matrix.halmos }}
env:
FOUNDRY_PROFILE: venom-halmos
FOUNDRY_PROFILE: halmos-venom

- name: Run Halmos ERC-1155 symbolic tests
run: halmos --contract ERC1155TestHalmos ${{ matrix.halmos }}
env:
FOUNDRY_PROFILE: venom-halmos
FOUNDRY_PROFILE: halmos-venom

- name: Run Halmos math symbolic tests
run: halmos --contract MathTestHalmos ${{ matrix.halmos }}
env:
FOUNDRY_PROFILE: venom-halmos
FOUNDRY_PROFILE: halmos-venom
14 changes: 7 additions & 7 deletions .github/workflows/venom-test-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.architecture }}

- name: Activate `venom` backend
- name: Activate Venom backend
run: python scripts/insert_venom_pragma.py

- name: Install Vyper
Expand Down Expand Up @@ -74,12 +74,12 @@ jobs:
- name: Show the Foundry CI config
run: forge config
env:
FOUNDRY_PROFILE: venom
FOUNDRY_PROFILE: ci-venom

- name: Foundry tests
run: forge test
env:
FOUNDRY_PROFILE: venom
FOUNDRY_PROFILE: ci-venom

- name: Show the Foundry default config
run: forge config
Expand All @@ -103,19 +103,19 @@ jobs:
- name: Show the Foundry Echidna config
run: forge config
env:
FOUNDRY_PROFILE: venom-echidna
FOUNDRY_PROFILE: echidna-venom

- name: Compile the Echidna test contracts
run: forge build --build-info
env:
FOUNDRY_PROFILE: venom-echidna
FOUNDRY_PROFILE: echidna-venom

- name: Run Echidna ERC-20 property tests
run: echidna test/tokens/echidna/ERC20Properties.sol --contract CryticERC20ExternalHarness ${{ matrix.echidna }}
env:
FOUNDRY_PROFILE: venom-echidna
FOUNDRY_PROFILE: echidna-venom

- name: Run Echidna ERC-721 property tests
run: echidna test/tokens/echidna/ERC721Properties.sol --contract CryticERC721ExternalHarness ${{ matrix.echidna }}
env:
FOUNDRY_PROFILE: venom-echidna
FOUNDRY_PROFILE: echidna-venom
22 changes: 10 additions & 12 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,26 @@ evm_version = "shanghai" # Set the EVM t
force = true # Perform always a clean build.
evm_version = "shanghai" # Set the EVM target version to `shanghai`.

#### THE PROFILES BELOW ARE TEMPORARY - WILL DELETE BEFORE MERGING

# Default overrides for the Venom-based tests.
[profile.default-venom]
skip = ["src/snekmate/**/*.vy", "src/snekmate/**/*.vyi"] # Skip the compilation of all Vyper files (to be removed before merging).
vyper = { experimental_codegen = true } # Enable experimental code generation using the Venom backend.

# Default overrides for the Venom-based fuzz tests.
[profile.venom]
# Default overrides for the Venom-based CI tests.
[profile.ci-venom]
force = true # Perform always a clean build.
verbosity = 4 # Increase the verbosity level for the tests.
fuzz = { runs = 10_000, max_test_rejects = 350_000 } # Increase the number of fuzz runs and maximum number of combined inputs that may be rejected for the tests.
invariant = { runs = 375, depth = 500 } # Increase the number of runs (while preserving the default depth) for each invariant test group.
skip = ["src/snekmate/**/*.vy", "src/snekmate/**/*.vyi"] # Skip the compilation of all Vyper files (to be removed before merging).
vyper = { experimental_codegen = true } # Enable experimental code generation using the Venom backend.

# Default overrides for the Halmos tests.
[profile.venom-halmos]
# Default overrides for the the Venom-based Echidna tests.
[profile.echidna-venom]
force = true # Perform always a clean build.
evm_version = "shanghai" # Set the EVM target version to `shanghai`.
skip = ["src/snekmate/**/*.vy", "src/snekmate/**/*.vyi"] # Skip the compilation of all Vyper files (to be removed before merging).
vyper = { experimental_codegen = true } # Enable experimental code generation using the Venom backend.

# Default overrides for the Echidna tests.
[profile.venom-echidna]
# Default overrides for the Venom-based Halmos tests.
[profile.halmos-venom]
force = true # Perform always a clean build.
evm_version = "shanghai" # Set the EVM target version to `shanghai`.
skip = ["src/snekmate/**/*.vy", "src/snekmate/**/*.vyi"] # Skip the compilation of all Vyper files (to be removed before merging).
vyper = { experimental_codegen = true } # Enable experimental code generation using the Venom backend.
2 changes: 1 addition & 1 deletion scripts/insert_venom_pragma.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def insert_venom_pragma(filepath):
lines = f.readlines()
if len(lines) < 2:
lines.append("")
# Insert `pragma experimental-codegen` on the second line to activate the `venom` backend.
# Insert `pragma experimental-codegen` on the second line to activate the Venom backend.
lines.insert(1, "# pragma experimental-codegen\n")
# Move the file pointer back to the beginning of the file.
f.seek(0)
Expand Down

0 comments on commit 14576fc

Please sign in to comment.