-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenesis.ma
45 lines (32 loc) · 996 Bytes
/
genesis.ma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import dcdc
machine:
genesis_contract
is:
command_contract
with:
int:FC = 7
Founder[]:founders
start:
genesis
state genesis:
export critical void registerChair(address:addr) -> awaitingChair:
registerChair(addr)
initNetAccount()
redeemNetCurrency()
export void default -> unknownCommand:
state awaitingFounders:
export critical void setFounderCount(uint:c) -> awaitingChair:
if c > 0: FC = c
export void default -> unknownCommand:
state unknownCommand:
log(previous state + " received an unknown command")
goto previous state
Founder? get chairPerson():
founders.first(f => f.ischairperson)?
critical void registerChair(address:addr):
if chairPerson: throw "chairperson is already registered"
founders.push(Founder addr)
critical void initNetAccount(address:addr):
let redeem = dcdc.system.issueCurrency("STK", "Stake", 100000000)
execute(redeem)
critical void initNetAccount():