GithubHelp home page GithubHelp logo

zilliqa / scilla Goto Github PK

View Code? Open in Web Editor NEW
241.0 28.0 79.0 12.74 MB

Scilla - A Smart Contract Intermediate Level Language

Home Page: https://scilla-lang.org

License: GNU General Public License v3.0

OCaml 59.18% Makefile 0.36% Shell 0.61% Emacs Lisp 0.75% Dockerfile 0.15% C++ 0.42% C 0.57% Ruby 0.02% JavaScript 0.02% Nix 0.16% Perl 4.18% Raku 32.04% Terra 0.05% CMake 0.97% HTML 0.02% CSS 0.48%
smart-contracts blockchain verification zilliqa scilla ocaml

scilla's Introduction

Zilliqa

Overview

Zilliqa is a scalable smart contract platform that aims to tackle the congestion issue plaguing the blockchain industry. Zilliqa utilises a unique sharded architecture to achieve parallel processing of transactions while maintaining a large number of public nodes. Hence, Zilliqa is a blockchain capable of reaching high throughput and processing more complex computations while remaining decentralised and secure.

NOTE: The master branch is not for production as development is currently being worked constantly, please use the tag releases if you wish to work on the version of Zilliqa client that is running live on the Zilliqa blockchain.

Zilliqa Mainnet

The current live version on the Zilliqa Mainnet is Zilliqa v9.2.3 and Scilla v0.13.3.

URL(s)
API URL https://api.zilliqa.com/
Block Explorer Viewblock
DEVEX

Developer Testnet

The current live version on the Developer Testnet is Zilliqa v9.2.5 and Scilla v0.13.3.

URL(s)
API URL https://dev-api.zilliqa.com/
Block Explorer Viewblock
DEVEX
Faucet Link

Zilliqa Improvement Proposal (ZIP)

The Zilliqa Improvement Proposals (ZIPs) are the core protocol standards for the Zilliqa platform.To view or contribute to ZIP, please visit https://github.com/Zilliqa/zip

Available Features

The current release has the following features implemented:

In the coming months, we plan to have the following features:

  • Further unit and integration tests
  • Enhancement of existing features
  • More operating system support
  • And much more...

Minimum System Requirements

To run Zilliqa, we recommend the minimum system requirements specified in our Mining page.

Build from Source Code

Starting with Zilliqa v8.6.0, the officially supported operating system is Ubuntu 22.04.

If you'd like to experiment with a different distro (including the previously supported Ubuntu 18.04), please make sure to install gcc >= 11.

Run the following to install the build dependencies:

sudo apt-get update
sudo apt-get install autoconf \
    build-essential \
    ccache \
    clang-format \
    clang-tidy \
    git \
    lcov \
    libcurl4-openssl-dev \
    libssl-dev \
    libtool \
    libxml2-utils \
    ninja-build \
    ocl-icd-opencl-dev \
    pkg-config \
    python3-dev \
    python3-pip \
    libgmp-dev \
    bison \
    gawk
git submodule update --init --recursive

Run the following to install latest version of cmake. CMake version >= 3.19 must be used:

wget https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh
mkdir -p "${HOME}"/.local
bash ./cmake-3.19.3-Linux-x86_64.sh --skip-license --prefix="${HOME}"/.local/
export PATH=$HOME/.local/bin:$PATH
cmake --version
rm cmake-3.19.3-Linux-x86_64.sh

To install, clone vcpkg to a separate location (do not use brew on macos):

$ git clone https://github.com/Microsoft/vcpkg.git /path/to/vcpkg
$ cd /path/to/vcpkg && git checkout 2022.09.27 && ./bootstrap-vcpkg.sh
$ cd /path/to/zilliqa
$ export VCPKG_ROOT=/path/to/vcpkg

As part of building our source code, we patch websocketpp 0.8.2 to compile on C++20; please see the license: https://github.com/zaphoyd/websocketpp/blob/master/COPYING.

Build Zilliqa from the source:

# build Zilliqa binary
$ ./build.sh

If you want to contribute by submitting code changes in a pull request perform the build with clang-format and clang-tidy enabled by doing:

$ ./build.sh style

Build Scilla for Smart Contract Execution

The Zilliqa client works together with Scilla for executing smart contracts. Please refer to the Scilla repository for build and installation instructions.

Boot Up a Local Testnet for Development

  1. Run the local testnet script in build directory:

    $ cd build && ./tests/Node/pre_run.sh && ./tests/Node/test_node_lookup.sh && ./tests/Node/test_node_simple.sh
  2. Logs of each node can be found at ./local_run

  3. To terminate Zilliqa:

    $ pkill zilliqa

