tx · 13WH727DhVupVkFsQ1KkuobUAquX3GysomUnqUPUfCFo 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5: -0.10000000 Waves 2020.11.19 20:30 [1272714] smart account 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5 > SELF 0.00000000 Waves
{ "type": 13, "id": "13WH727DhVupVkFsQ1KkuobUAquX3GysomUnqUPUfCFo", "fee": 10000000, "feeAssetId": null, "timestamp": 1605817839743, "version": 2, "chainId": 84, "sender": "3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5", "senderPublicKey": "BWQB37E3JLeot6EcSVXsbJMugLUYNarK8xU8W5XAPsvJ", "proofs": [ "2dYKhZdhPUvVMZNgQpuAqxuqTEUiVNLLnD9uXQp9ap34oygKcxExxtvgnNLdWodL29634yckkW6e17AJhuHMkp58" ], "script": "base64:AAIDAAAAAAAAAD8IARIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIIARIDCgEIEgUKAwgICBIFCgMICAESAwoBCBIDCgEIEgMKAQgAAAAIAAAAAAZRVU9SVU0AAAAAAAAAAAEBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAAdpc093bmVyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAACGdldEdyb3VwAAAAAAQAAAADd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mUoMTA1MykAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAACl9wZXJmb3JtZXIEAAAAC3RlYW1BZGRyZXNzCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABnRhc2tzXwUAAAAGdGFza0lkAgAAAAVfYXBwXwUAAAAOdGVhbUlkZW50aWZpZXICAAAAB19sZWFkZXIJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAAB19zdGF0dXMCAAAADXdvcmtfZmluaXNoZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAABV9hcHBfBQAAAA50ZWFtSWRlbnRpZmllcgIAAAAIX3Byb2Nlc3MCAAAADXdvcmtfZmluaXNoZWQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAC3RlYW1BZGRyZXNzBQAAAAxyZXdhcmRBbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAAITOCq", "height": 1272714, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3ECER4EGqDnSmfGXrHiC1653UAYEHTj9yhxU8vYGB9bN Next: 8dse6KgnUJJEHBeohhSLXcXcTtGJQaZHRjvBpmnd4Ero Diff:
Old | New | Differences | |
---|---|---|---|
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 | - | then throw(" | |
63 | + | then throw("this user already exists") | |
64 | 64 | else { | |
65 | 65 | let group = getMembers() | |
66 | 66 | let newGroup = ((group + ";") + memberAddress) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | @Callable(i) | |
107 | - | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
108 | - | then throw("you can't vote") | |
109 | - | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
110 | - | then throw("voting is closed or not started") | |
111 | - | else if (if ((voteValue != -1)) | |
112 | - | then (voteValue != 1) | |
113 | - | else false) | |
114 | - | then throw("you need to vote 1 or -1") | |
115 | - | else { | |
116 | - | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
117 | - | let previousVote = tryGetInteger(voteKey) | |
118 | - | if (!((previousVote == 0))) | |
119 | - | then throw("you have already voted") | |
120 | - | else { | |
121 | - | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
122 | - | let votingState = tryGetInteger(votingKey) | |
123 | - | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
124 | - | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
125 | - | let newVotingState = (votingState + voteValue) | |
126 | - | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
127 | - | } | |
128 | - | } | |
107 | + | func voteForTaskProposal (taskId,voteValue) = if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
108 | + | then throw("voting is closed or not started") | |
109 | + | else if (if ((voteValue != -1)) | |
110 | + | then (voteValue != 1) | |
111 | + | else false) | |
112 | + | then throw("you need to vote 1 or -1") | |
113 | + | else { | |
114 | + | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
115 | + | let previousVote = tryGetInteger(voteKey) | |
116 | + | if (!((previousVote == 0))) | |
117 | + | then throw("you have already voted") | |
118 | + | else { | |
119 | + | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
120 | + | let votingState = tryGetInteger(votingKey) | |
121 | + | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
122 | + | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
123 | + | let newVotingState = (votingState + voteValue) | |
124 | + | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
125 | + | } | |
126 | + | } | |
129 | 127 | ||
130 | 128 | ||
131 | 129 | ||
154 | 152 | func applyForTask (taskId,teamName,link) = { | |
155 | 153 | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
156 | 154 | if ((status != "ready_to_apply")) | |
157 | - | then throw(" | |
155 | + | then throw("this grant has not yet been approved") | |
158 | 156 | else { | |
159 | 157 | let listKey = (("tasks_" + taskId) + "_applicants") | |
160 | 158 | let currentApplicantsList = tryGetString(listKey) | |
222 | 220 | then throw("No one has yet responded to the grant") | |
223 | 221 | else { | |
224 | 222 | let chosenTeamId = { | |
225 | - | let $ | |
226 | - | let $ | |
227 | - | let $ | |
228 | - | if (($ | |
229 | - | then $ | |
223 | + | let $list1102011051 = [0, 1] | |
224 | + | let $size1102011051 = size($list1102011051) | |
225 | + | let $acc01102011051 = 0 | |
226 | + | if (($size1102011051 == 0)) | |
227 | + | then $acc01102011051 | |
230 | 228 | else { | |
231 | - | let $ | |
232 | - | if (($ | |
233 | - | then $ | |
229 | + | let $acc11102011051 = hasMoreVotes($acc01102011051, $list1102011051[0]) | |
230 | + | if (($size1102011051 == 1)) | |
231 | + | then $acc11102011051 | |
234 | 232 | else { | |
235 | - | let $ | |
236 | - | if (($ | |
237 | - | then $ | |
233 | + | let $acc21102011051 = hasMoreVotes($acc11102011051, $list1102011051[1]) | |
234 | + | if (($size1102011051 == 2)) | |
235 | + | then $acc21102011051 | |
238 | 236 | else { | |
239 | - | let $ | |
237 | + | let $acc31102011051 = hasMoreVotes($acc21102011051, $list1102011051[2]) | |
240 | 238 | throw("List size exceed 2") | |
241 | 239 | } | |
242 | 240 | } |
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 | - | then throw(" | |
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 | - | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
108 | - | then throw("you can't vote") | |
109 | - | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
110 | - | then throw("voting is closed or not started") | |
111 | - | else if (if ((voteValue != -1)) | |
112 | - | then (voteValue != 1) | |
113 | - | else false) | |
114 | - | then throw("you need to vote 1 or -1") | |
115 | - | else { | |
116 | - | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
117 | - | let previousVote = tryGetInteger(voteKey) | |
118 | - | if (!((previousVote == 0))) | |
119 | - | then throw("you have already voted") | |
120 | - | else { | |
121 | - | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
122 | - | let votingState = tryGetInteger(votingKey) | |
123 | - | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
124 | - | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
125 | - | let newVotingState = (votingState + voteValue) | |
126 | - | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
127 | - | } | |
128 | - | } | |
107 | + | func voteForTaskProposal (taskId,voteValue) = if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
108 | + | then throw("voting is closed or not started") | |
109 | + | else if (if ((voteValue != -1)) | |
110 | + | then (voteValue != 1) | |
111 | + | else false) | |
112 | + | then throw("you need to vote 1 or -1") | |
113 | + | else { | |
114 | + | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
115 | + | let previousVote = tryGetInteger(voteKey) | |
116 | + | if (!((previousVote == 0))) | |
117 | + | then throw("you have already voted") | |
118 | + | else { | |
119 | + | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
120 | + | let votingState = tryGetInteger(votingKey) | |
121 | + | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
122 | + | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
123 | + | let newVotingState = (votingState + voteValue) | |
124 | + | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
125 | + | } | |
126 | + | } | |
129 | 127 | ||
130 | 128 | ||
131 | 129 | ||
132 | 130 | @Callable(i) | |
133 | 131 | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size")))) | |
134 | 132 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
135 | 133 | else if (!(isGroupMember(i.caller))) | |
136 | 134 | then throw("grants working group access only") | |
137 | 135 | else { | |
138 | 136 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
139 | 137 | let votingState = tryGetInteger(votingKey) | |
140 | 138 | if ((votingState > 0)) | |
141 | 139 | then { | |
142 | 140 | let votingResult = "ready_to_apply" | |
143 | 141 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
144 | 142 | } | |
145 | 143 | else { | |
146 | 144 | let votingResult = "rejected" | |
147 | 145 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
148 | 146 | } | |
149 | 147 | } | |
150 | 148 | ||
151 | 149 | ||
152 | 150 | ||
153 | 151 | @Callable(i) | |
154 | 152 | func applyForTask (taskId,teamName,link) = { | |
155 | 153 | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
156 | 154 | if ((status != "ready_to_apply")) | |
157 | - | then throw(" | |
155 | + | then throw("this grant has not yet been approved") | |
158 | 156 | else { | |
159 | 157 | let listKey = (("tasks_" + taskId) + "_applicants") | |
160 | 158 | let currentApplicantsList = tryGetString(listKey) | |
161 | 159 | let applicantKey = drop(toString(i.caller), 10) | |
162 | 160 | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
163 | 161 | 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)]) | |
164 | 162 | } | |
165 | 163 | } | |
166 | 164 | ||
167 | 165 | ||
168 | 166 | ||
169 | 167 | @Callable(i) | |
170 | 168 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
171 | 169 | then throw("you can't vote") | |
172 | 170 | else { | |
173 | 171 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
174 | 172 | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
175 | 173 | let vote = tryGetInteger(voteKey) | |
176 | 174 | if ((vote != 0)) | |
177 | 175 | then throw("you have already voted on this team") | |
178 | 176 | else { | |
179 | 177 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
180 | 178 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
181 | 179 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
182 | 180 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
183 | 181 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
184 | 182 | } | |
185 | 183 | } | |
186 | 184 | ||
187 | 185 | ||
188 | 186 | ||
189 | 187 | @Callable(i) | |
190 | 188 | func finishApplicantsVoting (taskId) = { | |
191 | 189 | func isApplicantVotedEnough (aid,aid2) = { | |
192 | 190 | let listKey = (("tasks_" + taskId) + "_applicants") | |
193 | 191 | let applicantsList = split(getStringValue(this, listKey), ";") | |
194 | 192 | let teamIdentifier = applicantsList[aid] | |
195 | 193 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
196 | 194 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
197 | 195 | if ((teamVotesAmount > 0)) | |
198 | 196 | then 1 | |
199 | 197 | else throw(("not enough votes to make decision on " + teamIdentifier)) | |
200 | 198 | } | |
201 | 199 | ||
202 | 200 | func hasMoreVotes (aid,aid2) = { | |
203 | 201 | let listKey = (("tasks_" + taskId) + "_applicants") | |
204 | 202 | let applicantsList = split(getStringValue(this, listKey), ";") | |
205 | 203 | let teamIdentifier = applicantsList[aid] | |
206 | 204 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
207 | 205 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
208 | 206 | let team2Identifier = applicantsList[aid2] | |
209 | 207 | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
210 | 208 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
211 | 209 | if ((teamVotesAmount > team2VotesAmount)) | |
212 | 210 | then aid | |
213 | 211 | else aid2 | |
214 | 212 | } | |
215 | 213 | ||
216 | 214 | if (!(isGroupMember(i.caller))) | |
217 | 215 | then throw("grants working group access only") | |
218 | 216 | else { | |
219 | 217 | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
220 | 218 | let applicantsList = split(listKeys, ";") | |
221 | 219 | if ((size(applicantsList) == 0)) | |
222 | 220 | then throw("No one has yet responded to the grant") | |
223 | 221 | else { | |
224 | 222 | let chosenTeamId = { | |
225 | - | let $ | |
226 | - | let $ | |
227 | - | let $ | |
228 | - | if (($ | |
229 | - | then $ | |
223 | + | let $list1102011051 = [0, 1] | |
224 | + | let $size1102011051 = size($list1102011051) | |
225 | + | let $acc01102011051 = 0 | |
226 | + | if (($size1102011051 == 0)) | |
227 | + | then $acc01102011051 | |
230 | 228 | else { | |
231 | - | let $ | |
232 | - | if (($ | |
233 | - | then $ | |
229 | + | let $acc11102011051 = hasMoreVotes($acc01102011051, $list1102011051[0]) | |
230 | + | if (($size1102011051 == 1)) | |
231 | + | then $acc11102011051 | |
234 | 232 | else { | |
235 | - | let $ | |
236 | - | if (($ | |
237 | - | then $ | |
233 | + | let $acc21102011051 = hasMoreVotes($acc11102011051, $list1102011051[1]) | |
234 | + | if (($size1102011051 == 2)) | |
235 | + | then $acc21102011051 | |
238 | 236 | else { | |
239 | - | let $ | |
237 | + | let $acc31102011051 = hasMoreVotes($acc21102011051, $list1102011051[2]) | |
240 | 238 | throw("List size exceed 2") | |
241 | 239 | } | |
242 | 240 | } | |
243 | 241 | } | |
244 | 242 | } | |
245 | 243 | let teamIdentifier = applicantsList[chosenTeamId] | |
246 | 244 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
247 | 245 | } | |
248 | 246 | } | |
249 | 247 | } | |
250 | 248 | ||
251 | 249 | ||
252 | 250 | ||
253 | 251 | @Callable(i) | |
254 | 252 | func startWork (taskId) = { | |
255 | 253 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
256 | 254 | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
257 | 255 | then throw("team leader only") | |
258 | 256 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
259 | 257 | } | |
260 | 258 | ||
261 | 259 | ||
262 | 260 | ||
263 | 261 | @Callable(i) | |
264 | 262 | func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller))) | |
265 | 263 | then throw("grants working group access only") | |
266 | 264 | else { | |
267 | 265 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
268 | 266 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
269 | 267 | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
270 | 268 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
271 | 269 | } | |
272 | 270 | ||
273 | 271 |
github/deemru/w8io/169f3d6 52.69 ms ◑