tx · 6GFQRCNVFcpDhrPJzHMeqirYZba3m4Ht7LoR3N3A4ted 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA: -0.10000000 Waves 2020.12.25 15:28 [1324219] smart account 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA > SELF 0.00000000 Waves
{ "type": 13, "id": "6GFQRCNVFcpDhrPJzHMeqirYZba3m4Ht7LoR3N3A4ted", "fee": 10000000, "feeAssetId": null, "timestamp": 1608899309548, "version": 2, "chainId": 84, "sender": "3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA", "senderPublicKey": "4xMxUnfdbHYsent96ThiYC63gXHiahi6bh3urdHHntHi", "proofs": [ "KGMa92LsnRrzW9vQ6AvGQ25R33D1pK24sPSwQWjA25jP2ER5nVD6N2CkWbyoLrKxG5dUpdQJgbVn3ExFD2nrSNd" ], "script": "base64:AAIDAAAAAAAAADsIARIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIEgUKAwgICBIDCgEIEgMKAQgSBAoCCAgSAwoBCAAAAA8AAAAADG1haW5Db250cmFjdAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXdSemkyQm1xWlpYV3JDR0N3Y1JRTHNuaWMyQW9kNnpoUwAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQ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Ut6mQ=", "height": 1324219, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4t81rRMPYwLV9VJqLnhf49nAEbfrMp5Kcu2ma9FUUWN1 Next: DZ8ac63CPQubpKUPPn2XZ4WShH2bb3VB4tzRkgbJAtS7 Diff:
Old | New | Differences | |
---|---|---|---|
106 | 106 | ||
107 | 107 | func voteForTaskProposalConditions (address,taskId) = if (!(canMemberVote(address))) | |
108 | 108 | then throw("you can't vote") | |
109 | - | else if (( | |
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 | + | else true | |
114 | + | ||
115 | + | ||
116 | + | func finishTaskProposalVotingConditions (address,taskId) = if (!(isGroupMember(address))) | |
117 | + | then throw("grants working group access only") | |
118 | + | else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed")) | |
119 | + | then throw("voting is not active") | |
120 | + | else if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize()))) | |
121 | + | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
113 | 122 | else true | |
114 | 123 | ||
115 | 124 | ||
147 | 156 | ||
148 | 157 | ||
149 | 158 | @Callable(i) | |
150 | - | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize()))) | |
151 | - | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
152 | - | else if (!(isGroupMember(i.caller))) | |
153 | - | then throw("grants working group access only") | |
154 | - | else { | |
155 | - | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
156 | - | let votingState = tryGetInteger(votingKey) | |
157 | - | if ((votingState > 0)) | |
158 | - | then { | |
159 | - | let votingResult = "ready_to_apply" | |
160 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
161 | - | } | |
162 | - | else { | |
163 | - | let votingResult = "rejected" | |
164 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
165 | - | } | |
166 | - | } | |
159 | + | func finishTaskProposalVoting (taskId) = if (finishTaskProposalVotingConditions(i.caller, taskId)) | |
160 | + | then { | |
161 | + | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
162 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), if ((tryGetInteger(votingKey) > 0)) | |
163 | + | then "ready_to_apply" | |
164 | + | else "rejected")]) | |
165 | + | } | |
166 | + | else throw("checks are not passed") | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | ||
240 | 240 | then throw("No one has yet responded to the grant") | |
241 | 241 | else { | |
242 | 242 | let chosenTeamId = { | |
243 | - | let $ | |
244 | - | let $ | |
245 | - | let $ | |
246 | - | if (($ | |
247 | - | then $ | |
243 | + | let $list1021210243 = [0, 1] | |
244 | + | let $size1021210243 = size($list1021210243) | |
245 | + | let $acc01021210243 = 0 | |
246 | + | if (($size1021210243 == 0)) | |
247 | + | then $acc01021210243 | |
248 | 248 | else { | |
249 | - | let $ | |
250 | - | if (($ | |
251 | - | then $ | |
249 | + | let $acc11021210243 = hasMoreVotes($acc01021210243, $list1021210243[0]) | |
250 | + | if (($size1021210243 == 1)) | |
251 | + | then $acc11021210243 | |
252 | 252 | else { | |
253 | - | let $ | |
254 | - | if (($ | |
255 | - | then $ | |
253 | + | let $acc21021210243 = hasMoreVotes($acc11021210243, $list1021210243[1]) | |
254 | + | if (($size1021210243 == 2)) | |
255 | + | then $acc21021210243 | |
256 | 256 | else { | |
257 | - | let $ | |
257 | + | let $acc31021210243 = hasMoreVotes($acc21021210243, $list1021210243[2]) | |
258 | 258 | throw("List size exceed 2") | |
259 | 259 | } | |
260 | 260 | } |
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 | - | else if (( | |
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 | + | else true | |
114 | + | ||
115 | + | ||
116 | + | func finishTaskProposalVotingConditions (address,taskId) = if (!(isGroupMember(address))) | |
117 | + | then throw("grants working group access only") | |
118 | + | else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed")) | |
119 | + | then throw("voting is not active") | |
120 | + | else if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize()))) | |
121 | + | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
113 | 122 | else true | |
114 | 123 | ||
115 | 124 | ||
116 | 125 | @Callable(i) | |
117 | 126 | func addTask (title,link) = if (addTaskConditions(i.caller)) | |
118 | 127 | then WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
119 | 128 | else throw("checks are not passed") | |
120 | 129 | ||
121 | 130 | ||
122 | 131 | ||
123 | 132 | @Callable(i) | |
124 | 133 | func addReward (taskId) = if (addRewardConditions(i.caller, taskId)) | |
125 | 134 | then { | |
126 | 135 | let reward = extract(i.payment).amount | |
127 | 136 | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
128 | 137 | } | |
129 | 138 | else throw("checks are not passed") | |
130 | 139 | ||
131 | 140 | ||
132 | 141 | ||
133 | 142 | @Callable(i) | |
134 | 143 | func voteForTaskProposal (taskId,voteValue) = if (voteForTaskProposalConditions(i.caller, taskId)) | |
135 | 144 | then { | |
136 | 145 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
137 | 146 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
138 | 147 | let votingState = tryGetInteger(votingKey) | |
139 | 148 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
140 | 149 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
141 | 150 | let voteValueInt = getVoteValue(voteValue) | |
142 | 151 | let newVotingState = (votingState + voteValueInt) | |
143 | 152 | WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValueInt), DataEntry(votesAmountKey, votesAmountState)]) | |
144 | 153 | } | |
145 | 154 | else throw("checks are not passed") | |
146 | 155 | ||
147 | 156 | ||
148 | 157 | ||
149 | 158 | @Callable(i) | |
150 | - | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize()))) | |
151 | - | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
152 | - | else if (!(isGroupMember(i.caller))) | |
153 | - | then throw("grants working group access only") | |
154 | - | else { | |
155 | - | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
156 | - | let votingState = tryGetInteger(votingKey) | |
157 | - | if ((votingState > 0)) | |
158 | - | then { | |
159 | - | let votingResult = "ready_to_apply" | |
160 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
161 | - | } | |
162 | - | else { | |
163 | - | let votingResult = "rejected" | |
164 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
165 | - | } | |
166 | - | } | |
159 | + | func finishTaskProposalVoting (taskId) = if (finishTaskProposalVotingConditions(i.caller, taskId)) | |
160 | + | then { | |
161 | + | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
162 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), if ((tryGetInteger(votingKey) > 0)) | |
163 | + | then "ready_to_apply" | |
164 | + | else "rejected")]) | |
165 | + | } | |
166 | + | else throw("checks are not passed") | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | ||
170 | 170 | @Callable(i) | |
171 | 171 | func applyForTask (taskId,teamName,link) = { | |
172 | 172 | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
173 | 173 | if ((status != "ready_to_apply")) | |
174 | 174 | then throw("This grant has not yet been approved") | |
175 | 175 | else { | |
176 | 176 | let listKey = (("tasks_" + taskId) + "_applicants") | |
177 | 177 | let currentApplicantsList = tryGetString(listKey) | |
178 | 178 | let applicantKey = drop(toString(i.caller), 10) | |
179 | 179 | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
180 | 180 | 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)]) | |
181 | 181 | } | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | ||
186 | 186 | @Callable(i) | |
187 | 187 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i.caller))) | |
188 | 188 | then throw("you can't vote") | |
189 | 189 | else { | |
190 | 190 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
191 | 191 | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
192 | 192 | let vote = tryGetInteger(voteKey) | |
193 | 193 | if ((vote != 0)) | |
194 | 194 | then throw("you have already voted on this team") | |
195 | 195 | else { | |
196 | 196 | let valueVoteInt = getVoteValue(voteValue) | |
197 | 197 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
198 | 198 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
199 | 199 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
200 | 200 | let newTeamScore = (valueVoteInt + tryGetInteger(teamScoreKey)) | |
201 | 201 | WriteSet([DataEntry(voteKey, valueVoteInt), DataEntry(teamScoreKey, newTeamScore)]) | |
202 | 202 | } | |
203 | 203 | } | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | ||
207 | 207 | @Callable(i) | |
208 | 208 | func finishApplicantsVoting (taskId) = { | |
209 | 209 | func isApplicantVotedEnough (aid,aid2) = { | |
210 | 210 | let listKey = (("tasks_" + taskId) + "_applicants") | |
211 | 211 | let applicantsList = split(getStringValue(this, listKey), ";") | |
212 | 212 | let teamIdentifier = applicantsList[aid] | |
213 | 213 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
214 | 214 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
215 | 215 | if ((teamVotesAmount > 0)) | |
216 | 216 | then 1 | |
217 | 217 | else throw(("not enough votes to make decision on " + teamIdentifier)) | |
218 | 218 | } | |
219 | 219 | ||
220 | 220 | func hasMoreVotes (aid,aid2) = { | |
221 | 221 | let listKey = (("tasks_" + taskId) + "_applicants") | |
222 | 222 | let applicantsList = split(getStringValue(this, listKey), ";") | |
223 | 223 | let teamIdentifier = applicantsList[aid] | |
224 | 224 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
225 | 225 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
226 | 226 | let team2Identifier = applicantsList[aid2] | |
227 | 227 | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
228 | 228 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
229 | 229 | if ((teamVotesAmount > team2VotesAmount)) | |
230 | 230 | then aid | |
231 | 231 | else aid2 | |
232 | 232 | } | |
233 | 233 | ||
234 | 234 | if (!(isGroupMember(i.caller))) | |
235 | 235 | then throw("grants working group access only") | |
236 | 236 | else { | |
237 | 237 | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
238 | 238 | let applicantsList = split(listKeys, ";") | |
239 | 239 | if ((size(applicantsList) == 0)) | |
240 | 240 | then throw("No one has yet responded to the grant") | |
241 | 241 | else { | |
242 | 242 | let chosenTeamId = { | |
243 | - | let $ | |
244 | - | let $ | |
245 | - | let $ | |
246 | - | if (($ | |
247 | - | then $ | |
243 | + | let $list1021210243 = [0, 1] | |
244 | + | let $size1021210243 = size($list1021210243) | |
245 | + | let $acc01021210243 = 0 | |
246 | + | if (($size1021210243 == 0)) | |
247 | + | then $acc01021210243 | |
248 | 248 | else { | |
249 | - | let $ | |
250 | - | if (($ | |
251 | - | then $ | |
249 | + | let $acc11021210243 = hasMoreVotes($acc01021210243, $list1021210243[0]) | |
250 | + | if (($size1021210243 == 1)) | |
251 | + | then $acc11021210243 | |
252 | 252 | else { | |
253 | - | let $ | |
254 | - | if (($ | |
255 | - | then $ | |
253 | + | let $acc21021210243 = hasMoreVotes($acc11021210243, $list1021210243[1]) | |
254 | + | if (($size1021210243 == 2)) | |
255 | + | then $acc21021210243 | |
256 | 256 | else { | |
257 | - | let $ | |
257 | + | let $acc31021210243 = hasMoreVotes($acc21021210243, $list1021210243[2]) | |
258 | 258 | throw("List size exceed 2") | |
259 | 259 | } | |
260 | 260 | } | |
261 | 261 | } | |
262 | 262 | } | |
263 | 263 | let teamIdentifier = applicantsList[chosenTeamId] | |
264 | 264 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
265 | 265 | } | |
266 | 266 | } | |
267 | 267 | } | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | ||
271 | 271 | @Callable(i) | |
272 | 272 | func startWork (taskId) = { | |
273 | 273 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
274 | 274 | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
275 | 275 | then throw("team leader only") | |
276 | 276 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
277 | 277 | } | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | ||
281 | 281 | @Callable(i) | |
282 | 282 | func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller))) | |
283 | 283 | then throw("grants working group access only") | |
284 | 284 | else { | |
285 | 285 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
286 | 286 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
287 | 287 | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
288 | 288 | 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)])) | |
289 | 289 | } | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | ||
293 | 293 | @Callable(i) | |
294 | 294 | func rejectTask (taskId) = if (!(isGroupMember(i.caller))) | |
295 | 295 | then throw("grants working group access only") | |
296 | 296 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")]) | |
297 | 297 | ||
298 | 298 |
github/deemru/w8io/026f985 49.16 ms ◑