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