tx · 6CDtCpDXRNcP5bYXMSydMcQXBsgpnvW4zzqN8pHbr7EB 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5: -0.10000000 Waves 2020.11.18 02:29 [1270030] smart account 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5 > SELF 0.00000000 Waves
{ "type": 13, "id": "6CDtCpDXRNcP5bYXMSydMcQXBsgpnvW4zzqN8pHbr7EB", "fee": 10000000, "feeAssetId": null, "timestamp": 1605655793866, "version": 2, "chainId": 84, "sender": "3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5", "senderPublicKey": "BWQB37E3JLeot6EcSVXsbJMugLUYNarK8xU8W5XAPsvJ", "proofs": [ "4sLzVfGkzWjvRS9s5mJi9scCQ1YicLDT3UdKP9A3CX5QKLyf3vPWNMEAZBFAAZazoawN91cJSzbMorBpLpzzpZQ4" ], "script": "base64:AAIDAAAAAAAAAD0IARIDCgEIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSBAoCCAgSBQoDCAgBEgMKAQgSAwoBCBIDCgEIAAAACAAAAAAGUVVPUlVNAAAAAAAAAAAyAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwkAAAAAAAACBQAAAAdhZGRyZXNzBQAAAAR0aGl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AAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAANd29ya19maW5pc2hlZAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAALdGVhbUFkZHJlc3MFAAAADHJld2FyZEFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAMUcEUs=", "height": 1270030, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BdPmAAKEac4se3nbTii5f46ksHuQsaSNDhjUuiw4XrtV Next: EoQ6tL22jkUC2yNex6V9dSrkKtgt1NJ9YtHEQLCfoiG2 Diff:
Old | New | Differences | |
---|---|---|---|
148 | 148 | ||
149 | 149 | @Callable(i) | |
150 | 150 | func applyForTask (taskId,teamName) = { | |
151 | - | let listKey = (("tasks_" + taskId) + "_applicants") | |
152 | - | let currentApplicantsList = tryGetString(listKey) | |
153 | - | let applicantKey = drop(toString(i.caller), 20) | |
154 | - | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
155 | - | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
151 | + | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
152 | + | if ((status != "ready_to_apply")) | |
153 | + | then throw("This grant has not yet been approved") | |
154 | + | else { | |
155 | + | let listKey = (("tasks_" + taskId) + "_applicants") | |
156 | + | let currentApplicantsList = tryGetString(listKey) | |
157 | + | let applicantKey = drop(toString(i.caller), 20) | |
158 | + | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
159 | + | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
160 | + | } | |
156 | 161 | } | |
157 | 162 | ||
158 | 163 | ||
213 | 218 | then throw("No one has yet responded to the grant") | |
214 | 219 | else { | |
215 | 220 | let chosenTeamId = { | |
216 | - | let $ | |
217 | - | let $ | |
218 | - | let $ | |
219 | - | if (($ | |
220 | - | then $ | |
221 | + | let $list1032910360 = [0, 1] | |
222 | + | let $size1032910360 = size($list1032910360) | |
223 | + | let $acc01032910360 = 0 | |
224 | + | if (($size1032910360 == 0)) | |
225 | + | then $acc01032910360 | |
221 | 226 | else { | |
222 | - | let $ | |
223 | - | if (($ | |
224 | - | then $ | |
227 | + | let $acc11032910360 = hasMoreVotes($acc01032910360, $list1032910360[0]) | |
228 | + | if (($size1032910360 == 1)) | |
229 | + | then $acc11032910360 | |
225 | 230 | else { | |
226 | - | let $ | |
227 | - | if (($ | |
228 | - | then $ | |
231 | + | let $acc21032910360 = hasMoreVotes($acc11032910360, $list1032910360[1]) | |
232 | + | if (($size1032910360 == 2)) | |
233 | + | then $acc21032910360 | |
229 | 234 | else { | |
230 | - | let $ | |
235 | + | let $acc31032910360 = hasMoreVotes($acc21032910360, $list1032910360[2]) | |
231 | 236 | throw("List size exceed 2") | |
232 | 237 | } | |
233 | 238 | } |
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 | 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") { | |
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 { | |
63 | 63 | let group = getMembers() | |
64 | 64 | let newGroup = ((group + ";") + memberAddress) | |
65 | 65 | let groupSize = tryGetInteger("dao_size") | |
66 | 66 | let newGroupSize = (groupSize + 1) | |
67 | 67 | WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry((("dao_member_" + memberAddress) + "_weight"), 1)]) | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(i) | |
73 | 73 | func addGroupMember (memberAddress) = if (!(isOwner(i.caller))) | |
74 | 74 | then throw("access only to the DAO owner") | |
75 | 75 | else { | |
76 | 76 | let group = getGroup() | |
77 | 77 | let newGroup = ((group + ";") + memberAddress) | |
78 | 78 | let groupSize = tryGetInteger("working_group_size") | |
79 | 79 | let newGroupSize = (groupSize + 1) | |
80 | 80 | WriteSet([DataEntry("working_group_name", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)]) | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(i) | |
86 | 86 | func addTask (title) = if (!(isGroupMember(i.caller))) | |
87 | 87 | then throw("grants working group access only") | |
88 | 88 | else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title)]) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | ||
92 | 92 | @Callable(i) | |
93 | 93 | func addTaskDetails (taskId) = if (!(isGroupMember(i.caller))) | |
94 | 94 | then throw("grants working group access only") | |
95 | 95 | else { | |
96 | 96 | let reward = extract(i.payment).amount | |
97 | 97 | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")]) | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i))) | |
104 | 104 | then throw("you can't vote") | |
105 | 105 | else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed")) | |
106 | 106 | then throw("voting is closed or not started") | |
107 | 107 | else if (if ((voteValue != -1)) | |
108 | 108 | then (voteValue != 1) | |
109 | 109 | else false) | |
110 | 110 | then throw("you need to vote 1 or -1") | |
111 | 111 | else { | |
112 | 112 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
113 | 113 | let previousVote = tryGetInteger(voteKey) | |
114 | 114 | if (!((previousVote == 0))) | |
115 | 115 | then throw("you have already voted") | |
116 | 116 | else { | |
117 | 117 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
118 | 118 | let votingState = tryGetInteger(votingKey) | |
119 | 119 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
120 | 120 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
121 | 121 | let newVotingState = (votingState + voteValue) | |
122 | 122 | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
123 | 123 | } | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(i) | |
129 | 129 | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size")))) | |
130 | 130 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
131 | 131 | else if (!(isGroupMember(i.caller))) | |
132 | 132 | then throw("grants working group access only") | |
133 | 133 | else { | |
134 | 134 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
135 | 135 | let votingState = tryGetInteger(votingKey) | |
136 | 136 | if ((votingState > 0)) | |
137 | 137 | then { | |
138 | 138 | let votingResult = "ready_to_apply" | |
139 | 139 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
140 | 140 | } | |
141 | 141 | else { | |
142 | 142 | let votingResult = "rejected" | |
143 | 143 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
144 | 144 | } | |
145 | 145 | } | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | ||
149 | 149 | @Callable(i) | |
150 | 150 | func applyForTask (taskId,teamName) = { | |
151 | - | let listKey = (("tasks_" + taskId) + "_applicants") | |
152 | - | let currentApplicantsList = tryGetString(listKey) | |
153 | - | let applicantKey = drop(toString(i.caller), 20) | |
154 | - | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
155 | - | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
151 | + | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
152 | + | if ((status != "ready_to_apply")) | |
153 | + | then throw("This grant has not yet been approved") | |
154 | + | else { | |
155 | + | let listKey = (("tasks_" + taskId) + "_applicants") | |
156 | + | let currentApplicantsList = tryGetString(listKey) | |
157 | + | let applicantKey = drop(toString(i.caller), 20) | |
158 | + | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
159 | + | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
160 | + | } | |
156 | 161 | } | |
157 | 162 | ||
158 | 163 | ||
159 | 164 | ||
160 | 165 | @Callable(i) | |
161 | 166 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
162 | 167 | then throw("you can't vote") | |
163 | 168 | else { | |
164 | 169 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
165 | 170 | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
166 | 171 | let vote = tryGetInteger(voteKey) | |
167 | 172 | if ((vote != 0)) | |
168 | 173 | then throw("you have already voted on this team") | |
169 | 174 | else { | |
170 | 175 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
171 | 176 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
172 | 177 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
173 | 178 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
174 | 179 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
175 | 180 | } | |
176 | 181 | } | |
177 | 182 | ||
178 | 183 | ||
179 | 184 | ||
180 | 185 | @Callable(i) | |
181 | 186 | func finishApplicantsVoting (taskId) = { | |
182 | 187 | func isApplicantVotedEnough (aid,aid2) = { | |
183 | 188 | let listKey = (("tasks_" + taskId) + "_applicants") | |
184 | 189 | let applicantsList = split(getStringValue(this, listKey), ";") | |
185 | 190 | let teamIdentifier = applicantsList[aid] | |
186 | 191 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
187 | 192 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
188 | 193 | if ((teamVotesAmount > 0)) | |
189 | 194 | then 1 | |
190 | 195 | else throw(("not enough votes to make decision on " + teamIdentifier)) | |
191 | 196 | } | |
192 | 197 | ||
193 | 198 | func hasMoreVotes (aid,aid2) = { | |
194 | 199 | let listKey = (("tasks_" + taskId) + "_applicants") | |
195 | 200 | let applicantsList = split(getStringValue(this, listKey), ";") | |
196 | 201 | let teamIdentifier = applicantsList[aid] | |
197 | 202 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
198 | 203 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
199 | 204 | let team2Identifier = applicantsList[aid2] | |
200 | 205 | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
201 | 206 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
202 | 207 | if ((teamVotesAmount > team2VotesAmount)) | |
203 | 208 | then aid | |
204 | 209 | else aid2 | |
205 | 210 | } | |
206 | 211 | ||
207 | 212 | if (!(isGroupMember(i.caller))) | |
208 | 213 | then throw("grants working group access only") | |
209 | 214 | else { | |
210 | 215 | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
211 | 216 | let applicantsList = split(listKeys, ";") | |
212 | 217 | if ((size(applicantsList) == 0)) | |
213 | 218 | then throw("No one has yet responded to the grant") | |
214 | 219 | else { | |
215 | 220 | let chosenTeamId = { | |
216 | - | let $ | |
217 | - | let $ | |
218 | - | let $ | |
219 | - | if (($ | |
220 | - | then $ | |
221 | + | let $list1032910360 = [0, 1] | |
222 | + | let $size1032910360 = size($list1032910360) | |
223 | + | let $acc01032910360 = 0 | |
224 | + | if (($size1032910360 == 0)) | |
225 | + | then $acc01032910360 | |
221 | 226 | else { | |
222 | - | let $ | |
223 | - | if (($ | |
224 | - | then $ | |
227 | + | let $acc11032910360 = hasMoreVotes($acc01032910360, $list1032910360[0]) | |
228 | + | if (($size1032910360 == 1)) | |
229 | + | then $acc11032910360 | |
225 | 230 | else { | |
226 | - | let $ | |
227 | - | if (($ | |
228 | - | then $ | |
231 | + | let $acc21032910360 = hasMoreVotes($acc11032910360, $list1032910360[1]) | |
232 | + | if (($size1032910360 == 2)) | |
233 | + | then $acc21032910360 | |
229 | 234 | else { | |
230 | - | let $ | |
235 | + | let $acc31032910360 = hasMoreVotes($acc21032910360, $list1032910360[2]) | |
231 | 236 | throw("List size exceed 2") | |
232 | 237 | } | |
233 | 238 | } | |
234 | 239 | } | |
235 | 240 | } | |
236 | 241 | let teamIdentifier = applicantsList[chosenTeamId] | |
237 | 242 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
238 | 243 | } | |
239 | 244 | } | |
240 | 245 | } | |
241 | 246 | ||
242 | 247 | ||
243 | 248 | ||
244 | 249 | @Callable(i) | |
245 | 250 | func startWork (taskId) = { | |
246 | 251 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
247 | 252 | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
248 | 253 | then throw("team leader only") | |
249 | 254 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
250 | 255 | } | |
251 | 256 | ||
252 | 257 | ||
253 | 258 | ||
254 | 259 | @Callable(i) | |
255 | 260 | func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller))) | |
256 | 261 | then throw("grants working group access only") | |
257 | 262 | else { | |
258 | 263 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
259 | 264 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
260 | 265 | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
261 | 266 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
262 | 267 | } | |
263 | 268 | ||
264 | 269 |
github/deemru/w8io/169f3d6 61.32 ms ◑