tx · 21am3aLM3SHgmN51wmfpBvLYRWCnEKGbpcGAX6huFtRy 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA: -0.10000000 Waves 2020.12.27 05:56 [1326532] smart account 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA > SELF 0.00000000 Waves
{ "type": 13, "id": "21am3aLM3SHgmN51wmfpBvLYRWCnEKGbpcGAX6huFtRy", "fee": 10000000, "feeAssetId": null, "timestamp": 1609037806194, "version": 2, "chainId": 84, "sender": "3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA", "senderPublicKey": "4xMxUnfdbHYsent96ThiYC63gXHiahi6bh3urdHHntHi", "proofs": [ "2qoXarm4BgJbyZmHReDKwcCT979W1H41GhMSpHcvACJbDmCyJyRsgv7BPNTXvNQhM4jV52mv3wZBPos4jaSxJPeG" ], "script": "base64:AAIDAAAAAAAAADsIARIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIEgUKAwgICBIDCgEIEgMKAQgSBAoCCAgSAwoBCAAAABQAAAAADG1haW5Db250cmFjdAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXdSemkyQm1xWlpYV3JDR0N3Y1JRTHNuaWMyQW9kNnpoUwAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0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m9jZXNzAgAAAA13b3JrX2ZpbmlzaGVkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAAB19yZXBvcnQFAAAACnJlcG9ydExpbmsFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAC3RlYW1BZGRyZXNzBQAAAAxyZXdhcmRBbW91bnQFAAAABHVuaXQFAAAAA25pbAkAAAIAAAABAgAAABVjaGVja3MgYXJlIG5vdCBwYXNzZWQAAAABaQEAAAAKcmVqZWN0VGFzawAAAAEAAAAGdGFza0lkAwkBAAAADWlzR3JvdXBNZW1iZXIAAAABCAUAAAABaQAAAAZjYWxsZXIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3N0YXR1cwIAAAAIcmVqZWN0ZWQFAAAAA25pbAkAAAIAAAABAgAAACBncmFudHMgd29ya2luZyBncm91cCBhY2Nlc3Mgb25seQAAAACRmQP+", "height": 1326532, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5eteApA1NbRDfEdfDL7QCSmy2ARWbPNyxEF1XjcgHY8E Next: BeqCv6w7wz1CzpU11NU7EQVwmV4EDqGHHX4SxmqTU3oP Diff:
Old | New | Differences | |
---|---|---|---|
142 | 142 | func finishApplicantsVotingConditions (address,taskId,applicantsList) = if (!(isGroupMember(address))) | |
143 | 143 | then throw("grants working group access only") | |
144 | 144 | else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply")) | |
145 | - | then throw(" | |
145 | + | then throw("voting is not active") | |
146 | 146 | else if ((size(applicantsList) == 0)) | |
147 | 147 | then throw("no one has yet responded to the grant") | |
148 | 148 | else true |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let mainContract = addressFromStringValue("3MwRzi2BmqZZXWrCGCwcRQLsnic2Aod6zhS") | |
5 | 5 | ||
6 | 6 | let QUORUM = 1 | |
7 | 7 | ||
8 | 8 | func tryGetInteger (key) = { | |
9 | 9 | let val = match getInteger(this, key) { | |
10 | 10 | case b: Int => | |
11 | 11 | b | |
12 | 12 | case _ => | |
13 | 13 | 0 | |
14 | 14 | } | |
15 | 15 | val | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func tryGetString (key) = { | |
20 | 20 | let val = match getString(this, key) { | |
21 | 21 | case b: String => | |
22 | 22 | b | |
23 | 23 | case _ => | |
24 | 24 | "" | |
25 | 25 | } | |
26 | 26 | val | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func isOwner (address) = (address == this) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getGroup () = { | |
34 | 34 | let val = match getString(mainContract, "working_group_members") { | |
35 | 35 | case b: String => | |
36 | 36 | b | |
37 | 37 | case _ => | |
38 | 38 | "" | |
39 | 39 | } | |
40 | 40 | val | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getMembers () = { | |
45 | 45 | let val = match getString(mainContract, "dao_members") { | |
46 | 46 | case b: String => | |
47 | 47 | b | |
48 | 48 | case _ => | |
49 | 49 | "" | |
50 | 50 | } | |
51 | 51 | val | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getDAOSize () = { | |
56 | 56 | let val = match getInteger(mainContract, "dao_size") { | |
57 | 57 | case b: Int => | |
58 | 58 | b | |
59 | 59 | case _ => | |
60 | 60 | 0 | |
61 | 61 | } | |
62 | 62 | val | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func isGroupMember (a) = { | |
67 | 67 | let val = match getInteger(mainContract, (("working_group_member_" + toString(a)) + "_weight")) { | |
68 | 68 | case b: Int => | |
69 | 69 | b | |
70 | 70 | case _ => | |
71 | 71 | 0 | |
72 | 72 | } | |
73 | 73 | (val > 0) | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func canMemberVote (address) = { | |
78 | 78 | let val = match getInteger(mainContract, (("dao_member_" + toString(address)) + "_weight")) { | |
79 | 79 | case b: Int => | |
80 | 80 | b | |
81 | 81 | case _ => | |
82 | 82 | 0 | |
83 | 83 | } | |
84 | 84 | (val > 0) | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getVoteValue (s) = if ((s == "like")) | |
89 | 89 | then 1 | |
90 | 90 | else if ((s == "dislike")) | |
91 | 91 | then -1 | |
92 | 92 | else throw("you need to vote with 'like' or 'dislike' value") | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func addTaskConditions (address) = if (!(isGroupMember(address))) | |
96 | 96 | then throw("grants working group access only") | |
97 | 97 | else true | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func addRewardConditions (address,taskId) = if (!(isGroupMember(address))) | |
101 | 101 | then throw("grants working group access only") | |
102 | 102 | else if ((tryGetString((("tasks_" + taskId) + "_status")) != "")) | |
103 | 103 | then throw("grant isn`t new") | |
104 | 104 | else true | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func voteForTaskProposalConditions (address,taskId) = if (!(canMemberVote(address))) | |
108 | 108 | then throw("you can't vote") | |
109 | 109 | else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed")) | |
110 | 110 | then throw("voting is closed or not started") | |
111 | 111 | else if ((tryGetInteger(((("tasks_" + taskId) + "_voted_") + toString(address))) != 0)) | |
112 | 112 | then throw("you have already voted") | |
113 | 113 | else true | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func finishTaskProposalVotingConditions (address,taskId) = if (!(isGroupMember(address))) | |
117 | 117 | then throw("grants working group access only") | |
118 | 118 | else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed")) | |
119 | 119 | then throw("voting is not active") | |
120 | 120 | else if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize()))) | |
121 | 121 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
122 | 122 | else true | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func applyForTaskConditions (address,taskId,teamIdentifier) = if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply")) | |
126 | 126 | then throw("this grant has not yet been approved") | |
127 | 127 | else if ((tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) == toString(address))) | |
128 | 128 | then throw("you are applied") | |
129 | 129 | else true | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func voteForApplicantConditions (address,taskId,teamIdentifier) = { | |
133 | 133 | let voteHash = (drop(toString(address), 10) + drop(teamIdentifier, 10)) | |
134 | 134 | if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply")) | |
135 | 135 | then throw("voting is not active") | |
136 | 136 | else if ((tryGetInteger(((("tasks_" + taskId) + "_vote_") + voteHash)) != 0)) | |
137 | 137 | then throw("you have already voted on this team") | |
138 | 138 | else true | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func finishApplicantsVotingConditions (address,taskId,applicantsList) = if (!(isGroupMember(address))) | |
143 | 143 | then throw("grants working group access only") | |
144 | 144 | else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply")) | |
145 | - | then throw(" | |
145 | + | then throw("voting is not active") | |
146 | 146 | else if ((size(applicantsList) == 0)) | |
147 | 147 | then throw("no one has yet responded to the grant") | |
148 | 148 | else true | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func startWorkConditions (address,taskId,teamIdentifier) = if ((tryGetString((("tasks_" + taskId) + "_status")) != "team_chosen")) | |
152 | 152 | then throw("winner is not define") | |
153 | 153 | else if ((toString(address) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
154 | 154 | then throw("team leader only") | |
155 | 155 | else true | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func acceptWorkResultConditions (address,taskId) = if (!(isGroupMember(address))) | |
159 | 159 | then throw("grants working group access only") | |
160 | 160 | else true | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | @Callable(i) | |
164 | 164 | func addTask (title,link) = if (addTaskConditions(i.caller)) | |
165 | 165 | then WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
166 | 166 | else throw("checks are not passed") | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | ||
170 | 170 | @Callable(i) | |
171 | 171 | func addReward (taskId) = if (addRewardConditions(i.caller, taskId)) | |
172 | 172 | then { | |
173 | 173 | let reward = extract(i.payment).amount | |
174 | 174 | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
175 | 175 | } | |
176 | 176 | else throw("checks are not passed") | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | ||
180 | 180 | @Callable(i) | |
181 | 181 | func voteForTaskProposal (taskId,voteValue) = if (voteForTaskProposalConditions(i.caller, taskId)) | |
182 | 182 | then { | |
183 | 183 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
184 | 184 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
185 | 185 | let votingState = tryGetInteger(votingKey) | |
186 | 186 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
187 | 187 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
188 | 188 | let voteValueInt = getVoteValue(voteValue) | |
189 | 189 | let newVotingState = (votingState + voteValueInt) | |
190 | 190 | WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValueInt), DataEntry(votesAmountKey, votesAmountState)]) | |
191 | 191 | } | |
192 | 192 | else throw("checks are not passed") | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | ||
196 | 196 | @Callable(i) | |
197 | 197 | func finishTaskProposalVoting (taskId) = if (finishTaskProposalVotingConditions(i.caller, taskId)) | |
198 | 198 | then { | |
199 | 199 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
200 | 200 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), if ((tryGetInteger(votingKey) > 0)) | |
201 | 201 | then "ready_to_apply" | |
202 | 202 | else "rejected")]) | |
203 | 203 | } | |
204 | 204 | else throw("checks are not passed") | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | ||
208 | 208 | @Callable(i) | |
209 | 209 | func applyForTask (taskId,teamName,link) = { | |
210 | 210 | let teamIdentifier = drop(toString(i.caller), 10) | |
211 | 211 | if (applyForTaskConditions(i.caller, taskId, teamIdentifier)) | |
212 | 212 | then { | |
213 | 213 | let listKey = (("tasks_" + taskId) + "_applicants") | |
214 | 214 | let currentApplicantsList = tryGetString(listKey) | |
215 | 215 | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
216 | 216 | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id"), teamIdentifier), DataEntry(listKey, newApplicantsList)]) | |
217 | 217 | } | |
218 | 218 | else throw("checks are not passed") | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (voteForApplicantConditions(i.caller, taskId, teamIdentifier)) | |
225 | 225 | then { | |
226 | 226 | let listKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted") | |
227 | 227 | let newApplicantsList = ((tryGetString(listKey) + ";") + toString(i.caller)) | |
228 | 228 | let voteHash = (drop(toString(i.caller), 20) + teamIdentifier) | |
229 | 229 | let voteKey = ((("tasks_" + taskId) + "_vh_") + voteHash) | |
230 | 230 | if ((tryGetString(voteKey) == toString(i.caller))) | |
231 | 231 | then throw("you have already voted on this team") | |
232 | 232 | else { | |
233 | 233 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
234 | 234 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
235 | 235 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
236 | 236 | let newTeamScore = (getVoteValue(voteValue) + tryGetInteger(teamScoreKey)) | |
237 | 237 | WriteSet([DataEntry(listKey, newApplicantsList), DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)]) | |
238 | 238 | } | |
239 | 239 | } | |
240 | 240 | else throw("checks are not passed") | |
241 | 241 | ||
242 | 242 | ||
243 | 243 | ||
244 | 244 | @Callable(i) | |
245 | 245 | func finishApplicantsVoting (taskId) = { | |
246 | 246 | func hasMoreVotes (aid,aid2) = { | |
247 | 247 | let listKey = (("tasks_" + taskId) + "_applicants") | |
248 | 248 | let applicantsList = split(getStringValue(this, listKey), ";") | |
249 | 249 | let teamIdentifier = applicantsList[aid] | |
250 | 250 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
251 | 251 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
252 | 252 | let team2Identifier = applicantsList[aid2] | |
253 | 253 | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
254 | 254 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
255 | 255 | if ((teamVotesAmount > team2VotesAmount)) | |
256 | 256 | then aid | |
257 | 257 | else aid2 | |
258 | 258 | } | |
259 | 259 | ||
260 | 260 | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
261 | 261 | let applicantsList = split(listKeys, ";") | |
262 | 262 | if (finishApplicantsVotingConditions(i.caller, taskId, applicantsList)) | |
263 | 263 | then { | |
264 | 264 | let chosenTeamId = { | |
265 | 265 | let $list1236212393 = [0, 1] | |
266 | 266 | let $size1236212393 = size($list1236212393) | |
267 | 267 | let $acc01236212393 = 0 | |
268 | 268 | if (($size1236212393 == 0)) | |
269 | 269 | then $acc01236212393 | |
270 | 270 | else { | |
271 | 271 | let $acc11236212393 = hasMoreVotes($acc01236212393, $list1236212393[0]) | |
272 | 272 | if (($size1236212393 == 1)) | |
273 | 273 | then $acc11236212393 | |
274 | 274 | else { | |
275 | 275 | let $acc21236212393 = hasMoreVotes($acc11236212393, $list1236212393[1]) | |
276 | 276 | if (($size1236212393 == 2)) | |
277 | 277 | then $acc21236212393 | |
278 | 278 | else { | |
279 | 279 | let $acc31236212393 = hasMoreVotes($acc21236212393, $list1236212393[2]) | |
280 | 280 | throw("List size exceed 2") | |
281 | 281 | } | |
282 | 282 | } | |
283 | 283 | } | |
284 | 284 | } | |
285 | 285 | let teamIdentifier = drop(applicantsList[chosenTeamId], 20) | |
286 | 286 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
287 | 287 | } | |
288 | 288 | else throw("checks are not passed") | |
289 | 289 | } | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | ||
293 | 293 | @Callable(i) | |
294 | 294 | func startWork (taskId) = { | |
295 | 295 | let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer")) | |
296 | 296 | if (startWorkConditions(i.caller, taskId, teamIdentifier)) | |
297 | 297 | then WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
298 | 298 | else throw("checks are not passed") | |
299 | 299 | } | |
300 | 300 | ||
301 | 301 | ||
302 | 302 | ||
303 | 303 | @Callable(i) | |
304 | 304 | func acceptWorkResult (taskId,reportLink) = if (acceptWorkResultConditions(i.caller, taskId)) | |
305 | 305 | then { | |
306 | 306 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
307 | 307 | let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer")) | |
308 | 308 | let teamAddress = tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
309 | 309 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished"), DataEntry((("tasks_" + taskId) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
310 | 310 | } | |
311 | 311 | else throw("checks are not passed") | |
312 | 312 | ||
313 | 313 | ||
314 | 314 | ||
315 | 315 | @Callable(i) | |
316 | 316 | func rejectTask (taskId) = if (isGroupMember(i.caller)) | |
317 | 317 | then WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")]) | |
318 | 318 | else throw("grants working group access only") | |
319 | 319 | ||
320 | 320 |
github/deemru/w8io/026f985 44.89 ms ◑