forked from windranger-io/windranger-governance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflows.puml
299 lines (211 loc) · 7.48 KB
/
flows.puml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
@startuml
!pragma layout smetana
'skinparam defaultFontSize 29
'https://plantuml.com/sequence-diagram
box "(community)" #LightYellow
actor Alice_novice as alice
actor Bob as bob
end box
box "(offchain)" #Coral
actor Forum as forum
end box
box "(community)" #LightGray
actor Communities_novice as community
actor Guarantors_expert as guarantor
end box
box "(multisig)" #Peru
actor BitDAOAdmins_expert as bitdaoadmin
end box
box "(token)" #OliveDrab
actor TokenHolders_novice as tokenholders
endbox
box "(offchain)" #Coral
database Snapshot as snapshot
end box
box "(onchain)" #Lavender
collections Executor as executor
collections Token as token
collections BondContract as bondcontract
collections RewardsContract as rewardscontract
collections InsuranceContract as insurancecontract
collections GrantsTreasury as grantstreasury
collections BitDAOTreasury as bitdaotreasury
collections BitDAOGovernanceV2 as bitdaogovernance
end box
autonumber "Current:[00]"
== Current ==
alice -> grantstreasury: create grants treasury
alice <-- grantstreasury: treasury address
alice -> forum: create forum proposal
activate forum
community -> forum: get proposals
community <-- forum: list of proposals
community -> forum: put positive/negative feedback
alice <-- forum: get positive/negative feedback
deactivate forum
community -> community: delegate votes
alice -> snapshot: submit proposal
activate snapshot
tokenholders -> snapshot: get proposals
tokenholders <-- snapshot: list of proposals
tokenholders -> snapshot: vote on open proposals
tokenholders <-- snapshot: vote confirmation
'alice -> snapshot: get Alice's proposal result
'alice <-- snapshot: Alice's proposal pass/fail result
bitdaoadmin -> snapshot: get Alice's proposal result
bitdaoadmin <-- snapshot: Alice's proposal pass/fail result
deactivate snapshot
bitdaoadmin -> bitdaotreasury: transfer funds to grants treasury
bitdaotreasury -> grantstreasury: funds transfer
alt#Gold #DarkSeaGreen trace
alice <-- grantstreasury: transfer confirmation
end
alice --> alice: execute proposal
newpage
autonumber "Bond:[00]"
== Bond ==
alice -> grantstreasury: create grants treasury
alice <-- grantstreasury: treasury address
' bond
alice -> forum: create forum proposal
activate forum
guarantor -> forum: get proposals
guarantor <-- forum: list of proposals
guarantor -> forum: put positive/negative feedback
alice -> bondcontract: create bond
guarantor -> bondcontract: contribute BIT tokens
guarantor <-- bondcontract: ERC20 Fungible bond tokens (1:1 swap)
' treasury
community -> forum: get proposals
community <-- forum: list of proposals
community -> forum: put positive/negative feedback
alice <-- forum: get positive/negative feedback
deactivate forum
community --> community: delegate votes
alice -> snapshot: submit proposal
activate snapshot
tokenholders -> snapshot: get proposals
tokenholders <-- snapshot: list of proposals
tokenholders -> snapshot: vote on open proposals
tokenholders <-- snapshot: vote confirmation
deactivate snapshot
bitdaoadmin -> bitdaotreasury: allow funds transfer
bitdaotreasury -> grantstreasury: transfer funds
' execution
alice --> alice: execute proposal
' tranche request
'alice -> forum: create tranche release request forum proposal
'activate forum
'guarantor -> forum: get proposals
'guarantor <-- forum: list of proposals
'guarantor -> forum: put positive/negative feedback
'
'community -> forum: get proposals
'community <-- forum: list of proposals
'community -> forum: put positive/negative feedback
'
'alice <-- forum: get positive/negative feedback
'deactivate forum
'
'community --> community: delegate votes
' bond release
alice -> forum: create bond release request forum proposal
activate forum
guarantor -> forum: get proposals
guarantor <-- forum: list of proposals
guarantor -> forum: put positive/negative feedback
community -> forum: get proposals
community <-- forum: list of proposals
community -> forum: put positive/negative feedback
alice <-- forum: get positive/negative feedback
deactivate forum
community --> community: delegate votes
alice -> snapshot: submit bond release request proposal
activate snapshot
guarantor -> snapshot: get proposals
guarantor <-- snapshot: list of proposals
guarantor -> snapshot: vote to release or proportional slash
tokenholders -> snapshot: get proposals
tokenholders <-- snapshot: list of proposals
tokenholders -> snapshot: vote on open proposals
tokenholders <-- snapshot: vote confirmation
deactivate snapshot
bitdaoadmin -> snapshot: get vote result
bitdaoadmin <-- snapshot: pass/fail proposal result
alt#Gold #LightBlue pass
bitdaoadmin -> bondcontract: release bond
bitdaoadmin <-- bondcontract: release confirmation
guarantor -> bondcontract: submit and redeem bond tokens
guarantor <-- bondcontract: transfer BIT tokens
else #Pink fail
bitdaoadmin -> bondcontract: slash bond
bondcontract -> bitdaotreasury: transfer any slashed BIT tokens
guarantor -> bondcontract: submit and redeem bond tokens (relative to non-slashed portion)
guarantor <-- bondcontract: transfer BIT tokens
end
alt#Gold #DarkSeaGreen trace
bitdaoadmin <-- bondcontract: TxHash
end
newpage
autonumber "Roles:[00]"
== Roles ==
alice -> forum: submit create role proposal
community -> forum: list role proposals
community <-- forum: role proposals
community -> forum: positive/negative feedback
alice <-- forum: get positive/negative feedback
community -> community: delegate votes
alice -> snapshot: create admin role
bitdaoadmin -> snapshot: list role proposals
bitdaoadmin <-- snapshot: role proposals
bitdaoadmin -> snapshot: get results
bitdaoadmin <-- snapshot: list of results
bitdaoadmin -> bitdaogovernance: create role
alt#Gold #DarkSeaGreen trace
bitdaoadmin <-- bitdaogovernance: TxHash
end
newpage
autonumber "Insurance:[00]"
== Insurance ==
alice -> insurancecontract: create insurance ticket
alice -> insurancecontract: pay for insurance daily / monthly
alice -> insurancecontract: compensate
community -> community: delegate votes
alice -> snapshot: submit proposal
guarantor -> snapshot: get proposals
guarantor <-- snapshot: list of proposals
guarantor -> snapshot: vote on proposal
guarantor <-- snapshot: vote confirmation
bitdaoadmin -> snapshot: get vote result
bitdaoadmin <-- snapshot: pass/fail vote result
bitdaoadmin -> bitdaotreasury: allow funds transfer
bitdaotreasury -> insurancecontract: transfer funds
alice <-- insurancecontract: execute proposal
bitdaoadmin -> insurancecontract: if (high debt) terminate alice insurance
community -> community: delegate votes
bitdaoadmin -> snapshot: submit proposal
guarantor -> snapshot: get all proposals
guarantor <-- snapshot: list of proposals
guarantor -> snapshot: vote on proposal
bitdaoadmin -> snapshot: get vote result
bitdaoadmin <-- snapshot: pass/fail vote result
bitdaoadmin -> insurancecontract: terminate insurance
bitdaoadmin <-- insurancecontract: execute proposal
newpage
autonumber "Rewards:[00]"
== Rewards ==
alice -> forum: create forum proposal
alice <- guarantor: positive/negative feedback
alice -> rewardscontract: create rewards program
community -> community: delegate votes
alice -> snapshot: submit proposal
bitdaoadmin -> bitdaotreasury: allow funds
bitdaotreasury -> rewardscontract: transfer funds for rewards
alice <-- rewardscontract: execute proposal
bob -> forum: create forum proposal
bob <- guarantor: positive/negative feedback
bob -> snapshot: submit release request
community -> community: delegate votes
community -> snapshot: vote
community -> rewardscontract: claim reward
@enduml