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