https://github.com/codefordao/cairo-array-utils
a set of useful functions utils for manipulating arrays in Cairo lang
https://github.com/codefordao/cairo-array-utils
Last synced: 2 months ago
JSON representation
a set of useful functions utils for manipulating arrays in Cairo lang
- Host: GitHub
- URL: https://github.com/codefordao/cairo-array-utils
- Owner: CodeforDAO
- License: mit
- Created: 2022-06-08T15:10:54.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-08T16:13:25.000Z (about 4 years ago)
- Last Synced: 2025-01-01T18:20:47.068Z (over 1 year ago)
- Language: Cairo
- Size: 8.79 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
CodeforDAO Contracts in Cairo (StarkNet)
Base on, build upon and code for DAOs.
Make DAO the next generation of productivity tools for global collaboration.
Follow us on Twitter @codefordao.
## Cairo-array-utils
This module is implemented on StarkNet in Cairo language. Using this module requires that you have a basic understanding of the Cairo language and python.
### Install
```bash
pip install git+https://github.com/CodeforDAO/cairo-array-utils.git
```
### APIs
```python
from codefordao.utils.array import Array
# APIs
Array.save(
arr_len: felt,
arr: felt*
) -> (key: felt)
Array.get_item(
key: felt,
index: felt
) -> (res: felt)
Array.get_array(
key: felt,
) -> (
arr_len: felt,
arr: felt*
)
```
### Set up the project
#### Create a Python virtual environment
```bash
python -m venv env
source env/bin/activate
```
#### 📦 Install the requirements
```bash
pip install -r requirements.txt
```
### ⛏️ Compile
```bash
nile compile --directory src
```
### 🌡️ Test
```bash
# Run all tests
pytest tests
```
## 📄 License
**cairo-array-utils** is released under the [MIT](LICENSE).