tx · BdPmAAKEac4se3nbTii5f46ksHuQsaSNDhjUuiw4XrtV 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5: -0.10000000 Waves 2020.11.18 02:15 [1270016] smart account 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5 > SELF 0.00000000 Waves
{ "type": 13, "id": "BdPmAAKEac4se3nbTii5f46ksHuQsaSNDhjUuiw4XrtV", "fee": 10000000, "feeAssetId": null, "timestamp": 1605654954749, "version": 2, "chainId": 84, "sender": "3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5", "senderPublicKey": "BWQB37E3JLeot6EcSVXsbJMugLUYNarK8xU8W5XAPsvJ", "proofs": [ "4HkcfasmZZyF71ryJoCFEjj5XxGYpyF6LFjwrGYwjdqKXiizSFX84xsB7i1rg5jLQ7wyrjhRy6VCSNysba8W6Mix" ], "script": "base64:AAIDAAAAAAAAAD0IARIDCgEIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSBAoCCAgSBQoDCAgBEgMKAQgSAwoBCBIDCgEIAAAACAAAAAAGUVVPUlVNAAAAAAAAAAAyAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwkAAAAAAAACBQAAAAdhZGRyZXNzBQAAAAR0aGlzAQAAAAh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WFtQWRkcmVzcwUAAAAMcmV3YXJkQW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAMcYG/Q==", "height": 1270016, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: At3T9h93bZatFJqiaXVUHZcRYeneTSjps8LViac7m6Nd Next: 6CDtCpDXRNcP5bYXMSydMcQXBsgpnvW4zzqN8pHbr7EB Diff:
Old | New | Differences | |
---|---|---|---|
119 | 119 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
120 | 120 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
121 | 121 | let newVotingState = (votingState + voteValue) | |
122 | - | WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]) | |
122 | + | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
123 | 123 | } | |
124 | 124 | } | |
125 | 125 | ||
207 | 207 | if (!(isGroupMember(i.caller))) | |
208 | 208 | then throw("grants working group access only") | |
209 | 209 | else { | |
210 | - | let chosenTeamId = { | |
211 | - | let $list98469877 = [0, 1] | |
212 | - | let $size98469877 = size($list98469877) | |
213 | - | let $acc098469877 = 0 | |
214 | - | if (($size98469877 == 0)) | |
215 | - | then $acc098469877 | |
216 | - | else { | |
217 | - | let $acc198469877 = hasMoreVotes($acc098469877, $list98469877[0]) | |
218 | - | if (($size98469877 == 1)) | |
219 | - | then $acc198469877 | |
210 | + | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
211 | + | let applicantsList = split(listKeys, ";") | |
212 | + | if ((size(applicantsList) == 0)) | |
213 | + | then throw("No one has yet responded to the grant") | |
214 | + | else { | |
215 | + | let chosenTeamId = { | |
216 | + | let $list1008510116 = [0, 1] | |
217 | + | let $size1008510116 = size($list1008510116) | |
218 | + | let $acc01008510116 = 0 | |
219 | + | if (($size1008510116 == 0)) | |
220 | + | then $acc01008510116 | |
220 | 221 | else { | |
221 | - | let $ | |
222 | - | if (($ | |
223 | - | then $ | |
222 | + | let $acc11008510116 = hasMoreVotes($acc01008510116, $list1008510116[0]) | |
223 | + | if (($size1008510116 == 1)) | |
224 | + | then $acc11008510116 | |
224 | 225 | else { | |
225 | - | let $acc398469877 = hasMoreVotes($acc298469877, $list98469877[2]) | |
226 | - | throw("List size exceed 2") | |
226 | + | let $acc21008510116 = hasMoreVotes($acc11008510116, $list1008510116[1]) | |
227 | + | if (($size1008510116 == 2)) | |
228 | + | then $acc21008510116 | |
229 | + | else { | |
230 | + | let $acc31008510116 = hasMoreVotes($acc21008510116, $list1008510116[2]) | |
231 | + | throw("List size exceed 2") | |
232 | + | } | |
227 | 233 | } | |
228 | 234 | } | |
229 | 235 | } | |
230 | - | } | |
231 | - | let listKey = (("tasks_" + taskId) + "_applicants") | |
232 | - | let applicantsList = split(getStringValue(this, listKey), ";") | |
233 | - | let teamIdentifier = applicantsList[chosenTeamId] | |
234 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
236 | + | let teamIdentifier = applicantsList[chosenTeamId] | |
237 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
238 | + | } | |
235 | 239 | } | |
236 | 240 | } | |
237 | 241 |
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 | - | WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]) | |
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 | 151 | let listKey = (("tasks_" + taskId) + "_applicants") | |
152 | 152 | let currentApplicantsList = tryGetString(listKey) | |
153 | 153 | let applicantKey = drop(toString(i.caller), 20) | |
154 | 154 | let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller)) | |
155 | 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)]) | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | ||
160 | 160 | @Callable(i) | |
161 | 161 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
162 | 162 | then throw("you can't vote") | |
163 | 163 | else { | |
164 | 164 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
165 | 165 | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
166 | 166 | let vote = tryGetInteger(voteKey) | |
167 | 167 | if ((vote != 0)) | |
168 | 168 | then throw("you have already voted on this team") | |
169 | 169 | else { | |
170 | 170 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
171 | 171 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
172 | 172 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
173 | 173 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
174 | 174 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
175 | 175 | } | |
176 | 176 | } | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | ||
180 | 180 | @Callable(i) | |
181 | 181 | func finishApplicantsVoting (taskId) = { | |
182 | 182 | func isApplicantVotedEnough (aid,aid2) = { | |
183 | 183 | let listKey = (("tasks_" + taskId) + "_applicants") | |
184 | 184 | let applicantsList = split(getStringValue(this, listKey), ";") | |
185 | 185 | let teamIdentifier = applicantsList[aid] | |
186 | 186 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
187 | 187 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
188 | 188 | if ((teamVotesAmount > 0)) | |
189 | 189 | then 1 | |
190 | 190 | else throw(("not enough votes to make decision on " + teamIdentifier)) | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | func hasMoreVotes (aid,aid2) = { | |
194 | 194 | let listKey = (("tasks_" + taskId) + "_applicants") | |
195 | 195 | let applicantsList = split(getStringValue(this, listKey), ";") | |
196 | 196 | let teamIdentifier = applicantsList[aid] | |
197 | 197 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
198 | 198 | let teamVotesAmount = tryGetInteger(teamVotesAmountKey) | |
199 | 199 | let team2Identifier = applicantsList[aid2] | |
200 | 200 | let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes") | |
201 | 201 | let team2VotesAmount = tryGetInteger(team2VotesAmountKey) | |
202 | 202 | if ((teamVotesAmount > team2VotesAmount)) | |
203 | 203 | then aid | |
204 | 204 | else aid2 | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | if (!(isGroupMember(i.caller))) | |
208 | 208 | then throw("grants working group access only") | |
209 | 209 | else { | |
210 | - | let chosenTeamId = { | |
211 | - | let $list98469877 = [0, 1] | |
212 | - | let $size98469877 = size($list98469877) | |
213 | - | let $acc098469877 = 0 | |
214 | - | if (($size98469877 == 0)) | |
215 | - | then $acc098469877 | |
216 | - | else { | |
217 | - | let $acc198469877 = hasMoreVotes($acc098469877, $list98469877[0]) | |
218 | - | if (($size98469877 == 1)) | |
219 | - | then $acc198469877 | |
210 | + | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
211 | + | let applicantsList = split(listKeys, ";") | |
212 | + | if ((size(applicantsList) == 0)) | |
213 | + | then throw("No one has yet responded to the grant") | |
214 | + | else { | |
215 | + | let chosenTeamId = { | |
216 | + | let $list1008510116 = [0, 1] | |
217 | + | let $size1008510116 = size($list1008510116) | |
218 | + | let $acc01008510116 = 0 | |
219 | + | if (($size1008510116 == 0)) | |
220 | + | then $acc01008510116 | |
220 | 221 | else { | |
221 | - | let $ | |
222 | - | if (($ | |
223 | - | then $ | |
222 | + | let $acc11008510116 = hasMoreVotes($acc01008510116, $list1008510116[0]) | |
223 | + | if (($size1008510116 == 1)) | |
224 | + | then $acc11008510116 | |
224 | 225 | else { | |
225 | - | let $acc398469877 = hasMoreVotes($acc298469877, $list98469877[2]) | |
226 | - | throw("List size exceed 2") | |
226 | + | let $acc21008510116 = hasMoreVotes($acc11008510116, $list1008510116[1]) | |
227 | + | if (($size1008510116 == 2)) | |
228 | + | then $acc21008510116 | |
229 | + | else { | |
230 | + | let $acc31008510116 = hasMoreVotes($acc21008510116, $list1008510116[2]) | |
231 | + | throw("List size exceed 2") | |
232 | + | } | |
227 | 233 | } | |
228 | 234 | } | |
229 | 235 | } | |
230 | - | } | |
231 | - | let listKey = (("tasks_" + taskId) + "_applicants") | |
232 | - | let applicantsList = split(getStringValue(this, listKey), ";") | |
233 | - | let teamIdentifier = applicantsList[chosenTeamId] | |
234 | - | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
236 | + | let teamIdentifier = applicantsList[chosenTeamId] | |
237 | + | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")]) | |
238 | + | } | |
235 | 239 | } | |
236 | 240 | } | |
237 | 241 | ||
238 | 242 | ||
239 | 243 | ||
240 | 244 | @Callable(i) | |
241 | 245 | func startWork (taskId) = { | |
242 | 246 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
243 | 247 | if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
244 | 248 | then throw("team leader only") | |
245 | 249 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")]) | |
246 | 250 | } | |
247 | 251 | ||
248 | 252 | ||
249 | 253 | ||
250 | 254 | @Callable(i) | |
251 | 255 | func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller))) | |
252 | 256 | then throw("grants working group access only") | |
253 | 257 | else { | |
254 | 258 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
255 | 259 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
256 | 260 | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) | |
257 | 261 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
258 | 262 | } | |
259 | 263 | ||
260 | 264 |
github/deemru/w8io/169f3d6 42.01 ms ◑