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