tx · DZ8ac63CPQubpKUPPn2XZ4WShH2bb3VB4tzRkgbJAtS7

3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA:  -0.10000000 Waves

2020.12.27 05:32 [1326508] smart account 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA > SELF 0.00000000 Waves

{ "type": 13, "id": "DZ8ac63CPQubpKUPPn2XZ4WShH2bb3VB4tzRkgbJAtS7", "fee": 10000000, "feeAssetId": null, "timestamp": 1609036427467, "version": 2, "chainId": 84, "sender": "3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA", "senderPublicKey": "4xMxUnfdbHYsent96ThiYC63gXHiahi6bh3urdHHntHi", "proofs": [ "3Rvpq1HWoh3L9JhXiQX95HhdTVVz2fM3mRaZryZW8L9honZLKvS3DixEu3PExS1MD6u7GRoEgYpDStGtje8nccb4" ], "script": "base64:AAIDAAAAAAAAADsIARIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIEgUKAwgICBIDCgEIEgMKAQgSBAoCCAgSAwoBCAAAABQAAAAADG1haW5Db250cmFjdAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXdSemkyQm1xWlpYV3JDR0N3Y1JRTHNuaWMyQW9kNnpoUwAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAA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dfc3RhdHVzAgAAAAhyZWplY3RlZAUAAAADbmlsCQAAAgAAAAECAAAAIGdyYW50cyB3b3JraW5nIGdyb3VwIGFjY2VzcyBvbmx5AAAAAG0jxeM=", "height": 1326508, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6GFQRCNVFcpDhrPJzHMeqirYZba3m4Ht7LoR3N3A4ted Next: 8VjJ6RfRX1FR5boUnU7DohQpGWgtXUaeQCLE1YShNoYr Diff:
OldNewDifferences
122122 else true
123123
124124
125+func applyForTaskConditions (address,taskId) = if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
126+ then throw("This grant has not yet been approved")
127+ else true
128+
129+
130+func voteForApplicantConditions (address,taskId,teamIdentifier) = {
131+ let voteHash = (drop(toString(address), 10) + drop(teamIdentifier, 10))
132+ if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
133+ then throw("This grant has not yet been approved")
134+ else if ((tryGetInteger(((("tasks_" + taskId) + "_vote_") + voteHash)) != 0))
135+ then throw("you have already voted on this team")
136+ else true
137+ }
138+
139+
140+func finishApplicantsVotingConditions (address,taskId,applicantsList) = if (!(isGroupMember(address)))
141+ then throw("grants working group access only")
142+ else if ((size(applicantsList) == 0))
143+ then throw("No one has yet responded to the grant")
144+ else true
145+
146+
147+func startWorkConditions (address,taskId,teamIdentifier) = if ((toString(address) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
148+ then throw("team leader only")
149+ else true
150+
151+
152+func acceptWorkResultConditions (address,taskId) = if (!(isGroupMember(address)))
153+ then throw("grants working group access only")
154+ else true
155+
156+
125157 @Callable(i)
126158 func addTask (title,link) = if (addTaskConditions(i.caller))
127159 then WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
168200
169201
170202 @Callable(i)
171-func applyForTask (taskId,teamName,link) = {
172- let status = tryGetString((("tasks_" + taskId) + "_status"))
173- if ((status != "ready_to_apply"))
174- then throw("This grant has not yet been approved")
175- else {
176- let listKey = (("tasks_" + taskId) + "_applicants")
177- let currentApplicantsList = tryGetString(listKey)
178- let applicantKey = drop(toString(i.caller), 10)
179- let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
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- }
182- }
203+func applyForTask (taskId,teamName,link) = if (applyForTaskConditions(i.caller, taskId))
204+ then {
205+ let listKey = (("tasks_" + taskId) + "_applicants")
206+ let currentApplicantsList = tryGetString(listKey)
207+ let teamIdentifier = drop(toString(i.caller), 10)
208+ let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
209+ WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id"), teamIdentifier), DataEntry(listKey, newApplicantsList)])
210+ }
211+ else throw("checks are not passed")
183212
184213
185214
186215 @Callable(i)
187-func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i.caller)))
188- then throw("you can't vote")
189- else {
190- let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
191- let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
192- let vote = tryGetInteger(voteKey)
193- if ((vote != 0))
216+func voteForApplicant (taskId,teamIdentifier,voteValue) = if (voteForApplicantConditions(i.caller, taskId, teamIdentifier))
217+ then {
218+ let listKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted")
219+ let newApplicantsList = ((tryGetString(listKey) + ";") + toString(i.caller))
220+ let voteHash = (drop(toString(i.caller), 20) + teamIdentifier)
221+ let voteKey = ((("tasks_" + taskId) + "_vh_") + voteHash)
222+ if ((tryGetString(voteKey) == toString(i.caller)))
194223 then throw("you have already voted on this team")
195224 else {
196- let valueVoteInt = getVoteValue(voteValue)
197225 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
198226 let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
199227 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
200- let newTeamScore = (valueVoteInt + tryGetInteger(teamScoreKey))
201- WriteSet([DataEntry(voteKey, valueVoteInt), DataEntry(teamScoreKey, newTeamScore)])
228+ let newTeamScore = (getVoteValue(voteValue) + tryGetInteger(teamScoreKey))
229+ WriteSet([DataEntry(listKey, newApplicantsList), DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)])
202230 }
203231 }
232+ else throw("checks are not passed")
204233
205234
206235
207236 @Callable(i)
208237 func finishApplicantsVoting (taskId) = {
209- func isApplicantVotedEnough (aid,aid2) = {
210- let listKey = (("tasks_" + taskId) + "_applicants")
211- let applicantsList = split(getStringValue(this, listKey), ";")
212- let teamIdentifier = applicantsList[aid]
213- let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
214- let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
215- if ((teamVotesAmount > 0))
216- then 1
217- else throw(("not enough votes to make decision on " + teamIdentifier))
218- }
219-
220238 func hasMoreVotes (aid,aid2) = {
221239 let listKey = (("tasks_" + taskId) + "_applicants")
222240 let applicantsList = split(getStringValue(this, listKey), ";")
231249 else aid2
232250 }
233251
234- if (!(isGroupMember(i.caller)))
235- then throw("grants working group access only")
236- else {
237- let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
238- let applicantsList = split(listKeys, ";")
239- if ((size(applicantsList) == 0))
240- then throw("No one has yet responded to the grant")
241- else {
242- let chosenTeamId = {
243- let $list1021210243 = [0, 1]
244- let $size1021210243 = size($list1021210243)
245- let $acc01021210243 = 0
246- if (($size1021210243 == 0))
247- then $acc01021210243
252+ let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
253+ let applicantsList = split(listKeys, ";")
254+ if (finishApplicantsVotingConditions(i.caller, taskId, applicantsList))
255+ then {
256+ let chosenTeamId = {
257+ let $list1195411985 = [0, 1]
258+ let $size1195411985 = size($list1195411985)
259+ let $acc01195411985 = 0
260+ if (($size1195411985 == 0))
261+ then $acc01195411985
262+ else {
263+ let $acc11195411985 = hasMoreVotes($acc01195411985, $list1195411985[0])
264+ if (($size1195411985 == 1))
265+ then $acc11195411985
248266 else {
249- let $acc11021210243 = hasMoreVotes($acc01021210243, $list1021210243[0])
250- if (($size1021210243 == 1))
251- then $acc11021210243
267+ let $acc21195411985 = hasMoreVotes($acc11195411985, $list1195411985[1])
268+ if (($size1195411985 == 2))
269+ then $acc21195411985
252270 else {
253- let $acc21021210243 = hasMoreVotes($acc11021210243, $list1021210243[1])
254- if (($size1021210243 == 2))
255- then $acc21021210243
256- else {
257- let $acc31021210243 = hasMoreVotes($acc21021210243, $list1021210243[2])
258- throw("List size exceed 2")
259- }
271+ let $acc31195411985 = hasMoreVotes($acc21195411985, $list1195411985[2])
272+ throw("List size exceed 2")
260273 }
261274 }
262275 }
263- let teamIdentifier = applicantsList[chosenTeamId]
264- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
265- }
276+ }
277+ let teamIdentifier = drop(applicantsList[chosenTeamId], 20)
278+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
266279 }
280+ else throw("checks are not passed")
267281 }
268282
269283
270284
271285 @Callable(i)
272286 func startWork (taskId) = {
273- let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
274- if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
275- then throw("team leader only")
276- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
287+ let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
288+ if (startWorkConditions(i.caller, taskId, teamIdentifier))
289+ then WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
290+ else throw("checks are not passed")
277291 }
278292
279293
280294
281295 @Callable(i)
282-func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
283- then throw("grants working group access only")
284- else {
296+func acceptWorkResult (taskId,reportLink) = if (acceptWorkResultConditions(i.caller, taskId))
297+ then {
285298 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
286- let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
287- let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
299+ let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
300+ let teamAddress = tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
288301 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)]))
289302 }
303+ else throw("checks are not passed")
290304
291305
292306
293307 @Callable(i)
294-func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
295- then throw("grants working group access only")
296- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
308+func rejectTask (taskId) = if (isGroupMember(i.caller))
309+ then WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
310+ else throw("grants working group access only")
297311
298312
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let mainContract = addressFromStringValue("3MwRzi2BmqZZXWrCGCwcRQLsnic2Aod6zhS")
55
66 let QUORUM = 1
77
88 func tryGetInteger (key) = {
99 let val = match getInteger(this, key) {
1010 case b: Int =>
1111 b
1212 case _ =>
1313 0
1414 }
1515 val
1616 }
1717
1818
1919 func tryGetString (key) = {
2020 let val = match getString(this, key) {
2121 case b: String =>
2222 b
2323 case _ =>
2424 ""
2525 }
2626 val
2727 }
2828
2929
3030 func isOwner (address) = (address == this)
3131
3232
3333 func getGroup () = {
3434 let val = match getString(mainContract, "working_group_members") {
3535 case b: String =>
3636 b
3737 case _ =>
3838 ""
3939 }
4040 val
4141 }
4242
4343
4444 func getMembers () = {
4545 let val = match getString(mainContract, "dao_members") {
4646 case b: String =>
4747 b
4848 case _ =>
4949 ""
5050 }
5151 val
5252 }
5353
5454
5555 func getDAOSize () = {
5656 let val = match getInteger(mainContract, "dao_size") {
5757 case b: Int =>
5858 b
5959 case _ =>
6060 0
6161 }
6262 val
6363 }
6464
6565
6666 func isGroupMember (a) = {
6767 let val = match getInteger(mainContract, (("working_group_member_" + toString(a)) + "_weight")) {
6868 case b: Int =>
6969 b
7070 case _ =>
7171 0
7272 }
7373 (val > 0)
7474 }
7575
7676
7777 func canMemberVote (address) = {
7878 let val = match getInteger(mainContract, (("dao_member_" + toString(address)) + "_weight")) {
7979 case b: Int =>
8080 b
8181 case _ =>
8282 0
8383 }
8484 (val > 0)
8585 }
8686
8787
8888 func getVoteValue (s) = if ((s == "like"))
8989 then 1
9090 else if ((s == "dislike"))
9191 then -1
9292 else throw("you need to vote with 'like' or 'dislike' value")
9393
9494
9595 func addTaskConditions (address) = if (!(isGroupMember(address)))
9696 then throw("grants working group access only")
9797 else true
9898
9999
100100 func addRewardConditions (address,taskId) = if (!(isGroupMember(address)))
101101 then throw("grants working group access only")
102102 else if ((tryGetString((("tasks_" + taskId) + "_status")) != ""))
103103 then throw("grant isn`t new")
104104 else true
105105
106106
107107 func voteForTaskProposalConditions (address,taskId) = if (!(canMemberVote(address)))
108108 then throw("you can't vote")
109109 else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed"))
110110 then throw("voting is closed or not started")
111111 else if ((tryGetInteger(((("tasks_" + taskId) + "_voted_") + toString(address))) != 0))
112112 then throw("you have already voted")
113113 else true
114114
115115
116116 func finishTaskProposalVotingConditions (address,taskId) = if (!(isGroupMember(address)))
117117 then throw("grants working group access only")
118118 else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed"))
119119 then throw("voting is not active")
120120 else if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
121121 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
122122 else true
123123
124124
125+func applyForTaskConditions (address,taskId) = if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
126+ then throw("This grant has not yet been approved")
127+ else true
128+
129+
130+func voteForApplicantConditions (address,taskId,teamIdentifier) = {
131+ let voteHash = (drop(toString(address), 10) + drop(teamIdentifier, 10))
132+ if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
133+ then throw("This grant has not yet been approved")
134+ else if ((tryGetInteger(((("tasks_" + taskId) + "_vote_") + voteHash)) != 0))
135+ then throw("you have already voted on this team")
136+ else true
137+ }
138+
139+
140+func finishApplicantsVotingConditions (address,taskId,applicantsList) = if (!(isGroupMember(address)))
141+ then throw("grants working group access only")
142+ else if ((size(applicantsList) == 0))
143+ then throw("No one has yet responded to the grant")
144+ else true
145+
146+
147+func startWorkConditions (address,taskId,teamIdentifier) = if ((toString(address) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
148+ then throw("team leader only")
149+ else true
150+
151+
152+func acceptWorkResultConditions (address,taskId) = if (!(isGroupMember(address)))
153+ then throw("grants working group access only")
154+ else true
155+
156+
125157 @Callable(i)
126158 func addTask (title,link) = if (addTaskConditions(i.caller))
127159 then WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
128160 else throw("checks are not passed")
129161
130162
131163
132164 @Callable(i)
133165 func addReward (taskId) = if (addRewardConditions(i.caller, taskId))
134166 then {
135167 let reward = extract(i.payment).amount
136168 WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
137169 }
138170 else throw("checks are not passed")
139171
140172
141173
142174 @Callable(i)
143175 func voteForTaskProposal (taskId,voteValue) = if (voteForTaskProposalConditions(i.caller, taskId))
144176 then {
145177 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
146178 let votingKey = (("tasks_" + taskId) + "_voting_state")
147179 let votingState = tryGetInteger(votingKey)
148180 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
149181 let votesAmountState = (tryGetInteger(votingKey) + 1)
150182 let voteValueInt = getVoteValue(voteValue)
151183 let newVotingState = (votingState + voteValueInt)
152184 WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValueInt), DataEntry(votesAmountKey, votesAmountState)])
153185 }
154186 else throw("checks are not passed")
155187
156188
157189
158190 @Callable(i)
159191 func finishTaskProposalVoting (taskId) = if (finishTaskProposalVotingConditions(i.caller, taskId))
160192 then {
161193 let votingKey = (("tasks_" + taskId) + "_voting_state")
162194 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), if ((tryGetInteger(votingKey) > 0))
163195 then "ready_to_apply"
164196 else "rejected")])
165197 }
166198 else throw("checks are not passed")
167199
168200
169201
170202 @Callable(i)
171-func applyForTask (taskId,teamName,link) = {
172- let status = tryGetString((("tasks_" + taskId) + "_status"))
173- if ((status != "ready_to_apply"))
174- then throw("This grant has not yet been approved")
175- else {
176- let listKey = (("tasks_" + taskId) + "_applicants")
177- let currentApplicantsList = tryGetString(listKey)
178- let applicantKey = drop(toString(i.caller), 10)
179- let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
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- }
182- }
203+func applyForTask (taskId,teamName,link) = if (applyForTaskConditions(i.caller, taskId))
204+ then {
205+ let listKey = (("tasks_" + taskId) + "_applicants")
206+ let currentApplicantsList = tryGetString(listKey)
207+ let teamIdentifier = drop(toString(i.caller), 10)
208+ let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
209+ WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id"), teamIdentifier), DataEntry(listKey, newApplicantsList)])
210+ }
211+ else throw("checks are not passed")
183212
184213
185214
186215 @Callable(i)
187-func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i.caller)))
188- then throw("you can't vote")
189- else {
190- let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
191- let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
192- let vote = tryGetInteger(voteKey)
193- if ((vote != 0))
216+func voteForApplicant (taskId,teamIdentifier,voteValue) = if (voteForApplicantConditions(i.caller, taskId, teamIdentifier))
217+ then {
218+ let listKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted")
219+ let newApplicantsList = ((tryGetString(listKey) + ";") + toString(i.caller))
220+ let voteHash = (drop(toString(i.caller), 20) + teamIdentifier)
221+ let voteKey = ((("tasks_" + taskId) + "_vh_") + voteHash)
222+ if ((tryGetString(voteKey) == toString(i.caller)))
194223 then throw("you have already voted on this team")
195224 else {
196- let valueVoteInt = getVoteValue(voteValue)
197225 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
198226 let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
199227 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
200- let newTeamScore = (valueVoteInt + tryGetInteger(teamScoreKey))
201- WriteSet([DataEntry(voteKey, valueVoteInt), DataEntry(teamScoreKey, newTeamScore)])
228+ let newTeamScore = (getVoteValue(voteValue) + tryGetInteger(teamScoreKey))
229+ WriteSet([DataEntry(listKey, newApplicantsList), DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)])
202230 }
203231 }
232+ else throw("checks are not passed")
204233
205234
206235
207236 @Callable(i)
208237 func finishApplicantsVoting (taskId) = {
209- func isApplicantVotedEnough (aid,aid2) = {
210- let listKey = (("tasks_" + taskId) + "_applicants")
211- let applicantsList = split(getStringValue(this, listKey), ";")
212- let teamIdentifier = applicantsList[aid]
213- let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
214- let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
215- if ((teamVotesAmount > 0))
216- then 1
217- else throw(("not enough votes to make decision on " + teamIdentifier))
218- }
219-
220238 func hasMoreVotes (aid,aid2) = {
221239 let listKey = (("tasks_" + taskId) + "_applicants")
222240 let applicantsList = split(getStringValue(this, listKey), ";")
223241 let teamIdentifier = applicantsList[aid]
224242 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
225243 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
226244 let team2Identifier = applicantsList[aid2]
227245 let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
228246 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
229247 if ((teamVotesAmount > team2VotesAmount))
230248 then aid
231249 else aid2
232250 }
233251
234- if (!(isGroupMember(i.caller)))
235- then throw("grants working group access only")
236- else {
237- let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
238- let applicantsList = split(listKeys, ";")
239- if ((size(applicantsList) == 0))
240- then throw("No one has yet responded to the grant")
241- else {
242- let chosenTeamId = {
243- let $list1021210243 = [0, 1]
244- let $size1021210243 = size($list1021210243)
245- let $acc01021210243 = 0
246- if (($size1021210243 == 0))
247- then $acc01021210243
252+ let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
253+ let applicantsList = split(listKeys, ";")
254+ if (finishApplicantsVotingConditions(i.caller, taskId, applicantsList))
255+ then {
256+ let chosenTeamId = {
257+ let $list1195411985 = [0, 1]
258+ let $size1195411985 = size($list1195411985)
259+ let $acc01195411985 = 0
260+ if (($size1195411985 == 0))
261+ then $acc01195411985
262+ else {
263+ let $acc11195411985 = hasMoreVotes($acc01195411985, $list1195411985[0])
264+ if (($size1195411985 == 1))
265+ then $acc11195411985
248266 else {
249- let $acc11021210243 = hasMoreVotes($acc01021210243, $list1021210243[0])
250- if (($size1021210243 == 1))
251- then $acc11021210243
267+ let $acc21195411985 = hasMoreVotes($acc11195411985, $list1195411985[1])
268+ if (($size1195411985 == 2))
269+ then $acc21195411985
252270 else {
253- let $acc21021210243 = hasMoreVotes($acc11021210243, $list1021210243[1])
254- if (($size1021210243 == 2))
255- then $acc21021210243
256- else {
257- let $acc31021210243 = hasMoreVotes($acc21021210243, $list1021210243[2])
258- throw("List size exceed 2")
259- }
271+ let $acc31195411985 = hasMoreVotes($acc21195411985, $list1195411985[2])
272+ throw("List size exceed 2")
260273 }
261274 }
262275 }
263- let teamIdentifier = applicantsList[chosenTeamId]
264- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
265- }
276+ }
277+ let teamIdentifier = drop(applicantsList[chosenTeamId], 20)
278+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
266279 }
280+ else throw("checks are not passed")
267281 }
268282
269283
270284
271285 @Callable(i)
272286 func startWork (taskId) = {
273- let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
274- if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
275- then throw("team leader only")
276- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
287+ let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
288+ if (startWorkConditions(i.caller, taskId, teamIdentifier))
289+ then WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
290+ else throw("checks are not passed")
277291 }
278292
279293
280294
281295 @Callable(i)
282-func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
283- then throw("grants working group access only")
284- else {
296+func acceptWorkResult (taskId,reportLink) = if (acceptWorkResultConditions(i.caller, taskId))
297+ then {
285298 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
286- let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
287- let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
299+ let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
300+ let teamAddress = tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
288301 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)]))
289302 }
303+ else throw("checks are not passed")
290304
291305
292306
293307 @Callable(i)
294-func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
295- then throw("grants working group access only")
296- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
308+func rejectTask (taskId) = if (isGroupMember(i.caller))
309+ then WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
310+ else throw("grants working group access only")
297311
298312

github/deemru/w8io/169f3d6 
68.89 ms