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