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

Conversation

pcaversaccio
Copy link
Owner

@pcaversaccio pcaversaccio commented Feb 19, 2024

β–ˆβ–ˆβ•—β–‘β–‘β–‘β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–‘β–‘β–‘β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘
β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—
β•šβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ•”β•β–‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
β–‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–‘β–‘β–‘β•šβ–ˆβ–ˆβ•”β•β–‘β–‘β–ˆβ–ˆβ•”β•β•β•β•β–‘β–ˆβ–ˆβ•”β•β•β•β–‘β–‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—
β–‘β–‘β•šβ–ˆβ–ˆβ•”β•β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–‘β–‘β–ˆβ–ˆβ•‘
β–‘β–‘β–‘β•šβ•β•β–‘β–‘β–‘β–‘β–‘β–‘β•šβ•β•β–‘β–‘β–‘β•šβ•β•β–‘β–‘β–‘β–‘β–‘β•šβ•β•β•β•β•β•β•β•šβ•β•β–‘β–‘β•šβ•β•

πŸ•“ Changelog

We bump the Vyper version to the latest breaking release 0.4.0 (technically, since Vyper 0.4.0 has not been released yet, we use the latest release candidate 0.4.0rc6 instead), which implements stateless (see vyperlang/vyper@c6f457a) and stateful modules (see vyperlang/vyper@8ccacb3). Furthermore, all existing 🐍 snekmate contracts have been refactored to be module-friendly (closes #221):

Furthermore, this PR closes the following issues:

Eventually, the following changes are implemented:

🐢 Cute Animal Picture

image

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio self-assigned this Feb 19, 2024
@pcaversaccio pcaversaccio added feature πŸ’₯ New feature or request dependencies πŸ” Pull requests that update a dependency file optimisation ⚑️ Code optimisations (e.g. gas improvements) ci/cd πŸ‘·β€β™‚οΈ CI/CD configurations labels Feb 19, 2024
@pcaversaccio pcaversaccio modified the milestones: 0.0.5, 0.1.0 Feb 19, 2024
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
pcaversaccio and others added 17 commits February 20, 2024 08:52
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: sudo rm -rf --no-preserve-root / <pcaversaccio@users.noreply.github.com>
pcaversaccio and others added 19 commits May 17, 2024 13:31
### πŸ•“ Changelog

All 🐍 snekmate contracts now target the new Vyper default EVM version
`cancun` (see vyperlang/vyper#4029). I also bump
the Vyper version to the latest release candidate
[`v0.4.0rc5`](https://github.com/vyperlang/vyper/releases/tag/v0.4.0rc5).

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
### πŸ•“ Changelog

This PR adds [`halmos`](https://github.com/a16z/halmos)-based symbolic
tests for the `erc20`, `erc721`, `erc1155`, and `math` contracts (closes
#180). The `erc721` and `erc1155` tests each take substantial amount of
time as part of the CI. Hence, we run the new `halmos` CI pipeline each
day at 03:30 a.m. (= "nightly" tests) as scheduled `cron` job instead of
integrating it into the normal `push` and `pull_request` pipeline.
Furthermore, the `halmos`-based `math` tests `testHalmosAssertMulDiv`,
`testHalmosAssertWadLn`, `testHalmosAssertWadExp`,
`testHalmosAssertCbrt`, and `testHalmosAssertWadCbrt` face out of memory
issues as the timeout for the Z3 solver does not work for the queries of
these tests. Thus, these tests are currently commented out.
Additionally, the test `testHalmosAssertNoBackdoor` in the `erc721` and
`erc1155` contracts is currently commented out due to performance and
reverting path issues in `halmos`. Eventually, we target the `main`
`halmos` branch (= "nightly" version) in the CI pipeline and use the
[Yices 2 SMT solver](https://github.com/SRI-CSL/yices2).

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
### πŸ•“ Changelog

Replace the Homebrew-based Yices 2 SMT solver installation in the
`halmos` CI pipeline with `apt-get` (i.e. pulling directly the
binaries). This will speed up the installation considerably (Homebrew
installs the Yices 2 SMT solver from the source).

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
### πŸ•“ Changelog

Using directly interface events leads to a cleaner code structure, i.e.
they do not have to be redefined in a module contract. In addition, we
adjust the upper bound for the batch calls in the `erc1155` contract to
`128` (and an `uint8` type), reduce the upper bound for the return value
of `eip712Domain` to `32`, and implement a `constant` parameter
`_DYNARRAY_BOUND` for the dynamic arrays in the
`merkle_proof_verification` contract.

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
### πŸ•“ Changelog

This PR adds documentation on how to use 🐍 snekmate contracts as
modules.

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
### πŸ•“ Changelog

The PRs a16z/halmos#296 and
a16z/halmos#298 have added support for
configuration files in `halmos` (https://github.com/a16z/halmos). This
PR refactors the configurations currently used inline via the CLI and
moves them to the new configuration file `halmos.toml`, which is located
in the `test/` subdirectory. I also rename the configuration file
`echidna-config.yaml` to `echidna.yaml` and move it to the subdirectory
`test/` as well. Eventually, I bump the submodules
`FreshCryptoLib` (https://github.com/rdubois-crypto/FreshCryptoLib) and
`properties` (https://github.com/crytic/properties) to the latest
available commit.

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: sudo rm -rf --no-preserve-root / <pcaversaccio@users.noreply.github.com>
@pcaversaccio pcaversaccio changed the title πŸ” Upgrade Vyper Version to 0.4.0 and Make All 🐍 snekmate Contracts Module-Friendly πŸ” Upgrade to Vyper Version 0.4.0 and Make All 🐍 snekmate Contracts Module-Friendly Jun 3, 2024
pcaversaccio and others added 5 commits June 4, 2024 16:56
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Copy link
Owner Author

@pcaversaccio pcaversaccio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@pcaversaccio pcaversaccio merged commit 4cb87bf into main Jun 5, 2024
13 checks passed
@pcaversaccio pcaversaccio deleted the modules branch June 5, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd πŸ‘·β€β™‚οΈ CI/CD configurations dependencies πŸ” Pull requests that update a dependency file documentation πŸ“– Improvements or additions to documentation feature πŸ’₯ New feature or request optimisation ⚑️ Code optimisations (e.g. gas improvements) refactor/cleanup ♻️ Code refactorings and cleanups
Projects
None yet
2 participants