tx · At3T9h93bZatFJqiaXVUHZcRYeneTSjps8LViac7m6Nd 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5: -0.10000000 Waves 2020.11.17 15:55 [1269388] smart account 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5 > SELF 0.00000000 Waves
{ "type": 13, "id": "At3T9h93bZatFJqiaXVUHZcRYeneTSjps8LViac7m6Nd", "fee": 10000000, "feeAssetId": null, "timestamp": 1605617764224, "version": 2, "chainId": 84, "sender": "3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5", "senderPublicKey": "BWQB37E3JLeot6EcSVXsbJMugLUYNarK8xU8W5XAPsvJ", "proofs": [ "2hVrEywCin9kDocjNUwi883NgtRrRKi8YBy5pYbMwevfx2RhVdy8xAQc1khBpWWDYLB64Re42BLWCMjLcbF5cEdF" ], "script": "base64:AAIDAAAAAAAAAD0IARIDCgEIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSBAoCCAgSBQoDCAgBEgMKAQgSAwoBCBIDCgEIAAAACAAAAAAGUVVPUlVNAAAAAAAAAAAyAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwkAAAAAAAACBQAAAAdhZGRyZXNzBQAAAAR0aGlzAQAAAAhnZXRHcm91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AAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAKX3BlcmZvcm1lcgQAAAALdGVhbUFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAABV9hcHBfBQAAAA50ZWFtSWRlbnRpZmllcgIAAAAHX2xlYWRlcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3N0YXR1cwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAANd29ya19maW5pc2hlZAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAALdGVhbUFkZHJlc3MFAAAADHJld2FyZEFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAADa3nlo=", "height": 1269388, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7qbeQyVRRErf8meDYSBteACFDB8auXRoWwxobkGKye6D Next: BdPmAAKEac4se3nbTii5f46ksHuQsaSNDhjUuiw4XrtV Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let QUORUM = 50 | |
5 | - | ||
6 | - | let WCTid = base58'4zfrrwDVjbGFM8wxbZGriVLY4XJsVD4oNMp21FnDnMAa' | |
7 | 5 | ||
8 | 6 | func tryGetInteger (key) = { | |
9 | 7 | let val = match getInteger(this, key) { | |
11 | 9 | b | |
12 | 10 | case _ => | |
13 | 11 | 0 | |
12 | + | } | |
13 | + | val | |
14 | + | } | |
15 | + | ||
16 | + | ||
17 | + | func tryGetString (key) = { | |
18 | + | let val = match getString(this, key) { | |
19 | + | case b: String => | |
20 | + | b | |
21 | + | case _ => | |
22 | + | "" | |
14 | 23 | } | |
15 | 24 | val | |
16 | 25 | } | |
81 | 90 | ||
82 | 91 | ||
83 | 92 | @Callable(i) | |
84 | - | func rateTask (taskId,rate) = if (!(if ((rate == 1)) | |
85 | - | then true | |
86 | - | else (rate == -1))) | |
87 | - | then throw("your rate needs to be +1 or -1") | |
88 | - | else { | |
89 | - | let pmt = extract(i.payment) | |
90 | - | if ((pmt.assetId != WCTid)) | |
91 | - | then throw("you need to vote using WCT") | |
92 | - | else { | |
93 | - | let weight = pmt.amount | |
94 | - | let vote = (rate * weight) | |
95 | - | let previousRate = tryGetInteger((("tasks_" + taskId) + "_community_rate")) | |
96 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_community_rate"), (previousRate + vote))]), TransferSet([ScriptTransfer(i.caller, pmt.amount, pmt.assetId)])) | |
97 | - | } | |
98 | - | } | |
99 | - | ||
100 | - | ||
101 | - | ||
102 | - | @Callable(i) | |
103 | 93 | func addTaskDetails (taskId) = if (!(isGroupMember(i.caller))) | |
104 | 94 | then throw("grants working group access only") | |
105 | 95 | else { | |
129 | 119 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
130 | 120 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
131 | 121 | let newVotingState = (votingState + voteValue) | |
132 | - | | |
122 | + | WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]) | |
133 | 123 | } | |
134 | 124 | } | |
135 | 125 | ||
159 | 149 | @Callable(i) | |
160 | 150 | func applyForTask (taskId,teamName) = { | |
161 | 151 | let listKey = (("tasks_" + taskId) + "_applicants") | |
162 | - | let currentApplicantsList = match getString(this, listKey) { | |
163 | - | case b: String => | |
164 | - | b | |
165 | - | case _ => | |
166 | - | "" | |
167 | - | } | |
152 | + | let currentApplicantsList = tryGetString(listKey) | |
153 | + | let applicantKey = drop(toString(i.caller), 20) | |
168 | 154 | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
169 | - | WriteSet([DataEntry((((("tasks_" + taskId) + "_ | |
155 | + | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
170 | 156 | } | |
171 | 157 | ||
172 | 158 | ||
175 | 161 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
176 | 162 | then throw("you can't vote") | |
177 | 163 | else { | |
178 | - | let voteKey = (((("tasks_" + taskId) + "_vote_") + toString(i.caller)) + teamIdentifier) | |
164 | + | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
165 | + | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
179 | 166 | let vote = tryGetInteger(voteKey) | |
180 | 167 | if ((vote != 0)) | |
181 | 168 | then throw("you have already voted on this team") | |
182 | 169 | else { | |
183 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_ | |
184 | - | let teamScoreKey = (((("tasks_" + taskId) + "_ | |
170 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
171 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
185 | 172 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
186 | 173 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
187 | 174 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
196 | 183 | let listKey = (("tasks_" + taskId) + "_applicants") | |
197 | 184 | let applicantsList = split(getStringValue(this, listKey), ";") | |
198 | 185 | let teamIdentifier = applicantsList[aid] | |
199 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_ | |
186 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
200 | 187 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
201 | 188 | if ((teamVotesAmount > 0)) | |
202 | 189 | then 1 | |
207 | 194 | let listKey = (("tasks_" + taskId) + "_applicants") | |
208 | 195 | let applicantsList = split(getStringValue(this, listKey), ";") | |
209 | 196 | let teamIdentifier = applicantsList[aid] | |
210 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_ | |
197 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
211 | 198 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
212 | 199 | let team2Identifier = applicantsList[aid2] | |
213 | - | let team2VotesAmountKey = (((("tasks_" + taskId) + "_ | |
200 | + | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
214 | 201 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
215 | 202 | if ((teamVotesAmount > team2VotesAmount)) | |
216 | 203 | then aid | |
221 | 208 | then throw("grants working group access only") | |
222 | 209 | else { | |
223 | 210 | let chosenTeamId = { | |
224 | - | let $ | |
225 | - | let $ | |
226 | - | let $ | |
227 | - | if (($ | |
228 | - | then $ | |
211 | + | let $list98469877 = [0, 1] | |
212 | + | let $size98469877 = size($list98469877) | |
213 | + | let $acc098469877 = 0 | |
214 | + | if (($size98469877 == 0)) | |
215 | + | then $acc098469877 | |
229 | 216 | else { | |
230 | - | let $ | |
231 | - | if (($ | |
232 | - | then $ | |
217 | + | let $acc198469877 = hasMoreVotes($acc098469877, $list98469877[0]) | |
218 | + | if (($size98469877 == 1)) | |
219 | + | then $acc198469877 | |
233 | 220 | else { | |
234 | - | let $ | |
235 | - | if (($ | |
236 | - | then $ | |
221 | + | let $acc298469877 = hasMoreVotes($acc198469877, $list98469877[1]) | |
222 | + | if (($size98469877 == 2)) | |
223 | + | then $acc298469877 | |
237 | 224 | else { | |
238 | - | let $ | |
225 | + | let $acc398469877 = hasMoreVotes($acc298469877, $list98469877[2]) | |
239 | 226 | throw("List size exceed 2") | |
240 | 227 | } | |
241 | 228 | } | |
244 | 231 | let listKey = (("tasks_" + taskId) + "_applicants") | |
245 | 232 | let applicantsList = split(getStringValue(this, listKey), ";") | |
246 | 233 | let teamIdentifier = applicantsList[chosenTeamId] | |
247 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_ | |
234 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
248 | 235 | } | |
249 | 236 | } | |
250 | 237 | ||
253 | 240 | @Callable(i) | |
254 | 241 | func startWork (taskId) = { | |
255 | 242 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
256 | - | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_ | |
243 | + | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
257 | 244 | then throw("team leader only") | |
258 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_ | |
245 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
259 | 246 | } | |
260 | 247 | ||
261 | 248 | ||
266 | 253 | else { | |
267 | 254 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
268 | 255 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
269 | - | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_ | |
270 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_ | |
256 | + | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
257 | + | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
271 | 258 | } | |
272 | 259 | ||
273 | 260 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let QUORUM = 50 | |
5 | - | ||
6 | - | let WCTid = base58'4zfrrwDVjbGFM8wxbZGriVLY4XJsVD4oNMp21FnDnMAa' | |
7 | 5 | ||
8 | 6 | func tryGetInteger (key) = { | |
9 | 7 | let val = match getInteger(this, key) { | |
10 | 8 | case b: Int => | |
11 | 9 | b | |
12 | 10 | case _ => | |
13 | 11 | 0 | |
12 | + | } | |
13 | + | val | |
14 | + | } | |
15 | + | ||
16 | + | ||
17 | + | func tryGetString (key) = { | |
18 | + | let val = match getString(this, key) { | |
19 | + | case b: String => | |
20 | + | b | |
21 | + | case _ => | |
22 | + | "" | |
14 | 23 | } | |
15 | 24 | val | |
16 | 25 | } | |
17 | 26 | ||
18 | 27 | ||
19 | 28 | func isOwner (address) = (address == this) | |
20 | 29 | ||
21 | 30 | ||
22 | 31 | func getGroup () = { | |
23 | 32 | let val = match getString(this, "working_group") { | |
24 | 33 | case b: String => | |
25 | 34 | b | |
26 | 35 | case _ => | |
27 | 36 | "" | |
28 | 37 | } | |
29 | 38 | val | |
30 | 39 | } | |
31 | 40 | ||
32 | 41 | ||
33 | 42 | func getMembers () = { | |
34 | 43 | let val = match getString(this, "dao_members") { | |
35 | 44 | case b: String => | |
36 | 45 | b | |
37 | 46 | case _ => | |
38 | 47 | "" | |
39 | 48 | } | |
40 | 49 | val | |
41 | 50 | } | |
42 | 51 | ||
43 | 52 | ||
44 | 53 | func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0) | |
45 | 54 | ||
46 | 55 | ||
47 | 56 | func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0) | |
48 | 57 | ||
49 | 58 | ||
50 | 59 | @Callable(i) | |
51 | 60 | func addDAOMember (memberAddress) = if (!(isOwner(i.caller))) | |
52 | 61 | then throw("access only to the DAO owner") | |
53 | 62 | else { | |
54 | 63 | let group = getMembers() | |
55 | 64 | let newGroup = ((group + ";") + memberAddress) | |
56 | 65 | let groupSize = tryGetInteger("dao_size") | |
57 | 66 | let newGroupSize = (groupSize + 1) | |
58 | 67 | WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry((("dao_member_" + memberAddress) + "_weight"), 1)]) | |
59 | 68 | } | |
60 | 69 | ||
61 | 70 | ||
62 | 71 | ||
63 | 72 | @Callable(i) | |
64 | 73 | func addGroupMember (memberAddress) = if (!(isOwner(i.caller))) | |
65 | 74 | then throw("access only to the DAO owner") | |
66 | 75 | else { | |
67 | 76 | let group = getGroup() | |
68 | 77 | let newGroup = ((group + ";") + memberAddress) | |
69 | 78 | let groupSize = tryGetInteger("working_group_size") | |
70 | 79 | let newGroupSize = (groupSize + 1) | |
71 | 80 | WriteSet([DataEntry("working_group_name", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)]) | |
72 | 81 | } | |
73 | 82 | ||
74 | 83 | ||
75 | 84 | ||
76 | 85 | @Callable(i) | |
77 | 86 | func addTask (title) = if (!(isGroupMember(i.caller))) | |
78 | 87 | then throw("grants working group access only") | |
79 | 88 | else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title)]) | |
80 | 89 | ||
81 | 90 | ||
82 | 91 | ||
83 | 92 | @Callable(i) | |
84 | - | func rateTask (taskId,rate) = if (!(if ((rate == 1)) | |
85 | - | then true | |
86 | - | else (rate == -1))) | |
87 | - | then throw("your rate needs to be +1 or -1") | |
88 | - | else { | |
89 | - | let pmt = extract(i.payment) | |
90 | - | if ((pmt.assetId != WCTid)) | |
91 | - | then throw("you need to vote using WCT") | |
92 | - | else { | |
93 | - | let weight = pmt.amount | |
94 | - | let vote = (rate * weight) | |
95 | - | let previousRate = tryGetInteger((("tasks_" + taskId) + "_community_rate")) | |
96 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_community_rate"), (previousRate + vote))]), TransferSet([ScriptTransfer(i.caller, pmt.amount, pmt.assetId)])) | |
97 | - | } | |
98 | - | } | |
99 | - | ||
100 | - | ||
101 | - | ||
102 | - | @Callable(i) | |
103 | 93 | func addTaskDetails (taskId) = if (!(isGroupMember(i.caller))) | |
104 | 94 | then throw("grants working group access only") | |
105 | 95 | else { | |
106 | 96 | let reward = extract(i.payment).amount | |
107 | 97 | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
108 | 98 | } | |
109 | 99 | ||
110 | 100 | ||
111 | 101 | ||
112 | 102 | @Callable(i) | |
113 | 103 | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
114 | 104 | then throw("you can't vote") | |
115 | 105 | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
116 | 106 | then throw("voting is closed or not started") | |
117 | 107 | else if (if ((voteValue != -1)) | |
118 | 108 | then (voteValue != 1) | |
119 | 109 | else false) | |
120 | 110 | then throw("you need to vote 1 or -1") | |
121 | 111 | else { | |
122 | 112 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
123 | 113 | let previousVote = tryGetInteger(voteKey) | |
124 | 114 | if (!((previousVote == 0))) | |
125 | 115 | then throw("you have already voted") | |
126 | 116 | else { | |
127 | 117 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
128 | 118 | let votingState = tryGetInteger(votingKey) | |
129 | 119 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
130 | 120 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
131 | 121 | let newVotingState = (votingState + voteValue) | |
132 | - | | |
122 | + | WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]) | |
133 | 123 | } | |
134 | 124 | } | |
135 | 125 | ||
136 | 126 | ||
137 | 127 | ||
138 | 128 | @Callable(i) | |
139 | 129 | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size")))) | |
140 | 130 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
141 | 131 | else if (!(isGroupMember(i.caller))) | |
142 | 132 | then throw("grants working group access only") | |
143 | 133 | else { | |
144 | 134 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
145 | 135 | let votingState = tryGetInteger(votingKey) | |
146 | 136 | if ((votingState > 0)) | |
147 | 137 | then { | |
148 | 138 | let votingResult = "ready_to_apply" | |
149 | 139 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
150 | 140 | } | |
151 | 141 | else { | |
152 | 142 | let votingResult = "rejected" | |
153 | 143 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
154 | 144 | } | |
155 | 145 | } | |
156 | 146 | ||
157 | 147 | ||
158 | 148 | ||
159 | 149 | @Callable(i) | |
160 | 150 | func applyForTask (taskId,teamName) = { | |
161 | 151 | let listKey = (("tasks_" + taskId) + "_applicants") | |
162 | - | let currentApplicantsList = match getString(this, listKey) { | |
163 | - | case b: String => | |
164 | - | b | |
165 | - | case _ => | |
166 | - | "" | |
167 | - | } | |
152 | + | let currentApplicantsList = tryGetString(listKey) | |
153 | + | let applicantKey = drop(toString(i.caller), 20) | |
168 | 154 | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
169 | - | WriteSet([DataEntry((((("tasks_" + taskId) + "_ | |
155 | + | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
170 | 156 | } | |
171 | 157 | ||
172 | 158 | ||
173 | 159 | ||
174 | 160 | @Callable(i) | |
175 | 161 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
176 | 162 | then throw("you can't vote") | |
177 | 163 | else { | |
178 | - | let voteKey = (((("tasks_" + taskId) + "_vote_") + toString(i.caller)) + teamIdentifier) | |
164 | + | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
165 | + | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
179 | 166 | let vote = tryGetInteger(voteKey) | |
180 | 167 | if ((vote != 0)) | |
181 | 168 | then throw("you have already voted on this team") | |
182 | 169 | else { | |
183 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_ | |
184 | - | let teamScoreKey = (((("tasks_" + taskId) + "_ | |
170 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
171 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
185 | 172 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
186 | 173 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
187 | 174 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
188 | 175 | } | |
189 | 176 | } | |
190 | 177 | ||
191 | 178 | ||
192 | 179 | ||
193 | 180 | @Callable(i) | |
194 | 181 | func finishApplicantsVoting (taskId) = { | |
195 | 182 | func isApplicantVotedEnough (aid,aid2) = { | |
196 | 183 | let listKey = (("tasks_" + taskId) + "_applicants") | |
197 | 184 | let applicantsList = split(getStringValue(this, listKey), ";") | |
198 | 185 | let teamIdentifier = applicantsList[aid] | |
199 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_ | |
186 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
200 | 187 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
201 | 188 | if ((teamVotesAmount > 0)) | |
202 | 189 | then 1 | |
203 | 190 | else throw(("not enough votes to make decision on " + teamIdentifier)) | |
204 | 191 | } | |
205 | 192 | ||
206 | 193 | func hasMoreVotes (aid,aid2) = { | |
207 | 194 | let listKey = (("tasks_" + taskId) + "_applicants") | |
208 | 195 | let applicantsList = split(getStringValue(this, listKey), ";") | |
209 | 196 | let teamIdentifier = applicantsList[aid] | |
210 | - | let teamVotesAmountKey = (((("tasks_" + taskId) + "_ | |
197 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
211 | 198 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
212 | 199 | let team2Identifier = applicantsList[aid2] | |
213 | - | let team2VotesAmountKey = (((("tasks_" + taskId) + "_ | |
200 | + | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
214 | 201 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
215 | 202 | if ((teamVotesAmount > team2VotesAmount)) | |
216 | 203 | then aid | |
217 | 204 | else aid2 | |
218 | 205 | } | |
219 | 206 | ||
220 | 207 | if (!(isGroupMember(i.caller))) | |
221 | 208 | then throw("grants working group access only") | |
222 | 209 | else { | |
223 | 210 | let chosenTeamId = { | |
224 | - | let $ | |
225 | - | let $ | |
226 | - | let $ | |
227 | - | if (($ | |
228 | - | then $ | |
211 | + | let $list98469877 = [0, 1] | |
212 | + | let $size98469877 = size($list98469877) | |
213 | + | let $acc098469877 = 0 | |
214 | + | if (($size98469877 == 0)) | |
215 | + | then $acc098469877 | |
229 | 216 | else { | |
230 | - | let $ | |
231 | - | if (($ | |
232 | - | then $ | |
217 | + | let $acc198469877 = hasMoreVotes($acc098469877, $list98469877[0]) | |
218 | + | if (($size98469877 == 1)) | |
219 | + | then $acc198469877 | |
233 | 220 | else { | |
234 | - | let $ | |
235 | - | if (($ | |
236 | - | then $ | |
221 | + | let $acc298469877 = hasMoreVotes($acc198469877, $list98469877[1]) | |
222 | + | if (($size98469877 == 2)) | |
223 | + | then $acc298469877 | |
237 | 224 | else { | |
238 | - | let $ | |
225 | + | let $acc398469877 = hasMoreVotes($acc298469877, $list98469877[2]) | |
239 | 226 | throw("List size exceed 2") | |
240 | 227 | } | |
241 | 228 | } | |
242 | 229 | } | |
243 | 230 | } | |
244 | 231 | let listKey = (("tasks_" + taskId) + "_applicants") | |
245 | 232 | let applicantsList = split(getStringValue(this, listKey), ";") | |
246 | 233 | let teamIdentifier = applicantsList[chosenTeamId] | |
247 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_ | |
234 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
248 | 235 | } | |
249 | 236 | } | |
250 | 237 | ||
251 | 238 | ||
252 | 239 | ||
253 | 240 | @Callable(i) | |
254 | 241 | func startWork (taskId) = { | |
255 | 242 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
256 | - | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_ | |
243 | + | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
257 | 244 | then throw("team leader only") | |
258 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_ | |
245 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
259 | 246 | } | |
260 | 247 | ||
261 | 248 | ||
262 | 249 | ||
263 | 250 | @Callable(i) | |
264 | 251 | func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller))) | |
265 | 252 | then throw("grants working group access only") | |
266 | 253 | else { | |
267 | 254 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
268 | 255 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
269 | - | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_ | |
270 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_ | |
256 | + | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
257 | + | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
271 | 258 | } | |
272 | 259 | ||
273 | 260 |
github/deemru/w8io/169f3d6 77.55 ms ◑