tx · 4vuJfi2arwN8NUw4DPiy5Mty5dsL8C8SmqbbBGHfAsAg 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA: -0.10000000 Waves 2020.12.22 13:21 [1319781] smart account 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA > SELF 0.00000000 Waves
{ "type": 13, "id": "4vuJfi2arwN8NUw4DPiy5Mty5dsL8C8SmqbbBGHfAsAg", "fee": 10000000, "feeAssetId": null, "timestamp": 1608632457910, "version": 2, "chainId": 84, "sender": "3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA", "senderPublicKey": "4xMxUnfdbHYsent96ThiYC63gXHiahi6bh3urdHHntHi", "proofs": [ "3v4oNpsePa6GD4z2mv6RsphZEeKsPQTcpVqVrYkS5BZwR8Tv7nXNMgP3654phfG1GuvVgN1UTUnNKVGD3ZCnovha" ], "script": "base64:AAIDAAAAAAAAADUIARIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIEgUKAwgICBIDCgEIEgMKAQgSAwoBCAAAAAsAAAAADG1haW5Db250cmFjdAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXdSemkyQm1xWlpYV3JDR0N3Y1JRTHNuaWMyQW9kNnpoUwAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbW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AAIk9VrQ==", "height": 1319781, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HkCL8mHt1CDtPsYzRroxvjCfdQ3reRB89WQJHbvg9cJL Next: JBdTBC39pTrjmWb4Zkt735KfDCRZpc2GTTftVgWL7xLK Diff:
Old | New | Differences | |
---|---|---|---|
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | + | func r (s) = if ((s == "like")) | |
110 | + | then 1 | |
111 | + | else if ((s == "dislike")) | |
112 | + | then -1 | |
113 | + | else throw("you need to vote with 'like' or 'dislike' value") | |
114 | + | ||
115 | + | ||
109 | 116 | @Callable(q) | |
110 | - | func addTask ( | |
117 | + | func addTask (t,u) = if (!(n(q.caller))) | |
111 | 118 | then throw("grants working group access only") | |
112 | - | else WriteSet([DataEntry((("tasks_" + toBase58String(q.transactionId)) + "_title"), | |
119 | + | else WriteSet([DataEntry((("tasks_" + toBase58String(q.transactionId)) + "_title"), t), DataEntry((("tasks_" + toBase58String(q.transactionId)) + "_link"), u)]) | |
113 | 120 | ||
114 | 121 | ||
115 | 122 | ||
116 | 123 | @Callable(q) | |
117 | - | func addReward ( | |
124 | + | func addReward (v) = if (!(n(q.caller))) | |
118 | 125 | then throw("grants working group access only") | |
119 | 126 | else { | |
120 | - | let | |
121 | - | WriteSet([DataEntry((("tasks_" + | |
127 | + | let w = extract(q.payment).amount | |
128 | + | WriteSet([DataEntry((("tasks_" + v) + "_reward"), w), DataEntry((("tasks_" + v) + "_status"), "proposed")]) | |
122 | 129 | } | |
123 | 130 | ||
124 | 131 | ||
125 | 132 | ||
126 | 133 | @Callable(q) | |
127 | - | func voteForTaskProposal ( | |
134 | + | func voteForTaskProposal (v,x) = if (!(p(q))) | |
128 | 135 | then throw("you can't vote") | |
129 | - | else if ((getStringValue(this, (("tasks_" + | |
136 | + | else if ((getStringValue(this, (("tasks_" + v) + "_status")) != "proposed")) | |
130 | 137 | then throw("voting is closed or not started") | |
131 | - | else if (if (( | |
132 | - | then ( | |
138 | + | else if (if ((x != "like")) | |
139 | + | then (x != "dislike") | |
133 | 140 | else false) | |
134 | - | then throw("you need to vote | |
141 | + | then throw("you need to vote like or dislike") | |
135 | 142 | else { | |
136 | - | let w = ((("tasks_" + t) + "_voted_") + toString(q.caller)) | |
137 | - | let x = c(w) | |
138 | - | if (!((x == 0))) | |
143 | + | let y = r(x) | |
144 | + | let z = ((("tasks_" + v) + "_voted_") + toString(q.caller)) | |
145 | + | let A = c(z) | |
146 | + | if (!((A == 0))) | |
139 | 147 | then throw("you have already voted") | |
140 | 148 | else { | |
141 | - | let | |
142 | - | let | |
143 | - | let | |
144 | - | let | |
145 | - | let | |
146 | - | ScriptResult(WriteSet([DataEntry( | |
149 | + | let B = (("tasks_" + v) + "_voting_state") | |
150 | + | let C = c(B) | |
151 | + | let D = (("tasks_" + v) + "_voting_amount") | |
152 | + | let E = (c(B) + 1) | |
153 | + | let F = (C + y) | |
154 | + | ScriptResult(WriteSet([DataEntry(B, F), DataEntry(z, y), DataEntry(D, E)]), TransferSet([ScriptTransfer(q.caller, 500000, unit)])) | |
147 | 155 | } | |
148 | 156 | } | |
149 | 157 | ||
150 | 158 | ||
151 | 159 | ||
152 | 160 | @Callable(q) | |
153 | - | func finishTaskProposalVoting ( | |
161 | + | func finishTaskProposalVoting (v) = if ((b > ((c((("tasks_" + v) + "_voting_amount")) * 100) / m()))) | |
154 | 162 | then throw((("more than " + toString(b)) + "% members have to vote before finishing the voting")) | |
155 | 163 | else if (!(n(q.caller))) | |
156 | 164 | then throw("grants working group access only") | |
157 | 165 | else { | |
158 | - | let | |
159 | - | let | |
160 | - | if (( | |
166 | + | let B = (("tasks_" + v) + "_voting_state") | |
167 | + | let C = c(B) | |
168 | + | if ((C > 0)) | |
161 | 169 | then { | |
162 | - | let | |
163 | - | WriteSet([DataEntry((("tasks_" + | |
170 | + | let G = "ready_to_apply" | |
171 | + | WriteSet([DataEntry((("tasks_" + v) + "_status"), G)]) | |
164 | 172 | } | |
165 | 173 | else { | |
166 | - | let | |
167 | - | WriteSet([DataEntry((("tasks_" + | |
174 | + | let G = "rejected" | |
175 | + | WriteSet([DataEntry((("tasks_" + v) + "_status"), G)]) | |
168 | 176 | } | |
169 | 177 | } | |
170 | 178 | ||
171 | 179 | ||
172 | 180 | ||
173 | 181 | @Callable(q) | |
174 | - | func applyForTask ( | |
175 | - | let | |
176 | - | if (( | |
182 | + | func applyForTask (v,H,u) = { | |
183 | + | let I = h((("tasks_" + v) + "_status")) | |
184 | + | if ((I != "ready_to_apply")) | |
177 | 185 | then throw("This grant has not yet been approved") | |
178 | 186 | else { | |
179 | - | let | |
180 | - | let | |
181 | - | let | |
182 | - | let | |
183 | - | WriteSet([DataEntry((((("tasks_" + | |
187 | + | let J = (("tasks_" + v) + "_applicants") | |
188 | + | let K = h(J) | |
189 | + | let L = drop(toString(q.caller), 10) | |
190 | + | let M = ((K + ";") + toString(q.caller)) | |
191 | + | WriteSet([DataEntry((((("tasks_" + v) + "_app_") + L) + "_name"), H), DataEntry((((("tasks_" + v) + "_app_") + L) + "_link"), u), DataEntry((((("tasks_" + v) + "_app_") + L) + "_leader"), toString(q.caller)), DataEntry((((("tasks_" + v) + "_app_") + L) + "_id"), L), DataEntry(J, M)]) | |
184 | 192 | } | |
185 | 193 | } | |
186 | 194 | ||
187 | 195 | ||
188 | 196 | ||
189 | 197 | @Callable(q) | |
190 | - | func voteForApplicant ( | |
198 | + | func voteForApplicant (v,N,x) = if (!(p(q))) | |
191 | 199 | then throw("you can't vote") | |
192 | 200 | else { | |
193 | - | let | |
194 | - | let | |
195 | - | let | |
196 | - | if (( | |
201 | + | let O = (drop(toString(q.caller), 10) + drop(N, 10)) | |
202 | + | let z = ((("tasks_" + v) + "_vote_") + O) | |
203 | + | let P = c(z) | |
204 | + | if ((P != 0)) | |
197 | 205 | then throw("you have already voted on this team") | |
198 | 206 | else { | |
199 | - | let N = (((("tasks_" + t) + "_app_") + K) + "_votes") | |
200 | - | let O = (((("tasks_" + t) + "_app_") + K) + "_score") | |
201 | - | let P = (1 + c(N)) | |
202 | - | let Q = (v + c(O)) | |
203 | - | WriteSet([DataEntry(w, v), DataEntry(O, Q)]) | |
207 | + | let y = r(x) | |
208 | + | let Q = (((("tasks_" + v) + "_app_") + N) + "_votes") | |
209 | + | let R = (((("tasks_" + v) + "_app_") + N) + "_score") | |
210 | + | let S = (1 + c(Q)) | |
211 | + | let T = (y + c(R)) | |
212 | + | WriteSet([DataEntry(z, y), DataEntry(R, T)]) | |
204 | 213 | } | |
205 | 214 | } | |
206 | 215 | ||
207 | 216 | ||
208 | 217 | ||
209 | 218 | @Callable(q) | |
210 | - | func finishApplicantsVoting ( | |
211 | - | func | |
212 | - | let | |
213 | - | let | |
214 | - | let | |
215 | - | let | |
216 | - | let | |
217 | - | if (( | |
219 | + | func finishApplicantsVoting (v) = { | |
220 | + | func U (V,W) = { | |
221 | + | let J = (("tasks_" + v) + "_applicants") | |
222 | + | let X = split(getStringValue(this, J), ";") | |
223 | + | let N = X[V] | |
224 | + | let Q = (((("tasks_" + v) + "_app_") + N) + "_votes") | |
225 | + | let S = c(Q) | |
226 | + | if ((S > 0)) | |
218 | 227 | then 1 | |
219 | - | else throw(("not enough votes to make decision on " + | |
228 | + | else throw(("not enough votes to make decision on " + N)) | |
220 | 229 | } | |
221 | 230 | ||
222 | - | func | |
223 | - | let | |
224 | - | let | |
225 | - | let | |
226 | - | let | |
227 | - | let | |
228 | - | let | |
229 | - | let | |
230 | - | let | |
231 | - | if (( | |
232 | - | then | |
233 | - | else | |
231 | + | func Y (V,W) = { | |
232 | + | let J = (("tasks_" + v) + "_applicants") | |
233 | + | let X = split(getStringValue(this, J), ";") | |
234 | + | let N = X[V] | |
235 | + | let Q = (((("tasks_" + v) + "_app_") + N) + "_votes") | |
236 | + | let S = c(Q) | |
237 | + | let Z = X[W] | |
238 | + | let aa = (((("tasks_" + v) + "_app_") + Z) + "_votes") | |
239 | + | let ab = c(aa) | |
240 | + | if ((S > ab)) | |
241 | + | then V | |
242 | + | else W | |
234 | 243 | } | |
235 | 244 | ||
236 | 245 | if (!(n(q.caller))) | |
237 | 246 | then throw("grants working group access only") | |
238 | 247 | else { | |
239 | - | let | |
240 | - | let | |
241 | - | if ((size( | |
248 | + | let ac = h((("tasks_" + v) + "_applicants")) | |
249 | + | let X = split(ac, ";") | |
250 | + | if ((size(X) == 0)) | |
242 | 251 | then throw("No one has yet responded to the grant") | |
243 | 252 | else { | |
244 | - | let | |
245 | - | let | |
246 | - | let | |
247 | - | let | |
248 | - | if (( | |
249 | - | then | |
253 | + | let ad = { | |
254 | + | let ae = [0, 1] | |
255 | + | let af = size(ae) | |
256 | + | let ag = 0 | |
257 | + | if ((af == 0)) | |
258 | + | then ag | |
250 | 259 | else { | |
251 | - | let | |
252 | - | if (( | |
253 | - | then | |
260 | + | let ah = Y(ag, ae[0]) | |
261 | + | if ((af == 1)) | |
262 | + | then ah | |
254 | 263 | else { | |
255 | - | let | |
256 | - | if (( | |
257 | - | then | |
264 | + | let ai = Y(ah, ae[1]) | |
265 | + | if ((af == 2)) | |
266 | + | then ai | |
258 | 267 | else { | |
259 | - | let | |
268 | + | let aj = Y(ai, ae[2]) | |
260 | 269 | throw("List size exceed 2") | |
261 | 270 | } | |
262 | 271 | } | |
263 | 272 | } | |
264 | 273 | } | |
265 | - | let | |
266 | - | WriteSet([DataEntry((("tasks_" + | |
274 | + | let N = X[ad] | |
275 | + | WriteSet([DataEntry((("tasks_" + v) + "_status"), "team_chosen"), DataEntry((("tasks_" + v) + "_performer"), N), DataEntry((((("tasks_" + v) + "_app_") + N) + "_process"), "can_begin")]) | |
267 | 276 | } | |
268 | 277 | } | |
269 | 278 | } | |
271 | 280 | ||
272 | 281 | ||
273 | 282 | @Callable(q) | |
274 | - | func startWork ( | |
275 | - | let | |
276 | - | if ((toString(q.caller) != getStringValue(this, (((("tasks_" + | |
283 | + | func startWork (v) = { | |
284 | + | let N = getStringValue(this, (("tasks_" + v) + "_performer")) | |
285 | + | if ((toString(q.caller) != getStringValue(this, (((("tasks_" + v) + "_app_") + N) + "_leader")))) | |
277 | 286 | then throw("team leader only") | |
278 | - | else WriteSet([DataEntry((("tasks_" + | |
287 | + | else WriteSet([DataEntry((("tasks_" + v) + "_status"), "work_started"), DataEntry((((("tasks_" + v) + "_app_") + N) + "_process"), "work_started")]) | |
279 | 288 | } | |
280 | 289 | ||
281 | 290 | ||
282 | 291 | ||
283 | 292 | @Callable(q) | |
284 | - | func acceptWorkResult ( | |
293 | + | func acceptWorkResult (v) = if (!(n(q.caller))) | |
285 | 294 | then throw("grants working group access only") | |
286 | 295 | else { | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + | |
296 | + | let ak = c((("tasks_" + v) + "_reward")) | |
297 | + | let N = getStringValue(this, (("tasks_" + v) + "_performer")) | |
298 | + | let al = getStringValue(this, (((("tasks_" + v) + "_app_") + N) + "_leader")) | |
299 | + | ScriptResult(WriteSet([DataEntry((("tasks_" + v) + "_status"), "work_finished"), DataEntry((((("tasks_" + v) + "_app_") + N) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(al), ak, unit)])) | |
291 | 300 | } | |
292 | 301 | ||
293 | 302 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = addressFromStringValue("3MwRzi2BmqZZXWrCGCwcRQLsnic2Aod6zhS") | |
5 | 5 | ||
6 | 6 | let b = 1 | |
7 | 7 | ||
8 | 8 | func c (d) = { | |
9 | 9 | let e = { | |
10 | 10 | let f = getInteger(this, d) | |
11 | 11 | if ($isInstanceOf(f, "Int")) | |
12 | 12 | then { | |
13 | 13 | let g = f | |
14 | 14 | g | |
15 | 15 | } | |
16 | 16 | else 0 | |
17 | 17 | } | |
18 | 18 | e | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func h (d) = { | |
23 | 23 | let e = { | |
24 | 24 | let f = getString(this, d) | |
25 | 25 | if ($isInstanceOf(f, "String")) | |
26 | 26 | then { | |
27 | 27 | let g = f | |
28 | 28 | g | |
29 | 29 | } | |
30 | 30 | else "" | |
31 | 31 | } | |
32 | 32 | e | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func i (j) = (j == this) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func k () = { | |
40 | 40 | let e = { | |
41 | 41 | let f = getString(a, "working_group_members") | |
42 | 42 | if ($isInstanceOf(f, "String")) | |
43 | 43 | then { | |
44 | 44 | let g = f | |
45 | 45 | g | |
46 | 46 | } | |
47 | 47 | else "" | |
48 | 48 | } | |
49 | 49 | e | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func l () = { | |
54 | 54 | let e = { | |
55 | 55 | let f = getString(a, "dao_members") | |
56 | 56 | if ($isInstanceOf(f, "String")) | |
57 | 57 | then { | |
58 | 58 | let g = f | |
59 | 59 | g | |
60 | 60 | } | |
61 | 61 | else "" | |
62 | 62 | } | |
63 | 63 | e | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func m () = { | |
68 | 68 | let e = { | |
69 | 69 | let f = getInteger(a, "dao_size") | |
70 | 70 | if ($isInstanceOf(f, "Int")) | |
71 | 71 | then { | |
72 | 72 | let g = f | |
73 | 73 | g | |
74 | 74 | } | |
75 | 75 | else 0 | |
76 | 76 | } | |
77 | 77 | e | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func n (o) = { | |
82 | 82 | let e = { | |
83 | 83 | let f = getInteger(a, (("working_group_member_" + toString(o)) + "_weight")) | |
84 | 84 | if ($isInstanceOf(f, "Int")) | |
85 | 85 | then { | |
86 | 86 | let g = f | |
87 | 87 | g | |
88 | 88 | } | |
89 | 89 | else 0 | |
90 | 90 | } | |
91 | 91 | (e > 0) | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func p (q) = { | |
96 | 96 | let e = { | |
97 | 97 | let f = getInteger(a, (("dao_member_" + toString(q.caller)) + "_weight")) | |
98 | 98 | if ($isInstanceOf(f, "Int")) | |
99 | 99 | then { | |
100 | 100 | let g = f | |
101 | 101 | g | |
102 | 102 | } | |
103 | 103 | else 0 | |
104 | 104 | } | |
105 | 105 | (e > 0) | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | + | func r (s) = if ((s == "like")) | |
110 | + | then 1 | |
111 | + | else if ((s == "dislike")) | |
112 | + | then -1 | |
113 | + | else throw("you need to vote with 'like' or 'dislike' value") | |
114 | + | ||
115 | + | ||
109 | 116 | @Callable(q) | |
110 | - | func addTask ( | |
117 | + | func addTask (t,u) = if (!(n(q.caller))) | |
111 | 118 | then throw("grants working group access only") | |
112 | - | else WriteSet([DataEntry((("tasks_" + toBase58String(q.transactionId)) + "_title"), | |
119 | + | else WriteSet([DataEntry((("tasks_" + toBase58String(q.transactionId)) + "_title"), t), DataEntry((("tasks_" + toBase58String(q.transactionId)) + "_link"), u)]) | |
113 | 120 | ||
114 | 121 | ||
115 | 122 | ||
116 | 123 | @Callable(q) | |
117 | - | func addReward ( | |
124 | + | func addReward (v) = if (!(n(q.caller))) | |
118 | 125 | then throw("grants working group access only") | |
119 | 126 | else { | |
120 | - | let | |
121 | - | WriteSet([DataEntry((("tasks_" + | |
127 | + | let w = extract(q.payment).amount | |
128 | + | WriteSet([DataEntry((("tasks_" + v) + "_reward"), w), DataEntry((("tasks_" + v) + "_status"), "proposed")]) | |
122 | 129 | } | |
123 | 130 | ||
124 | 131 | ||
125 | 132 | ||
126 | 133 | @Callable(q) | |
127 | - | func voteForTaskProposal ( | |
134 | + | func voteForTaskProposal (v,x) = if (!(p(q))) | |
128 | 135 | then throw("you can't vote") | |
129 | - | else if ((getStringValue(this, (("tasks_" + | |
136 | + | else if ((getStringValue(this, (("tasks_" + v) + "_status")) != "proposed")) | |
130 | 137 | then throw("voting is closed or not started") | |
131 | - | else if (if (( | |
132 | - | then ( | |
138 | + | else if (if ((x != "like")) | |
139 | + | then (x != "dislike") | |
133 | 140 | else false) | |
134 | - | then throw("you need to vote | |
141 | + | then throw("you need to vote like or dislike") | |
135 | 142 | else { | |
136 | - | let w = ((("tasks_" + t) + "_voted_") + toString(q.caller)) | |
137 | - | let x = c(w) | |
138 | - | if (!((x == 0))) | |
143 | + | let y = r(x) | |
144 | + | let z = ((("tasks_" + v) + "_voted_") + toString(q.caller)) | |
145 | + | let A = c(z) | |
146 | + | if (!((A == 0))) | |
139 | 147 | then throw("you have already voted") | |
140 | 148 | else { | |
141 | - | let | |
142 | - | let | |
143 | - | let | |
144 | - | let | |
145 | - | let | |
146 | - | ScriptResult(WriteSet([DataEntry( | |
149 | + | let B = (("tasks_" + v) + "_voting_state") | |
150 | + | let C = c(B) | |
151 | + | let D = (("tasks_" + v) + "_voting_amount") | |
152 | + | let E = (c(B) + 1) | |
153 | + | let F = (C + y) | |
154 | + | ScriptResult(WriteSet([DataEntry(B, F), DataEntry(z, y), DataEntry(D, E)]), TransferSet([ScriptTransfer(q.caller, 500000, unit)])) | |
147 | 155 | } | |
148 | 156 | } | |
149 | 157 | ||
150 | 158 | ||
151 | 159 | ||
152 | 160 | @Callable(q) | |
153 | - | func finishTaskProposalVoting ( | |
161 | + | func finishTaskProposalVoting (v) = if ((b > ((c((("tasks_" + v) + "_voting_amount")) * 100) / m()))) | |
154 | 162 | then throw((("more than " + toString(b)) + "% members have to vote before finishing the voting")) | |
155 | 163 | else if (!(n(q.caller))) | |
156 | 164 | then throw("grants working group access only") | |
157 | 165 | else { | |
158 | - | let | |
159 | - | let | |
160 | - | if (( | |
166 | + | let B = (("tasks_" + v) + "_voting_state") | |
167 | + | let C = c(B) | |
168 | + | if ((C > 0)) | |
161 | 169 | then { | |
162 | - | let | |
163 | - | WriteSet([DataEntry((("tasks_" + | |
170 | + | let G = "ready_to_apply" | |
171 | + | WriteSet([DataEntry((("tasks_" + v) + "_status"), G)]) | |
164 | 172 | } | |
165 | 173 | else { | |
166 | - | let | |
167 | - | WriteSet([DataEntry((("tasks_" + | |
174 | + | let G = "rejected" | |
175 | + | WriteSet([DataEntry((("tasks_" + v) + "_status"), G)]) | |
168 | 176 | } | |
169 | 177 | } | |
170 | 178 | ||
171 | 179 | ||
172 | 180 | ||
173 | 181 | @Callable(q) | |
174 | - | func applyForTask ( | |
175 | - | let | |
176 | - | if (( | |
182 | + | func applyForTask (v,H,u) = { | |
183 | + | let I = h((("tasks_" + v) + "_status")) | |
184 | + | if ((I != "ready_to_apply")) | |
177 | 185 | then throw("This grant has not yet been approved") | |
178 | 186 | else { | |
179 | - | let | |
180 | - | let | |
181 | - | let | |
182 | - | let | |
183 | - | WriteSet([DataEntry((((("tasks_" + | |
187 | + | let J = (("tasks_" + v) + "_applicants") | |
188 | + | let K = h(J) | |
189 | + | let L = drop(toString(q.caller), 10) | |
190 | + | let M = ((K + ";") + toString(q.caller)) | |
191 | + | WriteSet([DataEntry((((("tasks_" + v) + "_app_") + L) + "_name"), H), DataEntry((((("tasks_" + v) + "_app_") + L) + "_link"), u), DataEntry((((("tasks_" + v) + "_app_") + L) + "_leader"), toString(q.caller)), DataEntry((((("tasks_" + v) + "_app_") + L) + "_id"), L), DataEntry(J, M)]) | |
184 | 192 | } | |
185 | 193 | } | |
186 | 194 | ||
187 | 195 | ||
188 | 196 | ||
189 | 197 | @Callable(q) | |
190 | - | func voteForApplicant ( | |
198 | + | func voteForApplicant (v,N,x) = if (!(p(q))) | |
191 | 199 | then throw("you can't vote") | |
192 | 200 | else { | |
193 | - | let | |
194 | - | let | |
195 | - | let | |
196 | - | if (( | |
201 | + | let O = (drop(toString(q.caller), 10) + drop(N, 10)) | |
202 | + | let z = ((("tasks_" + v) + "_vote_") + O) | |
203 | + | let P = c(z) | |
204 | + | if ((P != 0)) | |
197 | 205 | then throw("you have already voted on this team") | |
198 | 206 | else { | |
199 | - | let N = (((("tasks_" + t) + "_app_") + K) + "_votes") | |
200 | - | let O = (((("tasks_" + t) + "_app_") + K) + "_score") | |
201 | - | let P = (1 + c(N)) | |
202 | - | let Q = (v + c(O)) | |
203 | - | WriteSet([DataEntry(w, v), DataEntry(O, Q)]) | |
207 | + | let y = r(x) | |
208 | + | let Q = (((("tasks_" + v) + "_app_") + N) + "_votes") | |
209 | + | let R = (((("tasks_" + v) + "_app_") + N) + "_score") | |
210 | + | let S = (1 + c(Q)) | |
211 | + | let T = (y + c(R)) | |
212 | + | WriteSet([DataEntry(z, y), DataEntry(R, T)]) | |
204 | 213 | } | |
205 | 214 | } | |
206 | 215 | ||
207 | 216 | ||
208 | 217 | ||
209 | 218 | @Callable(q) | |
210 | - | func finishApplicantsVoting ( | |
211 | - | func | |
212 | - | let | |
213 | - | let | |
214 | - | let | |
215 | - | let | |
216 | - | let | |
217 | - | if (( | |
219 | + | func finishApplicantsVoting (v) = { | |
220 | + | func U (V,W) = { | |
221 | + | let J = (("tasks_" + v) + "_applicants") | |
222 | + | let X = split(getStringValue(this, J), ";") | |
223 | + | let N = X[V] | |
224 | + | let Q = (((("tasks_" + v) + "_app_") + N) + "_votes") | |
225 | + | let S = c(Q) | |
226 | + | if ((S > 0)) | |
218 | 227 | then 1 | |
219 | - | else throw(("not enough votes to make decision on " + | |
228 | + | else throw(("not enough votes to make decision on " + N)) | |
220 | 229 | } | |
221 | 230 | ||
222 | - | func | |
223 | - | let | |
224 | - | let | |
225 | - | let | |
226 | - | let | |
227 | - | let | |
228 | - | let | |
229 | - | let | |
230 | - | let | |
231 | - | if (( | |
232 | - | then | |
233 | - | else | |
231 | + | func Y (V,W) = { | |
232 | + | let J = (("tasks_" + v) + "_applicants") | |
233 | + | let X = split(getStringValue(this, J), ";") | |
234 | + | let N = X[V] | |
235 | + | let Q = (((("tasks_" + v) + "_app_") + N) + "_votes") | |
236 | + | let S = c(Q) | |
237 | + | let Z = X[W] | |
238 | + | let aa = (((("tasks_" + v) + "_app_") + Z) + "_votes") | |
239 | + | let ab = c(aa) | |
240 | + | if ((S > ab)) | |
241 | + | then V | |
242 | + | else W | |
234 | 243 | } | |
235 | 244 | ||
236 | 245 | if (!(n(q.caller))) | |
237 | 246 | then throw("grants working group access only") | |
238 | 247 | else { | |
239 | - | let | |
240 | - | let | |
241 | - | if ((size( | |
248 | + | let ac = h((("tasks_" + v) + "_applicants")) | |
249 | + | let X = split(ac, ";") | |
250 | + | if ((size(X) == 0)) | |
242 | 251 | then throw("No one has yet responded to the grant") | |
243 | 252 | else { | |
244 | - | let | |
245 | - | let | |
246 | - | let | |
247 | - | let | |
248 | - | if (( | |
249 | - | then | |
253 | + | let ad = { | |
254 | + | let ae = [0, 1] | |
255 | + | let af = size(ae) | |
256 | + | let ag = 0 | |
257 | + | if ((af == 0)) | |
258 | + | then ag | |
250 | 259 | else { | |
251 | - | let | |
252 | - | if (( | |
253 | - | then | |
260 | + | let ah = Y(ag, ae[0]) | |
261 | + | if ((af == 1)) | |
262 | + | then ah | |
254 | 263 | else { | |
255 | - | let | |
256 | - | if (( | |
257 | - | then | |
264 | + | let ai = Y(ah, ae[1]) | |
265 | + | if ((af == 2)) | |
266 | + | then ai | |
258 | 267 | else { | |
259 | - | let | |
268 | + | let aj = Y(ai, ae[2]) | |
260 | 269 | throw("List size exceed 2") | |
261 | 270 | } | |
262 | 271 | } | |
263 | 272 | } | |
264 | 273 | } | |
265 | - | let | |
266 | - | WriteSet([DataEntry((("tasks_" + | |
274 | + | let N = X[ad] | |
275 | + | WriteSet([DataEntry((("tasks_" + v) + "_status"), "team_chosen"), DataEntry((("tasks_" + v) + "_performer"), N), DataEntry((((("tasks_" + v) + "_app_") + N) + "_process"), "can_begin")]) | |
267 | 276 | } | |
268 | 277 | } | |
269 | 278 | } | |
270 | 279 | ||
271 | 280 | ||
272 | 281 | ||
273 | 282 | @Callable(q) | |
274 | - | func startWork ( | |
275 | - | let | |
276 | - | if ((toString(q.caller) != getStringValue(this, (((("tasks_" + | |
283 | + | func startWork (v) = { | |
284 | + | let N = getStringValue(this, (("tasks_" + v) + "_performer")) | |
285 | + | if ((toString(q.caller) != getStringValue(this, (((("tasks_" + v) + "_app_") + N) + "_leader")))) | |
277 | 286 | then throw("team leader only") | |
278 | - | else WriteSet([DataEntry((("tasks_" + | |
287 | + | else WriteSet([DataEntry((("tasks_" + v) + "_status"), "work_started"), DataEntry((((("tasks_" + v) + "_app_") + N) + "_process"), "work_started")]) | |
279 | 288 | } | |
280 | 289 | ||
281 | 290 | ||
282 | 291 | ||
283 | 292 | @Callable(q) | |
284 | - | func acceptWorkResult ( | |
293 | + | func acceptWorkResult (v) = if (!(n(q.caller))) | |
285 | 294 | then throw("grants working group access only") | |
286 | 295 | else { | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + | |
296 | + | let ak = c((("tasks_" + v) + "_reward")) | |
297 | + | let N = getStringValue(this, (("tasks_" + v) + "_performer")) | |
298 | + | let al = getStringValue(this, (((("tasks_" + v) + "_app_") + N) + "_leader")) | |
299 | + | ScriptResult(WriteSet([DataEntry((("tasks_" + v) + "_status"), "work_finished"), DataEntry((((("tasks_" + v) + "_app_") + N) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(al), ak, unit)])) | |
291 | 300 | } | |
292 | 301 | ||
293 | 302 |
github/deemru/w8io/026f985 141.24 ms ◑