{"id":15061174,"url":"https://github.com/zilliqa/scilla","last_synced_at":"2025-05-16T05:00:19.632Z","repository":{"id":33044380,"uuid":"121423120","full_name":"Zilliqa/scilla","owner":"Zilliqa","description":"Scilla - A Smart Contract Intermediate Level Language","archived":false,"fork":false,"pushed_at":"2025-04-30T02:51:41.000Z","size":13091,"stargazers_count":248,"open_issues_count":138,"forks_count":77,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-09T07:40:40.889Z","etag":null,"topics":["blockchain","ocaml","scilla","smart-contracts","verification","zilliqa"],"latest_commit_sha":null,"homepage":"https://scilla-lang.org","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zilliqa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-13T18:58:51.000Z","updated_at":"2025-04-07T02:35:33.000Z","dependencies_parsed_at":"2023-02-17T02:31:23.650Z","dependency_job_id":"87747320-0f69-4f2f-970f-302cbf2d287e","html_url":"https://github.com/Zilliqa/scilla","commit_stats":{"total_commits":1147,"total_committers":50,"mean_commits":22.94,"dds":0.7253705318221447,"last_synced_commit":"308af35eb3948528702259c39a2537ba1e515ea1"},"previous_names":[],"tags_count":89,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fscilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fscilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fscilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zilliqa%2Fscilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zilliqa","download_url":"https://codeload.github.com/Zilliqa/scilla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471028,"owners_count":22076582,"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":["blockchain","ocaml","scilla","smart-contracts","verification","zilliqa"],"created_at":"2024-09-24T23:11:00.961Z","updated_at":"2025-05-16T05:00:18.747Z","avatar_url":"https://github.com/Zilliqa.png","language":"OCaml","readme":"# Scilla: A Smart Contract Intermediate Level Language\n\n[![Build Status](https://travis-ci.com/Zilliqa/scilla.svg?token=7qzjATfZuxTQvRjMHPVQ\u0026branch=master)](https://travis-ci.com/Zilliqa/scilla)\n[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/Zilliqa/scilla/blob/master/LICENSE)\n[![Discord chat](https://img.shields.io/discord/370992535725932544.svg)](https://discord.gg/mWp9HdR)\n[![Coverage Status](https://coveralls.io/repos/github/Zilliqa/scilla/badge.svg?branch=master)](https://coveralls.io/github/Zilliqa/scilla?branch=master)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://scilla-lang.org/\"\u003e\u003cimg src=\"https://github.com/Zilliqa/scilla/blob/master/imgs/scilla-logo-color.jpg\" width=\"200\" height=\"200\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\nScilla short for Smart Contract Intermediate-Level LAnguage is an intermediate-level smart contract language being developed for Zilliqa. Scilla has been designed as a principled language with smart contract safety in mind.\n\nScilla imposes a structure on smart contracts that will make applications less vulnerable to attacks by eliminating certain known vulnerabilities directly at the language-level. Furthermore, the principled structure of Scilla will make applications inherently more secure and amenable to formal verification.\n\nZilliqa - the underlying blockchain platform on which Scilla contracts are run, has been designed to be scalable. It employs the idea of sharding to validate transactions in parallel. Zilliqa has an intrinsic token named Zilling, ZIL for short that are required to run smart contracts on Zilliqa.\n\n### Language Reference\n\nA comprehensive documentation on Scilla, its features and constructs can be found [here](https://scilla.readthedocs.io/en/latest/)\n\n## Building Scilla\n\nIf you don't want to setup and build Scilla from source, skip this section to follow the opam installation instructions.\n\n### 1. Cloning source code\n\nWe suggest users to use the latest release of Scilla available [here](https://github.com/Zilliqa/scilla/releases).\n\nIf you'd like to hack on Scilla, clone it with all of its submodules:\n```shell\ngit clone --jobs 4 --recurse-submodules https://github.com/Zilliqa/scilla/\n```\n\n### 2. Build prerequisites\n\nPlatform specific instructions for setting up your system for building Scilla can be\nfound in [INSTALL.md](./INSTALL.md).\n\n### 3. Compiling\n\nTo build the project from the root folder:\n```\nmake\n```\n\n### Installation\n\nScilla can be installed into your opam switch as\n\n```\nmake install\n```\n\nand can similarly be uninstalled as\n\n```\nmake uninstall\n```\n\n## Installing Scilla with opam\nScilla can be installed using OCaml's package manager `opam`.\n\n### Installing Scilla from GitHub\n\nTo install the development version of Scilla package make sure you are using\nthe correct opam switch and execute the following\n\n```shell\nopam pin add scilla git+https://github.com/Zilliqa/scilla#master --yes\n```\n\n### Installing Scilla from your local repo\n\n```shell\ncd \u003cscilla-repo\u003e\n# It is important to pick the right git branch because opam pins the package to the current branch\ngit checkout master\nopam install ./scilla.opam\n```\n\nIf you are using a local opam switch (see [here](https://github.com/Zilliqa/scilla/blob/master/INSTALL.md#installing-opam-packages))\nin your local Scilla repo (`~/path/to/scilla`), then most likely you will want to reuse the same local switch for your Scilla-based project.\nTo do that create a symlink `_opam` as follows:\n\n```shell\ncd \u003cscilla-based-project-repo\u003e\nln -s ~/path/to/scilla/_opam _opam\n```\n\n## Running the binary\n\nOnce the project is built you can try the following things:\n\n#### Evaluating a standalone closed expression:\n\nFrom the project root, execute\n\n```\neval-runner -gaslimit 10000 -libdir src/stdlib tests/eval/good/let.scilexp\n```\n\nInstead of `let.scilla` you might want to try any different file in\n`tests/eval`. The second argument, which is a path to the Scilla\nstandard library can alternatively be specified in the environment\nvariable `SCILLA_STDLIB_PATH`. This must be an absolute path (or a\nlist of paths separated with `:` (or `;` on Windows).\n\n#### Type-checking a contract\n\nFrom the project root, execute\n\n```\nscilla-checker -gaslimit 10000 -libdir src/stdlib tests/contracts/auction.scilla\n```\n\nInstead of `auction.scilla` you might want to try any different file in\n`tests/contracts` with a complete implementation of a contract, or your\nown contract code. The second argument, which is a path to the Scilla\nstandard library can alternatively be specified in the environment\nvariable `SCILLA_STDLIB_PATH`. As above, this must be an absolute\npath(s).\n\nIf the checker only returns the contract structure in JSON format, it\nmeans that the contract has no type errors. Otherwise, a type error\ntrace is provided.\n\nThe checker can be run with the following optional flags:\n\n- `-cf` to enable the cashflow checker and print its results.\n\n\n#### Executing a simple transition\n\nFrom the project root, execute\n\n```\nscilla-runner -init tests/runner/crowdfunding/init.json -istate tests/runner/crowdfunding/state_4.json -iblockchain tests/runner/crowdfunding/blockchain_4.json -imessage tests/runner/crowdfunding/message_4.json -o tests/runner/crowdfunding/output_4.json -i tests/contracts/crowdfunding.scilla -libdir src/stdlib -gaslimit 8000\n```\n  or\n```\nscilla-runner -init tests/runner/zil-game/init.json -istate tests/runner/zil-game/state_5.json -iblockchain tests/runner/zil-game/blockchain_5.json -imessage tests/runner/zil-game/message_5.json -o tests/runner/zil-game/output_5.json -i tests/contracts/zil-game.scilla -libdir src/stdlib -gaslimit 8000\n```\n\nIf you'd like to see the output produced by the aforementioned commands,\ncheck the file specified by `-o path/to/file.json` argument.\n\nAlternatively, use the `easyrun.sh` script as below:\n\n```\n./easyrun.sh crowdfunding 1\n```\n\nwhere `n` is a number `0-5` for the number of \"steps\" to execute the\nprotocol (the messages and blockchain states are provided for only so\nmany steps in the simulation).\n\n#### Using Scilla as a service\nA `scilla-server` is provided that provides the functionality of `scilla-runner`\nand `scilla-checker` as a JSON-RPC server. The `scilla-server` process accepts\ncontract execution requests and executes the contract, providing a JSON output\nwithin the server process itself.\n\nMore details on the protocol can be found [here](https://github.com/Zilliqa/scilla/wiki/scilla-server-API).\n\nFor local testing and experiments, a `scilla-client` is also provided on development\nbuilds (`make dev`). This can interact with `scilla-server`, achieving the same effect\nas `scilla-runner` and `scilla-client`.\n\nStart `scilla-server` without any arguments. Examples for checking a contract\nand running a transition via `scilla-server` are provided below. They are to be\nrun on a separate shell (while `scilla-server` continues to run).\n\n```shell\nscilla-client run -argv \" -init tests/runner/crowdfunding/init.json -istate tests/runner/crowdfunding/state_4.json -iblockchain tests/runner/crowdfunding/blockchain_4.json -imessage tests/runner/crowdfunding/message_4.json -o tests/runner/crowdfunding/output_4.json -i tests/contracts/crowdfunding.scilla -libdir src/stdlib -gaslimit 8000\"\n\nscilla-client check -argv \" -libdir src/stdlib -gaslimit 8000 tests/contracts/helloWorld.scilla\"\n```\n\n\n### Where to find binaries\n\n* The runnables are put into the folder\n\n```\n$PROJECT_DIR/bin\n```\n\n## Developer Tools\n\n### Emacs mode\n\nAn emacs major mode for editing Scilla contracts is [provided](./misc/emacs-mode/scilla-mode.el).\nAdd the following line to your `.emacs` file to load this mode for files ending with `.scilla` and `.scillib`.\nFor enabling flycheck mode for Scilla (see [INSTALL.md](./INSTALL.md)). When `scilla-checker` is available,\ntype reporting is also supported. The key binding `C-c C-t` will print the type of the variable on which\nthe cursor currently is.\n\n```\n;; For enabling flycheck mode for Scilla.\n(setq scilla-root \"/path/to/scilla/root\")\n;; Scilla mode\n(load-file \"/path/to/scilla-mode.el\")\n```\n### VSCode Plugin\n\nVisual Studio Code support for Scilla is available. [Github Source](https://github.com/as1ndu/vscode-scilla)\nYou can install it through:https://marketplace.visualstudio.com/items?itemName=as1ndu.scilla\n\nCredits: [as1ndu](https://github.com/as1ndu)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilliqa%2Fscilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzilliqa%2Fscilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilliqa%2Fscilla/lists"}