{"id":18437830,"url":"https://github.com/zilliqa/rs-scilla-parser","last_synced_at":"2026-02-08T08:31:59.268Z","repository":{"id":215079027,"uuid":"738055443","full_name":"Zilliqa/rs-scilla-parser","owner":"Zilliqa","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-10T11:16:08.000Z","size":135,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-15T03:11:22.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zilliqa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-02T10:05:54.000Z","updated_at":"2024-12-11T09:00:40.000Z","dependencies_parsed_at":"2024-01-02T11:47:09.147Z","dependency_job_id":"b6d6f724-a064-4581-a2d8-334775cbeed0","html_url":"https://github.com/Zilliqa/rs-scilla-parser","commit_stats":null,"previous_names":["zilliqa/rs-scilla-parser"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Zilliqa/rs-scilla-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Frs-scilla-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Frs-scilla-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Frs-scilla-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Frs-scilla-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zilliqa","download_url":"https://codeload.github.com/Zilliqa/rs-scilla-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Frs-scilla-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265506182,"owners_count":23778676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-11-06T06:16:22.485Z","updated_at":"2026-02-08T08:31:59.081Z","avatar_url":"https://github.com/Zilliqa.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scilla Parser\nThis repository contains a Rust parser for the Scilla smart contract language. [Scilla](https://scilla-lang.org/) is the smart contract language used in the Zilliqa blockchain.\n\n# Install\nAdd the following to your Cargo.toml:\n```toml\n[dependencies]\nscilla_parser = \"1.0.0\"\n```\n\nAlternatively, You can run this command:\n```shell\ncargo add scilla_parser\n```\nThis will add the scilla_parser dependency to Cargo.toml as specified in the installation instructions above.\n\n# Usage\nThis library parses a .scilla file. There are two options:\n1. Use `Contract::parse` and pass a contract path.\n2. Parse a string (slice) containing a scilla contract.\n\n## To parse a Scilla file:\nHere is the code to parse [SendZil.scilla](./tests/contracts/SendZil.scilla) contract:\n\n```rust\n    let contract_path = PathBuf::from(\"tests/contracts/SendZil.scilla\");\n    let contract = Contract::parse(\u0026contract_path).unwrap();\n\n    assert_eq!(\n        contract,\n        Contract {\n            name: \"SendZil\".to_string(),\n            init_params: FieldList::default(),\n            fields: FieldList(vec![\n                Field::new(\"test_field\", Type::Uint256),\n                Field::new(\"bool\", Type::Bool),\n                Field::new(\"empty_bool\", Type::Option(Box::new(Type::Bool))),\n                Field::new(\"some_int\", Type::Option(Box::new(Type::Int32))),\n                Field::new(\n                    \"pair\",\n                    Type::Pair(Box::new(Type::String), Box::new(Type::Uint32))\n                ),\n                Field::new(\"list\", Type::List(Box::new(Type::Int32))),\n            ]),\n            transitions: TransitionList(vec![\n                Transition::new_without_param(\"acceptZil\"),\n                Transition::new(\n                    \"updateTestField\",\n                    FieldList(vec![Field::new(\"val\", Type::Uint256)])\n                ),\n                Transition::new_without_param(\"dontAcceptZil\"),\n                Transition::new(\n                    \"fundUserWithTag\",\n                    FieldList(vec![\n                        Field::new(\"user\", Type::ByStr20),\n                        Field::new(\"amount\", Type::Uint128)\n                    ])\n                ),\n                Transition::new(\n                    \"fundUser\",\n                    FieldList(vec![\n                        Field::new(\"user\", Type::ByStr20),\n                        Field::new(\"amount\", Type::Uint128)\n                    ])\n                ),\n                Transition::new(\n                    \"fundContract\",\n                    FieldList(vec![\n                        Field::new(\"contract_address\", Type::ByStr20),\n                        Field::new(\"amount\", Type::Uint128)\n                    ])\n                ),\n                Transition::new(\n                    \"callOtherContract\",\n                    FieldList(vec![\n                        Field::new(\"contract_address\", Type::ByStr20),\n                        Field::new(\"tag\", Type::String),\n                        Field::new(\"value\", Type::Uint256)\n                    ])\n                ),\n            ])\n        }\n    );\n```\n\n## To parse a string containing a scilla contract:\n```rust\n    let contract_code: \u0026str = \"contract HelloWorld\";\n    let contract: Contract = contract_code.parse().unwrap();\n```\n\nFor more examples, take a look at the [tests](./tests/full_contract_tests.rs).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilliqa%2Frs-scilla-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzilliqa%2Frs-scilla-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilliqa%2Frs-scilla-parser/lists"}