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