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