tx · At3T9h93bZatFJqiaXVUHZcRYeneTSjps8LViac7m6Nd

3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5:  -0.10000000 Waves

2020.11.17 15:55 [1269388] smart account 3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5 > SELF 0.00000000 Waves

{ "type": 13, "id": "At3T9h93bZatFJqiaXVUHZcRYeneTSjps8LViac7m6Nd", "fee": 10000000, "feeAssetId": null, "timestamp": 1605617764224, "version": 2, "chainId": 84, "sender": "3N1eyWNffhxPCmYBWBdnWbhmAVAVjkTEqY5", "senderPublicKey": "BWQB37E3JLeot6EcSVXsbJMugLUYNarK8xU8W5XAPsvJ", "proofs": [ "2hVrEywCin9kDocjNUwi883NgtRrRKi8YBy5pYbMwevfx2RhVdy8xAQc1khBpWWDYLB64Re42BLWCMjLcbF5cEdF" ], "script": "base64:AAIDAAAAAAAAAD0IARIDCgEIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSBAoCCAgSBQoDCAgBEgMKAQgSAwoBCBIDCgEIAAAACAAAAAAGUVVPUlVNAAAAAAAAAAAyAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwkAAAAAAAACBQAAAAdhZGRyZXNzBQAAAAR0aGlzAQAAAAhnZXRHcm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AAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAKX3BlcmZvcm1lcgQAAAALdGVhbUFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAABV9hcHBfBQAAAA50ZWFtSWRlbnRpZmllcgIAAAAHX2xlYWRlcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3N0YXR1cwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAANd29ya19maW5pc2hlZAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAALdGVhbUFkZHJlc3MFAAAADHJld2FyZEFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAADa3nlo=", "height": 1269388, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7qbeQyVRRErf8meDYSBteACFDB8auXRoWwxobkGKye6D Next: BdPmAAKEac4se3nbTii5f46ksHuQsaSNDhjUuiw4XrtV Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let QUORUM = 50
5-
6-let WCTid = base58'4zfrrwDVjbGFM8wxbZGriVLY4XJsVD4oNMp21FnDnMAa'
75
86 func tryGetInteger (key) = {
97 let val = match getInteger(this, key) {
119 b
1210 case _ =>
1311 0
12+ }
13+ val
14+ }
15+
16+
17+func tryGetString (key) = {
18+ let val = match getString(this, key) {
19+ case b: String =>
20+ b
21+ case _ =>
22+ ""
1423 }
1524 val
1625 }
8190
8291
8392 @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)
10393 func addTaskDetails (taskId) = if (!(isGroupMember(i.caller)))
10494 then throw("grants working group access only")
10595 else {
129119 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
130120 let votesAmountState = (tryGetInteger(votingKey) + 1)
131121 let newVotingState = (votingState + voteValue)
132- ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
122+ WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)])
133123 }
134124 }
135125
159149 @Callable(i)
160150 func applyForTask (taskId,teamName) = {
161151 let listKey = (("tasks_" + taskId) + "_applicants")
162- let currentApplicantsList = match getString(this, listKey) {
163- case b: String =>
164- b
165- case _ =>
166- ""
167- }
152+ let currentApplicantsList = tryGetString(listKey)
153+ let applicantKey = drop(toString(i.caller), 20)
168154 let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
169- WriteSet([DataEntry((((("tasks_" + taskId) + "_applicant_") + toString(i.caller)) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_applicant_") + toString(i.caller)) + "_leader"), toString(i.caller)), DataEntry(listKey, newApplicantsList)])
155+ WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)])
170156 }
171157
172158
175161 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
176162 then throw("you can't vote")
177163 else {
178- let voteKey = (((("tasks_" + taskId) + "_vote_") + toString(i.caller)) + teamIdentifier)
164+ let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
165+ let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
179166 let vote = tryGetInteger(voteKey)
180167 if ((vote != 0))
181168 then throw("you have already voted on this team")
182169 else {
183- let teamVotesAmountKey = (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_votes")
184- let teamScoreKey = (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_score")
170+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
171+ let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
185172 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
186173 let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
187174 WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
196183 let listKey = (("tasks_" + taskId) + "_applicants")
197184 let applicantsList = split(getStringValue(this, listKey), ";")
198185 let teamIdentifier = applicantsList[aid]
199- let teamVotesAmountKey = (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_votes")
186+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
200187 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
201188 if ((teamVotesAmount > 0))
202189 then 1
207194 let listKey = (("tasks_" + taskId) + "_applicants")
208195 let applicantsList = split(getStringValue(this, listKey), ";")
209196 let teamIdentifier = applicantsList[aid]
210- let teamVotesAmountKey = (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_votes")
197+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
211198 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
212199 let team2Identifier = applicantsList[aid2]
213- let team2VotesAmountKey = (((("tasks_" + taskId) + "_applicant_") + team2Identifier) + "_votes")
200+ let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
214201 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
215202 if ((teamVotesAmount > team2VotesAmount))
216203 then aid
221208 then throw("grants working group access only")
222209 else {
223210 let chosenTeamId = {
224- let $list1039410425 = [0, 1]
225- let $size1039410425 = size($list1039410425)
226- let $acc01039410425 = 0
227- if (($size1039410425 == 0))
228- then $acc01039410425
211+ let $list98469877 = [0, 1]
212+ let $size98469877 = size($list98469877)
213+ let $acc098469877 = 0
214+ if (($size98469877 == 0))
215+ then $acc098469877
229216 else {
230- let $acc11039410425 = hasMoreVotes($acc01039410425, $list1039410425[0])
231- if (($size1039410425 == 1))
232- then $acc11039410425
217+ let $acc198469877 = hasMoreVotes($acc098469877, $list98469877[0])
218+ if (($size98469877 == 1))
219+ then $acc198469877
233220 else {
234- let $acc21039410425 = hasMoreVotes($acc11039410425, $list1039410425[1])
235- if (($size1039410425 == 2))
236- then $acc21039410425
221+ let $acc298469877 = hasMoreVotes($acc198469877, $list98469877[1])
222+ if (($size98469877 == 2))
223+ then $acc298469877
237224 else {
238- let $acc31039410425 = hasMoreVotes($acc21039410425, $list1039410425[2])
225+ let $acc398469877 = hasMoreVotes($acc298469877, $list98469877[2])
239226 throw("List size exceed 2")
240227 }
241228 }
244231 let listKey = (("tasks_" + taskId) + "_applicants")
245232 let applicantsList = split(getStringValue(this, listKey), ";")
246233 let teamIdentifier = applicantsList[chosenTeamId]
247- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_process"), "can_begin")])
234+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
248235 }
249236 }
250237
253240 @Callable(i)
254241 func startWork (taskId) = {
255242 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
256- if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_leader"))))
243+ if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
257244 then throw("team leader only")
258- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_process"), "work_started")])
245+ else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
259246 }
260247
261248
266253 else {
267254 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
268255 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
269- let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_leader"))
270- ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
256+ let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
257+ ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
271258 }
272259
273260
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let QUORUM = 50
5-
6-let WCTid = base58'4zfrrwDVjbGFM8wxbZGriVLY4XJsVD4oNMp21FnDnMAa'
75
86 func tryGetInteger (key) = {
97 let val = match getInteger(this, key) {
108 case b: Int =>
119 b
1210 case _ =>
1311 0
12+ }
13+ val
14+ }
15+
16+
17+func tryGetString (key) = {
18+ let val = match getString(this, key) {
19+ case b: String =>
20+ b
21+ case _ =>
22+ ""
1423 }
1524 val
1625 }
1726
1827
1928 func isOwner (address) = (address == this)
2029
2130
2231 func getGroup () = {
2332 let val = match getString(this, "working_group") {
2433 case b: String =>
2534 b
2635 case _ =>
2736 ""
2837 }
2938 val
3039 }
3140
3241
3342 func getMembers () = {
3443 let val = match getString(this, "dao_members") {
3544 case b: String =>
3645 b
3746 case _ =>
3847 ""
3948 }
4049 val
4150 }
4251
4352
4453 func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
4554
4655
4756 func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0)
4857
4958
5059 @Callable(i)
5160 func addDAOMember (memberAddress) = if (!(isOwner(i.caller)))
5261 then throw("access only to the DAO owner")
5362 else {
5463 let group = getMembers()
5564 let newGroup = ((group + ";") + memberAddress)
5665 let groupSize = tryGetInteger("dao_size")
5766 let newGroupSize = (groupSize + 1)
5867 WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry((("dao_member_" + memberAddress) + "_weight"), 1)])
5968 }
6069
6170
6271
6372 @Callable(i)
6473 func addGroupMember (memberAddress) = if (!(isOwner(i.caller)))
6574 then throw("access only to the DAO owner")
6675 else {
6776 let group = getGroup()
6877 let newGroup = ((group + ";") + memberAddress)
6978 let groupSize = tryGetInteger("working_group_size")
7079 let newGroupSize = (groupSize + 1)
7180 WriteSet([DataEntry("working_group_name", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry((("working_group_member_" + memberAddress) + "_weight"), 1)])
7281 }
7382
7483
7584
7685 @Callable(i)
7786 func addTask (title) = if (!(isGroupMember(i.caller)))
7887 then throw("grants working group access only")
7988 else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title)])
8089
8190
8291
8392 @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)
10393 func addTaskDetails (taskId) = if (!(isGroupMember(i.caller)))
10494 then throw("grants working group access only")
10595 else {
10696 let reward = extract(i.payment).amount
10797 WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
10898 }
10999
110100
111101
112102 @Callable(i)
113103 func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i)))
114104 then throw("you can't vote")
115105 else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
116106 then throw("voting is closed or not started")
117107 else if (if ((voteValue != -1))
118108 then (voteValue != 1)
119109 else false)
120110 then throw("you need to vote 1 or -1")
121111 else {
122112 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
123113 let previousVote = tryGetInteger(voteKey)
124114 if (!((previousVote == 0)))
125115 then throw("you have already voted")
126116 else {
127117 let votingKey = (("tasks_" + taskId) + "_voting_state")
128118 let votingState = tryGetInteger(votingKey)
129119 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
130120 let votesAmountState = (tryGetInteger(votingKey) + 1)
131121 let newVotingState = (votingState + voteValue)
132- ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
122+ WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)])
133123 }
134124 }
135125
136126
137127
138128 @Callable(i)
139129 func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size"))))
140130 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
141131 else if (!(isGroupMember(i.caller)))
142132 then throw("grants working group access only")
143133 else {
144134 let votingKey = (("tasks_" + taskId) + "_voting_state")
145135 let votingState = tryGetInteger(votingKey)
146136 if ((votingState > 0))
147137 then {
148138 let votingResult = "ready_to_apply"
149139 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
150140 }
151141 else {
152142 let votingResult = "rejected"
153143 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
154144 }
155145 }
156146
157147
158148
159149 @Callable(i)
160150 func applyForTask (taskId,teamName) = {
161151 let listKey = (("tasks_" + taskId) + "_applicants")
162- let currentApplicantsList = match getString(this, listKey) {
163- case b: String =>
164- b
165- case _ =>
166- ""
167- }
152+ let currentApplicantsList = tryGetString(listKey)
153+ let applicantKey = drop(toString(i.caller), 20)
168154 let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
169- WriteSet([DataEntry((((("tasks_" + taskId) + "_applicant_") + toString(i.caller)) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_applicant_") + toString(i.caller)) + "_leader"), toString(i.caller)), DataEntry(listKey, newApplicantsList)])
155+ WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + applicantKey) + "_id"), applicantKey), DataEntry(listKey, newApplicantsList)])
170156 }
171157
172158
173159
174160 @Callable(i)
175161 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
176162 then throw("you can't vote")
177163 else {
178- let voteKey = (((("tasks_" + taskId) + "_vote_") + toString(i.caller)) + teamIdentifier)
164+ let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
165+ let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
179166 let vote = tryGetInteger(voteKey)
180167 if ((vote != 0))
181168 then throw("you have already voted on this team")
182169 else {
183- let teamVotesAmountKey = (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_votes")
184- let teamScoreKey = (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_score")
170+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
171+ let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
185172 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
186173 let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
187174 WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
188175 }
189176 }
190177
191178
192179
193180 @Callable(i)
194181 func finishApplicantsVoting (taskId) = {
195182 func isApplicantVotedEnough (aid,aid2) = {
196183 let listKey = (("tasks_" + taskId) + "_applicants")
197184 let applicantsList = split(getStringValue(this, listKey), ";")
198185 let teamIdentifier = applicantsList[aid]
199- let teamVotesAmountKey = (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_votes")
186+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
200187 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
201188 if ((teamVotesAmount > 0))
202189 then 1
203190 else throw(("not enough votes to make decision on " + teamIdentifier))
204191 }
205192
206193 func hasMoreVotes (aid,aid2) = {
207194 let listKey = (("tasks_" + taskId) + "_applicants")
208195 let applicantsList = split(getStringValue(this, listKey), ";")
209196 let teamIdentifier = applicantsList[aid]
210- let teamVotesAmountKey = (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_votes")
197+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
211198 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
212199 let team2Identifier = applicantsList[aid2]
213- let team2VotesAmountKey = (((("tasks_" + taskId) + "_applicant_") + team2Identifier) + "_votes")
200+ let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
214201 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
215202 if ((teamVotesAmount > team2VotesAmount))
216203 then aid
217204 else aid2
218205 }
219206
220207 if (!(isGroupMember(i.caller)))
221208 then throw("grants working group access only")
222209 else {
223210 let chosenTeamId = {
224- let $list1039410425 = [0, 1]
225- let $size1039410425 = size($list1039410425)
226- let $acc01039410425 = 0
227- if (($size1039410425 == 0))
228- then $acc01039410425
211+ let $list98469877 = [0, 1]
212+ let $size98469877 = size($list98469877)
213+ let $acc098469877 = 0
214+ if (($size98469877 == 0))
215+ then $acc098469877
229216 else {
230- let $acc11039410425 = hasMoreVotes($acc01039410425, $list1039410425[0])
231- if (($size1039410425 == 1))
232- then $acc11039410425
217+ let $acc198469877 = hasMoreVotes($acc098469877, $list98469877[0])
218+ if (($size98469877 == 1))
219+ then $acc198469877
233220 else {
234- let $acc21039410425 = hasMoreVotes($acc11039410425, $list1039410425[1])
235- if (($size1039410425 == 2))
236- then $acc21039410425
221+ let $acc298469877 = hasMoreVotes($acc198469877, $list98469877[1])
222+ if (($size98469877 == 2))
223+ then $acc298469877
237224 else {
238- let $acc31039410425 = hasMoreVotes($acc21039410425, $list1039410425[2])
225+ let $acc398469877 = hasMoreVotes($acc298469877, $list98469877[2])
239226 throw("List size exceed 2")
240227 }
241228 }
242229 }
243230 }
244231 let listKey = (("tasks_" + taskId) + "_applicants")
245232 let applicantsList = split(getStringValue(this, listKey), ";")
246233 let teamIdentifier = applicantsList[chosenTeamId]
247- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_process"), "can_begin")])
234+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
248235 }
249236 }
250237
251238
252239
253240 @Callable(i)
254241 func startWork (taskId) = {
255242 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
256- if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_leader"))))
243+ if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
257244 then throw("team leader only")
258- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_process"), "work_started")])
245+ else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
259246 }
260247
261248
262249
263250 @Callable(i)
264251 func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller)))
265252 then throw("grants working group access only")
266253 else {
267254 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
268255 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
269- let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_leader"))
270- ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_applicant_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
256+ let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
257+ ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
271258 }
272259
273260

github/deemru/w8io/169f3d6 
77.55 ms