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