{"id":13718645,"url":"https://github.com/crytic/caracal","last_synced_at":"2026-01-27T18:08:44.138Z","repository":{"id":181266099,"uuid":"595312198","full_name":"crytic/caracal","owner":"crytic","description":"Static Analyzer for Starknet smart contracts","archived":false,"fork":false,"pushed_at":"2024-01-25T13:43:20.000Z","size":448,"stargazers_count":145,"open_issues_count":5,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-09T23:55:43.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Cairo","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crytic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-30T20:34:40.000Z","updated_at":"2025-12-08T13:59:43.000Z","dependencies_parsed_at":"2024-01-09T20:45:10.890Z","dependency_job_id":"ce45dfb9-646a-4d06-8173-2acf560b274e","html_url":"https://github.com/crytic/caracal","commit_stats":null,"previous_names":["crytic/caracal"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/crytic/caracal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fcaracal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fcaracal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fcaracal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fcaracal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crytic","download_url":"https://codeload.github.com/crytic/caracal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fcaracal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28817796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T18:01:38.485Z","status":"ssl_error","status_checked_at":"2026-01-27T18:01:27.499Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:00:35.094Z","updated_at":"2026-01-27T18:08:44.108Z","avatar_url":"https://github.com/crytic.png","language":"Cairo","funding_links":[],"categories":["Additional developer resources","Tools"],"sub_categories":[],"readme":"# Caracal\n\nCaracal is a static analyzer tool over the SIERRA representation for Starknet smart contracts.\n\n## Features\n- Detectors to detect vulnerable Cairo code\n- Printers to report information\n- Taint analysis\n- Data flow analysis framework\n- Easy to run in Scarb projects\n\n## Installation\n\n### Precompiled binaries\nPrecompiled binaries are available on our [releases page](https://github.com/crytic/caracal/releases). If you are using Cairo compiler 1.x.x uses the binary v0.1.x otherwise if you are using the Cairo compiler 2.x.x uses v0.2.x.\n\n### Building from source\nYou need the Rust compiler and Cargo.\nBuilding from git:\n```bash\ncargo install --git https://github.com/crytic/caracal --profile release --force\n```\nBuilding from a local copy:\n```bash\ngit clone https://github.com/crytic/caracal\ncd caracal\ncargo install --path . --profile release --force\n```\n\n## Usage\nList detectors:\n```bash\ncaracal detectors\n```\nList printers:\n```bash\ncaracal printers\n```\n### Standalone\nTo use with a standalone cairo file and you have a local cairo compiler binary it's enough to point it to the file. Otherwise otherwise a bundled compiler is used and you need to pass the path to the [corelib](https://github.com/starkware-libs/cairo/tree/main/corelib) library either with the `--corelib` cli option or by setting the `CORELIB_PATH` environment variable.  \nRun detectors:\n```bash\ncaracal detect path/file/to/analyze\n```\n```bash\ncaracal detect path/file/to/analyze --corelib path/to/corelib/src\n```\nRun printers:\n```bash\ncaracal print path/file/to/analyze --printer printer_to_use --corelib path/to/corelib/src\n```\n### Cairo project\nIf you have a cairo project with multiple files and contracts you may need to specify which contracts with `--contract-path`. The local cairo compiler binary is used if available otherwise a bundled compiler is used. In the latter case you also need to specify the corelib as explained above for the standalone case. The path is the directory where `cairo_project.toml` resides.  \nRun detectors:\n```bash\ncaracal detect path/to/dir\n```\n```bash\ncaracal detect path/to/dir --contract-path token::myerc20::... token::myerc721::...\n```\nRun printers:\n```bash\ncaracal print path/to/dir --printer printer_to_use\n```\n### Scarb\nIf you have a project that uses Scarb you need to add the following in Scarb.toml:\n```bash\n[[target.starknet-contract]]\nsierra = true\n\n[cairo]\nsierra-replace-ids = true\n```\nThen pass the path to the directory where Scarb.toml resides.\nRun detectors:\n```bash\ncaracal detect path/to/dir\n```\nRun printers:\n```bash\ncaracal print path/to/dir --printer printer_to_use\n```\n\n## Detectors\nNum | Detector | What it Detects | Impact | Confidence | Cairo\n--- | --- | --- | --- | --- | ---\n1 | `controlled-library-call` | Library calls with a user controlled class hash | High | Medium | 1 \u0026 2\n2 | `unchecked-l1-handler-from` | Detect L1 handlers without from address check | High | Medium | 1 \u0026 2\n3 | `felt252-unsafe-arithmetic` | Detect user controlled operations with felt252 type, which is not overflow/underflow safe | Medium | Medium | 1 \u0026 2\n4 | `reentrancy` | Detect when a storage variable is read before an external call and written after | Medium | Medium | 1 \u0026 2\n5 | `read-only-reentrancy` | Detect when a view function read a storage variable written after an external call | Medium | Medium | 1 \u0026 2\n6 | `unused-events` | Events defined but not emitted | Medium | Medium | 1 \u0026 2\n7 | `unused-return` | Unused return values | Medium | Medium | 1 \u0026 2\n8 | `unenforced-view` | Function has view decorator but modifies state | Medium | Medium | 1\n9 | `tx-origin` | Detect usage of the transaction origin address as access control | Medium | Medium | 2\n10 | `unused-arguments` | Unused arguments | Low | Medium | 1 \u0026 2\n11 | `reentrancy-benign` | Detect when a storage variable is written after an external call but not read before | Low | Medium | 1 \u0026 2\n12 | `reentrancy-events` | Detect when an event is emitted after an external call leading to out-of-order events | Low | Medium | 1 \u0026 2\n13 | `dead-code` | Private functions never used | Low | Medium | 1 \u0026 2\n14 | `use-after-pop-front` | Detect use of an array or a span after removing element(s) | Low | Medium | 1 \u0026 2\n\nThe Cairo column represent the compiler version(s) for which the detector is valid.\n\n## Printers\n- `cfg`: Export the CFG of each function to a .dot file\n- `callgraph`: Export function call graph to a .dot file\n\n## How to contribute\nCheck the wiki on the following topics:\n  * [How to write a detector](https://github.com/crytic/caracal/wiki/How-to-write-a-detector)\n  * [How to write a printer](https://github.com/crytic/caracal/wiki/How-to-write-a-printer)\n\n## Limitations\n- Inlined functions are not handled correctly.\n- Since it's working over the SIERRA representation it's not possible to report where an error is in the source code but we can only report SIERRA instructions/what's available in a SIERRA program.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrytic%2Fcaracal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrytic%2Fcaracal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrytic%2Fcaracal/lists"}