tx · C55mBGHXE4WypgeZ8cyyn9nyWgi15xiSfGWkP5dk6fui 3N2sQRGTRmL9NGZVVtzhfBEjEyVR7S9Mkum: -0.10000000 Waves 2020.11.30 20:19 [1288447] smart account 3N2sQRGTRmL9NGZVVtzhfBEjEyVR7S9Mkum > SELF 0.00000000 Waves
{ "type": 13, "id": "C55mBGHXE4WypgeZ8cyyn9nyWgi15xiSfGWkP5dk6fui", "fee": 10000000, "feeAssetId": null, "timestamp": 1606756771119, "version": 2, "chainId": 84, "sender": "3N2sQRGTRmL9NGZVVtzhfBEjEyVR7S9Mkum", "senderPublicKey": "J8SeDz97kvV9MTtzmwVB965Dz8iEWst5MzMzgUgG1dfK", "proofs": [ "sH1xw1pKihrp9jzNHLv42Fqb1qb5ns2ezVqxEbyxwN9cnLu2oBTbSZa8mtmoFTU2GUuPJLVgNGMG2PCpgBbmRrM" ], "script": "base64:AAIDAAAAAAAAAFAIARIECgIICBIECgIICBIECgIIARIDCgEIEgUKAwgICBIFCgMICAESAwoBCBIECgIICBIECgIICBIDCgEIEgUKAwgIARIFCgMICAgSAwoBCAAAAAkAAAAABlFVT1JVTQAAAAAAAAAAAQEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAEAAAAMdHJ5R2V0U3RyaW5nAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAABQAAAAN2YWwAAAAADG1haW5Db250cmFjdAUAAAAEdGhpcwEAAAAHaXNPd25lcgAAAAEAAAAHYWRkc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rSWQCAAAAB19zdGF0dXMCAAAADXdvcmtfZmluaXNoZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAABV9hcHBfBQAAABB3aW5uZXJJZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAAGd2lubmVyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAAB19yZXBvcnQFAAAACnJlcG9ydExpbmsFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAC3RlYW1BZGRyZXNzBQAAAAxyZXdhcmRBbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAFpAQAAAApyZWplY3RUYXNrAAAAAQAAAAZ0YXNrSWQDCQEAAAABIQAAAAEJAQAAAA1pc0dyb3VwTWVtYmVyAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAAAgAAAAECAAAAIGdyYW50cyB3b3JraW5nIGdyb3VwIGFjY2VzcyBvbmx5BAAAAA50ZWFtSWRlbnRpZmllcgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwkAASwAAAACCQABLAAAAAICAAAABnRhc2tzXwUAAAAGdGFza0lkAgAAAApfcGVyZm9ybWVyCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAAB19zdGF0dXMCAAAACHJlamVjdGVkBQAAAANuaWwAAAAA1JKFoA==", "height": 1288447, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: YdV15e9RL3QUZtEd7aGvtyEooBUpozk57ov2mCVXd7Z Next: 4B2tAihenV1dPSS95zpNiZ1WfUU5dxxMBSk5GYQb4jqd Diff:
Old | New | Differences | |
---|---|---|---|
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | - | func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started") | |
80 | - | ||
81 | - | ||
82 | - | func isJuryMember (i,taskId) = true | |
83 | - | ||
84 | - | ||
85 | 79 | @Callable(i) | |
86 | 80 | func addTask (title,link) = if (!(isGroupMember(i.caller))) | |
87 | 81 | then throw("grants working group access only") | |
155 | 149 | let listKey = (("tasks_" + taskId) + "_applicants") | |
156 | 150 | let currentApplicantsList = tryGetString(listKey) | |
157 | 151 | let applicantKey = drop(toString(i.caller), 10) | |
158 | - | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
159 | - | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
152 | + | let leader = toString(i.caller) | |
153 | + | let newApplicantsList = ((currentApplicantsList + ";") + leader) | |
154 | + | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), leader), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
160 | 155 | } | |
161 | 156 | } | |
162 | 157 | ||
190 | 185 | else { | |
191 | 186 | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
192 | 187 | let applicantsList = split(listKeys, ";") | |
193 | - | let teamIdentifier = "TEAM_KEY_UNDEFINED" | |
194 | 188 | if ((size(applicantsList) == 0)) | |
195 | 189 | then throw("No one has applied to the hackathon, yet") | |
196 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((( | |
190 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((("tasks_" + taskId) + "_status"), "ready_to_submit")]) | |
197 | 191 | } | |
198 | 192 | } | |
199 | 193 | ||
208 | 202 | ||
209 | 203 | @Callable(i) | |
210 | 204 | func submitSolution (taskId,solutionLink) = { | |
205 | + | func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started") | |
206 | + | ||
211 | 207 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
212 | 208 | if (!(areSubmissionsEnabled(taskId))) | |
213 | 209 | then throw("not possible to upload solution now") | |
226 | 222 | ||
227 | 223 | ||
228 | 224 | @Callable(i) | |
229 | - | func voteForSolution (taskId,teamIdentifier,voteValue) = if (!(isJuryMember(i, taskId))) | |
230 | - | then throw("you can't vote") | |
231 | - | else { | |
232 | - | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
233 | - | let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash) | |
234 | - | let vote = tryGetInteger(voteKey) | |
235 | - | if ((vote != 0)) | |
236 | - | then throw("you have already voted on this solution") | |
237 | - | else { | |
238 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes") | |
239 | - | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore") | |
240 | - | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
241 | - | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
242 | - | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
243 | - | } | |
244 | - | } | |
225 | + | func voteForSolution (taskId,teamIdentifier,voteValue) = { | |
226 | + | func isJuryMember (i,taskId) = true | |
227 | + | ||
228 | + | if (!(isJuryMember(i, taskId))) | |
229 | + | then throw("you can't vote") | |
230 | + | else { | |
231 | + | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
232 | + | let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash) | |
233 | + | let vote = tryGetInteger(voteKey) | |
234 | + | if ((vote != 0)) | |
235 | + | then throw("you have already voted on this solution") | |
236 | + | else { | |
237 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes") | |
238 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore") | |
239 | + | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
240 | + | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
241 | + | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
242 | + | } | |
243 | + | } | |
244 | + | } | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | ||
249 | 249 | func acceptWorkResult (taskId,winnerIdentifier,reportLink) = if (!(isGroupMember(i.caller))) | |
250 | 250 | then throw("grants working group access only") | |
251 | 251 | else { | |
252 | - | let teamIdentifier = "TEAM_KEY_UNDEFINED" | |
253 | 252 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
254 | - | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + | |
255 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + | |
253 | + | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_leader")) | |
254 | + | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_process"), "winner"), DataEntry((("tasks_" + taskId) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
256 | 255 | } | |
257 | 256 | ||
258 | 257 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let QUORUM = 1 | |
5 | 5 | ||
6 | 6 | func tryGetInteger (key) = { | |
7 | 7 | let val = match getInteger(this, key) { | |
8 | 8 | case b: Int => | |
9 | 9 | b | |
10 | 10 | case _ => | |
11 | 11 | 0 | |
12 | 12 | } | |
13 | 13 | val | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func tryGetString (key) = { | |
18 | 18 | let val = match getString(this, key) { | |
19 | 19 | case b: String => | |
20 | 20 | b | |
21 | 21 | case _ => | |
22 | 22 | "" | |
23 | 23 | } | |
24 | 24 | val | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | let mainContract = this | |
29 | 29 | ||
30 | 30 | func isOwner (address) = if ((address == this)) | |
31 | 31 | then true | |
32 | 32 | else (address == mainContract) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func getGroup () = { | |
36 | 36 | let val = match getString(mainContract, "working_group_members") { | |
37 | 37 | case b: String => | |
38 | 38 | b | |
39 | 39 | case _ => | |
40 | 40 | "" | |
41 | 41 | } | |
42 | 42 | val | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getMembers () = { | |
47 | 47 | let val = match getString(mainContract, "dao_members") { | |
48 | 48 | case b: String => | |
49 | 49 | b | |
50 | 50 | case _ => | |
51 | 51 | "" | |
52 | 52 | } | |
53 | 53 | val | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func isGroupMember (a) = { | |
58 | 58 | let val = match getInteger(mainContract, (("working_group_member_" + toString(a)) + "_weight")) { | |
59 | 59 | case b: Int => | |
60 | 60 | b | |
61 | 61 | case _ => | |
62 | 62 | 0 | |
63 | 63 | } | |
64 | 64 | (val > 0) | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func canMemberVote (i) = { | |
69 | 69 | let val = match getInteger(mainContract, (("dao_member_" + toString(i.caller)) + "_weight")) { | |
70 | 70 | case b: Int => | |
71 | 71 | b | |
72 | 72 | case _ => | |
73 | 73 | 0 | |
74 | 74 | } | |
75 | 75 | (val > 0) | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | - | func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started") | |
80 | - | ||
81 | - | ||
82 | - | func isJuryMember (i,taskId) = true | |
83 | - | ||
84 | - | ||
85 | 79 | @Callable(i) | |
86 | 80 | func addTask (title,link) = if (!(isGroupMember(i.caller))) | |
87 | 81 | then throw("grants working group access only") | |
88 | 82 | else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
89 | 83 | ||
90 | 84 | ||
91 | 85 | ||
92 | 86 | @Callable(i) | |
93 | 87 | func addTaskDetails (taskId,detailsLink) = if (!(isGroupMember(i.caller))) | |
94 | 88 | then throw("grants working group access only") | |
95 | 89 | else { | |
96 | 90 | let reward = extract(i.payment).amount | |
97 | 91 | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_details"), detailsLink), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
98 | 92 | } | |
99 | 93 | ||
100 | 94 | ||
101 | 95 | ||
102 | 96 | @Callable(i) | |
103 | 97 | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
104 | 98 | then throw("you can't vote") | |
105 | 99 | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
106 | 100 | then throw("voting is closed or not started") | |
107 | 101 | else if (if ((voteValue != -1)) | |
108 | 102 | then (voteValue != 1) | |
109 | 103 | else false) | |
110 | 104 | then throw("you need to vote 1 or -1") | |
111 | 105 | else { | |
112 | 106 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
113 | 107 | let previousVote = tryGetInteger(voteKey) | |
114 | 108 | if (!((previousVote == 0))) | |
115 | 109 | then throw("you have already voted") | |
116 | 110 | else { | |
117 | 111 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
118 | 112 | let votingState = tryGetInteger(votingKey) | |
119 | 113 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
120 | 114 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
121 | 115 | let newVotingState = (votingState + voteValue) | |
122 | 116 | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
123 | 117 | } | |
124 | 118 | } | |
125 | 119 | ||
126 | 120 | ||
127 | 121 | ||
128 | 122 | @Callable(i) | |
129 | 123 | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size")))) | |
130 | 124 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
131 | 125 | else if (!(isGroupMember(i.caller))) | |
132 | 126 | then throw("grants working group access only") | |
133 | 127 | else { | |
134 | 128 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
135 | 129 | let votingState = tryGetInteger(votingKey) | |
136 | 130 | if ((votingState > 0)) | |
137 | 131 | then { | |
138 | 132 | let votingResult = "ready_to_apply" | |
139 | 133 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
140 | 134 | } | |
141 | 135 | else { | |
142 | 136 | let votingResult = "rejected" | |
143 | 137 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
144 | 138 | } | |
145 | 139 | } | |
146 | 140 | ||
147 | 141 | ||
148 | 142 | ||
149 | 143 | @Callable(i) | |
150 | 144 | func applyForTask (taskId,teamName,link) = { | |
151 | 145 | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
152 | 146 | if ((status != "ready_to_apply")) | |
153 | 147 | then throw("This grant has not yet been approved") | |
154 | 148 | else { | |
155 | 149 | let listKey = (("tasks_" + taskId) + "_applicants") | |
156 | 150 | let currentApplicantsList = tryGetString(listKey) | |
157 | 151 | let applicantKey = drop(toString(i.caller), 10) | |
158 | - | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
159 | - | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
152 | + | let leader = toString(i.caller) | |
153 | + | let newApplicantsList = ((currentApplicantsList + ";") + leader) | |
154 | + | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), leader), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
160 | 155 | } | |
161 | 156 | } | |
162 | 157 | ||
163 | 158 | ||
164 | 159 | ||
165 | 160 | @Callable(i) | |
166 | 161 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
167 | 162 | then throw("you can't vote") | |
168 | 163 | else { | |
169 | 164 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
170 | 165 | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
171 | 166 | let vote = tryGetInteger(voteKey) | |
172 | 167 | if ((vote != 0)) | |
173 | 168 | then throw("you have already voted on this team") | |
174 | 169 | else { | |
175 | 170 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
176 | 171 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
177 | 172 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
178 | 173 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
179 | 174 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
180 | 175 | } | |
181 | 176 | } | |
182 | 177 | ||
183 | 178 | ||
184 | 179 | ||
185 | 180 | @Callable(i) | |
186 | 181 | func finishApplicantsVoting (taskId) = { | |
187 | 182 | let minVotesToApproveApplicant = 1 | |
188 | 183 | if (!(isGroupMember(i.caller))) | |
189 | 184 | then throw("grants working group access only") | |
190 | 185 | else { | |
191 | 186 | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
192 | 187 | let applicantsList = split(listKeys, ";") | |
193 | - | let teamIdentifier = "TEAM_KEY_UNDEFINED" | |
194 | 188 | if ((size(applicantsList) == 0)) | |
195 | 189 | then throw("No one has applied to the hackathon, yet") | |
196 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((( | |
190 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((("tasks_" + taskId) + "_status"), "ready_to_submit")]) | |
197 | 191 | } | |
198 | 192 | } | |
199 | 193 | ||
200 | 194 | ||
201 | 195 | ||
202 | 196 | @Callable(i) | |
203 | 197 | func enableSubmissions (taskId,juryList) = if (!(isGroupMember(i.caller))) | |
204 | 198 | then throw("grants working group access only") | |
205 | 199 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((("tasks_" + taskId) + "_jury"), juryList)]) | |
206 | 200 | ||
207 | 201 | ||
208 | 202 | ||
209 | 203 | @Callable(i) | |
210 | 204 | func submitSolution (taskId,solutionLink) = { | |
205 | + | func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started") | |
206 | + | ||
211 | 207 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
212 | 208 | if (!(areSubmissionsEnabled(taskId))) | |
213 | 209 | then throw("not possible to upload solution now") | |
214 | 210 | else if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
215 | 211 | then throw("team leader only") | |
216 | 212 | else WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_submitted"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solution"), solutionLink)]) | |
217 | 213 | } | |
218 | 214 | ||
219 | 215 | ||
220 | 216 | ||
221 | 217 | @Callable(i) | |
222 | 218 | func stopSubmissions (taskId) = if (!(isGroupMember(i.caller))) | |
223 | 219 | then throw("grants working group access only") | |
224 | 220 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished")]) | |
225 | 221 | ||
226 | 222 | ||
227 | 223 | ||
228 | 224 | @Callable(i) | |
229 | - | func voteForSolution (taskId,teamIdentifier,voteValue) = if (!(isJuryMember(i, taskId))) | |
230 | - | then throw("you can't vote") | |
231 | - | else { | |
232 | - | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
233 | - | let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash) | |
234 | - | let vote = tryGetInteger(voteKey) | |
235 | - | if ((vote != 0)) | |
236 | - | then throw("you have already voted on this solution") | |
237 | - | else { | |
238 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes") | |
239 | - | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore") | |
240 | - | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
241 | - | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
242 | - | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
243 | - | } | |
244 | - | } | |
225 | + | func voteForSolution (taskId,teamIdentifier,voteValue) = { | |
226 | + | func isJuryMember (i,taskId) = true | |
227 | + | ||
228 | + | if (!(isJuryMember(i, taskId))) | |
229 | + | then throw("you can't vote") | |
230 | + | else { | |
231 | + | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
232 | + | let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash) | |
233 | + | let vote = tryGetInteger(voteKey) | |
234 | + | if ((vote != 0)) | |
235 | + | then throw("you have already voted on this solution") | |
236 | + | else { | |
237 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes") | |
238 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore") | |
239 | + | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
240 | + | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
241 | + | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
242 | + | } | |
243 | + | } | |
244 | + | } | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | ||
248 | 248 | @Callable(i) | |
249 | 249 | func acceptWorkResult (taskId,winnerIdentifier,reportLink) = if (!(isGroupMember(i.caller))) | |
250 | 250 | then throw("grants working group access only") | |
251 | 251 | else { | |
252 | - | let teamIdentifier = "TEAM_KEY_UNDEFINED" | |
253 | 252 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
254 | - | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + | |
255 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + | |
253 | + | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_leader")) | |
254 | + | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_process"), "winner"), DataEntry((("tasks_" + taskId) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
256 | 255 | } | |
257 | 256 | ||
258 | 257 | ||
259 | 258 | ||
260 | 259 | @Callable(i) | |
261 | 260 | func rejectTask (taskId) = if (!(isGroupMember(i.caller))) | |
262 | 261 | then throw("grants working group access only") | |
263 | 262 | else { | |
264 | 263 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
265 | 264 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")]) | |
266 | 265 | } | |
267 | 266 | ||
268 | 267 |
github/deemru/w8io/169f3d6 62.29 ms ◑