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