tx · 8yvHDdeX2yvUsQ4zyoxQ9Yf9xpjrMgCBbBLy17RBQ5Fz

3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan:  -0.10000000 Waves

2020.12.02 13:52 [1290962] smart account 3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan > SELF 0.00000000 Waves

{ "type": 13, "id": "8yvHDdeX2yvUsQ4zyoxQ9Yf9xpjrMgCBbBLy17RBQ5Fz", "fee": 10000000, "feeAssetId": null, "timestamp": 1606906389759, "version": 2, "chainId": 84, "sender": "3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan", "senderPublicKey": "5tBY17DiYVDP2QCBiAPKpjhmn1hCu1rS4XbwiY9zchFf", "proofs": [ "5bVuW7vPBGBnpVQ1eqNvb4Y5V6CgytN8fLxEdcewKEJHmVFYZypmykV5eh7hCpQkoT7eX4z8t1kFwwgcBU7qxHYd" ], "script": "base64:AAIDAAAAAAAAAEUIARIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIICBIDCgEIEgUKAwgICBIFCgMICAgSAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAIAAAAAAZRVU9SVU0AAAAAAAAAAAEBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAAdpc093bmVyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc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0ZWFtQWRkcmVzcwUAAAAMcmV3YXJkQW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAhsEXVg==", "height": 1290962, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 1Mi2hU2NyehC8NDVB8DcJaBHgchJ7t87ey3whV57NTg Next: DSY6u9fzYhsW7pugaff1B2U9wmu3u84YHd8FMcdaonUf Diff:
OldNewDifferences
108108 then throw("you can't vote")
109109 else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
110110 then throw("voting is closed or not started")
111- else if (if ((voteValue != -1))
112- then (voteValue != 1)
111+ else if (if ((voteValue != "like"))
112+ then (voteValue != "dislike")
113113 else false)
114- then throw("you need to vote 1 or -1")
114+ then throw("you need to vote like or dislike")
115115 else {
116+ func getValue (vote) = if ((vote == "like"))
117+ then 1
118+ else -1
119+
116120 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
117121 let previousVote = tryGetInteger(voteKey)
118122 if (!((previousVote == 0)))
122126 let votingState = tryGetInteger(votingKey)
123127 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
124128 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)]))
129+ let newVotingState = (votingState + getValue(voteValue))
130+ ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, getValue(voteValue)), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
127131 }
128132 }
129133
156160 if ((status != "ready_to_apply"))
157161 then throw("This grant has not yet been approved")
158162 else {
159- let listKey = (("tasks_" + taskId) + "_applicants")
160- let currentApplicantsList = tryGetString(listKey)
161- let applicantKey = drop(toString(i.caller), 10)
162- let leader = toString(i.caller)
163- let newApplicantsList = ((currentApplicantsList + ";") + leader)
164- WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), leader), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)])
163+ let applicantKey = drop(toString(i.caller), 20)
164+ if ((tryGetString((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name")) == teamName))
165+ then throw("commnad with name is exist")
166+ else {
167+ let listKey = (("tasks_" + taskId) + "_applicants")
168+ let currentApplicantsList = tryGetString(listKey)
169+ let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
170+ WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)])
171+ }
165172 }
166173 }
167174
170177 @Callable(i)
171178 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
172179 then throw("you can't vote")
173- else {
174- let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
175- let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
176- let vote = tryGetInteger(voteKey)
177- if ((vote != 0))
178- then throw("you have already voted on this team")
179- else {
180- let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
181- let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
182- let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
183- let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
184- WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
185- }
186- }
180+ else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
181+ then throw("voting is closed or not started")
182+ else if ((tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id")) != teamIdentifier))
183+ then throw("team is not found use id team on application")
184+ else if (if ((voteValue != "like"))
185+ then (voteValue != "dislike")
186+ else false)
187+ then throw("you need to vote like or dislike")
188+ else {
189+ func getValue (vote) = if ((vote == "like"))
190+ then 1
191+ else -1
192+
193+ let listKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted")
194+ let newApplicantsList = ((tryGetString(listKey) + ";") + toString(i.caller))
195+ let voteHash = (drop(toString(i.caller), 20) + teamIdentifier)
196+ let voteKey = ((("tasks_" + taskId) + "_vh_") + voteHash)
197+ if ((tryGetString(voteKey) == toString(i.caller)))
198+ then throw("you have already voted on this team")
199+ else {
200+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
201+ let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
202+ let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
203+ let newTeamScore = (getValue(voteValue) + tryGetInteger(teamScoreKey))
204+ WriteSet([DataEntry(listKey, newApplicantsList), DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)])
205+ }
206+ }
187207
188208
189209
190210 @Callable(i)
191211 func finishApplicantsVoting (taskId) = {
192- let minVotesToApproveApplicant = 1
212+ func isApplicantVotedEnough (aid,aid2) = {
213+ let listKey = (("tasks_" + taskId) + "_applicants")
214+ let applicantsList = split(getStringValue(this, listKey), ";")
215+ let teamIdentifier = applicantsList[aid]
216+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
217+ let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
218+ if ((teamVotesAmount > 0))
219+ then 1
220+ else throw(("not enough votes to make decision on " + teamIdentifier))
221+ }
222+
223+ func hasMoreVotes (aid,aid2) = {
224+ let listKey = (("tasks_" + taskId) + "_applicants")
225+ let applicantsList = split(getStringValue(this, listKey), ";")
226+ let teamIdentifier = applicantsList[aid]
227+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
228+ let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
229+ let team2Identifier = applicantsList[aid2]
230+ let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
231+ let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
232+ if ((teamVotesAmount > team2VotesAmount))
233+ then aid
234+ else aid2
235+ }
236+
193237 if (!(isGroupMember(i.caller)))
194238 then throw("grants working group access only")
195239 else {
196240 let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
197241 let applicantsList = split(listKeys, ";")
198242 if ((size(applicantsList) == 0))
199- then throw("No one has applied to the hackathon, yet")
200- else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((("tasks_" + taskId) + "_status"), "ready_to_submit")])
201- }
202- }
203-
204-
205-
206-@Callable(i)
207-func enableSubmissions (taskId,juryList) = if (!(isGroupMember(i.caller)))
208- then throw("grants working group access only")
209- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((("tasks_" + taskId) + "_jury"), juryList)])
210-
211-
212-
213-@Callable(i)
214-func submitSolution (taskId,solutionLink) = {
215- func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started")
216-
217- let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
218- if (!(areSubmissionsEnabled(taskId)))
219- then throw("not possible to upload solution now")
220- else if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
221- then throw("team leader only")
222- else WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_submitted"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solution"), solutionLink)])
223- }
224-
225-
226-
227-@Callable(i)
228-func stopSubmissions (taskId) = if (!(isGroupMember(i.caller)))
229- then throw("grants working group access only")
230- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished")])
231-
232-
233-
234-@Callable(i)
235-func voteForSolution (taskId,teamIdentifier,voteValue) = {
236- func isJuryMember (i,taskId) = true
237-
238- if (!(isJuryMember(i, taskId)))
239- then throw("you can't vote")
240- else {
241- let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
242- let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash)
243- let vote = tryGetInteger(voteKey)
244- if ((vote != 0))
245- then throw("you have already voted on this solution")
243+ then throw("No one has yet responded to the grant")
246244 else {
247- let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes")
248- let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore")
249- let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
250- let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
251- WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
245+ let chosenTeamId = {
246+ let $list1255112582 = [0, 1]
247+ let $size1255112582 = size($list1255112582)
248+ let $acc01255112582 = 0
249+ if (($size1255112582 == 0))
250+ then $acc01255112582
251+ else {
252+ let $acc11255112582 = hasMoreVotes($acc01255112582, $list1255112582[0])
253+ if (($size1255112582 == 1))
254+ then $acc11255112582
255+ else {
256+ let $acc21255112582 = hasMoreVotes($acc11255112582, $list1255112582[1])
257+ if (($size1255112582 == 2))
258+ then $acc21255112582
259+ else {
260+ let $acc31255112582 = hasMoreVotes($acc21255112582, $list1255112582[2])
261+ throw("List size exceed 2")
262+ }
263+ }
264+ }
265+ }
266+ let teamIdentifier = drop(applicantsList[chosenTeamId], 20)
267+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
252268 }
253269 }
254270 }
256272
257273
258274 @Callable(i)
259-func acceptWorkResult (taskId,winnerIdentifier,reportLink) = if (!(isGroupMember(i.caller)))
260- then throw("grants working group access only")
261- else {
262- let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
263- let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_leader"))
264- ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_process"), "winner"), DataEntry((("tasks_" + taskId) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
265- }
275+func startWork (taskId) = {
276+ let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
277+ if ((tryGetString((("tasks_" + taskId) + "_status")) != "team_chosen"))
278+ then throw("team is not choosen")
279+ else if ((toString(i.caller) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
280+ then throw("team leader only")
281+ else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
282+ }
266283
267284
268285
272289 else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
273290
274291
292+
293+@Callable(i)
294+func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
295+ then throw("grants working group access only")
296+ else {
297+ let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
298+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
299+ let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
300+ ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
301+ }
302+
303+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let QUORUM = 1
55
66 func tryGetInteger (key) = {
77 let val = match getInteger(this, key) {
88 case b: Int =>
99 b
1010 case _ =>
1111 0
1212 }
1313 val
1414 }
1515
1616
1717 func tryGetString (key) = {
1818 let val = match getString(this, key) {
1919 case b: String =>
2020 b
2121 case _ =>
2222 ""
2323 }
2424 val
2525 }
2626
2727
2828 func isOwner (address) = (address == this)
2929
3030
3131 func getGroup () = {
3232 let val = match getString(this, "working_group_members") {
3333 case b: String =>
3434 b
3535 case _ =>
3636 ""
3737 }
3838 val
3939 }
4040
4141
4242 func getMembers () = {
4343 let val = match getString(this, "dao_members") {
4444 case b: String =>
4545 b
4646 case _ =>
4747 ""
4848 }
4949 val
5050 }
5151
5252
5353 func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
5454
5555
5656 func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0)
5757
5858
5959 @Callable(i)
6060 func addDAOMember (memberAddress) = if (!(isOwner(i.caller)))
6161 then throw("access only to the DAO owner")
6262 else if ((tryGetInteger((("dao_member_" + memberAddress) + "_weight")) == 1))
6363 then throw("This user already exists")
6464 else {
6565 let group = getMembers()
6666 let newGroup = ((group + ";") + memberAddress)
6767 let groupSize = tryGetInteger("dao_size")
6868 let newGroupSize = (groupSize + 1)
6969 WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry((("dao_member_" + memberAddress) + "_weight"), 1)])
7070 }
7171
7272
7373
7474 @Callable(i)
7575 func addGroupMember (memberAddress) = if (!(isOwner(i.caller)))
7676 then throw("access only to the DAO owner")
7777 else if ((tryGetInteger((("working_group_member_" + memberAddress) + "_weight")) == 1))
7878 then throw("This user already exists")
7979 else {
8080 let group = getGroup()
8181 let newGroup = ((group + ";") + memberAddress)
8282 let groupSize = tryGetInteger("working_group_size")
8383 let newGroupSize = (groupSize + 1)
8484 WriteSet([DataEntry("working_group_members", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)])
8585 }
8686
8787
8888
8989 @Callable(i)
9090 func addTask (title,link) = if (!(isGroupMember(i.caller)))
9191 then throw("grants working group access only")
9292 else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
9393
9494
9595
9696 @Callable(i)
9797 func addReward (taskId) = if (!(isGroupMember(i.caller)))
9898 then throw("grants working group access only")
9999 else {
100100 let reward = extract(i.payment).amount
101101 WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
102102 }
103103
104104
105105
106106 @Callable(i)
107107 func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i)))
108108 then throw("you can't vote")
109109 else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
110110 then throw("voting is closed or not started")
111- else if (if ((voteValue != -1))
112- then (voteValue != 1)
111+ else if (if ((voteValue != "like"))
112+ then (voteValue != "dislike")
113113 else false)
114- then throw("you need to vote 1 or -1")
114+ then throw("you need to vote like or dislike")
115115 else {
116+ func getValue (vote) = if ((vote == "like"))
117+ then 1
118+ else -1
119+
116120 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
117121 let previousVote = tryGetInteger(voteKey)
118122 if (!((previousVote == 0)))
119123 then throw("you have already voted")
120124 else {
121125 let votingKey = (("tasks_" + taskId) + "_voting_state")
122126 let votingState = tryGetInteger(votingKey)
123127 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
124128 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)]))
129+ let newVotingState = (votingState + getValue(voteValue))
130+ ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, getValue(voteValue)), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
127131 }
128132 }
129133
130134
131135
132136 @Callable(i)
133137 func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size"))))
134138 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
135139 else if (!(isGroupMember(i.caller)))
136140 then throw("grants working group access only")
137141 else {
138142 let votingKey = (("tasks_" + taskId) + "_voting_state")
139143 let votingState = tryGetInteger(votingKey)
140144 if ((votingState > 0))
141145 then {
142146 let votingResult = "ready_to_apply"
143147 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
144148 }
145149 else {
146150 let votingResult = "rejected"
147151 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
148152 }
149153 }
150154
151155
152156
153157 @Callable(i)
154158 func applyForTask (taskId,teamName,link) = {
155159 let status = tryGetString((("tasks_" + taskId) + "_status"))
156160 if ((status != "ready_to_apply"))
157161 then throw("This grant has not yet been approved")
158162 else {
159- let listKey = (("tasks_" + taskId) + "_applicants")
160- let currentApplicantsList = tryGetString(listKey)
161- let applicantKey = drop(toString(i.caller), 10)
162- let leader = toString(i.caller)
163- let newApplicantsList = ((currentApplicantsList + ";") + leader)
164- WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), leader), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)])
163+ let applicantKey = drop(toString(i.caller), 20)
164+ if ((tryGetString((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name")) == teamName))
165+ then throw("commnad with name is exist")
166+ else {
167+ let listKey = (("tasks_" + taskId) + "_applicants")
168+ let currentApplicantsList = tryGetString(listKey)
169+ let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
170+ WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)])
171+ }
165172 }
166173 }
167174
168175
169176
170177 @Callable(i)
171178 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
172179 then throw("you can't vote")
173- else {
174- let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
175- let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
176- let vote = tryGetInteger(voteKey)
177- if ((vote != 0))
178- then throw("you have already voted on this team")
179- else {
180- let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
181- let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
182- let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
183- let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
184- WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
185- }
186- }
180+ else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
181+ then throw("voting is closed or not started")
182+ else if ((tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id")) != teamIdentifier))
183+ then throw("team is not found use id team on application")
184+ else if (if ((voteValue != "like"))
185+ then (voteValue != "dislike")
186+ else false)
187+ then throw("you need to vote like or dislike")
188+ else {
189+ func getValue (vote) = if ((vote == "like"))
190+ then 1
191+ else -1
192+
193+ let listKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted")
194+ let newApplicantsList = ((tryGetString(listKey) + ";") + toString(i.caller))
195+ let voteHash = (drop(toString(i.caller), 20) + teamIdentifier)
196+ let voteKey = ((("tasks_" + taskId) + "_vh_") + voteHash)
197+ if ((tryGetString(voteKey) == toString(i.caller)))
198+ then throw("you have already voted on this team")
199+ else {
200+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
201+ let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
202+ let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
203+ let newTeamScore = (getValue(voteValue) + tryGetInteger(teamScoreKey))
204+ WriteSet([DataEntry(listKey, newApplicantsList), DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)])
205+ }
206+ }
187207
188208
189209
190210 @Callable(i)
191211 func finishApplicantsVoting (taskId) = {
192- let minVotesToApproveApplicant = 1
212+ func isApplicantVotedEnough (aid,aid2) = {
213+ let listKey = (("tasks_" + taskId) + "_applicants")
214+ let applicantsList = split(getStringValue(this, listKey), ";")
215+ let teamIdentifier = applicantsList[aid]
216+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
217+ let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
218+ if ((teamVotesAmount > 0))
219+ then 1
220+ else throw(("not enough votes to make decision on " + teamIdentifier))
221+ }
222+
223+ func hasMoreVotes (aid,aid2) = {
224+ let listKey = (("tasks_" + taskId) + "_applicants")
225+ let applicantsList = split(getStringValue(this, listKey), ";")
226+ let teamIdentifier = applicantsList[aid]
227+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
228+ let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
229+ let team2Identifier = applicantsList[aid2]
230+ let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
231+ let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
232+ if ((teamVotesAmount > team2VotesAmount))
233+ then aid
234+ else aid2
235+ }
236+
193237 if (!(isGroupMember(i.caller)))
194238 then throw("grants working group access only")
195239 else {
196240 let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
197241 let applicantsList = split(listKeys, ";")
198242 if ((size(applicantsList) == 0))
199- then throw("No one has applied to the hackathon, yet")
200- else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((("tasks_" + taskId) + "_status"), "ready_to_submit")])
201- }
202- }
203-
204-
205-
206-@Callable(i)
207-func enableSubmissions (taskId,juryList) = if (!(isGroupMember(i.caller)))
208- then throw("grants working group access only")
209- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((("tasks_" + taskId) + "_jury"), juryList)])
210-
211-
212-
213-@Callable(i)
214-func submitSolution (taskId,solutionLink) = {
215- func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started")
216-
217- let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
218- if (!(areSubmissionsEnabled(taskId)))
219- then throw("not possible to upload solution now")
220- else if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
221- then throw("team leader only")
222- else WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_submitted"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solution"), solutionLink)])
223- }
224-
225-
226-
227-@Callable(i)
228-func stopSubmissions (taskId) = if (!(isGroupMember(i.caller)))
229- then throw("grants working group access only")
230- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished")])
231-
232-
233-
234-@Callable(i)
235-func voteForSolution (taskId,teamIdentifier,voteValue) = {
236- func isJuryMember (i,taskId) = true
237-
238- if (!(isJuryMember(i, taskId)))
239- then throw("you can't vote")
240- else {
241- let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
242- let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash)
243- let vote = tryGetInteger(voteKey)
244- if ((vote != 0))
245- then throw("you have already voted on this solution")
243+ then throw("No one has yet responded to the grant")
246244 else {
247- let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes")
248- let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore")
249- let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
250- let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
251- WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
245+ let chosenTeamId = {
246+ let $list1255112582 = [0, 1]
247+ let $size1255112582 = size($list1255112582)
248+ let $acc01255112582 = 0
249+ if (($size1255112582 == 0))
250+ then $acc01255112582
251+ else {
252+ let $acc11255112582 = hasMoreVotes($acc01255112582, $list1255112582[0])
253+ if (($size1255112582 == 1))
254+ then $acc11255112582
255+ else {
256+ let $acc21255112582 = hasMoreVotes($acc11255112582, $list1255112582[1])
257+ if (($size1255112582 == 2))
258+ then $acc21255112582
259+ else {
260+ let $acc31255112582 = hasMoreVotes($acc21255112582, $list1255112582[2])
261+ throw("List size exceed 2")
262+ }
263+ }
264+ }
265+ }
266+ let teamIdentifier = drop(applicantsList[chosenTeamId], 20)
267+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
252268 }
253269 }
254270 }
255271
256272
257273
258274 @Callable(i)
259-func acceptWorkResult (taskId,winnerIdentifier,reportLink) = if (!(isGroupMember(i.caller)))
260- then throw("grants working group access only")
261- else {
262- let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
263- let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_leader"))
264- ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_process"), "winner"), DataEntry((("tasks_" + taskId) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
265- }
275+func startWork (taskId) = {
276+ let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
277+ if ((tryGetString((("tasks_" + taskId) + "_status")) != "team_chosen"))
278+ then throw("team is not choosen")
279+ else if ((toString(i.caller) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
280+ then throw("team leader only")
281+ else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
282+ }
266283
267284
268285
269286 @Callable(i)
270287 func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
271288 then throw("grants working group access only")
272289 else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
273290
274291
292+
293+@Callable(i)
294+func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
295+ then throw("grants working group access only")
296+ else {
297+ let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
298+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
299+ let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
300+ ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
301+ }
302+
303+

github/deemru/w8io/169f3d6 
53.94 ms