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