tx · 78NbqZdbrxJJ3mEwD3VkjP2SdzaRFumByabG2VeKndFo

3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan:  -0.10000000 Waves

2020.12.22 13:21 [1319781] smart account 3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan > SELF 0.00000000 Waves

{ "type": 13, "id": "78NbqZdbrxJJ3mEwD3VkjP2SdzaRFumByabG2VeKndFo", "fee": 10000000, "feeAssetId": null, "timestamp": 1608632470872, "version": 2, "chainId": 84, "sender": "3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan", "senderPublicKey": "5tBY17DiYVDP2QCBiAPKpjhmn1hCu1rS4XbwiY9zchFf", "proofs": [ "4x2JTV8vqMYL9XLSBPRapvhzktR5i7RdhkH3QNFScXctkM5p44WVmH2kQmWW1EWf38Hognovtf7keXLuJcTMHXzZ" ], "script": "base64:AAIDAAAAAAAAADUIARIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIEgUKAwgICBIDCgEIEgMKAQgSAwoBCAAAAAsAAAAADG1haW5Db250cmFjdAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXdSemkyQm1xWlpYV3JDR0N3Y1JRTHNuaWMyQW9kNnpoUwAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAA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height": 1319781, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8ynjQRFoVBWP1BLnwmJc6cXQuLz59TzgZDHGW6ApdXMA Next: ExKu3epok3HftYVTofmZcZtJEGa1yRXmaXouePmyiEmq Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let mainContract = addressFromStringValue("3MwRzi2BmqZZXWrCGCwcRQLsnic2Aod6zhS")
5+
46 let QUORUM = 1
57
68 func tryGetInteger (key) = {
2931
3032
3133 func getGroup () = {
32- let val = match getString(this, "working_group") {
34+ let val = match getString(mainContract, "working_group_members") {
3335 case b: String =>
3436 b
3537 case _ =>
4042
4143
4244 func getMembers () = {
43- let val = match getString(this, "dao_members") {
45+ let val = match getString(mainContract, "dao_members") {
4446 case b: String =>
4547 b
4648 case _ =>
5052 }
5153
5254
53-func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
55+func getDAOSize () = {
56+ let val = match getInteger(mainContract, "dao_size") {
57+ case b: Int =>
58+ b
59+ case _ =>
60+ 0
61+ }
62+ val
63+ }
5464
5565
56-func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0)
66+func isGroupMember (a) = {
67+ let val = match getInteger(mainContract, (("working_group_member_" + toString(a)) + "_weight")) {
68+ case b: Int =>
69+ b
70+ case _ =>
71+ 0
72+ }
73+ (val > 0)
74+ }
5775
5876
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- }
77+func canMemberVote (i) = {
78+ let val = match getInteger(mainContract, (("dao_member_" + toString(i.caller)) + "_weight")) {
79+ case b: Int =>
80+ b
81+ case _ =>
82+ 0
83+ }
84+ (val > 0)
85+ }
7186
7287
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-
88+func getVoteValue (s) = if ((s == "like"))
89+ then 1
90+ else if ((s == "dislike"))
91+ then -1
92+ else throw("you need to vote with 'like' or 'dislike' value")
8793
8894
8995 @Callable(i)
94100
95101
96102 @Callable(i)
97-func addTaskDetails (taskId) = if (!(isGroupMember(i.caller)))
103+func addReward (taskId) = if (!(isGroupMember(i.caller)))
98104 then throw("grants working group access only")
99105 else {
100106 let reward = extract(i.payment).amount
108114 then throw("you can't vote")
109115 else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
110116 then throw("voting is closed or not started")
111- else if (if ((voteValue != -1))
112- then (voteValue != 1)
117+ else if (if ((voteValue != "like"))
118+ then (voteValue != "dislike")
113119 else false)
114- then throw("you need to vote 1 or -1")
120+ then throw("you need to vote like or dislike")
115121 else {
122+ let valueVoteInt = getVoteValue(voteValue)
116123 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
117124 let previousVote = tryGetInteger(voteKey)
118125 if (!((previousVote == 0)))
122129 let votingState = tryGetInteger(votingKey)
123130 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
124131 let votesAmountState = (tryGetInteger(votingKey) + 1)
125- let newVotingState = (votingState + voteValue)
126- ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
132+ let newVotingState = (votingState + valueVoteInt)
133+ ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, valueVoteInt), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
127134 }
128135 }
129136
130137
131138
132139 @Callable(i)
133-func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size"))))
140+func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
134141 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
135142 else if (!(isGroupMember(i.caller)))
136143 then throw("grants working group access only")
176183 if ((vote != 0))
177184 then throw("you have already voted on this team")
178185 else {
186+ let valueVoteInt = getVoteValue(voteValue)
179187 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
180188 let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
181189 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
182- let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
183- WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
190+ let newTeamScore = (valueVoteInt + tryGetInteger(teamScoreKey))
191+ WriteSet([DataEntry(voteKey, valueVoteInt), DataEntry(teamScoreKey, newTeamScore)])
184192 }
185193 }
186194
222230 then throw("No one has yet responded to the grant")
223231 else {
224232 let chosenTeamId = {
225- let $list1093010961 = [0, 1]
226- let $size1093010961 = size($list1093010961)
227- let $acc01093010961 = 0
228- if (($size1093010961 == 0))
229- then $acc01093010961
233+ let $list98869917 = [0, 1]
234+ let $size98869917 = size($list98869917)
235+ let $acc098869917 = 0
236+ if (($size98869917 == 0))
237+ then $acc098869917
230238 else {
231- let $acc11093010961 = hasMoreVotes($acc01093010961, $list1093010961[0])
232- if (($size1093010961 == 1))
233- then $acc11093010961
239+ let $acc198869917 = hasMoreVotes($acc098869917, $list98869917[0])
240+ if (($size98869917 == 1))
241+ then $acc198869917
234242 else {
235- let $acc21093010961 = hasMoreVotes($acc11093010961, $list1093010961[1])
236- if (($size1093010961 == 2))
237- then $acc21093010961
243+ let $acc298869917 = hasMoreVotes($acc198869917, $list98869917[1])
244+ if (($size98869917 == 2))
245+ then $acc298869917
238246 else {
239- let $acc31093010961 = hasMoreVotes($acc21093010961, $list1093010961[2])
247+ let $acc398869917 = hasMoreVotes($acc298869917, $list98869917[2])
240248 throw("List size exceed 2")
241249 }
242250 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let mainContract = addressFromStringValue("3MwRzi2BmqZZXWrCGCwcRQLsnic2Aod6zhS")
5+
46 let QUORUM = 1
57
68 func tryGetInteger (key) = {
79 let val = match getInteger(this, key) {
810 case b: Int =>
911 b
1012 case _ =>
1113 0
1214 }
1315 val
1416 }
1517
1618
1719 func tryGetString (key) = {
1820 let val = match getString(this, key) {
1921 case b: String =>
2022 b
2123 case _ =>
2224 ""
2325 }
2426 val
2527 }
2628
2729
2830 func isOwner (address) = (address == this)
2931
3032
3133 func getGroup () = {
32- let val = match getString(this, "working_group") {
34+ let val = match getString(mainContract, "working_group_members") {
3335 case b: String =>
3436 b
3537 case _ =>
3638 ""
3739 }
3840 val
3941 }
4042
4143
4244 func getMembers () = {
43- let val = match getString(this, "dao_members") {
45+ let val = match getString(mainContract, "dao_members") {
4446 case b: String =>
4547 b
4648 case _ =>
4749 ""
4850 }
4951 val
5052 }
5153
5254
53-func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
55+func getDAOSize () = {
56+ let val = match getInteger(mainContract, "dao_size") {
57+ case b: Int =>
58+ b
59+ case _ =>
60+ 0
61+ }
62+ val
63+ }
5464
5565
56-func canMemberVote (i) = (tryGetInteger((("dao_member_" + toString(i.caller)) + "_weight")) > 0)
66+func isGroupMember (a) = {
67+ let val = match getInteger(mainContract, (("working_group_member_" + toString(a)) + "_weight")) {
68+ case b: Int =>
69+ b
70+ case _ =>
71+ 0
72+ }
73+ (val > 0)
74+ }
5775
5876
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- }
77+func canMemberVote (i) = {
78+ let val = match getInteger(mainContract, (("dao_member_" + toString(i.caller)) + "_weight")) {
79+ case b: Int =>
80+ b
81+ case _ =>
82+ 0
83+ }
84+ (val > 0)
85+ }
7186
7287
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-
88+func getVoteValue (s) = if ((s == "like"))
89+ then 1
90+ else if ((s == "dislike"))
91+ then -1
92+ else throw("you need to vote with 'like' or 'dislike' value")
8793
8894
8995 @Callable(i)
9096 func addTask (title,link) = if (!(isGroupMember(i.caller)))
9197 then throw("grants working group access only")
9298 else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
9399
94100
95101
96102 @Callable(i)
97-func addTaskDetails (taskId) = if (!(isGroupMember(i.caller)))
103+func addReward (taskId) = if (!(isGroupMember(i.caller)))
98104 then throw("grants working group access only")
99105 else {
100106 let reward = extract(i.payment).amount
101107 WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
102108 }
103109
104110
105111
106112 @Callable(i)
107113 func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i)))
108114 then throw("you can't vote")
109115 else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
110116 then throw("voting is closed or not started")
111- else if (if ((voteValue != -1))
112- then (voteValue != 1)
117+ else if (if ((voteValue != "like"))
118+ then (voteValue != "dislike")
113119 else false)
114- then throw("you need to vote 1 or -1")
120+ then throw("you need to vote like or dislike")
115121 else {
122+ let valueVoteInt = getVoteValue(voteValue)
116123 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
117124 let previousVote = tryGetInteger(voteKey)
118125 if (!((previousVote == 0)))
119126 then throw("you have already voted")
120127 else {
121128 let votingKey = (("tasks_" + taskId) + "_voting_state")
122129 let votingState = tryGetInteger(votingKey)
123130 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
124131 let votesAmountState = (tryGetInteger(votingKey) + 1)
125- let newVotingState = (votingState + voteValue)
126- ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
132+ let newVotingState = (votingState + valueVoteInt)
133+ ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, valueVoteInt), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
127134 }
128135 }
129136
130137
131138
132139 @Callable(i)
133-func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size"))))
140+func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
134141 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
135142 else if (!(isGroupMember(i.caller)))
136143 then throw("grants working group access only")
137144 else {
138145 let votingKey = (("tasks_" + taskId) + "_voting_state")
139146 let votingState = tryGetInteger(votingKey)
140147 if ((votingState > 0))
141148 then {
142149 let votingResult = "ready_to_apply"
143150 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
144151 }
145152 else {
146153 let votingResult = "rejected"
147154 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
148155 }
149156 }
150157
151158
152159
153160 @Callable(i)
154161 func applyForTask (taskId,teamName,link) = {
155162 let status = tryGetString((("tasks_" + taskId) + "_status"))
156163 if ((status != "ready_to_apply"))
157164 then throw("This grant has not yet been approved")
158165 else {
159166 let listKey = (("tasks_" + taskId) + "_applicants")
160167 let currentApplicantsList = tryGetString(listKey)
161168 let applicantKey = drop(toString(i.caller), 10)
162169 let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
163170 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)])
164171 }
165172 }
166173
167174
168175
169176 @Callable(i)
170177 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
171178 then throw("you can't vote")
172179 else {
173180 let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
174181 let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
175182 let vote = tryGetInteger(voteKey)
176183 if ((vote != 0))
177184 then throw("you have already voted on this team")
178185 else {
186+ let valueVoteInt = getVoteValue(voteValue)
179187 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
180188 let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
181189 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
182- let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
183- WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
190+ let newTeamScore = (valueVoteInt + tryGetInteger(teamScoreKey))
191+ WriteSet([DataEntry(voteKey, valueVoteInt), DataEntry(teamScoreKey, newTeamScore)])
184192 }
185193 }
186194
187195
188196
189197 @Callable(i)
190198 func finishApplicantsVoting (taskId) = {
191199 func isApplicantVotedEnough (aid,aid2) = {
192200 let listKey = (("tasks_" + taskId) + "_applicants")
193201 let applicantsList = split(getStringValue(this, listKey), ";")
194202 let teamIdentifier = applicantsList[aid]
195203 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
196204 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
197205 if ((teamVotesAmount > 0))
198206 then 1
199207 else throw(("not enough votes to make decision on " + teamIdentifier))
200208 }
201209
202210 func hasMoreVotes (aid,aid2) = {
203211 let listKey = (("tasks_" + taskId) + "_applicants")
204212 let applicantsList = split(getStringValue(this, listKey), ";")
205213 let teamIdentifier = applicantsList[aid]
206214 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
207215 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
208216 let team2Identifier = applicantsList[aid2]
209217 let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
210218 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
211219 if ((teamVotesAmount > team2VotesAmount))
212220 then aid
213221 else aid2
214222 }
215223
216224 if (!(isGroupMember(i.caller)))
217225 then throw("grants working group access only")
218226 else {
219227 let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
220228 let applicantsList = split(listKeys, ";")
221229 if ((size(applicantsList) == 0))
222230 then throw("No one has yet responded to the grant")
223231 else {
224232 let chosenTeamId = {
225- let $list1093010961 = [0, 1]
226- let $size1093010961 = size($list1093010961)
227- let $acc01093010961 = 0
228- if (($size1093010961 == 0))
229- then $acc01093010961
233+ let $list98869917 = [0, 1]
234+ let $size98869917 = size($list98869917)
235+ let $acc098869917 = 0
236+ if (($size98869917 == 0))
237+ then $acc098869917
230238 else {
231- let $acc11093010961 = hasMoreVotes($acc01093010961, $list1093010961[0])
232- if (($size1093010961 == 1))
233- then $acc11093010961
239+ let $acc198869917 = hasMoreVotes($acc098869917, $list98869917[0])
240+ if (($size98869917 == 1))
241+ then $acc198869917
234242 else {
235- let $acc21093010961 = hasMoreVotes($acc11093010961, $list1093010961[1])
236- if (($size1093010961 == 2))
237- then $acc21093010961
243+ let $acc298869917 = hasMoreVotes($acc198869917, $list98869917[1])
244+ if (($size98869917 == 2))
245+ then $acc298869917
238246 else {
239- let $acc31093010961 = hasMoreVotes($acc21093010961, $list1093010961[2])
247+ let $acc398869917 = hasMoreVotes($acc298869917, $list98869917[2])
240248 throw("List size exceed 2")
241249 }
242250 }
243251 }
244252 }
245253 let teamIdentifier = applicantsList[chosenTeamId]
246254 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
247255 }
248256 }
249257 }
250258
251259
252260
253261 @Callable(i)
254262 func startWork (taskId) = {
255263 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
256264 if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
257265 then throw("team leader only")
258266 else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
259267 }
260268
261269
262270
263271 @Callable(i)
264272 func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller)))
265273 then throw("grants working group access only")
266274 else {
267275 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
268276 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
269277 let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
270278 ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
271279 }
272280
273281

github/deemru/w8io/169f3d6 
103.93 ms