Start a local network development environment

This is similar to the above, but deploys a local testnet to a local minikube cluster.

You can find documentation on how to do this on your local machine in docs/localdev.md.

You can find scripts which will set up an Ubuntu 22.04 machine in the cloud (or install necessary dependencies on your machine) in docs/setup/README.md.

Further Enquiries

Link(s)
Development discussion (discord)
Bug report
Security contact security 🌐 zilliqa.com
Security bug bounty HackerOne bug bounty

scilla's People

Contributors

advaypal avatar ahaliq avatar amritkumar avatar ansnunez avatar anton-trunov avatar aspiers avatar bb111189 avatar charles-cooper avatar chetan-zilliqa avatar czarly avatar edison0xyz avatar gnnng avatar gwchsec avatar hgsipiere avatar ilyasergey avatar jjcnn avatar jubnzv avatar kaikawaliu avatar mauromedda avatar nzyuzin avatar omahs avatar pavlops avatar rrw-zilliqa avatar simonelnahas avatar snowsledge avatar tramhnt99 avatar troelsfr avatar vaivaswatha avatar vyorkin avatar yaron-zilliqa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scilla's Issues

Support accessing special variables in mutable state initialization

@ilyasergey

Amrit and me were further analyzing the zil-game contract, and we realized that if neither of the player makes a move (Play), then the money is frozen in the account. Withdraw that I added today cannot help (yet). To be able to make this safe, we need to set another timer, after which the owner can withdraw.

To achieve this, we'll need a mutable variable "start_block" that can be initialized with the block number during contract creation. We have no syntax to achieve this.

field player_a_hash : Option Hash = None {Hash}
field player_b_hash : Option Hash = None {Hash}
field timer         : Option BNum  = None {BNum}
field start_block : BNum <- & BLOCKNUMBER

What are your thoughts on this?

Setup LLVM OCaml interface

Add infrastructure for generating LLVM IR from parsed Scilla code. This task is to setup working with LLVM from Scilla.

Improve zil-game

  1. game-on variable is only being set but not used. Use it appropriately.
  2. Add a new transition for the owner to claim back money in either of below two cases:
    (a) Too much time has passed and none of the players have claimed back.
    (b) Player-a = Player-b (same solution) and owner rightfully can get back the money. (right now, the owner depends on player-a or player-b to actually make a claim for him/her to get it back).

Add bash script for OCaml setup

Add a script to automate the OCaml setup process described in README.md. Running this on an Ubuntu system should make the system ready for building Scilla.

ScillaLexer.mll reads Sha3256 instead of Sha256.

ScillaLexer.mll in lang/syntax at line 21 reads let sha3256 = '0' 'x' ['a'-'f' '0'-'9']+. Aren't we using Sha256 and not Sha3-256? I think it will be good to be homogenous in terms of notations.

Command line parsing

Support below command line:

./scilla-runner -init init.json -istate input_state.json -iblockchain input_blockchain.json -imessage input_message.json -o output.json -i input.scilla

All arguments are mandatory and no other argument to be supported yet.

Design standard library

A library to be included with each contract, to avoid duplication. Involves the following data types:

  • Booleans
  • Hashes
  • Integers
  • Natural numbers
  • Lists
  • Maps

Describe the interfaces in a separate document

Create a test for a contract calling another one

This can be a simple contract that invokes the crowdfunding contract, at a pre-determined address. This is to enable testing main Zilliqa code that is responsible for creating chains of contracts calls

Get rid of `assert false` in `JSON.ml`

It seems like those can be removed with a minor refactoring in most of the cases (I removed some).

Use, result-returning functions instead (pure/fail), so the failed attempt to serialize/deserialize would be handled with a meaningful message.

Misc error checks

  • 1. Either both -imessage and -istate options can be provided or both not (depending on contact creation or not). Enforce this.
  • 2. Length / type for addresses and hashes in jsons aren't being verified.
  • 3. More meaning full error messages for json parsing.
  • 4. init.json must be validated even for contract creation.
  • 5. Add test case for contract creation.

A Type Checker for Scilla

  • Type-checking expressions
  • Basic effect tracking for statements
  • Better dynamic type annotation (for ADTs)
  • Bottom type an covariance

Fix hashing in Scilla interpreter

Currently, a number to be hashed, say "1" (represented currently as a string) is hashed as "(IntLit 1)". This needs to be standardized.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.