Skip to content

bazo-blockchain/lazo-specification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lazo: Language Specification

Build Status

Lazo is a statically typed, imperative and non-turing complete programming language.

Background

The Bazo Blockchain is a research blockchain to test different mechanisms and algorithms. In the current version, a Proof-of-Stake consensus algorithm and mechanisms to run the blockchain on mobile devices are integrated. Furthermore, there is also a virtual machine available to interpret and execute IL codes on the Bazo Blockchain. The goal of this study work is to specify a smart contract language for the Bazo Blochchain.

Result

Example

A "Simple Contract" program written in Lazo.

version 1.0

contract SimpleContract{
    Map<address, int> payments
    
    [Payable]
    [Pre: msg.coins > 0]
    function void pay() {
        payments[msg.sender] += msg.coins
    }
}

Run Tests

In order to run tests, execute the following command:

// Change directory
cd syntax-antlr

// Run tests
./gradlew test

Or use an IDE such as IntelliJ with the Gradle plugin (config parameter: test).