Skip to content

ronan5/cairo-lib1

 
 

Repository files navigation

cairo-lib logo

Libraries for Cairo development.

Library

lib
├─ array — array functions such as concatenation and equality.
├─ bitwise — bitwise left and right shift
├─ shortstring — transformations such as felt/int256 -> short string

Installation and Usage

Install with pip:

pip install cairolib

Example .cairo file:

from cairolib.array import arr_concat
from cairolib.shortstring import uint256_to_ss

let (token_uri_len, token_uri) = arr_concat(
    base_token_uri_len,
    base_token_uri,
    token_id_ss_len,
    token_id_ss,
)

let (token_id_ss_len, token_id_ss) = uint256_to_ss(token_id)

Testing:

make test

Safety

This is experimental software and is provided on an "as is" and "as available" basis.

These methods are NOT audited and are not designed with user safety in mind:

We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.

Acknowledgements

These functions were inspired by or directly modified from many sources, primarily:

About

Library for common cairo functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.0%
  • Makefile 5.0%