Skip to main content

Interface

Storage

constant chairman : address = @tz1h4CiqWxNe4UxSpkwXy617RM6DaK6NU76P
states =
| Activated initial
| Terminated
asset idea {
id : nat;
title : bytes;
desc : bytes;
nbvotes : nat = 0;
creation : date;
author : address;
}
asset voter {
addr : address;
remaining : nat = 5;
}
asset selected {
sid : nat;
}

Entry points

Register

entry register (a_voter : address) {
called by chairman
...
}

Add idea

entry add_idea(ititle : bytes, description : bytes) {
...
}

Vote

entry vote(n : nat, weight : nat) {
...
}

Terminate

 transition terminate () {
called by chairman
from Activated
to Terminated
with effect {
...
}
}