File tree Expand file tree Collapse file tree 4 files changed +45
-21
lines changed
Expand file tree Collapse file tree 4 files changed +45
-21
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ addons:
1212
1313script :
1414 - go test -v ./... -coverprofile=coverage.out -coverpkg=./...
15- - go run main.go run program .lazo
15+ - go run main.go run examples/SimpleContract .lazo
1616 - sonar-scanner
1717
1818after_success :
Original file line number Diff line number Diff line change @@ -42,6 +42,38 @@ into the Bazo Byte Code for the [Bazo Virtual Machine](https://github.com/bazo-b
4242 V
4343 Bazo Byte Code
4444
45+
46+ ## Result
47+
48+ * Link to technical documentation (Bachelor Thesis 2019)
49+ * Complete [ Language Specification v1.0] ( https://eprints.hsr.ch/736/1/HS%202018%202019-SA-EP-Pfister-THURAIRATNAM-Improving%20the%20Bazo%20Blockchain.pdf ) (Term Project 2018)
50+
51+ ## Lazo Example
52+
53+ Note: Lazo is still under development. The example below contains only the currently available features.
54+ Please see [ lazo-specification/examples] ( https://github.com/bazo-blockchain/lazo-specification/tree/master/examples )
55+ for real smart contract use cases.
56+
57+ ``` csharp
58+ contract SimpleContract {
59+ Map < int , int > balances
60+
61+ constructor () {
62+ balances [0x 01 ] = 10
63+ balances [0x 02 ] = 2
64+
65+ pay (0x 01 , 0x 02 , 5 )
66+ }
67+
68+ function void pay (int from , int to , int amount ) {
69+ if (amount > 0 && balances [from ] >= amount ){
70+ balances [from ] -= amount
71+ balances [to ] += amount
72+ }
73+ }
74+ }
75+ ```
76+
4577## Usage
4678
4779The Lazo tool works with the CLI commands.
Original file line number Diff line number Diff line change 11contract SimpleContract {
2- int x
3- int y = 1
4- bool b
5- string s = "test"
2+ Map<int, int> balances
63
7- function bool calc(int a, int b ) {
8- x = y
9- y = a + b
4+ constructor( ) {
5+ balances[0x01] = 10
6+ balances[0x02] = 2
107
11- return a > b
8+ pay(0x01, 0x02, 5)
9+ }
10+
11+ function void pay(int from, int to, int amount) {
12+ if (amount > 0 && balances[from] >= amount){
13+ balances[from] -= amount
14+ balances[to] += amount
15+ }
1216 }
1317}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments