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

🔁 Upgrade to Vyper Version 0.4.0 and Make All 🐍 snekmate Contracts Module-Friendly #207

Merged
merged 103 commits into from
Jun 5, 2024
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
8fb7ebc
🔥 Not all tests will pass, but lfg
pcaversaccio Feb 19, 2024
92f16ce
🔥 Two failing tests to go
pcaversaccio Feb 19, 2024
8f59830
🔥 lets see
pcaversaccio Feb 19, 2024
c98c99d
♻️ Add `.gas-snapshot`
pcaversaccio Feb 19, 2024
0c3a203
♻️ use keyword arguments for struct instantiation
pcaversaccio Feb 20, 2024
2df3a62
♻️ use floordiv operator
pcaversaccio Feb 21, 2024
1b603c2
Merge branch 'main' into modules
pcaversaccio Feb 22, 2024
14e6240
♻️ Use PEP 440 Version Specifier
pcaversaccio Feb 22, 2024
53bc82c
Merge branch 'main' into modules
pcaversaccio Feb 23, 2024
1f6c949
♻️ Add `I` Prefix to ERC Interfaces
pcaversaccio Feb 25, 2024
7eba9bf
Merge branch 'main' into modules
pcaversaccio Feb 25, 2024
0c38dea
Merge branch 'main' into modules
pcaversaccio Feb 27, 2024
a14fd9d
♻️ Bump Version
pcaversaccio Feb 27, 2024
e653304
Merge branch 'main' into modules
pcaversaccio Mar 1, 2024
a7e0ead
Merge branch 'main' into modules
pcaversaccio Mar 5, 2024
40010d1
♻️ Add `extcall` and `staticcall` Keywords
pcaversaccio Mar 6, 2024
72b9361
Merge branch 'main' into modules
pcaversaccio Mar 7, 2024
deb0b02
Merge branch 'main' into modules
pcaversaccio Mar 7, 2024
3c245fb
Merge branch 'main' into modules
pcaversaccio Mar 7, 2024
f9628b6
Merge branch 'main' into modules
pcaversaccio Mar 8, 2024
ef971eb
Merge branch 'main' into modules
pcaversaccio Mar 11, 2024
690e57a
Merge branch 'main' into modules
pcaversaccio Mar 12, 2024
32426ea
Merge branch 'main' into modules
pcaversaccio Mar 12, 2024
e4c1198
Merge branch 'main' into modules
pcaversaccio Mar 13, 2024
ba6b53c
♻️ Update `pragma` Statements
pcaversaccio Mar 16, 2024
dbaabe3
Merge branch 'main' into modules
pcaversaccio Mar 18, 2024
c63447d
Merge branch 'main' into modules
pcaversaccio Mar 18, 2024
e39ee96
Merge branch 'main' into modules
pcaversaccio Mar 18, 2024
19ed1e5
Merge branch 'main' into modules
pcaversaccio Mar 19, 2024
b8d0b53
♻️ Make `AccessControl` Module-Friendly (#216)
pcaversaccio Mar 25, 2024
e385c16
Merge branch 'main' into modules
pcaversaccio Mar 26, 2024
ac7f64f
♻️ Make `Ownable` Module-Friendly (#218)
pcaversaccio Mar 26, 2024
87cabde
♻️ Make `Ownable2Step` Module-Friendly (#219)
pcaversaccio Mar 27, 2024
6753458
♻️ Make `TimelockController` Module-Friendly (#220)
pcaversaccio Apr 2, 2024
9abed8b
♻️ Make `Base64` Module-Friendly (#222)
pcaversaccio Apr 4, 2024
b26a9f3
♻️ Make `BatchDistributor` Module-Friendly (#223)
pcaversaccio Apr 5, 2024
7207431
♻️ Make `CreateAddress` Module-Friendly (#224)
pcaversaccio Apr 6, 2024
40e019c
♻️ Make `Create2Address` Module-Friendly (#225)
pcaversaccio Apr 6, 2024
59ef94c
Merge branch 'main' into modules
pcaversaccio Apr 6, 2024
697ced2
Merge branch 'main' into modules
pcaversaccio Apr 6, 2024
dba2f27
♻️ Bump to `~=0.4.06`
pcaversaccio Apr 6, 2024
634ab88
Merge branch 'main' into modules
pcaversaccio Apr 8, 2024
7d2a4e7
♻️ Make `ECDSA` Module-Friendly and Carve Out the Message Hash Method…
pcaversaccio Apr 9, 2024
40a74ab
♻️ Make `SignatureChecker` Module-Friendly (#228)
pcaversaccio Apr 9, 2024
8bd2eb1
♻️ Make `EIP712DomainSeparator` Module-Friendly (#229)
pcaversaccio Apr 10, 2024
e73e197
♻️ Make `Math` Module-Friendly (#230)
pcaversaccio Apr 10, 2024
dd58215
Merge branch 'main' into modules
pcaversaccio Apr 10, 2024
d5a9c8d
♻️ Make `MerkleProofVerification` Module-Friendly (#231)
pcaversaccio Apr 10, 2024
a0c1145
♻️ Make `Multicall` Module-Friendly (#232)
pcaversaccio Apr 10, 2024
ea9499d
👷 Update URL Validation
pcaversaccio Apr 10, 2024
f5dc537
♻️ Bump Vyper Version to `0.4.0rc1`
pcaversaccio Apr 10, 2024
10432e2
♻️ Make `ERC2981` Module-Friendly (#233)
pcaversaccio Apr 11, 2024
2e432ac
Merge branch 'main' into modules
pcaversaccio Apr 14, 2024
f5387eb
♻️ Make `ERC20` Module-Friendly (#234)
pcaversaccio Apr 15, 2024
46c45eb
♻️ Fix `CHANGELOG`
pcaversaccio Apr 15, 2024
b5126de
♻️ Implement Dunder `__interface__` Method and Remove `userdoc` and `…
charles-cooper Apr 15, 2024
4b69964
Merge branch 'main' into modules
pcaversaccio Apr 17, 2024
64e3170
♻️ Make `ERC721` Module-Friendly (#237)
pcaversaccio Apr 18, 2024
17ccb43
Merge branch 'main' into modules
pcaversaccio Apr 21, 2024
5cf5ad5
♻️ Make `ERC1155` Module-Friendly (#238)
pcaversaccio Apr 22, 2024
a070840
Merge branch 'main' into modules
pcaversaccio Apr 24, 2024
afcf7cc
💥 Add `echidna`-Based Property Tests (#239)
pcaversaccio Apr 25, 2024
dc68567
Merge branch 'main' into modules
pcaversaccio Apr 27, 2024
bbd14ed
Merge branch 'main' into modules
pcaversaccio Apr 30, 2024
36445b5
Merge branch 'main' into modules
pcaversaccio Apr 30, 2024
31b15aa
Merge branch 'main' into modules
pcaversaccio May 1, 2024
e86ab37
Merge branch 'main' into modules
pcaversaccio May 5, 2024
a08f934
Merge branch 'main' into modules
pcaversaccio May 8, 2024
a32ee24
♻️ Make `ERC4626` Module-Friendly (#236)
pcaversaccio May 8, 2024
b57e825
Merge branch 'main' into modules
pcaversaccio May 9, 2024
325020b
♻️ Use `snake_case` Notation for Module and Mock Contracts (#242)
pcaversaccio May 9, 2024
4554750
Merge branch 'main' into modules
pcaversaccio May 12, 2024
87677d5
Merge branch 'main' into modules
pcaversaccio May 13, 2024
e0d2766
💥 Add NIST P-256 (a.k.a. `secp256r1`) ECDSA Verification Function (#243)
pcaversaccio May 13, 2024
506859a
📖 Update `pull_request_template`
pcaversaccio May 14, 2024
59df044
⬆ Bump to `0.4.0rc4`
pcaversaccio May 16, 2024
2fcf026
♻️ Resolve Merge Conflicts
pcaversaccio May 17, 2024
b55dbb1
🔁 Bump Submodules
pcaversaccio May 17, 2024
4f3b6c4
🔁 Upgrade EVM Version to `cancun` (#245)
pcaversaccio May 17, 2024
f20faf7
Merge branch 'main' into modules
pcaversaccio May 18, 2024
459ec3f
💥 Add `halmos`-Based Symbolic Tests (#240)
pcaversaccio May 22, 2024
c0342c9
🔁 Upgrade to Solidity Version `0.8.26`
pcaversaccio May 22, 2024
90b236b
Merge branch 'main' into modules
pcaversaccio May 22, 2024
0748f19
👷 Use `apt-get`-Based Binaries for Yices 2 SMT Solver (#246)
pcaversaccio May 23, 2024
acee070
♻️ Use Interface Events (#248)
pcaversaccio May 27, 2024
3fa9143
Merge branch 'main' into modules
pcaversaccio May 28, 2024
08b32ea
📖 Add Modules Documentation (#247)
pcaversaccio May 29, 2024
2c34874
♻️ Add missing NatSpec comments
pcaversaccio May 30, 2024
3af3b1c
♻️ Fix `depth` in Invariant Tests
pcaversaccio May 30, 2024
3d83be6
♻️ Fix `depth` in Invariant Tests
pcaversaccio May 31, 2024
78157e1
♻️ new runs and depth
pcaversaccio May 31, 2024
218d330
♻️ new runs level
pcaversaccio May 31, 2024
4293955
♻️ Bump to `0.4.0rc6`
pcaversaccio May 31, 2024
4716814
Merge branch 'main' into modules
pcaversaccio Jun 1, 2024
303be48
Merge branch 'main' into modules
pcaversaccio Jun 1, 2024
0abe10f
♻️ Use Configuration File for `halmos`-Based Symbolic Tests (#249)
pcaversaccio Jun 2, 2024
82de985
Merge branch 'main' into modules
pcaversaccio Jun 3, 2024
51b94fa
Merge branch 'main' into modules
pcaversaccio Jun 4, 2024
3988aec
♻️ Remove `mocks` From Source Distribution Files
pcaversaccio Jun 4, 2024
8b5f2f1
Merge branch 'main' into modules
pcaversaccio Jun 4, 2024
88d0548
♻️ Add `.gas-snapshot` File
pcaversaccio Jun 5, 2024
6d9b250
♻️ Amend `awesome_bot` Check
pcaversaccio Jun 5, 2024
daab44a
♻️ Amend `ape-config.yaml` File
pcaversaccio Jun 5, 2024
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
1,459 changes: 733 additions & 726 deletions .gas-snapshot

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 👮‍♂️ Sanity checks
on: [push, pull_request, workflow_dispatch]

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

jobs:
Expand All @@ -13,10 +13,10 @@ jobs:
matrix:
os:
- ubuntu-latest
python_version:
- 3.12
architecture:
- x64
python_version:
- 3.11
node_version:
- 20

Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
uses: psf/black@stable
with:
options: "--check --verbose"
src: "./scripts"
src: "./lib/utils"

codespell:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -107,8 +107,7 @@ jobs:

- name: Validate URLs
run: |
awesome_bot ./*.md src/snekmate/**/*.vy src/snekmate/**/interfaces/*.vy \
test/**/*.sol test/**/interfaces/*.sol test/**/mocks/*.sol \
test/**/scripts/*.js scripts/*.py --allow-dupe --allow-redirect \
--request-delay 0.4 \
--white-list https://www.wagmi.xyz,https://github.com/pcaversaccio/snekmate.git@,https://github.com/pcaversaccio/snekmate/releases/tag/v0.1.0,https://github.com/pcaversaccio/snekmate/blob/v0.1.0,https://github.com/pcaversaccio/snekmate/compare/v0.0.5...v0.1.0
awesome_bot ./*.md src/snekmate/**/*.vy src/snekmate/**/mocks/*.vy src/snekmate/**/interfaces/*.vyi \
test/**/*.sol test/**/interfaces/*.sol test/**/mocks/*.sol test/**/scripts/*.js lib/utils/*.sol lib/utils/*.py \
--allow-dupe --allow-redirect --request-delay 0.4 \
--white-list https://www.wagmi.xyz,https://github.com/pcaversaccio/snekmate.git@,https://github.com/pcaversaccio/snekmate/releases/tag/v0.1.0,https://github.com/pcaversaccio/snekmate/blob/v0.1.0,https://github.com/pcaversaccio/snekmate/compare/v0.0.5...v0.1.0,https://github.com/vyperlang/vyper/releases/tag/v0.4.0
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 🔍️ CodeQL
on: [push, pull_request, workflow_dispatch]

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

jobs:
Expand Down Expand Up @@ -35,4 +35,4 @@ jobs:
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
category: "/language:${{ matrix.language }}"
88 changes: 88 additions & 0 deletions .github/workflows/halmos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: 👁️ Halmos symbolic tests

on:
schedule:
# Run every day at 03:30 UTC.
- cron: "30 3 * * *"
workflow_dispatch:

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

jobs:
halmos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
python_version:
- 3.12
architecture:
- x64
halmos:
- "--config test/halmos.toml"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.architecture }}

- name: Install Vyper
run: pip install git+https://github.com/vyperlang/vyper.git@master

- name: Show the Vyper version
run: vyper --version

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install `setuptools`
run: pip install setuptools

- name: Install Halmos
run: pip install git+https://github.com/a16z/halmos.git@main

- name: Show the Halmos version
run: halmos --version

- name: Install Yices 2 SMT solver
run: |
sudo add-apt-repository ppa:sri-csl/formal-methods
sudo apt-get update
sudo apt-get install yices2

- name: Show the Foundry Halmos config
run: forge config
env:
FOUNDRY_PROFILE: halmos

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

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

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

- name: Run Halmos math symbolic tests
run: halmos --contract MathTestHalmos ${{ matrix.halmos }}
env:
FOUNDRY_PROFILE: halmos
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
matrix:
os:
- ubuntu-latest
python_version:
- 3.12
architecture:
- x64
python_version:
- 3.11

steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
matrix:
os:
- ubuntu-latest
python_version:
- 3.12
architecture:
- x64
python_version:
- 3.11

steps:
- name: Checkout
Expand Down
55 changes: 43 additions & 12 deletions .github/workflows/test-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 🕵️‍♂️ Test smart contracts
on: [push, pull_request, workflow_dispatch]

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

jobs:
Expand All @@ -13,12 +13,14 @@ jobs:
matrix:
os:
- ubuntu-latest
python_version:
- 3.12
architecture:
- x64
python_version:
- 3.11
node_version:
- 20
echidna:
- "--config test/echidna.yaml"

steps:
- name: Checkout
Expand All @@ -33,18 +35,18 @@ jobs:
architecture: ${{ matrix.architecture }}

- name: Install Vyper
run: pip install vyper
run: pip install git+https://github.com/vyperlang/vyper.git@master

- name: Check userdoc and devdoc compilation
run: python scripts/compile.py
- name: Show the Vyper version
run: vyper --version

- name: Setup Ape
uses: ApeWorX/github-action@v2
with:
python-version: ${{ matrix.python_version }}
# - name: Setup Ape
# uses: ApeWorX/github-action@v2
# with:
# python-version: ${{ matrix.python_version }}

- name: Check Ape compilation
run: ape compile
# - name: Check Ape compilation
# run: ape compile

- name: Install pnpm
uses: pnpm/action-setup@v3
Expand Down Expand Up @@ -97,3 +99,32 @@ jobs:
run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY
env:
FOUNDRY_PROFILE: default

- name: Install Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Install Echidna
run: brew install echidna

- name: Show the Echidna version
run: echidna --version

- name: Show the Foundry Echidna config
run: forge config
env:
FOUNDRY_PROFILE: echidna

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

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

- name: Run Echidna ERC-721 property tests
run: echidna test/tokens/echidna/ERC721Properties.sol --contract CryticERC721ExternalHarness ${{ matrix.echidna }}
env:
FOUNDRY_PROFILE: echidna
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ dist

# Ape build files
.build

# Echidna files
echidna-corpus
crytic-export
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std.git
[submodule "lib/properties"]
path = lib/properties
url = https://github.com/crytic/properties.git
[submodule "lib/create-util"]
path = lib/create-util
url = https://github.com/pcaversaccio/create-util.git
[submodule "lib/erc4626-tests"]
path = lib/erc4626-tests
url = https://github.com/a16z/erc4626-tests.git
[submodule "lib/FreshCryptoLib"]
path = lib/FreshCryptoLib
url = https://github.com/rdubois-crypto/FreshCryptoLib.git
[submodule "lib/halmos-cheatcodes"]
path = lib/halmos-cheatcodes
url = https://github.com/a16z/halmos-cheatcodes.git
[submodule "lib/solidity-bytes-utils"]
path = lib/solidity-bytes-utils
url = https://github.com/GNSPS/solidity-bytes-utils.git
Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ lib/solady
lib/solmate
lib/prb-test
lib/forge-std
lib/properties
lib/create-util
lib/erc4626-tests
lib/FreshCryptoLib
lib/halmos-cheatcodes
lib/solidity-bytes-utils
lib/openzeppelin-contracts
echidna-corpus
crytic-export
cache
out
dist
Expand Down
5 changes: 5 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ lib/solady
lib/solmate
lib/prb-test
lib/forge-std
lib/properties
lib/create-util
lib/erc4626-tests
lib/FreshCryptoLib
lib/halmos-cheatcodes
lib/solidity-bytes-utils
lib/openzeppelin-contracts
echidna-corpus
crytic-export
cache
out
dist
Expand Down
Loading