titanoboa-zksync
A Zksync plugin for the Titanoboa Vyper interpreter
Installation
First install the following dependencies, depending on your system:
Google Colab
For Google Colab: The following dependencies should be downloaded automatically.
Zkvyper Compiler
We use the era-compiler-vyper a.k.a. zkvyper: to compile Vyper code to ZkSync-compatible bytecode.
-
Download the latest binary from the zkvyper-bin repository and rename it as
zkvyper. -
On Linux/macOS, mark the binary as executable:
chmod a+x <path to file> -
On macOS, the binary may need to have its quarantine attribute cleared:
xattr -d com.apple.quarantine <path to file>
Then, make sure this is available in your system PATH.
ZkSync Node
If you want to test with forks or a local test node, you will need to install the ZkSync anvil-zksyncs.
- Download and install
anvil-zksync
curl --proto '=https' -sSf https://raw.githubusercontent.com/matter-labs/anvil-zksync/main/scripts/install.sh > install.sh
chmod +x install.sh
sudo ./install.sh
Then, make sure this is available in your system PATH.
Install the plugin
Finally, install the package:
pip install titanoboa-zksync
Usage
The usage of this plugin is similar to the original Titanoboa interpreter.
Configuring the environment
In Python:
import boa_zksync
boa_zksync.set_zksync_env("<rpc_url>") # use RPC
boa_zksync.set_zksync_fork("<rpc_url>") # fork from the mainnet
boa_zksync.set_zksync_test_env() # run a local test node
In JupyterLab or Google Colab:
import boa, boa_zksync
from boa.integrations.jupyter import BrowserSigner
# use the browser signer and RPC:
boa_zksync.set_zksync_browser_env() # use the browser signer and RPC
boa.env.set_chain_id(324) # Set the chain ID to the ZkSync network
# use the browser signer and a custom RPC:
boa_zksync.set_zksync_env("<rpc_url>")
boa.env.set_eoa(BrowserSigner())
Interacting with the network
import boa, boa_zksync
constructor_args, address = [], "0x1234..."
boa_zksync.set_zksync_test_env() # configure the environment, see previous section
# Load a contract from source code and deploy
boa.loads("contract source code", *constructor_args)
# Load a contract from file and deploy
contract = boa.load("path/to/contract.vy", *constructor_args)
# Load a contract from source file but don't deploy yet
deployer = boa.loads_partial("source code")
deployer.deploy(*constructor_args) # Deploy the contract
deployer.at(address) # Connect a contract to an existing address
# Load a contract from source file but don't deploy yet
deployer = boa.loads_partial("source code")
deployer.deploy(*constructor_args) # Deploy the contract
deployer.at(address) # Connect a contract to an existing address
# Run the given source code directly
boa.eval("source code")
Limitations
# pragma optimize gasis not supported by Zksync
Metadata
Release files for titanoboa-zksync 0.2.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| titanoboa_zksync-0.2.10.tar.gz | 26.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| titanoboa_zksync-0.2.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.9 kB
Release files / titanoboa_zksync-0.2.10.tar.gz
| Download URL | titanoboa_zksync-0.2.10.tar.gz |
|---|---|
| Size | 26.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c22ca0b9632acb852acb6418c8cbbd1be00855676480d72abf99525882599ea6
|
|
BLAKE2b-256 checksum How to use checksums |
f53efd3e4579dd06f24a710dc6986ca309ff15393d9d77754abf398ed2dabc3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2025.
Transparency logRelease files / titanoboa_zksync-0.2.10-py3-none-any.whl
| Download URL | titanoboa_zksync-0.2.10-py3-none-any.whl |
|---|---|
| Size | 25.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae204fbc5f62cfe04175219eab11e636b6a03cbe0ce90559eb326b9bf7619975
|
|
BLAKE2b-256 checksum How to use checksums |
362fb21f8e88e8263340a7cc3c4cd1f12c58c6dcce2c25237482c197a6c42af6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2025.
Transparency logSecurity for titanoboa-zksync 0.2.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for titanoboa_zksync-0.2.10.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.