tx · CwvKZj36NgmwuCnUmn6dvsxzNVvbrSJfkk4AffWtqCKm 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5: -0.10000000 Waves 2020.11.20 01:39 [1272851] smart account 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5 > SELF 0.00000000 Waves
{ "type": 13, "id": "CwvKZj36NgmwuCnUmn6dvsxzNVvbrSJfkk4AffWtqCKm", "fee": 10000000, "feeAssetId": null, "timestamp": 1605825607740, "version": 2, "chainId": 84, "sender": "3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5", "senderPublicKey": "BWQB37E3JLeot6EcSVXsbJMugLUYNarK8xU8W5XAPsvJ", "proofs": [ "48XoQ81rvBz1gtPkXpiXu8pkncXqj34H3pkupji2ritvrqBFLG5vGTeezSLjR8a7jSEyhwWKk1h2Bwbq7ViRApZb" ], "script": "base64:AAIDAAAAAAAAAD8IARIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIICBIDCgEIEgUKAwgICBIFCgMICAgSAwoBCBIDCgEIEgMKAQgAAAAIAAAAAAZRVU9SVU0AAAAAAAAAAAEBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAAdpc093bmVyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAACGdldEdyb3V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lNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAt0ZWFtQWRkcmVzcwUAAAAMcmV3YXJkQW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAA++CbxQ==", "height": 1272851, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CJtrqoTHsJ6sSbJ32iAGj8TaFnxYq9k94xnXZ4p7qTAo Next: B5MmUsuaDXF5btZ9fGNX5Eu1DjmBxavqokS2w1AMMVgY Diff:
Old | New | Differences | |
---|---|---|---|
193 | 193 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
194 | 194 | let voteKey = ((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted_") + voteHash) | |
195 | 195 | let vote = tryGetString(voteKey) | |
196 | - | if ((vote != toString(i.caller))) | |
197 | - | then throw("you have already voted on this team") | |
198 | - | else { | |
199 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
200 | - | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
201 | - | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
202 | - | let newTeamScore = (getValue(voteValue) + tryGetInteger(teamScoreKey)) | |
203 | - | WriteSet([DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)]) | |
204 | - | } | |
196 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
197 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
198 | + | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
199 | + | let newTeamScore = (getValue(voteValue) + tryGetInteger(teamScoreKey)) | |
200 | + | WriteSet([DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)]) | |
205 | 201 | } | |
206 | 202 | ||
207 | 203 | ||
242 | 238 | then throw("No one has yet responded to the grant") | |
243 | 239 | else { | |
244 | 240 | let chosenTeamId = { | |
245 | - | let $ | |
246 | - | let $ | |
247 | - | let $ | |
248 | - | if (($ | |
249 | - | then $ | |
241 | + | let $list1238412415 = [0, 1] | |
242 | + | let $size1238412415 = size($list1238412415) | |
243 | + | let $acc01238412415 = 0 | |
244 | + | if (($size1238412415 == 0)) | |
245 | + | then $acc01238412415 | |
250 | 246 | else { | |
251 | - | let $ | |
252 | - | if (($ | |
253 | - | then $ | |
247 | + | let $acc11238412415 = hasMoreVotes($acc01238412415, $list1238412415[0]) | |
248 | + | if (($size1238412415 == 1)) | |
249 | + | then $acc11238412415 | |
254 | 250 | else { | |
255 | - | let $ | |
256 | - | if (($ | |
257 | - | then $ | |
251 | + | let $acc21238412415 = hasMoreVotes($acc11238412415, $list1238412415[1]) | |
252 | + | if (($size1238412415 == 2)) | |
253 | + | then $acc21238412415 | |
258 | 254 | else { | |
259 | - | let $ | |
255 | + | let $acc31238412415 = hasMoreVotes($acc21238412415, $list1238412415[2]) | |
260 | 256 | throw("List size exceed 2") | |
261 | 257 | } | |
262 | 258 | } |
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 | func isOwner (address) = (address == this) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func getGroup () = { | |
32 | 32 | let val = match getString(this, "working_group") { | |
33 | 33 | case b: String => | |
34 | 34 | b | |
35 | 35 | case _ => | |
36 | 36 | "" | |
37 | 37 | } | |
38 | 38 | val | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func getMembers () = { | |
43 | 43 | let val = match getString(this, "dao_members") { | |
44 | 44 | case b: String => | |
45 | 45 | b | |
46 | 46 | case _ => | |
47 | 47 | "" | |
48 | 48 | } | |
49 | 49 | val | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | @Callable(i) | |
60 | 60 | func addDAOMember (memberAddress) = if (!(isOwner(i.caller))) | |
61 | 61 | then throw("access only to the DAO owner") | |
62 | 62 | else if ((tryGetInteger((("dao_member_" + memberAddress) + "_weight")) == 1)) | |
63 | 63 | then throw("this user already exists") | |
64 | 64 | else { | |
65 | 65 | let group = getMembers() | |
66 | 66 | let newGroup = ((group + ";") + memberAddress) | |
67 | 67 | let groupSize = tryGetInteger("dao_size") | |
68 | 68 | let newGroupSize = (groupSize + 1) | |
69 | 69 | WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry((("dao_member_" + memberAddress) + "_weight"), 1)]) | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||
74 | 74 | @Callable(i) | |
75 | 75 | func addGroupMember (memberAddress) = if (!(isOwner(i.caller))) | |
76 | 76 | then throw("access only to the DAO owner") | |
77 | 77 | else if ((tryGetInteger((("working_group_member_" + memberAddress) + "_weight")) == 1)) | |
78 | 78 | then throw("This user already exists") | |
79 | 79 | else { | |
80 | 80 | let group = getGroup() | |
81 | 81 | let newGroup = ((group + ";") + memberAddress) | |
82 | 82 | let groupSize = tryGetInteger("working_group_size") | |
83 | 83 | let newGroupSize = (groupSize + 1) | |
84 | 84 | WriteSet([DataEntry("working_group_name", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)]) | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(i) | |
90 | 90 | func addTask (title,link) = if (!(isGroupMember(i.caller))) | |
91 | 91 | then throw("grants working group access only") | |
92 | 92 | else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(i) | |
97 | 97 | func addTaskDetails (taskId) = if (!(isGroupMember(i.caller))) | |
98 | 98 | then throw("grants working group access only") | |
99 | 99 | else { | |
100 | 100 | let reward = extract(i.payment).amount | |
101 | 101 | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | ||
106 | 106 | @Callable(i) | |
107 | 107 | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
108 | 108 | then throw("you can't vote") | |
109 | 109 | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
110 | 110 | then throw("voting is closed or not started") | |
111 | 111 | else if (if ((voteValue != "like")) | |
112 | 112 | then (voteValue != "dislike") | |
113 | 113 | else false) | |
114 | 114 | then throw("you need to vote like or dislike") | |
115 | 115 | else { | |
116 | 116 | func getValue (vote) = if ((vote == "like")) | |
117 | 117 | then 1 | |
118 | 118 | else -1 | |
119 | 119 | ||
120 | 120 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
121 | 121 | let previousVote = tryGetInteger(voteKey) | |
122 | 122 | if (!((previousVote == 0))) | |
123 | 123 | then throw("you have already voted") | |
124 | 124 | else { | |
125 | 125 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
126 | 126 | let votingState = tryGetInteger(votingKey) | |
127 | 127 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
128 | 128 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
129 | 129 | let newVotingState = (votingState + getValue(voteValue)) | |
130 | 130 | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, getValue(voteValue)), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
131 | 131 | } | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | ||
136 | 136 | @Callable(i) | |
137 | 137 | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size")))) | |
138 | 138 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
139 | 139 | else if (!(isGroupMember(i.caller))) | |
140 | 140 | then throw("grants working group access only") | |
141 | 141 | else { | |
142 | 142 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
143 | 143 | let votingState = tryGetInteger(votingKey) | |
144 | 144 | if ((votingState > 0)) | |
145 | 145 | then { | |
146 | 146 | let votingResult = "ready_to_apply" | |
147 | 147 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
148 | 148 | } | |
149 | 149 | else { | |
150 | 150 | let votingResult = "rejected" | |
151 | 151 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
152 | 152 | } | |
153 | 153 | } | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | ||
157 | 157 | @Callable(i) | |
158 | 158 | func applyForTask (taskId,teamName,link) = { | |
159 | 159 | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
160 | 160 | if ((status != "ready_to_apply")) | |
161 | 161 | then throw("this grant has not yet been approved") | |
162 | 162 | else { | |
163 | 163 | let applicantKey = drop(toString(i.caller), 10) | |
164 | 164 | if ((tryGetString((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name")) == teamName)) | |
165 | 165 | then throw("commnad with name is exist") | |
166 | 166 | else { | |
167 | 167 | let listKey = (("tasks_" + taskId) + "_applicants") | |
168 | 168 | let currentApplicantsList = tryGetString(listKey) | |
169 | 169 | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
170 | 170 | 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)]) | |
171 | 171 | } | |
172 | 172 | } | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | ||
177 | 177 | @Callable(i) | |
178 | 178 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
179 | 179 | then throw("you can't vote") | |
180 | 180 | else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply")) | |
181 | 181 | then throw("voting is closed or not started") | |
182 | 182 | else if ((tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id")) != teamIdentifier)) | |
183 | 183 | then throw("team is not found use id team on application") | |
184 | 184 | else if (if ((voteValue != "like")) | |
185 | 185 | then (voteValue != "dislike") | |
186 | 186 | else false) | |
187 | 187 | then throw("you need to vote like or dislike") | |
188 | 188 | else { | |
189 | 189 | func getValue (vote) = if ((vote == "like")) | |
190 | 190 | then 1 | |
191 | 191 | else -1 | |
192 | 192 | ||
193 | 193 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
194 | 194 | let voteKey = ((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted_") + voteHash) | |
195 | 195 | let vote = tryGetString(voteKey) | |
196 | - | if ((vote != toString(i.caller))) | |
197 | - | then throw("you have already voted on this team") | |
198 | - | else { | |
199 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
200 | - | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
201 | - | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
202 | - | let newTeamScore = (getValue(voteValue) + tryGetInteger(teamScoreKey)) | |
203 | - | WriteSet([DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)]) | |
204 | - | } | |
196 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
197 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
198 | + | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
199 | + | let newTeamScore = (getValue(voteValue) + tryGetInteger(teamScoreKey)) | |
200 | + | WriteSet([DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)]) | |
205 | 201 | } | |
206 | 202 | ||
207 | 203 | ||
208 | 204 | ||
209 | 205 | @Callable(i) | |
210 | 206 | func finishApplicantsVoting (taskId) = { | |
211 | 207 | func isApplicantVotedEnough (aid,aid2) = { | |
212 | 208 | let listKey = (("tasks_" + taskId) + "_applicants") | |
213 | 209 | let applicantsList = split(getStringValue(this, listKey), ";") | |
214 | 210 | let teamIdentifier = applicantsList[aid] | |
215 | 211 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
216 | 212 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
217 | 213 | if ((teamVotesAmount > 0)) | |
218 | 214 | then 1 | |
219 | 215 | else throw(("not enough votes to make decision on " + teamIdentifier)) | |
220 | 216 | } | |
221 | 217 | ||
222 | 218 | func hasMoreVotes (aid,aid2) = { | |
223 | 219 | let listKey = (("tasks_" + taskId) + "_applicants") | |
224 | 220 | let applicantsList = split(getStringValue(this, listKey), ";") | |
225 | 221 | let teamIdentifier = applicantsList[aid] | |
226 | 222 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
227 | 223 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
228 | 224 | let team2Identifier = applicantsList[aid2] | |
229 | 225 | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
230 | 226 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
231 | 227 | if ((teamVotesAmount > team2VotesAmount)) | |
232 | 228 | then aid | |
233 | 229 | else aid2 | |
234 | 230 | } | |
235 | 231 | ||
236 | 232 | if (!(isGroupMember(i.caller))) | |
237 | 233 | then throw("grants working group access only") | |
238 | 234 | else { | |
239 | 235 | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
240 | 236 | let applicantsList = split(listKeys, ";") | |
241 | 237 | if ((size(applicantsList) == 0)) | |
242 | 238 | then throw("No one has yet responded to the grant") | |
243 | 239 | else { | |
244 | 240 | let chosenTeamId = { | |
245 | - | let $ | |
246 | - | let $ | |
247 | - | let $ | |
248 | - | if (($ | |
249 | - | then $ | |
241 | + | let $list1238412415 = [0, 1] | |
242 | + | let $size1238412415 = size($list1238412415) | |
243 | + | let $acc01238412415 = 0 | |
244 | + | if (($size1238412415 == 0)) | |
245 | + | then $acc01238412415 | |
250 | 246 | else { | |
251 | - | let $ | |
252 | - | if (($ | |
253 | - | then $ | |
247 | + | let $acc11238412415 = hasMoreVotes($acc01238412415, $list1238412415[0]) | |
248 | + | if (($size1238412415 == 1)) | |
249 | + | then $acc11238412415 | |
254 | 250 | else { | |
255 | - | let $ | |
256 | - | if (($ | |
257 | - | then $ | |
251 | + | let $acc21238412415 = hasMoreVotes($acc11238412415, $list1238412415[1]) | |
252 | + | if (($size1238412415 == 2)) | |
253 | + | then $acc21238412415 | |
258 | 254 | else { | |
259 | - | let $ | |
255 | + | let $acc31238412415 = hasMoreVotes($acc21238412415, $list1238412415[2]) | |
260 | 256 | throw("List size exceed 2") | |
261 | 257 | } | |
262 | 258 | } | |
263 | 259 | } | |
264 | 260 | } | |
265 | 261 | let teamIdentifier = applicantsList[chosenTeamId] | |
266 | 262 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
267 | 263 | } | |
268 | 264 | } | |
269 | 265 | } | |
270 | 266 | ||
271 | 267 | ||
272 | 268 | ||
273 | 269 | @Callable(i) | |
274 | 270 | func startWork (taskId) = { | |
275 | 271 | let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer")) | |
276 | 272 | if ((tryGetString((("tasks_" + taskId) + "_status")) != "team_chosen")) | |
277 | 273 | then throw("team is not choosen") | |
278 | 274 | else if ((toString(i.caller) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
279 | 275 | then throw("team leader only") | |
280 | 276 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
281 | 277 | } | |
282 | 278 | ||
283 | 279 | ||
284 | 280 | ||
285 | 281 | @Callable(i) | |
286 | 282 | func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller))) | |
287 | 283 | then throw("grants working group access only") | |
288 | 284 | else { | |
289 | 285 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
290 | 286 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
291 | 287 | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
292 | 288 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
293 | 289 | } | |
294 | 290 | ||
295 | 291 |
github/deemru/w8io/026f985 53.59 ms ◑