tx · DSY6u9fzYhsW7pugaff1B2U9wmu3u84YHd8FMcdaonUf

3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan:  -0.10000000 Waves

2020.12.21 13:54 [1318359] smart account 3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan > SELF 0.00000000 Waves

{ "type": 13, "id": "DSY6u9fzYhsW7pugaff1B2U9wmu3u84YHd8FMcdaonUf", "fee": 10000000, "feeAssetId": null, "timestamp": 1608548042246, "version": 2, "chainId": 84, "sender": "3N71MDc3kPD6cnbdWp6iEuDY8ghgZ9DiVan", "senderPublicKey": "5tBY17DiYVDP2QCBiAPKpjhmn1hCu1rS4XbwiY9zchFf", "proofs": [ "3wBvU7xBnsMiUKv1qxEm3YmNGDeqaAuUJdBfWWXiiJ9v7F8z6TeKgYPjwLSYqWvyJLFjmafx2idZ7NtiMD6pekos" ], "script": "base64:AAIDAAAAAAAAADwIARIECgIICBIECgIICBIECgIIARIDCgEIEgUKAwgICBIFCgMICAESAwoBCBIDCgEIEgMKAQgSBAoCCAgAAAAJAAAAAAZRVU9SVU0AAAAAAAAAAAEBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAAAAAAxtYWluQ29udHJhY3QJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM05Dc3FmNHBGR3RFQ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5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAdfcmVwb3J0BQAAAApyZXBvcnRMaW5rBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAt0ZWFtQWRkcmVzcwUAAAAMcmV3YXJkQW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAALRrHPg==", "height": 1318359, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8yvHDdeX2yvUsQ4zyoxQ9Yf9xpjrMgCBbBLy17RBQ5Fz Next: 8ynjQRFoVBWP1BLnwmJc6cXQuLz59TzgZDHGW6ApdXMA Diff:
OldNewDifferences
2525 }
2626
2727
28-func isOwner (address) = (address == this)
29-
28+let mainContract = addressFromStringValue("3NCsqf4pFGtECs3vM4j1nKqL6VA3HdiNGeZ")
3029
3130 func getGroup () = {
32- let val = match getString(this, "working_group_members") {
31+ let val = match getString(mainContract, "working_group_members") {
3332 case b: String =>
3433 b
3534 case _ =>
4039
4140
4241 func getMembers () = {
43- let val = match getString(this, "dao_members") {
42+ let val = match getString(mainContract, "dao_members") {
4443 case b: String =>
4544 b
4645 case _ =>
5049 }
5150
5251
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+ }
5461
5562
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+ }
5772
5873
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+ }
8783
8884
8985 @Callable(i)
9490
9591
9692 @Callable(i)
97-func addReward (taskId) = if (!(isGroupMember(i.caller)))
93+func addTaskDetails (taskId,detailsLink) = if (!(isGroupMember(i.caller)))
9894 then throw("grants working group access only")
9995 else {
10096 let reward = extract(i.payment).amount
101- WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
97+ WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_details"), detailsLink), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
10298 }
10399
104100
108104 then throw("you can't vote")
109105 else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
110106 then throw("voting is closed or not started")
111- else if (if ((voteValue != "like"))
112- then (voteValue != "dislike")
107+ else if (if ((voteValue != -1))
108+ then (voteValue != 1)
113109 else false)
114- then throw("you need to vote like or dislike")
110+ then throw("you need to vote 1 or -1")
115111 else {
116- func getValue (vote) = if ((vote == "like"))
117- then 1
118- else -1
119-
120112 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
121113 let previousVote = tryGetInteger(voteKey)
122114 if (!((previousVote == 0)))
126118 let votingState = tryGetInteger(votingKey)
127119 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
128120 let votesAmountState = (tryGetInteger(votingKey) + 1)
129- let newVotingState = (votingState + getValue(voteValue))
130- ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, getValue(voteValue)), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
121+ let newVotingState = (votingState + voteValue)
122+ ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
131123 }
132124 }
133125
134126
135127
136128 @Callable(i)
137-func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size"))))
129+func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
138130 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
139131 else if (!(isGroupMember(i.caller)))
140132 then throw("grants working group access only")
160152 if ((status != "ready_to_apply"))
161153 then throw("This grant has not yet been approved")
162154 else {
163- let applicantKey = drop(toString(i.caller), 20)
164- if ((tryGetString((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name")) == teamName))
165- then throw("commnad with name is exist")
166- else {
167- let listKey = (("tasks_" + taskId) + "_applicants")
168- let currentApplicantsList = tryGetString(listKey)
169- let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
170- 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)])
171- }
155+ let listKey = (("tasks_" + taskId) + "_applicants")
156+ let currentApplicantsList = tryGetString(listKey)
157+ let applicantKey = drop(toString(i.caller), 10)
158+ let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
159+ 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)])
172160 }
173161 }
174162
177165 @Callable(i)
178166 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
179167 then throw("you can't vote")
180- else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
181- then throw("voting is closed or not started")
182- else if ((tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id")) != teamIdentifier))
183- then throw("team is not found use id team on application")
184- else if (if ((voteValue != "like"))
185- then (voteValue != "dislike")
186- else false)
187- then throw("you need to vote like or dislike")
188- else {
189- func getValue (vote) = if ((vote == "like"))
190- then 1
191- else -1
192-
193- let listKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted")
194- let newApplicantsList = ((tryGetString(listKey) + ";") + toString(i.caller))
195- let voteHash = (drop(toString(i.caller), 20) + teamIdentifier)
196- let voteKey = ((("tasks_" + taskId) + "_vh_") + voteHash)
197- if ((tryGetString(voteKey) == toString(i.caller)))
198- then throw("you have already voted on this team")
199- else {
200- let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
201- let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
202- let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
203- let newTeamScore = (getValue(voteValue) + tryGetInteger(teamScoreKey))
204- WriteSet([DataEntry(listKey, newApplicantsList), DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)])
205- }
206- }
168+ else {
169+ let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
170+ let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
171+ let vote = tryGetInteger(voteKey)
172+ if ((vote != 0))
173+ then throw("you have already voted on this team")
174+ else {
175+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
176+ let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
177+ let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
178+ let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
179+ WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
180+ }
181+ }
207182
208183
209184
243218 then throw("No one has yet responded to the grant")
244219 else {
245220 let chosenTeamId = {
246- let $list1255112582 = [0, 1]
247- let $size1255112582 = size($list1255112582)
248- let $acc01255112582 = 0
249- if (($size1255112582 == 0))
250- then $acc01255112582
221+ let $list96709701 = [0, 1]
222+ let $size96709701 = size($list96709701)
223+ let $acc096709701 = 0
224+ if (($size96709701 == 0))
225+ then $acc096709701
251226 else {
252- let $acc11255112582 = hasMoreVotes($acc01255112582, $list1255112582[0])
253- if (($size1255112582 == 1))
254- then $acc11255112582
227+ let $acc196709701 = hasMoreVotes($acc096709701, $list96709701[0])
228+ if (($size96709701 == 1))
229+ then $acc196709701
255230 else {
256- let $acc21255112582 = hasMoreVotes($acc11255112582, $list1255112582[1])
257- if (($size1255112582 == 2))
258- then $acc21255112582
231+ let $acc296709701 = hasMoreVotes($acc196709701, $list96709701[1])
232+ if (($size96709701 == 2))
233+ then $acc296709701
259234 else {
260- let $acc31255112582 = hasMoreVotes($acc21255112582, $list1255112582[2])
235+ let $acc396709701 = hasMoreVotes($acc296709701, $list96709701[2])
261236 throw("List size exceed 2")
262237 }
263238 }
264239 }
265240 }
266- let teamIdentifier = drop(applicantsList[chosenTeamId], 20)
241+ let teamIdentifier = applicantsList[chosenTeamId]
267242 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
268243 }
269244 }
273248
274249 @Callable(i)
275250 func startWork (taskId) = {
276- let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
277- if ((tryGetString((("tasks_" + taskId) + "_status")) != "team_chosen"))
278- then throw("team is not choosen")
279- else if ((toString(i.caller) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
280- then throw("team leader only")
281- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
251+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
252+ if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
253+ then throw("team leader only")
254+ else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
282255 }
283256
284257
286259 @Callable(i)
287260 func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
288261 then throw("grants working group access only")
289- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
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+ }
290266
291267
292268
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let QUORUM = 1
55
66 func tryGetInteger (key) = {
77 let val = match getInteger(this, key) {
88 case b: Int =>
99 b
1010 case _ =>
1111 0
1212 }
1313 val
1414 }
1515
1616
1717 func tryGetString (key) = {
1818 let val = match getString(this, key) {
1919 case b: String =>
2020 b
2121 case _ =>
2222 ""
2323 }
2424 val
2525 }
2626
2727
28-func isOwner (address) = (address == this)
29-
28+let mainContract = addressFromStringValue("3NCsqf4pFGtECs3vM4j1nKqL6VA3HdiNGeZ")
3029
3130 func getGroup () = {
32- let val = match getString(this, "working_group_members") {
31+ let val = match getString(mainContract, "working_group_members") {
3332 case b: String =>
3433 b
3534 case _ =>
3635 ""
3736 }
3837 val
3938 }
4039
4140
4241 func getMembers () = {
43- let val = match getString(this, "dao_members") {
42+ let val = match getString(mainContract, "dao_members") {
4443 case b: String =>
4544 b
4645 case _ =>
4746 ""
4847 }
4948 val
5049 }
5150
5251
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+ }
5461
5562
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+ }
5772
5873
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+ }
8783
8884
8985 @Callable(i)
9086 func addTask (title,link) = if (!(isGroupMember(i.caller)))
9187 then throw("grants working group access only")
9288 else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
9389
9490
9591
9692 @Callable(i)
97-func addReward (taskId) = if (!(isGroupMember(i.caller)))
93+func addTaskDetails (taskId,detailsLink) = if (!(isGroupMember(i.caller)))
9894 then throw("grants working group access only")
9995 else {
10096 let reward = extract(i.payment).amount
101- WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
97+ WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_details"), detailsLink), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
10298 }
10399
104100
105101
106102 @Callable(i)
107103 func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i)))
108104 then throw("you can't vote")
109105 else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
110106 then throw("voting is closed or not started")
111- else if (if ((voteValue != "like"))
112- then (voteValue != "dislike")
107+ else if (if ((voteValue != -1))
108+ then (voteValue != 1)
113109 else false)
114- then throw("you need to vote like or dislike")
110+ then throw("you need to vote 1 or -1")
115111 else {
116- func getValue (vote) = if ((vote == "like"))
117- then 1
118- else -1
119-
120112 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
121113 let previousVote = tryGetInteger(voteKey)
122114 if (!((previousVote == 0)))
123115 then throw("you have already voted")
124116 else {
125117 let votingKey = (("tasks_" + taskId) + "_voting_state")
126118 let votingState = tryGetInteger(votingKey)
127119 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
128120 let votesAmountState = (tryGetInteger(votingKey) + 1)
129- let newVotingState = (votingState + getValue(voteValue))
130- ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, getValue(voteValue)), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
121+ let newVotingState = (votingState + voteValue)
122+ ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
131123 }
132124 }
133125
134126
135127
136128 @Callable(i)
137-func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size"))))
129+func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
138130 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
139131 else if (!(isGroupMember(i.caller)))
140132 then throw("grants working group access only")
141133 else {
142134 let votingKey = (("tasks_" + taskId) + "_voting_state")
143135 let votingState = tryGetInteger(votingKey)
144136 if ((votingState > 0))
145137 then {
146138 let votingResult = "ready_to_apply"
147139 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
148140 }
149141 else {
150142 let votingResult = "rejected"
151143 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
152144 }
153145 }
154146
155147
156148
157149 @Callable(i)
158150 func applyForTask (taskId,teamName,link) = {
159151 let status = tryGetString((("tasks_" + taskId) + "_status"))
160152 if ((status != "ready_to_apply"))
161153 then throw("This grant has not yet been approved")
162154 else {
163- let applicantKey = drop(toString(i.caller), 20)
164- if ((tryGetString((((("tasks_" + taskId) + "_app_") + applicantKey) + "_name")) == teamName))
165- then throw("commnad with name is exist")
166- else {
167- let listKey = (("tasks_" + taskId) + "_applicants")
168- let currentApplicantsList = tryGetString(listKey)
169- let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
170- 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)])
171- }
155+ let listKey = (("tasks_" + taskId) + "_applicants")
156+ let currentApplicantsList = tryGetString(listKey)
157+ let applicantKey = drop(toString(i.caller), 10)
158+ let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
159+ 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)])
172160 }
173161 }
174162
175163
176164
177165 @Callable(i)
178166 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
179167 then throw("you can't vote")
180- else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
181- then throw("voting is closed or not started")
182- else if ((tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id")) != teamIdentifier))
183- then throw("team is not found use id team on application")
184- else if (if ((voteValue != "like"))
185- then (voteValue != "dislike")
186- else false)
187- then throw("you need to vote like or dislike")
188- else {
189- func getValue (vote) = if ((vote == "like"))
190- then 1
191- else -1
192-
193- let listKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted")
194- let newApplicantsList = ((tryGetString(listKey) + ";") + toString(i.caller))
195- let voteHash = (drop(toString(i.caller), 20) + teamIdentifier)
196- let voteKey = ((("tasks_" + taskId) + "_vh_") + voteHash)
197- if ((tryGetString(voteKey) == toString(i.caller)))
198- then throw("you have already voted on this team")
199- else {
200- let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
201- let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
202- let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
203- let newTeamScore = (getValue(voteValue) + tryGetInteger(teamScoreKey))
204- WriteSet([DataEntry(listKey, newApplicantsList), DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)])
205- }
206- }
168+ else {
169+ let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
170+ let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
171+ let vote = tryGetInteger(voteKey)
172+ if ((vote != 0))
173+ then throw("you have already voted on this team")
174+ else {
175+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
176+ let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
177+ let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
178+ let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
179+ WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
180+ }
181+ }
207182
208183
209184
210185 @Callable(i)
211186 func finishApplicantsVoting (taskId) = {
212187 func isApplicantVotedEnough (aid,aid2) = {
213188 let listKey = (("tasks_" + taskId) + "_applicants")
214189 let applicantsList = split(getStringValue(this, listKey), ";")
215190 let teamIdentifier = applicantsList[aid]
216191 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
217192 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
218193 if ((teamVotesAmount > 0))
219194 then 1
220195 else throw(("not enough votes to make decision on " + teamIdentifier))
221196 }
222197
223198 func hasMoreVotes (aid,aid2) = {
224199 let listKey = (("tasks_" + taskId) + "_applicants")
225200 let applicantsList = split(getStringValue(this, listKey), ";")
226201 let teamIdentifier = applicantsList[aid]
227202 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
228203 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
229204 let team2Identifier = applicantsList[aid2]
230205 let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
231206 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
232207 if ((teamVotesAmount > team2VotesAmount))
233208 then aid
234209 else aid2
235210 }
236211
237212 if (!(isGroupMember(i.caller)))
238213 then throw("grants working group access only")
239214 else {
240215 let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
241216 let applicantsList = split(listKeys, ";")
242217 if ((size(applicantsList) == 0))
243218 then throw("No one has yet responded to the grant")
244219 else {
245220 let chosenTeamId = {
246- let $list1255112582 = [0, 1]
247- let $size1255112582 = size($list1255112582)
248- let $acc01255112582 = 0
249- if (($size1255112582 == 0))
250- then $acc01255112582
221+ let $list96709701 = [0, 1]
222+ let $size96709701 = size($list96709701)
223+ let $acc096709701 = 0
224+ if (($size96709701 == 0))
225+ then $acc096709701
251226 else {
252- let $acc11255112582 = hasMoreVotes($acc01255112582, $list1255112582[0])
253- if (($size1255112582 == 1))
254- then $acc11255112582
227+ let $acc196709701 = hasMoreVotes($acc096709701, $list96709701[0])
228+ if (($size96709701 == 1))
229+ then $acc196709701
255230 else {
256- let $acc21255112582 = hasMoreVotes($acc11255112582, $list1255112582[1])
257- if (($size1255112582 == 2))
258- then $acc21255112582
231+ let $acc296709701 = hasMoreVotes($acc196709701, $list96709701[1])
232+ if (($size96709701 == 2))
233+ then $acc296709701
259234 else {
260- let $acc31255112582 = hasMoreVotes($acc21255112582, $list1255112582[2])
235+ let $acc396709701 = hasMoreVotes($acc296709701, $list96709701[2])
261236 throw("List size exceed 2")
262237 }
263238 }
264239 }
265240 }
266- let teamIdentifier = drop(applicantsList[chosenTeamId], 20)
241+ let teamIdentifier = applicantsList[chosenTeamId]
267242 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
268243 }
269244 }
270245 }
271246
272247
273248
274249 @Callable(i)
275250 func startWork (taskId) = {
276- let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
277- if ((tryGetString((("tasks_" + taskId) + "_status")) != "team_chosen"))
278- then throw("team is not choosen")
279- else if ((toString(i.caller) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
280- then throw("team leader only")
281- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
251+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
252+ if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
253+ then throw("team leader only")
254+ else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
282255 }
283256
284257
285258
286259 @Callable(i)
287260 func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
288261 then throw("grants working group access only")
289- else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
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+ }
290266
291267
292268
293269 @Callable(i)
294270 func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
295271 then throw("grants working group access only")
296272 else {
297273 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
298274 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
299275 let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
300276 ScriptResult(WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_finished"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_report"), reportLink)]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
301277 }
302278
303279

github/deemru/w8io/169f3d6 
66.69 ms