tx · AhAQU4CwJvKCC9TLj94aCnwLAENgQVZgrBiQGZrHPZzL 3MvhwW8DRJqkZAHDJPMP7okZGfbFwxhBFEA: -0.03000000 Waves 2020.10.25 22:29 [1236536] smart account 3MvhwW8DRJqkZAHDJPMP7okZGfbFwxhBFEA > SELF 0.00000000 Waves
{ "type": 13, "id": "AhAQU4CwJvKCC9TLj94aCnwLAENgQVZgrBiQGZrHPZzL", "fee": 3000000, "feeAssetId": null, "timestamp": 1603654130858, "version": 2, "chainId": 84, "sender": "3MvhwW8DRJqkZAHDJPMP7okZGfbFwxhBFEA", "senderPublicKey": "76gvXgrqX3zR94Q9hUBuZtUWuT2cUmehesJdF9UeuTFV", "proofs": [ "2xJ2NJsQ8sp2nyKDAwGDUbhN3tdu7pSMq1P8c35bvK2jv5qN6jSdaLbCgHp18ur3Nc9FX2G5DWShXJWW9GYBsJt8" ], "script": "base64:AAIDAAAAAAAAAEMIARIDCgEIEgMKAQgSAwoBCBIECgIIARIDCgEIEgQKAggBEgMKAQgSBAoCCAgSBQoDCAgBEgMKAQgSAwoBCBIDCgEIAAAACAAAAAAGUVVPUlVNAAAAAAAAAAAyAAAAAAVXQ1RpZAEAAAAgO1kbDPy5xEIOvJ4v22ekSZz5VGdcetD16T0T8sRYgmMBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAAB2lzT3duZXIAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwEAAAAIZ2V0R3JvdXAAAAAABAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwIAAAANd29ya2luZ19ncm91cAMJAAABAAAAAgUAAAAHJG1hdGNoMAI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dGFza3NfBQAAAAZ0YXNrSWQCAAAABV9hcHBfBQAAAA50ZWFtSWRlbnRpZmllcgIAAAAHX2xlYWRlcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3N0YXR1cwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAANd29ya19maW5pc2hlZAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAALdGVhbUFkZHJlc3MFAAAADHJld2FyZEFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAACGOLXE=", "height": 1236536, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8dHwfZU563CxtsYFzzrhattK1vNZuAD3kc5mZtkFdTDx Next: 8f4fsPw6q4Kxer8sM8gpFGayDVZ16ZdHWgTXscAEmrEt Diff:
Old | New | Differences | |
---|---|---|---|
175 | 175 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
176 | 176 | then throw("you can't vote") | |
177 | 177 | else { | |
178 | - | let voteHash = sha256(toBytes((toString(i.caller) + teamIdentifier))) | |
179 | - | let voteKey = ((("tasks_" + taskId) + "_vote_") + | |
178 | + | let voteHash = toUtf8String(sha256(toBytes((toString(i.caller) + teamIdentifier)))) | |
179 | + | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
180 | 180 | let vote = tryGetInteger(voteKey) | |
181 | 181 | if ((vote != 0)) | |
182 | 182 | then throw("you have already voted on this team") | |
222 | 222 | then throw("grants working group access only") | |
223 | 223 | else { | |
224 | 224 | let chosenTeamId = { | |
225 | - | let $ | |
226 | - | let $ | |
227 | - | let $ | |
228 | - | if (($ | |
229 | - | then $ | |
225 | + | let $list1038810419 = [0, 1] | |
226 | + | let $size1038810419 = size($list1038810419) | |
227 | + | let $acc01038810419 = 0 | |
228 | + | if (($size1038810419 == 0)) | |
229 | + | then $acc01038810419 | |
230 | 230 | else { | |
231 | - | let $ | |
232 | - | if (($ | |
233 | - | then $ | |
231 | + | let $acc11038810419 = hasMoreVotes($acc01038810419, $list1038810419[0]) | |
232 | + | if (($size1038810419 == 1)) | |
233 | + | then $acc11038810419 | |
234 | 234 | else { | |
235 | - | let $ | |
236 | - | if (($ | |
237 | - | then $ | |
235 | + | let $acc21038810419 = hasMoreVotes($acc11038810419, $list1038810419[1]) | |
236 | + | if (($size1038810419 == 2)) | |
237 | + | then $acc21038810419 | |
238 | 238 | else { | |
239 | - | let $ | |
239 | + | let $acc31038810419 = hasMoreVotes($acc21038810419, $list1038810419[2]) | |
240 | 240 | throw("List size exceed 2") | |
241 | 241 | } | |
242 | 242 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let QUORUM = 50 | |
5 | 5 | ||
6 | 6 | let WCTid = base58'4zfrrwDVjbGFM8wxbZGriVLY4XJsVD4oNMp21FnDnMAa' | |
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 isOwner (address) = (address == this) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func getGroup () = { | |
23 | 23 | let val = match getString(this, "working_group") { | |
24 | 24 | case b: String => | |
25 | 25 | b | |
26 | 26 | case _ => | |
27 | 27 | "" | |
28 | 28 | } | |
29 | 29 | val | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getMembers () = { | |
34 | 34 | let val = match getString(this, "dao_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 isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(i) | |
51 | 51 | func addDAOMember (memberAddress) = if (!(isOwner(i.caller))) | |
52 | 52 | then throw("access only to the DAO owner") | |
53 | 53 | else { | |
54 | 54 | let group = getMembers() | |
55 | 55 | let newGroup = ((group + ";") + memberAddress) | |
56 | 56 | let groupSize = tryGetInteger("dao_size") | |
57 | 57 | let newGroupSize = (groupSize + 1) | |
58 | 58 | WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry((("dao_member_" + memberAddress) + "_weight"), 1)]) | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func addGroupMember (memberAddress) = if (!(isOwner(i.caller))) | |
65 | 65 | then throw("access only to the DAO owner") | |
66 | 66 | else { | |
67 | 67 | let group = getGroup() | |
68 | 68 | let newGroup = ((group + ";") + memberAddress) | |
69 | 69 | let groupSize = tryGetInteger("working_group_size") | |
70 | 70 | let newGroupSize = (groupSize + 1) | |
71 | 71 | WriteSet([DataEntry("working_group_name", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)]) | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Callable(i) | |
77 | 77 | func addTask (title) = if (!(isGroupMember(i.caller))) | |
78 | 78 | then throw("grants working group access only") | |
79 | 79 | else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title)]) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | ||
83 | 83 | @Callable(i) | |
84 | 84 | func rateTask (taskId,rate) = if (!(if ((rate == 1)) | |
85 | 85 | then true | |
86 | 86 | else (rate == -1))) | |
87 | 87 | then throw("your rate needs to be +1 or -1") | |
88 | 88 | else { | |
89 | 89 | let pmt = extract(i.payment) | |
90 | 90 | if ((pmt.assetId != WCTid)) | |
91 | 91 | then throw("you need to vote using WCT") | |
92 | 92 | else { | |
93 | 93 | let weight = pmt.amount | |
94 | 94 | let vote = (rate * weight) | |
95 | 95 | let previousRate = tryGetInteger((("tasks_" + taskId) + "_community_rate")) | |
96 | 96 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_community_rate"), (previousRate + vote))]), TransferSet([ScriptTransfer(i.caller, pmt.amount, pmt.assetId)])) | |
97 | 97 | } | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func addTaskDetails (taskId) = if (!(isGroupMember(i.caller))) | |
104 | 104 | then throw("grants working group access only") | |
105 | 105 | else { | |
106 | 106 | let reward = extract(i.payment).amount | |
107 | 107 | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | 112 | @Callable(i) | |
113 | 113 | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
114 | 114 | then throw("you can't vote") | |
115 | 115 | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
116 | 116 | then throw("voting is closed or not started") | |
117 | 117 | else if (if ((voteValue != -1)) | |
118 | 118 | then (voteValue != 1) | |
119 | 119 | else false) | |
120 | 120 | then throw("you need to vote 1 or -1") | |
121 | 121 | else { | |
122 | 122 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
123 | 123 | let previousVote = tryGetInteger(voteKey) | |
124 | 124 | if (!((previousVote == 0))) | |
125 | 125 | then throw("you have already voted") | |
126 | 126 | else { | |
127 | 127 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
128 | 128 | let votingState = tryGetInteger(votingKey) | |
129 | 129 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
130 | 130 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
131 | 131 | let newVotingState = (votingState + voteValue) | |
132 | 132 | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
133 | 133 | } | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(i) | |
139 | 139 | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size")))) | |
140 | 140 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
141 | 141 | else if (!(isGroupMember(i.caller))) | |
142 | 142 | then throw("grants working group access only") | |
143 | 143 | else { | |
144 | 144 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
145 | 145 | let votingState = tryGetInteger(votingKey) | |
146 | 146 | if ((votingState > 0)) | |
147 | 147 | then { | |
148 | 148 | let votingResult = "ready_to_apply" | |
149 | 149 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
150 | 150 | } | |
151 | 151 | else { | |
152 | 152 | let votingResult = "rejected" | |
153 | 153 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
154 | 154 | } | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Callable(i) | |
160 | 160 | func applyForTask (taskId,teamName) = { | |
161 | 161 | let listKey = (("tasks_" + taskId) + "_applicants") | |
162 | 162 | let currentApplicantsList = match getString(this, listKey) { | |
163 | 163 | case b: String => | |
164 | 164 | b | |
165 | 165 | case _ => | |
166 | 166 | "" | |
167 | 167 | } | |
168 | 168 | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
169 | 169 | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + toString(i.caller)) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + toString(i.caller)) + "_leader"), toString(i.caller)), DataEntry(listKey, newApplicantsList)]) | |
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 | 177 | else { | |
178 | - | let voteHash = sha256(toBytes((toString(i.caller) + teamIdentifier))) | |
179 | - | let voteKey = ((("tasks_" + taskId) + "_vote_") + | |
178 | + | let voteHash = toUtf8String(sha256(toBytes((toString(i.caller) + teamIdentifier)))) | |
179 | + | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
180 | 180 | let vote = tryGetInteger(voteKey) | |
181 | 181 | if ((vote != 0)) | |
182 | 182 | then throw("you have already voted on this team") | |
183 | 183 | else { | |
184 | 184 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
185 | 185 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
186 | 186 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
187 | 187 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
188 | 188 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
189 | 189 | } | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | 195 | func finishApplicantsVoting (taskId) = { | |
196 | 196 | func isApplicantVotedEnough (aid,aid2) = { | |
197 | 197 | let listKey = (("tasks_" + taskId) + "_applicants") | |
198 | 198 | let applicantsList = split(getStringValue(this, listKey), ";") | |
199 | 199 | let teamIdentifier = applicantsList[aid] | |
200 | 200 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
201 | 201 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
202 | 202 | if ((teamVotesAmount > 0)) | |
203 | 203 | then 1 | |
204 | 204 | else throw(("not enough votes to make decision on " + teamIdentifier)) | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | func hasMoreVotes (aid,aid2) = { | |
208 | 208 | let listKey = (("tasks_" + taskId) + "_applicants") | |
209 | 209 | let applicantsList = split(getStringValue(this, listKey), ";") | |
210 | 210 | let teamIdentifier = applicantsList[aid] | |
211 | 211 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
212 | 212 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
213 | 213 | let team2Identifier = applicantsList[aid2] | |
214 | 214 | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
215 | 215 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
216 | 216 | if ((teamVotesAmount > team2VotesAmount)) | |
217 | 217 | then aid | |
218 | 218 | else aid2 | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | if (!(isGroupMember(i.caller))) | |
222 | 222 | then throw("grants working group access only") | |
223 | 223 | else { | |
224 | 224 | let chosenTeamId = { | |
225 | - | let $ | |
226 | - | let $ | |
227 | - | let $ | |
228 | - | if (($ | |
229 | - | then $ | |
225 | + | let $list1038810419 = [0, 1] | |
226 | + | let $size1038810419 = size($list1038810419) | |
227 | + | let $acc01038810419 = 0 | |
228 | + | if (($size1038810419 == 0)) | |
229 | + | then $acc01038810419 | |
230 | 230 | else { | |
231 | - | let $ | |
232 | - | if (($ | |
233 | - | then $ | |
231 | + | let $acc11038810419 = hasMoreVotes($acc01038810419, $list1038810419[0]) | |
232 | + | if (($size1038810419 == 1)) | |
233 | + | then $acc11038810419 | |
234 | 234 | else { | |
235 | - | let $ | |
236 | - | if (($ | |
237 | - | then $ | |
235 | + | let $acc21038810419 = hasMoreVotes($acc11038810419, $list1038810419[1]) | |
236 | + | if (($size1038810419 == 2)) | |
237 | + | then $acc21038810419 | |
238 | 238 | else { | |
239 | - | let $ | |
239 | + | let $acc31038810419 = hasMoreVotes($acc21038810419, $list1038810419[2]) | |
240 | 240 | throw("List size exceed 2") | |
241 | 241 | } | |
242 | 242 | } | |
243 | 243 | } | |
244 | 244 | } | |
245 | 245 | let listKey = (("tasks_" + taskId) + "_applicants") | |
246 | 246 | let applicantsList = split(getStringValue(this, listKey), ";") | |
247 | 247 | let teamIdentifier = applicantsList[chosenTeamId] | |
248 | 248 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
249 | 249 | } | |
250 | 250 | } | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | ||
254 | 254 | @Callable(i) | |
255 | 255 | func startWork (taskId) = { | |
256 | 256 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
257 | 257 | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
258 | 258 | then throw("team leader only") | |
259 | 259 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
260 | 260 | } | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | ||
264 | 264 | @Callable(i) | |
265 | 265 | func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller))) | |
266 | 266 | then throw("grants working group access only") | |
267 | 267 | else { | |
268 | 268 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
269 | 269 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
270 | 270 | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
271 | 271 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
272 | 272 | } | |
273 | 273 | ||
274 | 274 |
github/deemru/w8io/169f3d6 105.04 ms ◑