tx · 8VEnZrdBny6vMin5Eq8EsZ2q8C8Vg6f4X7GKpEmN4wTx 3N2sQRGTRmL9NGZVVtzhfBEjEyVR7S9Mkum: -0.10000000 Waves 2020.12.21 13:53 [1318358] smart account 3N2sQRGTRmL9NGZVVtzhfBEjEyVR7S9Mkum > SELF 0.00000000 Waves
{ "type": 13, "id": "8VEnZrdBny6vMin5Eq8EsZ2q8C8Vg6f4X7GKpEmN4wTx", "fee": 10000000, "feeAssetId": null, "timestamp": 1608547992157, "version": 2, "chainId": 84, "sender": "3N2sQRGTRmL9NGZVVtzhfBEjEyVR7S9Mkum", "senderPublicKey": "J8SeDz97kvV9MTtzmwVB965Dz8iEWst5MzMzgUgG1dfK", "proofs": [ "4RFdPwCYhBBYZ52vLfUWuTDZusGw66PgJSDAmSL5NAtxGVRHur3TDPvncpwtRPvHCuW3MPShR3snLcDUGkf4Uqyi" ], "script": "base64:AAIDAAAAAAAAAE8IARIECgIICBIDCgEIEgQKAggBEgMKAQgSBQoDCAgIEgUKAwgIARIDCgEIEgQKAggIEgQKAggIEgMKAQgSBQoDCAgBEgUKAwgICBIDCgEIAAAACQAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAAAAAAMbWFpbkNvbnRyYWN0CQEAAAAcQGV4dHJVc2VyKGFkZHJ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1cwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAAEHdpbm5lcklkZW50aWZpZXICAAAACF9wcm9jZXNzAgAAAAZ3aW5uZXIJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3JlcG9ydAUAAAAKcmVwb3J0TGluawUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAALdGVhbUFkZHJlc3MFAAAADHJld2FyZEFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAWkBAAAACnJlamVjdFRhc2sAAAABAAAABnRhc2tJZAMJAQAAAAEhAAAAAQkBAAAADWlzR3JvdXBNZW1iZXIAAAABCAUAAAABaQAAAAZjYWxsZXIJAAACAAAAAQIAAAAgZ3JhbnRzIHdvcmtpbmcgZ3JvdXAgYWNjZXNzIG9ubHkJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3N0YXR1cwIAAAAIcmVqZWN0ZWQFAAAAA25pbAAAAAAZjSFD", "height": 1318358, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Wk5rug8WN98oiwLDUzeCbDo3r1nzqVWZE184zbpCHhT Next: E1qNSWYDUdhaLuwfofTDd79Pva7CiJyPM6NH8wuyfXsi 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) | |
130 | 126 | ||
131 | 127 | ||
132 | 128 | @Callable(i) | |
133 | - | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / | |
129 | + | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize()))) | |
134 | 130 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
135 | 131 | else if (!(isGroupMember(i.caller))) | |
136 | 132 | then throw("grants working group access only") |
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 | 93 | func addReward (taskId) = 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 | 97 | WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), 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 | 107 | else if (if ((voteValue != -1)) | |
112 | 108 | then (voteValue != 1) | |
113 | 109 | else false) | |
114 | 110 | then throw("you need to vote 1 or -1") | |
115 | 111 | else { | |
116 | 112 | let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller)) | |
117 | 113 | let previousVote = tryGetInteger(voteKey) | |
118 | 114 | if (!((previousVote == 0))) | |
119 | 115 | then throw("you have already voted") | |
120 | 116 | else { | |
121 | 117 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
122 | 118 | let votingState = tryGetInteger(votingKey) | |
123 | 119 | let votesAmountKey = (("tasks_" + taskId) + "_voting_amount") | |
124 | 120 | let votesAmountState = (tryGetInteger(votingKey) + 1) | |
125 | 121 | let newVotingState = (votingState + voteValue) | |
126 | 122 | ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)])) | |
127 | 123 | } | |
128 | 124 | } | |
129 | 125 | ||
130 | 126 | ||
131 | 127 | ||
132 | 128 | @Callable(i) | |
133 | - | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / | |
129 | + | func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize()))) | |
134 | 130 | then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting")) | |
135 | 131 | else if (!(isGroupMember(i.caller))) | |
136 | 132 | then throw("grants working group access only") | |
137 | 133 | else { | |
138 | 134 | let votingKey = (("tasks_" + taskId) + "_voting_state") | |
139 | 135 | let votingState = tryGetInteger(votingKey) | |
140 | 136 | if ((votingState > 0)) | |
141 | 137 | then { | |
142 | 138 | let votingResult = "ready_to_apply" | |
143 | 139 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
144 | 140 | } | |
145 | 141 | else { | |
146 | 142 | let votingResult = "rejected" | |
147 | 143 | WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)]) | |
148 | 144 | } | |
149 | 145 | } | |
150 | 146 | ||
151 | 147 | ||
152 | 148 | ||
153 | 149 | @Callable(i) | |
154 | 150 | func applyForTask (taskId,teamName,link) = { | |
155 | 151 | let status = tryGetString((("tasks_" + taskId) + "_status")) | |
156 | 152 | if ((status != "ready_to_apply")) | |
157 | 153 | then throw("This grant has not yet been approved") | |
158 | 154 | else { | |
159 | 155 | let listKey = (("tasks_" + taskId) + "_applicants") | |
160 | 156 | let currentApplicantsList = tryGetString(listKey) | |
161 | 157 | let applicantKey = drop(toString(i.caller), 10) | |
162 | 158 | let leader = toString(i.caller) | |
163 | 159 | let newApplicantsList = ((currentApplicantsList + ";") + leader) | |
164 | 160 | WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), leader), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)]) | |
165 | 161 | } | |
166 | 162 | } | |
167 | 163 | ||
168 | 164 | ||
169 | 165 | ||
170 | 166 | @Callable(i) | |
171 | 167 | func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i))) | |
172 | 168 | then throw("you can't vote") | |
173 | 169 | else { | |
174 | 170 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
175 | 171 | let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash) | |
176 | 172 | let vote = tryGetInteger(voteKey) | |
177 | 173 | if ((vote != 0)) | |
178 | 174 | then throw("you have already voted on this team") | |
179 | 175 | else { | |
180 | 176 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes") | |
181 | 177 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score") | |
182 | 178 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
183 | 179 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
184 | 180 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
185 | 181 | } | |
186 | 182 | } | |
187 | 183 | ||
188 | 184 | ||
189 | 185 | ||
190 | 186 | @Callable(i) | |
191 | 187 | func finishApplicantsVoting (taskId) = { | |
192 | 188 | let minVotesToApproveApplicant = 1 | |
193 | 189 | if (!(isGroupMember(i.caller))) | |
194 | 190 | then throw("grants working group access only") | |
195 | 191 | else { | |
196 | 192 | let listKeys = tryGetString((("tasks_" + taskId) + "_applicants")) | |
197 | 193 | let applicantsList = split(listKeys, ";") | |
198 | 194 | if ((size(applicantsList) == 0)) | |
199 | 195 | then throw("No one has applied to the hackathon, yet") | |
200 | 196 | else WriteSet([DataEntry((("tasks_" + taskId) + "_performer"), listKeys), DataEntry((("tasks_" + taskId) + "_status"), "ready_to_submit")]) | |
201 | 197 | } | |
202 | 198 | } | |
203 | 199 | ||
204 | 200 | ||
205 | 201 | ||
206 | 202 | @Callable(i) | |
207 | 203 | func enableSubmissions (taskId,juryList) = if (!(isGroupMember(i.caller))) | |
208 | 204 | then throw("grants working group access only") | |
209 | 205 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((("tasks_" + taskId) + "_jury"), juryList)]) | |
210 | 206 | ||
211 | 207 | ||
212 | 208 | ||
213 | 209 | @Callable(i) | |
214 | 210 | func submitSolution (taskId,solutionLink) = { | |
215 | 211 | func areSubmissionsEnabled (taskId) = (tryGetString((("tasks_" + taskId) + "_status")) == "work_started") | |
216 | 212 | ||
217 | 213 | let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer")) | |
218 | 214 | if (!(areSubmissionsEnabled(taskId))) | |
219 | 215 | then throw("not possible to upload solution now") | |
220 | 216 | else if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")))) | |
221 | 217 | then throw("team leader only") | |
222 | 218 | else WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_submitted"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solution"), solutionLink)]) | |
223 | 219 | } | |
224 | 220 | ||
225 | 221 | ||
226 | 222 | ||
227 | 223 | @Callable(i) | |
228 | 224 | func stopSubmissions (taskId) = if (!(isGroupMember(i.caller))) | |
229 | 225 | then throw("grants working group access only") | |
230 | 226 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished")]) | |
231 | 227 | ||
232 | 228 | ||
233 | 229 | ||
234 | 230 | @Callable(i) | |
235 | 231 | func voteForSolution (taskId,teamIdentifier,voteValue) = { | |
236 | 232 | func isJuryMember (i,taskId) = true | |
237 | 233 | ||
238 | 234 | if (!(isJuryMember(i, taskId))) | |
239 | 235 | then throw("you can't vote") | |
240 | 236 | else { | |
241 | 237 | let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10)) | |
242 | 238 | let voteKey = ((("tasks_" + taskId) + "_solutionvote_") + voteHash) | |
243 | 239 | let vote = tryGetInteger(voteKey) | |
244 | 240 | if ((vote != 0)) | |
245 | 241 | then throw("you have already voted on this solution") | |
246 | 242 | else { | |
247 | 243 | let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionvotes") | |
248 | 244 | let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_solutionscore") | |
249 | 245 | let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey)) | |
250 | 246 | let newTeamScore = (voteValue + tryGetInteger(teamScoreKey)) | |
251 | 247 | WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)]) | |
252 | 248 | } | |
253 | 249 | } | |
254 | 250 | } | |
255 | 251 | ||
256 | 252 | ||
257 | 253 | ||
258 | 254 | @Callable(i) | |
259 | 255 | func acceptWorkResult (taskId,winnerIdentifier,reportLink) = if (!(isGroupMember(i.caller))) | |
260 | 256 | then throw("grants working group access only") | |
261 | 257 | else { | |
262 | 258 | let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward")) | |
263 | 259 | let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_leader")) | |
264 | 260 | ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + winnerIdentifier) + "_process"), "winner"), DataEntry((("tasks_" + taskId) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)])) | |
265 | 261 | } | |
266 | 262 | ||
267 | 263 | ||
268 | 264 | ||
269 | 265 | @Callable(i) | |
270 | 266 | func rejectTask (taskId) = if (!(isGroupMember(i.caller))) | |
271 | 267 | then throw("grants working group access only") | |
272 | 268 | else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")]) | |
273 | 269 | ||
274 | 270 |
github/deemru/w8io/026f985 52.80 ms ◑