tx · 4t81rRMPYwLV9VJqLnhf49nAEbfrMp5Kcu2ma9FUUWN1

3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA:  -0.10000000 Waves

2020.12.25 15:14 [1324206] smart account 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA > SELF 0.00000000 Waves

{ "type": 13, "id": "4t81rRMPYwLV9VJqLnhf49nAEbfrMp5Kcu2ma9FUUWN1", "fee": 10000000, "feeAssetId": null, "timestamp": 1608898538612, "version": 2, "chainId": 84, "sender": "3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA", "senderPublicKey": "4xMxUnfdbHYsent96ThiYC63gXHiahi6bh3urdHHntHi", "proofs": [ "HPUim5H4VkbVNC1ftvswGtrsBhoWvd6gE1F9TqPKPP3ePe5y8YUk6UeXTVmoRPzU1cxuY5VvJVYjsfDGbBnnSbz" ], "script": "base64:AAIDAAAAAAAAADsIARIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIEgUKAwgICBIDCgEIEgMKAQgSBAoCCAgSAwoBCAAAAA4AAAAADG1haW5Db250cmFjdAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXdSemkyQm1xWlpYV3JDR0N3Y1JRTHNuaWMyQW9kNnpoUwAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAA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VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3N0YXR1cwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAABnRhc2tzXwUAAAAGdGFza0lkAgAAAAdfcmVwb3J0BQAAAApyZXBvcnRMaW5rBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAt0ZWFtQWRkcmVzcwUAAAAMcmV3YXJkQW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAABaQEAAAAKcmVqZWN0VGFzawAAAAEAAAAGdGFza0lkAwkBAAAAASEAAAABCQEAAAANaXNHcm91cE1lbWJlcgAAAAEIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAACBncmFudHMgd29ya2luZyBncm91cCBhY2Nlc3Mgb25seQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAABnRhc2tzXwUAAAAGdGFza0lkAgAAAAdfc3RhdHVzAgAAAAhyZWplY3RlZAUAAAADbmlsAAAAAK5nkFA=", "height": 1324206, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JBdTBC39pTrjmWb4Zkt735KfDCRZpc2GTTftVgWL7xLK Next: 6GFQRCNVFcpDhrPJzHMeqirYZba3m4Ht7LoR3N3A4ted Diff:
OldNewDifferences
7474 }
7575
7676
77-func canMemberVote (i) = {
78- let val = match getInteger(mainContract, (("dao_member_" + toString(i.caller)) + "_weight")) {
77+func canMemberVote (address) = {
78+ let val = match getInteger(mainContract, (("dao_member_" + toString(address)) + "_weight")) {
7979 case b: Int =>
8080 b
8181 case _ =>
9292 else throw("you need to vote with 'like' or 'dislike' value")
9393
9494
95+func addTaskConditions (address) = if (!(isGroupMember(address)))
96+ then throw("grants working group access only")
97+ else true
98+
99+
100+func addRewardConditions (address,taskId) = if (!(isGroupMember(address)))
101+ then throw("grants working group access only")
102+ else if ((tryGetString((("tasks_" + taskId) + "_status")) != ""))
103+ then throw("grant isn`t new")
104+ else true
105+
106+
107+func voteForTaskProposalConditions (address,taskId) = if (!(canMemberVote(address)))
108+ then throw("you can't vote")
109+ else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
110+ then throw("voting is closed or not started")
111+ else if ((tryGetInteger(((("tasks_" + taskId) + "_voted_") + toString(address))) != 0))
112+ then throw("you have already voted")
113+ else true
114+
115+
95116 @Callable(i)
96-func addTask (title,link) = if (!(isGroupMember(i.caller)))
97- then throw("grants working group access only")
98- else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
117+func addTask (title,link) = if (addTaskConditions(i.caller))
118+ then WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
119+ else throw("checks are not passed")
99120
100121
101122
102123 @Callable(i)
103-func addReward (taskId) = if (!(isGroupMember(i.caller)))
104- then throw("grants working group access only")
105- else {
124+func addReward (taskId) = if (addRewardConditions(i.caller, taskId))
125+ then {
106126 let reward = extract(i.payment).amount
107127 WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
108128 }
129+ else throw("checks are not passed")
109130
110131
111132
112133 @Callable(i)
113-func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i)))
114- then throw("you can't vote")
115- else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
116- then throw("voting is closed or not started")
117- else if (if ((voteValue != "like"))
118- then (voteValue != "dislike")
119- else false)
120- then throw("you need to vote like or dislike")
121- else {
122- let valueVoteInt = getVoteValue(voteValue)
123- let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
124- let previousVote = tryGetInteger(voteKey)
125- if (!((previousVote == 0)))
126- then throw("you have already voted")
127- else {
128- let votingKey = (("tasks_" + taskId) + "_voting_state")
129- let votingState = tryGetInteger(votingKey)
130- let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
131- let votesAmountState = (tryGetInteger(votingKey) + 1)
132- let newVotingState = (votingState + valueVoteInt)
133- ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, valueVoteInt), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
134- }
135- }
134+func voteForTaskProposal (taskId,voteValue) = if (voteForTaskProposalConditions(i.caller, taskId))
135+ then {
136+ let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
137+ let votingKey = (("tasks_" + taskId) + "_voting_state")
138+ let votingState = tryGetInteger(votingKey)
139+ let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
140+ let votesAmountState = (tryGetInteger(votingKey) + 1)
141+ let voteValueInt = getVoteValue(voteValue)
142+ let newVotingState = (votingState + voteValueInt)
143+ WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValueInt), DataEntry(votesAmountKey, votesAmountState)])
144+ }
145+ else throw("checks are not passed")
136146
137147
138148
174184
175185
176186 @Callable(i)
177-func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
187+func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i.caller)))
178188 then throw("you can't vote")
179189 else {
180190 let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
230240 then throw("No one has yet responded to the grant")
231241 else {
232242 let chosenTeamId = {
233- let $list98869917 = [0, 1]
234- let $size98869917 = size($list98869917)
235- let $acc098869917 = 0
236- if (($size98869917 == 0))
237- then $acc098869917
243+ let $list1009110122 = [0, 1]
244+ let $size1009110122 = size($list1009110122)
245+ let $acc01009110122 = 0
246+ if (($size1009110122 == 0))
247+ then $acc01009110122
238248 else {
239- let $acc198869917 = hasMoreVotes($acc098869917, $list98869917[0])
240- if (($size98869917 == 1))
241- then $acc198869917
249+ let $acc11009110122 = hasMoreVotes($acc01009110122, $list1009110122[0])
250+ if (($size1009110122 == 1))
251+ then $acc11009110122
242252 else {
243- let $acc298869917 = hasMoreVotes($acc198869917, $list98869917[1])
244- if (($size98869917 == 2))
245- then $acc298869917
253+ let $acc21009110122 = hasMoreVotes($acc11009110122, $list1009110122[1])
254+ if (($size1009110122 == 2))
255+ then $acc21009110122
246256 else {
247- let $acc398869917 = hasMoreVotes($acc298869917, $list98869917[2])
257+ let $acc31009110122 = hasMoreVotes($acc21009110122, $list1009110122[2])
248258 throw("List size exceed 2")
249259 }
250260 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let mainContract = addressFromStringValue("3MwRzi2BmqZZXWrCGCwcRQLsnic2Aod6zhS")
55
66 let QUORUM = 1
77
88 func tryGetInteger (key) = {
99 let val = match getInteger(this, key) {
1010 case b: Int =>
1111 b
1212 case _ =>
1313 0
1414 }
1515 val
1616 }
1717
1818
1919 func tryGetString (key) = {
2020 let val = match getString(this, key) {
2121 case b: String =>
2222 b
2323 case _ =>
2424 ""
2525 }
2626 val
2727 }
2828
2929
3030 func isOwner (address) = (address == this)
3131
3232
3333 func getGroup () = {
3434 let val = match getString(mainContract, "working_group_members") {
3535 case b: String =>
3636 b
3737 case _ =>
3838 ""
3939 }
4040 val
4141 }
4242
4343
4444 func getMembers () = {
4545 let val = match getString(mainContract, "dao_members") {
4646 case b: String =>
4747 b
4848 case _ =>
4949 ""
5050 }
5151 val
5252 }
5353
5454
5555 func getDAOSize () = {
5656 let val = match getInteger(mainContract, "dao_size") {
5757 case b: Int =>
5858 b
5959 case _ =>
6060 0
6161 }
6262 val
6363 }
6464
6565
6666 func isGroupMember (a) = {
6767 let val = match getInteger(mainContract, (("working_group_member_" + toString(a)) + "_weight")) {
6868 case b: Int =>
6969 b
7070 case _ =>
7171 0
7272 }
7373 (val > 0)
7474 }
7575
7676
77-func canMemberVote (i) = {
78- let val = match getInteger(mainContract, (("dao_member_" + toString(i.caller)) + "_weight")) {
77+func canMemberVote (address) = {
78+ let val = match getInteger(mainContract, (("dao_member_" + toString(address)) + "_weight")) {
7979 case b: Int =>
8080 b
8181 case _ =>
8282 0
8383 }
8484 (val > 0)
8585 }
8686
8787
8888 func getVoteValue (s) = if ((s == "like"))
8989 then 1
9090 else if ((s == "dislike"))
9191 then -1
9292 else throw("you need to vote with 'like' or 'dislike' value")
9393
9494
95+func addTaskConditions (address) = if (!(isGroupMember(address)))
96+ then throw("grants working group access only")
97+ else true
98+
99+
100+func addRewardConditions (address,taskId) = if (!(isGroupMember(address)))
101+ then throw("grants working group access only")
102+ else if ((tryGetString((("tasks_" + taskId) + "_status")) != ""))
103+ then throw("grant isn`t new")
104+ else true
105+
106+
107+func voteForTaskProposalConditions (address,taskId) = if (!(canMemberVote(address)))
108+ then throw("you can't vote")
109+ else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
110+ then throw("voting is closed or not started")
111+ else if ((tryGetInteger(((("tasks_" + taskId) + "_voted_") + toString(address))) != 0))
112+ then throw("you have already voted")
113+ else true
114+
115+
95116 @Callable(i)
96-func addTask (title,link) = if (!(isGroupMember(i.caller)))
97- then throw("grants working group access only")
98- else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
117+func addTask (title,link) = if (addTaskConditions(i.caller))
118+ then WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
119+ else throw("checks are not passed")
99120
100121
101122
102123 @Callable(i)
103-func addReward (taskId) = if (!(isGroupMember(i.caller)))
104- then throw("grants working group access only")
105- else {
124+func addReward (taskId) = if (addRewardConditions(i.caller, taskId))
125+ then {
106126 let reward = extract(i.payment).amount
107127 WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
108128 }
129+ else throw("checks are not passed")
109130
110131
111132
112133 @Callable(i)
113-func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i)))
114- then throw("you can't vote")
115- else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
116- then throw("voting is closed or not started")
117- else if (if ((voteValue != "like"))
118- then (voteValue != "dislike")
119- else false)
120- then throw("you need to vote like or dislike")
121- else {
122- let valueVoteInt = getVoteValue(voteValue)
123- let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
124- let previousVote = tryGetInteger(voteKey)
125- if (!((previousVote == 0)))
126- then throw("you have already voted")
127- else {
128- let votingKey = (("tasks_" + taskId) + "_voting_state")
129- let votingState = tryGetInteger(votingKey)
130- let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
131- let votesAmountState = (tryGetInteger(votingKey) + 1)
132- let newVotingState = (votingState + valueVoteInt)
133- ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, valueVoteInt), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
134- }
135- }
134+func voteForTaskProposal (taskId,voteValue) = if (voteForTaskProposalConditions(i.caller, taskId))
135+ then {
136+ let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
137+ let votingKey = (("tasks_" + taskId) + "_voting_state")
138+ let votingState = tryGetInteger(votingKey)
139+ let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
140+ let votesAmountState = (tryGetInteger(votingKey) + 1)
141+ let voteValueInt = getVoteValue(voteValue)
142+ let newVotingState = (votingState + voteValueInt)
143+ WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValueInt), DataEntry(votesAmountKey, votesAmountState)])
144+ }
145+ else throw("checks are not passed")
136146
137147
138148
139149 @Callable(i)
140150 func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
141151 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
142152 else if (!(isGroupMember(i.caller)))
143153 then throw("grants working group access only")
144154 else {
145155 let votingKey = (("tasks_" + taskId) + "_voting_state")
146156 let votingState = tryGetInteger(votingKey)
147157 if ((votingState > 0))
148158 then {
149159 let votingResult = "ready_to_apply"
150160 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
151161 }
152162 else {
153163 let votingResult = "rejected"
154164 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
155165 }
156166 }
157167
158168
159169
160170 @Callable(i)
161171 func applyForTask (taskId,teamName,link) = {
162172 let status = tryGetString((("tasks_" + taskId) + "_status"))
163173 if ((status != "ready_to_apply"))
164174 then throw("This grant has not yet been approved")
165175 else {
166176 let listKey = (("tasks_" + taskId) + "_applicants")
167177 let currentApplicantsList = tryGetString(listKey)
168178 let applicantKey = drop(toString(i.caller), 10)
169179 let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
170180 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)])
171181 }
172182 }
173183
174184
175185
176186 @Callable(i)
177-func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
187+func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i.caller)))
178188 then throw("you can't vote")
179189 else {
180190 let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
181191 let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
182192 let vote = tryGetInteger(voteKey)
183193 if ((vote != 0))
184194 then throw("you have already voted on this team")
185195 else {
186196 let valueVoteInt = getVoteValue(voteValue)
187197 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
188198 let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
189199 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
190200 let newTeamScore = (valueVoteInt + tryGetInteger(teamScoreKey))
191201 WriteSet([DataEntry(voteKey, valueVoteInt), DataEntry(teamScoreKey, newTeamScore)])
192202 }
193203 }
194204
195205
196206
197207 @Callable(i)
198208 func finishApplicantsVoting (taskId) = {
199209 func isApplicantVotedEnough (aid,aid2) = {
200210 let listKey = (("tasks_" + taskId) + "_applicants")
201211 let applicantsList = split(getStringValue(this, listKey), ";")
202212 let teamIdentifier = applicantsList[aid]
203213 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
204214 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
205215 if ((teamVotesAmount > 0))
206216 then 1
207217 else throw(("not enough votes to make decision on " + teamIdentifier))
208218 }
209219
210220 func hasMoreVotes (aid,aid2) = {
211221 let listKey = (("tasks_" + taskId) + "_applicants")
212222 let applicantsList = split(getStringValue(this, listKey), ";")
213223 let teamIdentifier = applicantsList[aid]
214224 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
215225 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
216226 let team2Identifier = applicantsList[aid2]
217227 let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
218228 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
219229 if ((teamVotesAmount > team2VotesAmount))
220230 then aid
221231 else aid2
222232 }
223233
224234 if (!(isGroupMember(i.caller)))
225235 then throw("grants working group access only")
226236 else {
227237 let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
228238 let applicantsList = split(listKeys, ";")
229239 if ((size(applicantsList) == 0))
230240 then throw("No one has yet responded to the grant")
231241 else {
232242 let chosenTeamId = {
233- let $list98869917 = [0, 1]
234- let $size98869917 = size($list98869917)
235- let $acc098869917 = 0
236- if (($size98869917 == 0))
237- then $acc098869917
243+ let $list1009110122 = [0, 1]
244+ let $size1009110122 = size($list1009110122)
245+ let $acc01009110122 = 0
246+ if (($size1009110122 == 0))
247+ then $acc01009110122
238248 else {
239- let $acc198869917 = hasMoreVotes($acc098869917, $list98869917[0])
240- if (($size98869917 == 1))
241- then $acc198869917
249+ let $acc11009110122 = hasMoreVotes($acc01009110122, $list1009110122[0])
250+ if (($size1009110122 == 1))
251+ then $acc11009110122
242252 else {
243- let $acc298869917 = hasMoreVotes($acc198869917, $list98869917[1])
244- if (($size98869917 == 2))
245- then $acc298869917
253+ let $acc21009110122 = hasMoreVotes($acc11009110122, $list1009110122[1])
254+ if (($size1009110122 == 2))
255+ then $acc21009110122
246256 else {
247- let $acc398869917 = hasMoreVotes($acc298869917, $list98869917[2])
257+ let $acc31009110122 = hasMoreVotes($acc21009110122, $list1009110122[2])
248258 throw("List size exceed 2")
249259 }
250260 }
251261 }
252262 }
253263 let teamIdentifier = applicantsList[chosenTeamId]
254264 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
255265 }
256266 }
257267 }
258268
259269
260270
261271 @Callable(i)
262272 func startWork (taskId) = {
263273 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
264274 if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
265275 then throw("team leader only")
266276 else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
267277 }
268278
269279
270280
271281 @Callable(i)
272282 func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
273283 then throw("grants working group access only")
274284 else {
275285 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
276286 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
277287 let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
278288 ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished"), DataEntry((("tasks_" + taskId) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
279289 }
280290
281291
282292
283293 @Callable(i)
284294 func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
285295 then throw("grants working group access only")
286296 else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
287297
288298

github/deemru/w8io/026f985 
54.74 ms