tx · 5TpwqYSbWw3yrqV8taWPud8oKtC3j97perB4hoVJHTCt

3MvqnYLwBErxGtKzeEjgWgr2RXgniokicR2:  -0.01400000 Waves

2020.11.20 00:56 [1272805] smart account 3MvqnYLwBErxGtKzeEjgWgr2RXgniokicR2 > SELF 0.00000000 Waves

{ "type": 13, "id": "5TpwqYSbWw3yrqV8taWPud8oKtC3j97perB4hoVJHTCt", "fee": 1400000, "feeAssetId": null, "timestamp": 1605822996980, "version": 2, "chainId": 84, "sender": "3MvqnYLwBErxGtKzeEjgWgr2RXgniokicR2", "senderPublicKey": "3dxKqzB5AWentnFkyzLnbnRfN2iRWgE7Q4paMwfi9MoT", "proofs": [ "2XZNpnDCWiV4NTRZajyrNWJjPdoDhw14tgBimpnuUSfz6RsS9frDnTmEMQ7jm4ZXizphVsSueyLwiCo6ayApYhPC" ], "script": "base64:AAIDAAAAAAAAAEYIARIDCgEIEgMKAQgSBAoCCAgSBAoCCAgSBAoCCAESAwoBCBIFCgMICAgSBQoDCAgBEgMKAQgSAwoBCBIDCgEIEgQKAggIAAAACAAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAEAAAAHaXNPd25lcgAAAAEAAAAHYWRkcmVzcwkAAAAAAAACBQAAAAdhZGRyZXNzBQAAAAR0aGlzAQAAAAh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AABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAABV9hcHBfBQAAAA50ZWFtSWRlbnRpZmllcgIAAAAHX2xlYWRlcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3N0YXR1cwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAhfcHJvY2VzcwIAAAANd29ya19maW5pc2hlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAFX2FwcF8FAAAADnRlYW1JZGVudGlmaWVyAgAAAAdfcmVwb3J0BQAAAApyZXBvcnRMaW5rBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAt0ZWFtQWRkcmVzcwUAAAAMcmV3YXJkQW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAOdsfJg==", "height": 1272805, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 25pk9sPbXUGhnRhfTSbeWTuypf9KAQnPKdMi6HGtk2we Next: FFUiSeMjjF2chK26uaofxuRkrM1cjqgLbUCcFWmbkyzk Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let QUORUM = 50
5-
6-let WCTid = base58'4zfrrwDVjbGFM8wxbZGriVLY4XJsVD4oNMp21FnDnMAa'
4+let QUORUM = 1
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 }
4150 }
4251
4352
44-func isGroupMember (a) = (tryGetInteger(("group_member_weight_" + toString(a))) > 0)
53+func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
4554
4655
47-func canMemberVote (i) = (tryGetInteger(("dao_member_weight_" + toString(i.caller))) > 0)
56+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")
53- else {
54- let group = getMembers()
55- let newGroup = ((group + ";") + memberAddress)
56- let groupSize = tryGetInteger("dao_size")
57- let newGroupSize = (groupSize + 1)
58- WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry(("dao_member_weight_" + memberAddress), 1)])
59- }
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+ }
6071
6172
6273
6374 @Callable(i)
6475 func addGroupMember (memberAddress) = if (!(isOwner(i.caller)))
6576 then throw("access only to the DAO owner")
66- else {
67- let group = getGroup()
68- let newGroup = ((group + ";") + memberAddress)
69- let groupSize = tryGetInteger("working_group_size")
70- let newGroupSize = (groupSize + 1)
71- WriteSet([DataEntry("working_group", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry(("group_member_weight_" + memberAddress), 1)])
72- }
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+ }
7386
7487
7588
7689 @Callable(i)
77-func addTask (title) = if (!(isGroupMember(i.caller)))
90+func addTask (title,link) = if (!(isGroupMember(i.caller)))
7891 then throw("grants working group access only")
79- else WriteSet([DataEntry((toBase58String(i.transactionId) + "_task"), title)])
92+ else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
8093
8194
8295
8396 @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((taskId + "_community_rate"))
96- ScriptResult(WriteSet([DataEntry((taskId + "_community_rate"), (previousRate + vote))]), TransferSet([ScriptTransfer(i.caller, pmt.amount, pmt.assetId)]))
97- }
98- }
99-
100-
101-
102-@Callable(i)
103-func addTaskDetails (taskId) = if (!(isGroupMember(i.caller)))
97+func addTaskDetails (taskId,detailsLink) = if (!(isGroupMember(i.caller)))
10498 then throw("grants working group access only")
10599 else {
106100 let reward = extract(i.payment).amount
107- WriteSet([DataEntry((taskId + "_reward"), reward), DataEntry((taskId + "_status"), "proposed")])
101+ WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_details"), detailsLink), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
108102 }
109103
110104
112106 @Callable(i)
113107 func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i)))
114108 then throw("you can't vote")
115- else if ((getStringValue(this, (taskId + "_status")) != "proposed"))
109+ else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
116110 then throw("voting is closed or not started")
117111 else if (if ((voteValue != -1))
118112 then (voteValue != 1)
119113 else false)
120114 then throw("you need to vote 1 or -1")
121115 else {
122- let voteKey = (((taskId + "_") + toString(i.caller)) + "_vote1")
116+ let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
123117 let previousVote = tryGetInteger(voteKey)
124118 if (!((previousVote == 0)))
125119 then throw("you have already voted")
126120 else {
127- let votingKey = (taskId + "_voting1")
121+ let votingKey = (("tasks_" + taskId) + "_voting_state")
128122 let votingState = tryGetInteger(votingKey)
129- let votesAmountKey = (taskId + "_voting1_amount")
123+ let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
130124 let votesAmountState = (tryGetInteger(votingKey) + 1)
131125 let newVotingState = (votingState + voteValue)
132126 ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
136130
137131
138132 @Callable(i)
139-func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((taskId + "_voting1_amount")) * 100) / tryGetInteger("dao_size"))))
133+func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size"))))
140134 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
141135 else if (!(isGroupMember(i.caller)))
142136 then throw("grants working group access only")
143137 else {
144- let votingKey = (taskId + "_voting1")
138+ let votingKey = (("tasks_" + taskId) + "_voting_state")
145139 let votingState = tryGetInteger(votingKey)
146140 if ((votingState > 0))
147141 then {
148142 let votingResult = "ready_to_apply"
149- WriteSet([DataEntry((taskId + "_status"), votingResult)])
143+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
150144 }
151145 else {
152146 let votingResult = "rejected"
153- WriteSet([DataEntry((taskId + "_status"), votingResult)])
147+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
154148 }
155149 }
156150
157151
158152
159153 @Callable(i)
160-func applyForTask (taskId,teamName) = {
161- let listKey = (taskId + "_applicants")
162- let currentApplicantsList = match getString(this, listKey) {
163- case b: String =>
164- b
165- case _ =>
166- ""
167- }
168- let newApplicantsList = ((currentApplicantsList + ";") + teamName)
169- WriteSet([DataEntry((((taskId + "_applicant_") + teamName) + "_leader"), toString(i.caller)), DataEntry(listKey, newApplicantsList)])
154+func applyForTask (taskId,teamName,link) = {
155+ let status = tryGetString((("tasks_" + taskId) + "_status"))
156+ if ((status != "ready_to_apply"))
157+ then throw("This grant has not yet been approved")
158+ else {
159+ let listKey = (("tasks_" + taskId) + "_applicants")
160+ let currentApplicantsList = tryGetString(listKey)
161+ let applicantKey = drop(toString(i.caller), 10)
162+ let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
163+ 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)])
164+ }
170165 }
171166
172167
173168
174169 @Callable(i)
175-func voteForApplicant (taskId,teamName,voteValue) = if (!(canMemberVote(i)))
170+func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
176171 then throw("you can't vote")
177172 else {
178- let voteKey = ((((taskId + "_") + toString(i.caller)) + "_vote_") + teamName)
173+ let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
174+ let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
179175 let vote = tryGetInteger(voteKey)
180176 if ((vote != 0))
181177 then throw("you have already voted on this team")
182178 else {
183- let teamVotesAmountKey = (((taskId + "_applicant_") + teamName) + "_votes")
184- let teamScoreKey = (((taskId + "_applicant_") + teamName) + "_score")
179+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
180+ let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
185181 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
186182 let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
187183 WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
193189 @Callable(i)
194190 func finishApplicantsVoting (taskId) = {
195191 func isApplicantVotedEnough (aid,aid2) = {
196- let listKey = (taskId + "_applicants")
192+ let listKey = (("tasks_" + taskId) + "_applicants")
197193 let applicantsList = split(getStringValue(this, listKey), ";")
198- let teamName = applicantsList[aid]
199- let teamVotesAmountKey = (((taskId + "_applicant_") + teamName) + "_votes")
194+ let teamIdentifier = applicantsList[aid]
195+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
200196 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
201197 if ((teamVotesAmount > 0))
202198 then 1
203- else throw(("not enough votes to make decision on " + teamName))
199+ else throw(("not enough votes to make decision on " + teamIdentifier))
204200 }
205201
206202 func hasMoreVotes (aid,aid2) = {
207- let listKey = (taskId + "_applicants")
203+ let listKey = (("tasks_" + taskId) + "_applicants")
208204 let applicantsList = split(getStringValue(this, listKey), ";")
209- let teamName = applicantsList[aid]
210- let teamVotesAmountKey = (((taskId + "_applicant_") + teamName) + "_votes")
205+ let teamIdentifier = applicantsList[aid]
206+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
211207 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
212- let team2Name = applicantsList[aid2]
213- let team2VotesAmountKey = (((taskId + "_applicant_") + team2Name) + "_votes")
208+ let team2Identifier = applicantsList[aid2]
209+ let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
214210 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
215211 if ((teamVotesAmount > team2VotesAmount))
216212 then aid
220216 if (!(isGroupMember(i.caller)))
221217 then throw("grants working group access only")
222218 else {
223- let chosenTeamId = {
224- let $list85228553 = [0, 1]
225- let $size85228553 = size($list85228553)
226- let $acc085228553 = 0
227- if (($size85228553 == 0))
228- then $acc085228553
229- else {
230- let $acc185228553 = hasMoreVotes($acc085228553, $list85228553[0])
231- if (($size85228553 == 1))
232- then $acc185228553
219+ let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
220+ let applicantsList = split(listKeys, ";")
221+ if ((size(applicantsList) == 0))
222+ then throw("No one has yet responded to the grant")
223+ else {
224+ let chosenTeamId = {
225+ let $list1113111162 = [0, 1]
226+ let $size1113111162 = size($list1113111162)
227+ let $acc01113111162 = 0
228+ if (($size1113111162 == 0))
229+ then $acc01113111162
233230 else {
234- let $acc285228553 = hasMoreVotes($acc185228553, $list85228553[1])
235- if (($size85228553 == 2))
236- then $acc285228553
231+ let $acc11113111162 = hasMoreVotes($acc01113111162, $list1113111162[0])
232+ if (($size1113111162 == 1))
233+ then $acc11113111162
237234 else {
238- let $acc385228553 = hasMoreVotes($acc285228553, $list85228553[2])
239- throw("List size exceed 2")
235+ let $acc21113111162 = hasMoreVotes($acc11113111162, $list1113111162[1])
236+ if (($size1113111162 == 2))
237+ then $acc21113111162
238+ else {
239+ let $acc31113111162 = hasMoreVotes($acc21113111162, $list1113111162[2])
240+ throw("List size exceed 2")
241+ }
240242 }
241243 }
242244 }
243- }
244- let listKey = (taskId + "_applicants")
245- let applicantsList = split(getStringValue(this, listKey), ";")
246- let teamName = applicantsList[chosenTeamId]
247- WriteSet([DataEntry((taskId + "_status"), "team_chosen"), DataEntry((taskId + "_performer"), teamName), DataEntry((((taskId + "_applicant_") + teamName) + "_work_process"), "can_begin")])
245+ let teamIdentifier = applicantsList[chosenTeamId]
246+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
247+ }
248248 }
249249 }
250250
252252
253253 @Callable(i)
254254 func startWork (taskId) = {
255- let teamName = getStringValue(this, (taskId + "_performer"))
256- if ((toString(i.caller) != getStringValue(this, (((taskId + "_applicant_") + teamName) + "_leader"))))
255+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
256+ if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
257257 then throw("team leader only")
258- else WriteSet([DataEntry((taskId + "_status"), "work_started"), DataEntry((((taskId + "_applicant_") + teamName) + "_work_process"), "work_started")])
258+ else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
259259 }
260260
261261
262262
263263 @Callable(i)
264-func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller)))
264+func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
265265 then throw("grants working group access only")
266266 else {
267- let rewardAmount = tryGetInteger((taskId + "_reward"))
268- let teamName = getStringValue(this, (taskId + "_performer"))
269- let teamAddress = getStringValue(this, (((taskId + "_applicant_") + teamName) + "_leader"))
270- ScriptResult(WriteSet([DataEntry((taskId + "_status"), "work_finished"), DataEntry((((taskId + "_applicant_") + teamName) + "_work_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
267+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
268+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "rejected")])
269+ }
270+
271+
272+
273+@Callable(i)
274+func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
275+ then throw("grants working group access only")
276+ else {
277+ let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
278+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
279+ let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
280+ 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)]))
271281 }
272282
273283
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let QUORUM = 50
5-
6-let WCTid = base58'4zfrrwDVjbGFM8wxbZGriVLY4XJsVD4oNMp21FnDnMAa'
4+let QUORUM = 1
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
44-func isGroupMember (a) = (tryGetInteger(("group_member_weight_" + toString(a))) > 0)
53+func isGroupMember (a) = (tryGetInteger((("working_group_member_" + toString(a)) + "_weight")) > 0)
4554
4655
47-func canMemberVote (i) = (tryGetInteger(("dao_member_weight_" + toString(i.caller))) > 0)
56+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")
53- else {
54- let group = getMembers()
55- let newGroup = ((group + ";") + memberAddress)
56- let groupSize = tryGetInteger("dao_size")
57- let newGroupSize = (groupSize + 1)
58- WriteSet([DataEntry("dao_members", newGroup), DataEntry("dao_size", newGroupSize), DataEntry(("dao_member_weight_" + memberAddress), 1)])
59- }
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+ }
6071
6172
6273
6374 @Callable(i)
6475 func addGroupMember (memberAddress) = if (!(isOwner(i.caller)))
6576 then throw("access only to the DAO owner")
66- else {
67- let group = getGroup()
68- let newGroup = ((group + ";") + memberAddress)
69- let groupSize = tryGetInteger("working_group_size")
70- let newGroupSize = (groupSize + 1)
71- WriteSet([DataEntry("working_group", newGroup), DataEntry("working_group_size", newGroupSize), DataEntry(("group_member_weight_" + memberAddress), 1)])
72- }
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+ }
7386
7487
7588
7689 @Callable(i)
77-func addTask (title) = if (!(isGroupMember(i.caller)))
90+func addTask (title,link) = if (!(isGroupMember(i.caller)))
7891 then throw("grants working group access only")
79- else WriteSet([DataEntry((toBase58String(i.transactionId) + "_task"), title)])
92+ else WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
8093
8194
8295
8396 @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((taskId + "_community_rate"))
96- ScriptResult(WriteSet([DataEntry((taskId + "_community_rate"), (previousRate + vote))]), TransferSet([ScriptTransfer(i.caller, pmt.amount, pmt.assetId)]))
97- }
98- }
99-
100-
101-
102-@Callable(i)
103-func addTaskDetails (taskId) = if (!(isGroupMember(i.caller)))
97+func addTaskDetails (taskId,detailsLink) = if (!(isGroupMember(i.caller)))
10498 then throw("grants working group access only")
10599 else {
106100 let reward = extract(i.payment).amount
107- WriteSet([DataEntry((taskId + "_reward"), reward), DataEntry((taskId + "_status"), "proposed")])
101+ WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_details"), detailsLink), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
108102 }
109103
110104
111105
112106 @Callable(i)
113107 func voteForTaskProposal (taskId,voteValue) = if (!(canMemberVote(i)))
114108 then throw("you can't vote")
115- else if ((getStringValue(this, (taskId + "_status")) != "proposed"))
109+ else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
116110 then throw("voting is closed or not started")
117111 else if (if ((voteValue != -1))
118112 then (voteValue != 1)
119113 else false)
120114 then throw("you need to vote 1 or -1")
121115 else {
122- let voteKey = (((taskId + "_") + toString(i.caller)) + "_vote1")
116+ let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
123117 let previousVote = tryGetInteger(voteKey)
124118 if (!((previousVote == 0)))
125119 then throw("you have already voted")
126120 else {
127- let votingKey = (taskId + "_voting1")
121+ let votingKey = (("tasks_" + taskId) + "_voting_state")
128122 let votingState = tryGetInteger(votingKey)
129- let votesAmountKey = (taskId + "_voting1_amount")
123+ let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
130124 let votesAmountState = (tryGetInteger(votingKey) + 1)
131125 let newVotingState = (votingState + voteValue)
132126 ScriptResult(WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValue), DataEntry(votesAmountKey, votesAmountState)]), TransferSet([ScriptTransfer(i.caller, 500000, unit)]))
133127 }
134128 }
135129
136130
137131
138132 @Callable(i)
139-func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((taskId + "_voting1_amount")) * 100) / tryGetInteger("dao_size"))))
133+func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / tryGetInteger("dao_size"))))
140134 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
141135 else if (!(isGroupMember(i.caller)))
142136 then throw("grants working group access only")
143137 else {
144- let votingKey = (taskId + "_voting1")
138+ let votingKey = (("tasks_" + taskId) + "_voting_state")
145139 let votingState = tryGetInteger(votingKey)
146140 if ((votingState > 0))
147141 then {
148142 let votingResult = "ready_to_apply"
149- WriteSet([DataEntry((taskId + "_status"), votingResult)])
143+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
150144 }
151145 else {
152146 let votingResult = "rejected"
153- WriteSet([DataEntry((taskId + "_status"), votingResult)])
147+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
154148 }
155149 }
156150
157151
158152
159153 @Callable(i)
160-func applyForTask (taskId,teamName) = {
161- let listKey = (taskId + "_applicants")
162- let currentApplicantsList = match getString(this, listKey) {
163- case b: String =>
164- b
165- case _ =>
166- ""
167- }
168- let newApplicantsList = ((currentApplicantsList + ";") + teamName)
169- WriteSet([DataEntry((((taskId + "_applicant_") + teamName) + "_leader"), toString(i.caller)), DataEntry(listKey, newApplicantsList)])
154+func applyForTask (taskId,teamName,link) = {
155+ let status = tryGetString((("tasks_" + taskId) + "_status"))
156+ if ((status != "ready_to_apply"))
157+ then throw("This grant has not yet been approved")
158+ else {
159+ let listKey = (("tasks_" + taskId) + "_applicants")
160+ let currentApplicantsList = tryGetString(listKey)
161+ let applicantKey = drop(toString(i.caller), 10)
162+ let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
163+ 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)])
164+ }
170165 }
171166
172167
173168
174169 @Callable(i)
175-func voteForApplicant (taskId,teamName,voteValue) = if (!(canMemberVote(i)))
170+func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i)))
176171 then throw("you can't vote")
177172 else {
178- let voteKey = ((((taskId + "_") + toString(i.caller)) + "_vote_") + teamName)
173+ let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
174+ let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
179175 let vote = tryGetInteger(voteKey)
180176 if ((vote != 0))
181177 then throw("you have already voted on this team")
182178 else {
183- let teamVotesAmountKey = (((taskId + "_applicant_") + teamName) + "_votes")
184- let teamScoreKey = (((taskId + "_applicant_") + teamName) + "_score")
179+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
180+ let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
185181 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
186182 let newTeamScore = (voteValue + tryGetInteger(teamScoreKey))
187183 WriteSet([DataEntry(voteKey, voteValue), DataEntry(teamScoreKey, newTeamScore)])
188184 }
189185 }
190186
191187
192188
193189 @Callable(i)
194190 func finishApplicantsVoting (taskId) = {
195191 func isApplicantVotedEnough (aid,aid2) = {
196- let listKey = (taskId + "_applicants")
192+ let listKey = (("tasks_" + taskId) + "_applicants")
197193 let applicantsList = split(getStringValue(this, listKey), ";")
198- let teamName = applicantsList[aid]
199- let teamVotesAmountKey = (((taskId + "_applicant_") + teamName) + "_votes")
194+ let teamIdentifier = applicantsList[aid]
195+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
200196 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
201197 if ((teamVotesAmount > 0))
202198 then 1
203- else throw(("not enough votes to make decision on " + teamName))
199+ else throw(("not enough votes to make decision on " + teamIdentifier))
204200 }
205201
206202 func hasMoreVotes (aid,aid2) = {
207- let listKey = (taskId + "_applicants")
203+ let listKey = (("tasks_" + taskId) + "_applicants")
208204 let applicantsList = split(getStringValue(this, listKey), ";")
209- let teamName = applicantsList[aid]
210- let teamVotesAmountKey = (((taskId + "_applicant_") + teamName) + "_votes")
205+ let teamIdentifier = applicantsList[aid]
206+ let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
211207 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
212- let team2Name = applicantsList[aid2]
213- let team2VotesAmountKey = (((taskId + "_applicant_") + team2Name) + "_votes")
208+ let team2Identifier = applicantsList[aid2]
209+ let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
214210 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
215211 if ((teamVotesAmount > team2VotesAmount))
216212 then aid
217213 else aid2
218214 }
219215
220216 if (!(isGroupMember(i.caller)))
221217 then throw("grants working group access only")
222218 else {
223- let chosenTeamId = {
224- let $list85228553 = [0, 1]
225- let $size85228553 = size($list85228553)
226- let $acc085228553 = 0
227- if (($size85228553 == 0))
228- then $acc085228553
229- else {
230- let $acc185228553 = hasMoreVotes($acc085228553, $list85228553[0])
231- if (($size85228553 == 1))
232- then $acc185228553
219+ let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
220+ let applicantsList = split(listKeys, ";")
221+ if ((size(applicantsList) == 0))
222+ then throw("No one has yet responded to the grant")
223+ else {
224+ let chosenTeamId = {
225+ let $list1113111162 = [0, 1]
226+ let $size1113111162 = size($list1113111162)
227+ let $acc01113111162 = 0
228+ if (($size1113111162 == 0))
229+ then $acc01113111162
233230 else {
234- let $acc285228553 = hasMoreVotes($acc185228553, $list85228553[1])
235- if (($size85228553 == 2))
236- then $acc285228553
231+ let $acc11113111162 = hasMoreVotes($acc01113111162, $list1113111162[0])
232+ if (($size1113111162 == 1))
233+ then $acc11113111162
237234 else {
238- let $acc385228553 = hasMoreVotes($acc285228553, $list85228553[2])
239- throw("List size exceed 2")
235+ let $acc21113111162 = hasMoreVotes($acc11113111162, $list1113111162[1])
236+ if (($size1113111162 == 2))
237+ then $acc21113111162
238+ else {
239+ let $acc31113111162 = hasMoreVotes($acc21113111162, $list1113111162[2])
240+ throw("List size exceed 2")
241+ }
240242 }
241243 }
242244 }
243- }
244- let listKey = (taskId + "_applicants")
245- let applicantsList = split(getStringValue(this, listKey), ";")
246- let teamName = applicantsList[chosenTeamId]
247- WriteSet([DataEntry((taskId + "_status"), "team_chosen"), DataEntry((taskId + "_performer"), teamName), DataEntry((((taskId + "_applicant_") + teamName) + "_work_process"), "can_begin")])
245+ let teamIdentifier = applicantsList[chosenTeamId]
246+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
247+ }
248248 }
249249 }
250250
251251
252252
253253 @Callable(i)
254254 func startWork (taskId) = {
255- let teamName = getStringValue(this, (taskId + "_performer"))
256- if ((toString(i.caller) != getStringValue(this, (((taskId + "_applicant_") + teamName) + "_leader"))))
255+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
256+ if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
257257 then throw("team leader only")
258- else WriteSet([DataEntry((taskId + "_status"), "work_started"), DataEntry((((taskId + "_applicant_") + teamName) + "_work_process"), "work_started")])
258+ else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
259259 }
260260
261261
262262
263263 @Callable(i)
264-func acceptWorkResult (taskId) = if (!(isGroupMember(i.caller)))
264+func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
265265 then throw("grants working group access only")
266266 else {
267- let rewardAmount = tryGetInteger((taskId + "_reward"))
268- let teamName = getStringValue(this, (taskId + "_performer"))
269- let teamAddress = getStringValue(this, (((taskId + "_applicant_") + teamName) + "_leader"))
270- ScriptResult(WriteSet([DataEntry((taskId + "_status"), "work_finished"), DataEntry((((taskId + "_applicant_") + teamName) + "_work_process"), "work_finished")]), TransferSet([ScriptTransfer(addressFromStringValue(teamAddress), rewardAmount, unit)]))
267+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
268+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "rejected")])
269+ }
270+
271+
272+
273+@Callable(i)
274+func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
275+ then throw("grants working group access only")
276+ else {
277+ let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
278+ let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
279+ let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
280+ 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)]))
271281 }
272282
273283

github/deemru/w8io/026f985 
59.39 ms