Name | titanoboa-zksync JSON |
Version |
0.2.9
JSON |
| download |
home_page | None |
Summary | A Zksync plugin for the Titanoboa Vyper interpreter |
upload_time | 2024-12-08 09:28:56 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | MIT License Copyright (c) 2024 Daniel Schiavini Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
ethereum
evm
smart contract
development
vyper
zksync
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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](https://github.com/matter-labs/era-compiler-vyper) a.k.a. `zkvyper`: to compile Vyper code to ZkSync-compatible bytecode.
1. Download the latest binary from the [zkvyper-bin repository](https://github.com/matter-labs/zkvyper-bin) and rename it as `zkvyper`.
2. On Linux/macOS, mark the binary as executable:
`chmod a+x <path to file>`
3. 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](https://github.com/matter-labs/anvil-zksync/releases).
1. Download and install `anvil-zksync`
```bash
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:
```bash
pip install titanoboa-zksync
```
## Usage
The usage of this plugin is similar to the original [Titanoboa interpreter](https://github.com/vyperlang/titanoboa).
### Configuring the environment
#### In Python:
```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:
```python
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
```python
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 gas` is not supported by Zksync
Raw data
{
"_id": null,
"home_page": null,
"name": "titanoboa-zksync",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "ethereum, evm, smart contract, development, vyper, zksync",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ec/7c/35d9fbc910b0b8855a77d5001d354d19e52dbfa8f0536cafe1cf49e7cabe/titanoboa_zksync-0.2.9.tar.gz",
"platform": null,
"description": "# titanoboa-zksync\nA Zksync plugin for the Titanoboa Vyper interpreter\n\n## Installation\n\nFirst install the following dependencies, depending on your system:\n\n#### Google Colab\nFor Google Colab: The following dependencies should be downloaded automatically.\n\n#### Zkvyper Compiler\nWe use the [era-compiler-vyper](https://github.com/matter-labs/era-compiler-vyper) a.k.a. `zkvyper`: to compile Vyper code to ZkSync-compatible bytecode.\n\n1. Download the latest binary from the [zkvyper-bin repository](https://github.com/matter-labs/zkvyper-bin) and rename it as `zkvyper`.\n \n2. On Linux/macOS, mark the binary as executable:\n`chmod a+x <path to file>`\n\n3. On macOS, the binary may need to have its quarantine attribute cleared: \n`xattr -d com.apple.quarantine <path to file>`\n\nThen, make sure this is available in your system PATH.\n\n#### ZkSync Node\n\nIf you want to test with forks or a local test node, you will need to install the ZkSync [anvil-zksyncs](https://github.com/matter-labs/anvil-zksync/releases).\n\n1. Download and install `anvil-zksync` \n\n```bash\ncurl --proto '=https' -sSf https://raw.githubusercontent.com/matter-labs/anvil-zksync/main/scripts/install.sh > install.sh\nchmod +x install.sh\nsudo ./install.sh\n```\n\nThen, make sure this is available in your system PATH.\n\n#### Install the plugin\nFinally, install the package:\n\n```bash\npip install titanoboa-zksync\n```\n\n## Usage\nThe usage of this plugin is similar to the original [Titanoboa interpreter](https://github.com/vyperlang/titanoboa).\n\n### Configuring the environment\n#### In Python:\n\n```python\nimport boa_zksync\n\nboa_zksync.set_zksync_env(\"<rpc_url>\") # use RPC\nboa_zksync.set_zksync_fork(\"<rpc_url>\") # fork from the mainnet\nboa_zksync.set_zksync_test_env() # run a local test node\n```\n\n#### In JupyterLab or Google Colab:\n```python\nimport boa, boa_zksync\nfrom boa.integrations.jupyter import BrowserSigner\n\n# use the browser signer and RPC:\nboa_zksync.set_zksync_browser_env() # use the browser signer and RPC\nboa.env.set_chain_id(324) # Set the chain ID to the ZkSync network\n\n# use the browser signer and a custom RPC:\nboa_zksync.set_zksync_env(\"<rpc_url>\")\nboa.env.set_eoa(BrowserSigner())\n```\n\n### Interacting with the network\n\n```python\nimport boa, boa_zksync\n\nconstructor_args, address = [], \"0x1234...\"\n\nboa_zksync.set_zksync_test_env() # configure the environment, see previous section\n\n# Load a contract from source code and deploy\nboa.loads(\"contract source code\", *constructor_args)\n\n# Load a contract from file and deploy\ncontract = boa.load(\"path/to/contract.vy\", *constructor_args)\n\n# Load a contract from source file but don't deploy yet\ndeployer = boa.loads_partial(\"source code\")\ndeployer.deploy(*constructor_args) # Deploy the contract\ndeployer.at(address) # Connect a contract to an existing address\n\n# Load a contract from source file but don't deploy yet\ndeployer = boa.loads_partial(\"source code\")\ndeployer.deploy(*constructor_args) # Deploy the contract\ndeployer.at(address) # Connect a contract to an existing address\n\n# Run the given source code directly\nboa.eval(\"source code\")\n```\n\n### Limitations\n- `# pragma optimize gas` is not supported by Zksync\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Daniel Schiavini Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "A Zksync plugin for the Titanoboa Vyper interpreter",
"version": "0.2.9",
"project_urls": null,
"split_keywords": [
"ethereum",
" evm",
" smart contract",
" development",
" vyper",
" zksync"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c4069ca1545bdafbeb3b681f65b850bf54e2c0cf25c64dff150210a2df03833a",
"md5": "fbc90a53ee9d441ac5ea34a518f98539",
"sha256": "ee95c2c8089519dc8579c97898e1edd02eeaef96970d68f5abbd28b365e49e18"
},
"downloads": -1,
"filename": "titanoboa_zksync-0.2.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fbc90a53ee9d441ac5ea34a518f98539",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 25478,
"upload_time": "2024-12-08T09:28:54",
"upload_time_iso_8601": "2024-12-08T09:28:54.258945Z",
"url": "https://files.pythonhosted.org/packages/c4/06/9ca1545bdafbeb3b681f65b850bf54e2c0cf25c64dff150210a2df03833a/titanoboa_zksync-0.2.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ec7c35d9fbc910b0b8855a77d5001d354d19e52dbfa8f0536cafe1cf49e7cabe",
"md5": "774e188b79a726a7d2ba2bb2aa6b10f4",
"sha256": "120f498f3a40f08c90d43264f8ca7d42b85d42e7977deb6abfaa4407a0711062"
},
"downloads": -1,
"filename": "titanoboa_zksync-0.2.9.tar.gz",
"has_sig": false,
"md5_digest": "774e188b79a726a7d2ba2bb2aa6b10f4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 26083,
"upload_time": "2024-12-08T09:28:56",
"upload_time_iso_8601": "2024-12-08T09:28:56.224898Z",
"url": "https://files.pythonhosted.org/packages/ec/7c/35d9fbc910b0b8855a77d5001d354d19e52dbfa8f0536cafe1cf49e7cabe/titanoboa_zksync-0.2.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-08 09:28:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "titanoboa-zksync"
}