tx · 5PCnFypGYzFyQDDeSAKVcua3qAfnjdXBkx2BVVymKftH 3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ: -0.10000000 Waves 2020.11.30 20:18 [1288446] smart account 3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ > SELF 0.00000000 Waves
{ "type": 13, "id": "5PCnFypGYzFyQDDeSAKVcua3qAfnjdXBkx2BVVymKftH", "fee": 10000000, "feeAssetId": null, "timestamp": 1606756689125, "version": 2, "chainId": 84, "sender": "3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ", "senderPublicKey": "3Fjao2FW1JXSPd5EkP7C3uerW18HYacYsaMYALFMGA6N", "proofs": [ "En8qHsWU7reaVnDJD1Uq2F51bnHDWsn7gn82puUhcdSKeU2sTErGrLkA7GUZnnzV7HcjTmmyiQyw9x7MEe9sogB" ], "script": "base64:AAIDAAAAAAAAAFAIARIECgIICBIECgIICBIECgIIARIDCgEIEgUKAwgICBIFCgMICAESAwoBCBIECgIICBIECgIICBIDCgEIEgUKAwgIARIFCgMICAgSAwoBCAAAAAkAAAAABlFVT1JVTQAAAAAAAAAAAQEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAEAAAAMdHJ5R2V0U3RyaW5nAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAABQAAAAN2YWwAAAAADG1haW5Db250cmFjdAUAAAAEdGhpcwEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwMJAAA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19zdGF0dXMCAAAADXdvcmtfZmluaXNoZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAABV9hcHBfBQAAABB3aW5uZXJJZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAAGd2lubmVyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAAB19yZXBvcnQFAAAACnJlcG9ydExpbmsFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAC3RlYW1BZGRyZXNzBQAAAAxyZXdhcmRBbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAFpAQAAAApyZWplY3RUYXNrAAAAAQAAAAZ0YXNrSWQDCQEAAAABIQAAAAEJAQAAAA1pc0dyb3VwTWVtYmVyAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAAAgAAAAECAAAAIGdyYW50cyB3b3JraW5nIGdyb3VwIGFjY2VzcyBvbmx5BAAAAA50ZWFtSWRlbnRpZmllcgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwkAASwAAAACCQABLAAAAAICAAAABnRhc2tzXwUAAAAGdGFza0lkAgAAAApfcGVyZm9ybWVyCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAAB19zdGF0dXMCAAAACHJlamVjdGVkBQAAAANuaWwAAAAA1JKFoA==", "height": 1288446, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AUewYi5WsC1EFqBAb4ywzF3ndZQGZgUfue828f85qKjQ Next: HR7iWwCxPc8HbX878WDmwLj9JY3RCAkJZTrcLwokNHFm Diff:
Old | New | Differences | |
---|---|---|---|
27 | 27 | ||
28 | 28 | let mainContract = this | |
29 | 29 | ||
30 | - | func isOwner (address) = (address == this) | |
30 | + | func isOwner (address) = if ((address == this)) | |
31 | + | then true | |
32 | + | else (address == mainContract) | |
31 | 33 | ||
32 | 34 | ||
33 | 35 | func getGroup () = { | |
75 | 77 | ||
76 | 78 | ||
77 | 79 | @Callable(i) | |
78 | - | func addTask (title,link) = WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
80 | + | func addTask (title,link) = if (!(isGroupMember(i.caller))) | |
81 | + | then throw("grants working group access only") | |
82 | + | else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
79 | 83 | ||
80 | 84 | ||
81 | 85 | ||
82 | 86 | @Callable(i) | |
83 | - | func addTaskDetails (taskId,reward) = { | |
84 | - | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
85 | - | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
86 | - | then throw("team leader only") | |
87 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_requestedreward"), reward)]) | |
88 | - | } | |
89 | - | ||
90 | - | ||
91 | - | ||
92 | - | @Callable(i) | |
93 | - | func initTaskVoting (taskId) = if (!(isGroupMember(i.caller))) | |
87 | + | func addTaskDetails (taskId,detailsLink) = if (!(isGroupMember(i.caller))) | |
94 | 88 | then throw("grants working group access only") | |
95 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "voting_started")]) | |
89 | + | else { | |
90 | + | let reward = extract(i.payment).amount | |
91 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_details"), detailsLink), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
92 | + | } | |
96 | 93 | ||
97 | 94 | ||
98 | 95 | ||
132 | 129 | let votingState = tryGetInteger(votingKey) | |
133 | 130 | if ((votingState > 0)) | |
134 | 131 | then { | |
135 | - | let votingResult = " | |
132 | + | let votingResult = "ready_to_apply" | |
136 | 133 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
137 | 134 | } | |
138 | 135 | else { | |
144 | 141 | ||
145 | 142 | ||
146 | 143 | @Callable(i) | |
147 | - | func startWork (taskId) = { | |
144 | + | func applyForTask (taskId,teamName,link) = { | |
145 | + | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
146 | + | if ((status != "ready_to_apply")) | |
147 | + | then throw("This grant has not yet been approved") | |
148 | + | else { | |
149 | + | let listKey = (("tasks_" + taskId) + "_applicants") | |
150 | + | let currentApplicantsList = tryGetString(listKey) | |
151 | + | let applicantKey = drop(toString(i.caller), 10) | |
152 | + | let leader = toString(i.caller) | |
153 | + | let newApplicantsList = ((currentApplicantsList + ";") + leader) | |
154 | + | 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)]) | |
155 | + | } | |
156 | + | } | |
157 | + | ||
158 | + | ||
159 | + | ||
160 | + | @Callable(i) | |
161 | + | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
162 | + | then throw("you can't vote") | |
163 | + | else { | |
164 | + | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
165 | + | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
166 | + | let vote = tryGetInteger(voteKey) | |
167 | + | if ((vote != 0)) | |
168 | + | then throw("you have already voted on this team") | |
169 | + | else { | |
170 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
171 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
172 | + | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
173 | + | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
174 | + | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
175 | + | } | |
176 | + | } | |
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | @Callable(i) | |
181 | + | func finishApplicantsVoting (taskId) = { | |
182 | + | let minVotesToApproveApplicant = 1 | |
183 | + | if (!(isGroupMember(i.caller))) | |
184 | + | then throw("grants working group access only") | |
185 | + | else { | |
186 | + | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
187 | + | let applicantsList = split(listKeys, ";") | |
188 | + | if ((size(applicantsList) == 0)) | |
189 | + | then throw("No one has applied to the hackathon, yet") | |
190 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((("tasks_" + taskId) + "_status"), "ready_to_submit")]) | |
191 | + | } | |
192 | + | } | |
193 | + | ||
194 | + | ||
195 | + | ||
196 | + | @Callable(i) | |
197 | + | func enableSubmissions (taskId,juryList) = if (!(isGroupMember(i.caller))) | |
198 | + | then throw("grants working group access only") | |
199 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((("tasks_" + taskId) + "_jury"), juryList)]) | |
200 | + | ||
201 | + | ||
202 | + | ||
203 | + | @Callable(i) | |
204 | + | func submitSolution (taskId,solutionLink) = { | |
205 | + | func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started") | |
206 | + | ||
148 | 207 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
149 | - | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
150 | - | then throw("team leader only") | |
151 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started")]) | |
208 | + | if (!(areSubmissionsEnabled(taskId))) | |
209 | + | then throw("not possible to upload solution now") | |
210 | + | else if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
211 | + | then throw("team leader only") | |
212 | + | else WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_submitted"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solution"), solutionLink)]) | |
152 | 213 | } | |
214 | + | ||
215 | + | ||
216 | + | ||
217 | + | @Callable(i) | |
218 | + | func stopSubmissions (taskId) = if (!(isGroupMember(i.caller))) | |
219 | + | then throw("grants working group access only") | |
220 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished")]) | |
221 | + | ||
222 | + | ||
223 | + | ||
224 | + | @Callable(i) | |
225 | + | func voteForSolution (taskId,teamIdentifier,voteValue) = { | |
226 | + | func isJuryMember (i,taskId) = true | |
227 | + | ||
228 | + | if (!(isJuryMember(i, taskId))) | |
229 | + | then throw("you can't vote") | |
230 | + | else { | |
231 | + | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
232 | + | let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash) | |
233 | + | let vote = tryGetInteger(voteKey) | |
234 | + | if ((vote != 0)) | |
235 | + | then throw("you have already voted on this solution") | |
236 | + | else { | |
237 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes") | |
238 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore") | |
239 | + | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
240 | + | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
241 | + | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
242 | + | } | |
243 | + | } | |
244 | + | } | |
245 | + | ||
246 | + | ||
247 | + | ||
248 | + | @Callable(i) | |
249 | + | func acceptWorkResult (taskId,winnerIdentifier,reportLink) = if (!(isGroupMember(i.caller))) | |
250 | + | then throw("grants working group access only") | |
251 | + | else { | |
252 | + | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
253 | + | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_leader")) | |
254 | + | 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)])) | |
255 | + | } | |
153 | 256 | ||
154 | 257 | ||
155 | 258 | ||
158 | 261 | then throw("grants working group access only") | |
159 | 262 | else { | |
160 | 263 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
161 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "rejected")]) | |
162 | - | } | |
163 | - | ||
164 | - | ||
165 | - | ||
166 | - | @Callable(i) | |
167 | - | func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller))) | |
168 | - | then throw("grants working group access only") | |
169 | - | else { | |
170 | - | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
171 | - | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
172 | - | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
173 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
264 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")]) | |
174 | 265 | } | |
175 | 266 | ||
176 | 267 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let QUORUM = 1 | |
5 | 5 | ||
6 | 6 | func tryGetInteger (key) = { | |
7 | 7 | let val = match getInteger(this, key) { | |
8 | 8 | case b: Int => | |
9 | 9 | b | |
10 | 10 | case _ => | |
11 | 11 | 0 | |
12 | 12 | } | |
13 | 13 | val | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func tryGetString (key) = { | |
18 | 18 | let val = match getString(this, key) { | |
19 | 19 | case b: String => | |
20 | 20 | b | |
21 | 21 | case _ => | |
22 | 22 | "" | |
23 | 23 | } | |
24 | 24 | val | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | let mainContract = this | |
29 | 29 | ||
30 | - | func isOwner (address) = (address == this) | |
30 | + | func isOwner (address) = if ((address == this)) | |
31 | + | then true | |
32 | + | else (address == mainContract) | |
31 | 33 | ||
32 | 34 | ||
33 | 35 | func getGroup () = { | |
34 | 36 | let val = match getString(mainContract, "working_group_members") { | |
35 | 37 | case b: String => | |
36 | 38 | b | |
37 | 39 | case _ => | |
38 | 40 | "" | |
39 | 41 | } | |
40 | 42 | val | |
41 | 43 | } | |
42 | 44 | ||
43 | 45 | ||
44 | 46 | func getMembers () = { | |
45 | 47 | let val = match getString(mainContract, "dao_members") { | |
46 | 48 | case b: String => | |
47 | 49 | b | |
48 | 50 | case _ => | |
49 | 51 | "" | |
50 | 52 | } | |
51 | 53 | val | |
52 | 54 | } | |
53 | 55 | ||
54 | 56 | ||
55 | 57 | func isGroupMember (a) = { | |
56 | 58 | let val = match getInteger(mainContract, (("working_group_member_" + toString(a)) + "_weight")) { | |
57 | 59 | case b: Int => | |
58 | 60 | b | |
59 | 61 | case _ => | |
60 | 62 | 0 | |
61 | 63 | } | |
62 | 64 | (val > 0) | |
63 | 65 | } | |
64 | 66 | ||
65 | 67 | ||
66 | 68 | func canMemberVote (i) = { | |
67 | 69 | let val = match getInteger(mainContract, (("dao_member_" + toString(i.caller)) + "_weight")) { | |
68 | 70 | case b: Int => | |
69 | 71 | b | |
70 | 72 | case _ => | |
71 | 73 | 0 | |
72 | 74 | } | |
73 | 75 | (val > 0) | |
74 | 76 | } | |
75 | 77 | ||
76 | 78 | ||
77 | 79 | @Callable(i) | |
78 | - | func addTask (title,link) = WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
80 | + | func addTask (title,link) = if (!(isGroupMember(i.caller))) | |
81 | + | then throw("grants working group access only") | |
82 | + | else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)]) | |
79 | 83 | ||
80 | 84 | ||
81 | 85 | ||
82 | 86 | @Callable(i) | |
83 | - | func addTaskDetails (taskId,reward) = { | |
84 | - | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
85 | - | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
86 | - | then throw("team leader only") | |
87 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_requestedreward"), reward)]) | |
88 | - | } | |
89 | - | ||
90 | - | ||
91 | - | ||
92 | - | @Callable(i) | |
93 | - | func initTaskVoting (taskId) = if (!(isGroupMember(i.caller))) | |
87 | + | func addTaskDetails (taskId,detailsLink) = if (!(isGroupMember(i.caller))) | |
94 | 88 | then throw("grants working group access only") | |
95 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "voting_started")]) | |
89 | + | else { | |
90 | + | let reward = extract(i.payment).amount | |
91 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_details"), detailsLink), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
92 | + | } | |
96 | 93 | ||
97 | 94 | ||
98 | 95 | ||
99 | 96 | @Callable(i) | |
100 | 97 | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
101 | 98 | then throw("you can't vote") | |
102 | 99 | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
103 | 100 | then throw("voting is closed or not started") | |
104 | 101 | else if (if ((voteValue != -1)) | |
105 | 102 | then (voteValue != 1) | |
106 | 103 | else false) | |
107 | 104 | then throw("you need to vote 1 or -1") | |
108 | 105 | else { | |
109 | 106 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
110 | 107 | let previousVote = tryGetInteger(voteKey) | |
111 | 108 | if (!((previousVote == 0))) | |
112 | 109 | then throw("you have already voted") | |
113 | 110 | else { | |
114 | 111 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
115 | 112 | let votingState = tryGetInteger(votingKey) | |
116 | 113 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
117 | 114 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
118 | 115 | let newVotingState = (votingState + voteValue) | |
119 | 116 | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
120 | 117 | } | |
121 | 118 | } | |
122 | 119 | ||
123 | 120 | ||
124 | 121 | ||
125 | 122 | @Callable(i) | |
126 | 123 | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size")))) | |
127 | 124 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
128 | 125 | else if (!(isGroupMember(i.caller))) | |
129 | 126 | then throw("grants working group access only") | |
130 | 127 | else { | |
131 | 128 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
132 | 129 | let votingState = tryGetInteger(votingKey) | |
133 | 130 | if ((votingState > 0)) | |
134 | 131 | then { | |
135 | - | let votingResult = " | |
132 | + | let votingResult = "ready_to_apply" | |
136 | 133 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
137 | 134 | } | |
138 | 135 | else { | |
139 | 136 | let votingResult = "rejected" | |
140 | 137 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
141 | 138 | } | |
142 | 139 | } | |
143 | 140 | ||
144 | 141 | ||
145 | 142 | ||
146 | 143 | @Callable(i) | |
147 | - | func startWork (taskId) = { | |
144 | + | func applyForTask (taskId,teamName,link) = { | |
145 | + | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
146 | + | if ((status != "ready_to_apply")) | |
147 | + | then throw("This grant has not yet been approved") | |
148 | + | else { | |
149 | + | let listKey = (("tasks_" + taskId) + "_applicants") | |
150 | + | let currentApplicantsList = tryGetString(listKey) | |
151 | + | let applicantKey = drop(toString(i.caller), 10) | |
152 | + | let leader = toString(i.caller) | |
153 | + | let newApplicantsList = ((currentApplicantsList + ";") + leader) | |
154 | + | 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)]) | |
155 | + | } | |
156 | + | } | |
157 | + | ||
158 | + | ||
159 | + | ||
160 | + | @Callable(i) | |
161 | + | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
162 | + | then throw("you can't vote") | |
163 | + | else { | |
164 | + | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
165 | + | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
166 | + | let vote = tryGetInteger(voteKey) | |
167 | + | if ((vote != 0)) | |
168 | + | then throw("you have already voted on this team") | |
169 | + | else { | |
170 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
171 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
172 | + | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
173 | + | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
174 | + | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
175 | + | } | |
176 | + | } | |
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | @Callable(i) | |
181 | + | func finishApplicantsVoting (taskId) = { | |
182 | + | let minVotesToApproveApplicant = 1 | |
183 | + | if (!(isGroupMember(i.caller))) | |
184 | + | then throw("grants working group access only") | |
185 | + | else { | |
186 | + | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
187 | + | let applicantsList = split(listKeys, ";") | |
188 | + | if ((size(applicantsList) == 0)) | |
189 | + | then throw("No one has applied to the hackathon, yet") | |
190 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((("tasks_" + taskId) + "_status"), "ready_to_submit")]) | |
191 | + | } | |
192 | + | } | |
193 | + | ||
194 | + | ||
195 | + | ||
196 | + | @Callable(i) | |
197 | + | func enableSubmissions (taskId,juryList) = if (!(isGroupMember(i.caller))) | |
198 | + | then throw("grants working group access only") | |
199 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((("tasks_" + taskId) + "_jury"), juryList)]) | |
200 | + | ||
201 | + | ||
202 | + | ||
203 | + | @Callable(i) | |
204 | + | func submitSolution (taskId,solutionLink) = { | |
205 | + | func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started") | |
206 | + | ||
148 | 207 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
149 | - | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
150 | - | then throw("team leader only") | |
151 | - | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started")]) | |
208 | + | if (!(areSubmissionsEnabled(taskId))) | |
209 | + | then throw("not possible to upload solution now") | |
210 | + | else if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
211 | + | then throw("team leader only") | |
212 | + | else WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_submitted"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solution"), solutionLink)]) | |
152 | 213 | } | |
214 | + | ||
215 | + | ||
216 | + | ||
217 | + | @Callable(i) | |
218 | + | func stopSubmissions (taskId) = if (!(isGroupMember(i.caller))) | |
219 | + | then throw("grants working group access only") | |
220 | + | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished")]) | |
221 | + | ||
222 | + | ||
223 | + | ||
224 | + | @Callable(i) | |
225 | + | func voteForSolution (taskId,teamIdentifier,voteValue) = { | |
226 | + | func isJuryMember (i,taskId) = true | |
227 | + | ||
228 | + | if (!(isJuryMember(i, taskId))) | |
229 | + | then throw("you can't vote") | |
230 | + | else { | |
231 | + | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
232 | + | let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash) | |
233 | + | let vote = tryGetInteger(voteKey) | |
234 | + | if ((vote != 0)) | |
235 | + | then throw("you have already voted on this solution") | |
236 | + | else { | |
237 | + | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes") | |
238 | + | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore") | |
239 | + | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
240 | + | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
241 | + | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
242 | + | } | |
243 | + | } | |
244 | + | } | |
245 | + | ||
246 | + | ||
247 | + | ||
248 | + | @Callable(i) | |
249 | + | func acceptWorkResult (taskId,winnerIdentifier,reportLink) = if (!(isGroupMember(i.caller))) | |
250 | + | then throw("grants working group access only") | |
251 | + | else { | |
252 | + | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
253 | + | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_leader")) | |
254 | + | 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)])) | |
255 | + | } | |
153 | 256 | ||
154 | 257 | ||
155 | 258 | ||
156 | 259 | @Callable(i) | |
157 | 260 | func rejectTask (taskId) = if (!(isGroupMember(i.caller))) | |
158 | 261 | then throw("grants working group access only") | |
159 | 262 | else { | |
160 | 263 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
161 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "rejected")]) | |
162 | - | } | |
163 | - | ||
164 | - | ||
165 | - | ||
166 | - | @Callable(i) | |
167 | - | func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller))) | |
168 | - | then throw("grants working group access only") | |
169 | - | else { | |
170 | - | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
171 | - | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
172 | - | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
173 | - | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
264 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")]) | |
174 | 265 | } | |
175 | 266 | ||
176 | 267 |
github/deemru/w8io/169f3d6 46.85 ms ◑