tx · 6GFQRCNVFcpDhrPJzHMeqirYZba3m4Ht7LoR3N3A4ted

3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA:  -0.10000000 Waves

2020.12.25 15:28 [1324219] smart account 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA > SELF 0.00000000 Waves

{ "type": 13, "id": "6GFQRCNVFcpDhrPJzHMeqirYZba3m4Ht7LoR3N3A4ted", "fee": 10000000, "feeAssetId": null, "timestamp": 1608899309548, "version": 2, "chainId": 84, "sender": "3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA", "senderPublicKey": "4xMxUnfdbHYsent96ThiYC63gXHiahi6bh3urdHHntHi", "proofs": [ "KGMa92LsnRrzW9vQ6AvGQ25R33D1pK24sPSwQWjA25jP2ER5nVD6N2CkWbyoLrKxG5dUpdQJgbVn3ExFD2nrSNd" ], "script": "base64:AAIDAAAAAAAAADsIARIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIEgUKAwgICBIDCgEIEgMKAQgSBAoCCAgSAwoBCAAAAA8AAAAADG1haW5Db250cmFjdAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXdSemkyQm1xWlpYV3JDR0N3Y1JRTHNuaWMyQW9kNnpoUwAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiB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KUt6mQ=", "height": 1324219, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4t81rRMPYwLV9VJqLnhf49nAEbfrMp5Kcu2ma9FUUWN1 Next: DZ8ac63CPQubpKUPPn2XZ4WShH2bb3VB4tzRkgbJAtS7 Diff:
OldNewDifferences
106106
107107 func voteForTaskProposalConditions (address,taskId) = if (!(canMemberVote(address)))
108108 then throw("you can't vote")
109- else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
109+ else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed"))
110110 then throw("voting is closed or not started")
111111 else if ((tryGetInteger(((("tasks_" + taskId) + "_voted_") + toString(address))) != 0))
112112 then throw("you have already voted")
113+ else true
114+
115+
116+func finishTaskProposalVotingConditions (address,taskId) = if (!(isGroupMember(address)))
117+ then throw("grants working group access only")
118+ else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed"))
119+ then throw("voting is not active")
120+ else if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
121+ then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
113122 else true
114123
115124
147156
148157
149158 @Callable(i)
150-func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
151- then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
152- else if (!(isGroupMember(i.caller)))
153- then throw("grants working group access only")
154- else {
155- let votingKey = (("tasks_" + taskId) + "_voting_state")
156- let votingState = tryGetInteger(votingKey)
157- if ((votingState > 0))
158- then {
159- let votingResult = "ready_to_apply"
160- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
161- }
162- else {
163- let votingResult = "rejected"
164- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
165- }
166- }
159+func finishTaskProposalVoting (taskId) = if (finishTaskProposalVotingConditions(i.caller, taskId))
160+ then {
161+ let votingKey = (("tasks_" + taskId) + "_voting_state")
162+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), if ((tryGetInteger(votingKey) > 0))
163+ then "ready_to_apply"
164+ else "rejected")])
165+ }
166+ else throw("checks are not passed")
167167
168168
169169
240240 then throw("No one has yet responded to the grant")
241241 else {
242242 let chosenTeamId = {
243- let $list1009110122 = [0, 1]
244- let $size1009110122 = size($list1009110122)
245- let $acc01009110122 = 0
246- if (($size1009110122 == 0))
247- then $acc01009110122
243+ let $list1021210243 = [0, 1]
244+ let $size1021210243 = size($list1021210243)
245+ let $acc01021210243 = 0
246+ if (($size1021210243 == 0))
247+ then $acc01021210243
248248 else {
249- let $acc11009110122 = hasMoreVotes($acc01009110122, $list1009110122[0])
250- if (($size1009110122 == 1))
251- then $acc11009110122
249+ let $acc11021210243 = hasMoreVotes($acc01021210243, $list1021210243[0])
250+ if (($size1021210243 == 1))
251+ then $acc11021210243
252252 else {
253- let $acc21009110122 = hasMoreVotes($acc11009110122, $list1009110122[1])
254- if (($size1009110122 == 2))
255- then $acc21009110122
253+ let $acc21021210243 = hasMoreVotes($acc11021210243, $list1021210243[1])
254+ if (($size1021210243 == 2))
255+ then $acc21021210243
256256 else {
257- let $acc31009110122 = hasMoreVotes($acc21009110122, $list1009110122[2])
257+ let $acc31021210243 = hasMoreVotes($acc21021210243, $list1021210243[2])
258258 throw("List size exceed 2")
259259 }
260260 }
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
7777 func canMemberVote (address) = {
7878 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
9595 func addTaskConditions (address) = if (!(isGroupMember(address)))
9696 then throw("grants working group access only")
9797 else true
9898
9999
100100 func addRewardConditions (address,taskId) = if (!(isGroupMember(address)))
101101 then throw("grants working group access only")
102102 else if ((tryGetString((("tasks_" + taskId) + "_status")) != ""))
103103 then throw("grant isn`t new")
104104 else true
105105
106106
107107 func voteForTaskProposalConditions (address,taskId) = if (!(canMemberVote(address)))
108108 then throw("you can't vote")
109- else if ((getStringValue(this, (("tasks_" + taskId) + "_status")) != "proposed"))
109+ else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed"))
110110 then throw("voting is closed or not started")
111111 else if ((tryGetInteger(((("tasks_" + taskId) + "_voted_") + toString(address))) != 0))
112112 then throw("you have already voted")
113+ else true
114+
115+
116+func finishTaskProposalVotingConditions (address,taskId) = if (!(isGroupMember(address)))
117+ then throw("grants working group access only")
118+ else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed"))
119+ then throw("voting is not active")
120+ else if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
121+ then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
113122 else true
114123
115124
116125 @Callable(i)
117126 func addTask (title,link) = if (addTaskConditions(i.caller))
118127 then WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
119128 else throw("checks are not passed")
120129
121130
122131
123132 @Callable(i)
124133 func addReward (taskId) = if (addRewardConditions(i.caller, taskId))
125134 then {
126135 let reward = extract(i.payment).amount
127136 WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
128137 }
129138 else throw("checks are not passed")
130139
131140
132141
133142 @Callable(i)
134143 func voteForTaskProposal (taskId,voteValue) = if (voteForTaskProposalConditions(i.caller, taskId))
135144 then {
136145 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
137146 let votingKey = (("tasks_" + taskId) + "_voting_state")
138147 let votingState = tryGetInteger(votingKey)
139148 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
140149 let votesAmountState = (tryGetInteger(votingKey) + 1)
141150 let voteValueInt = getVoteValue(voteValue)
142151 let newVotingState = (votingState + voteValueInt)
143152 WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValueInt), DataEntry(votesAmountKey, votesAmountState)])
144153 }
145154 else throw("checks are not passed")
146155
147156
148157
149158 @Callable(i)
150-func finishTaskProposalVoting (taskId) = if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
151- then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
152- else if (!(isGroupMember(i.caller)))
153- then throw("grants working group access only")
154- else {
155- let votingKey = (("tasks_" + taskId) + "_voting_state")
156- let votingState = tryGetInteger(votingKey)
157- if ((votingState > 0))
158- then {
159- let votingResult = "ready_to_apply"
160- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
161- }
162- else {
163- let votingResult = "rejected"
164- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), votingResult)])
165- }
166- }
159+func finishTaskProposalVoting (taskId) = if (finishTaskProposalVotingConditions(i.caller, taskId))
160+ then {
161+ let votingKey = (("tasks_" + taskId) + "_voting_state")
162+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), if ((tryGetInteger(votingKey) > 0))
163+ then "ready_to_apply"
164+ else "rejected")])
165+ }
166+ else throw("checks are not passed")
167167
168168
169169
170170 @Callable(i)
171171 func applyForTask (taskId,teamName,link) = {
172172 let status = tryGetString((("tasks_" + taskId) + "_status"))
173173 if ((status != "ready_to_apply"))
174174 then throw("This grant has not yet been approved")
175175 else {
176176 let listKey = (("tasks_" + taskId) + "_applicants")
177177 let currentApplicantsList = tryGetString(listKey)
178178 let applicantKey = drop(toString(i.caller), 10)
179179 let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
180180 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)])
181181 }
182182 }
183183
184184
185185
186186 @Callable(i)
187187 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (!(canMemberVote(i.caller)))
188188 then throw("you can't vote")
189189 else {
190190 let voteHash = (drop(toString(i.caller), 10) + drop(teamIdentifier, 10))
191191 let voteKey = ((("tasks_" + taskId) + "_vote_") + voteHash)
192192 let vote = tryGetInteger(voteKey)
193193 if ((vote != 0))
194194 then throw("you have already voted on this team")
195195 else {
196196 let valueVoteInt = getVoteValue(voteValue)
197197 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
198198 let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
199199 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
200200 let newTeamScore = (valueVoteInt + tryGetInteger(teamScoreKey))
201201 WriteSet([DataEntry(voteKey, valueVoteInt), DataEntry(teamScoreKey, newTeamScore)])
202202 }
203203 }
204204
205205
206206
207207 @Callable(i)
208208 func finishApplicantsVoting (taskId) = {
209209 func isApplicantVotedEnough (aid,aid2) = {
210210 let listKey = (("tasks_" + taskId) + "_applicants")
211211 let applicantsList = split(getStringValue(this, listKey), ";")
212212 let teamIdentifier = applicantsList[aid]
213213 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
214214 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
215215 if ((teamVotesAmount > 0))
216216 then 1
217217 else throw(("not enough votes to make decision on " + teamIdentifier))
218218 }
219219
220220 func hasMoreVotes (aid,aid2) = {
221221 let listKey = (("tasks_" + taskId) + "_applicants")
222222 let applicantsList = split(getStringValue(this, listKey), ";")
223223 let teamIdentifier = applicantsList[aid]
224224 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
225225 let teamVotesAmount = tryGetInteger(teamVotesAmountKey)
226226 let team2Identifier = applicantsList[aid2]
227227 let team2VotesAmountKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_votes")
228228 let team2VotesAmount = tryGetInteger(team2VotesAmountKey)
229229 if ((teamVotesAmount > team2VotesAmount))
230230 then aid
231231 else aid2
232232 }
233233
234234 if (!(isGroupMember(i.caller)))
235235 then throw("grants working group access only")
236236 else {
237237 let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
238238 let applicantsList = split(listKeys, ";")
239239 if ((size(applicantsList) == 0))
240240 then throw("No one has yet responded to the grant")
241241 else {
242242 let chosenTeamId = {
243- let $list1009110122 = [0, 1]
244- let $size1009110122 = size($list1009110122)
245- let $acc01009110122 = 0
246- if (($size1009110122 == 0))
247- then $acc01009110122
243+ let $list1021210243 = [0, 1]
244+ let $size1021210243 = size($list1021210243)
245+ let $acc01021210243 = 0
246+ if (($size1021210243 == 0))
247+ then $acc01021210243
248248 else {
249- let $acc11009110122 = hasMoreVotes($acc01009110122, $list1009110122[0])
250- if (($size1009110122 == 1))
251- then $acc11009110122
249+ let $acc11021210243 = hasMoreVotes($acc01021210243, $list1021210243[0])
250+ if (($size1021210243 == 1))
251+ then $acc11021210243
252252 else {
253- let $acc21009110122 = hasMoreVotes($acc11009110122, $list1009110122[1])
254- if (($size1009110122 == 2))
255- then $acc21009110122
253+ let $acc21021210243 = hasMoreVotes($acc11021210243, $list1021210243[1])
254+ if (($size1021210243 == 2))
255+ then $acc21021210243
256256 else {
257- let $acc31009110122 = hasMoreVotes($acc21009110122, $list1009110122[2])
257+ let $acc31021210243 = hasMoreVotes($acc21021210243, $list1021210243[2])
258258 throw("List size exceed 2")
259259 }
260260 }
261261 }
262262 }
263263 let teamIdentifier = applicantsList[chosenTeamId]
264264 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
265265 }
266266 }
267267 }
268268
269269
270270
271271 @Callable(i)
272272 func startWork (taskId) = {
273273 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
274274 if ((toString(i.caller) != getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
275275 then throw("team leader only")
276276 else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
277277 }
278278
279279
280280
281281 @Callable(i)
282282 func acceptWorkResult (taskId,reportLink) = if (!(isGroupMember(i.caller)))
283283 then throw("grants working group access only")
284284 else {
285285 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
286286 let teamIdentifier = getStringValue(this, (("tasks_" + taskId) + "_performer"))
287287 let teamAddress = getStringValue(this, (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
288288 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)]))
289289 }
290290
291291
292292
293293 @Callable(i)
294294 func rejectTask (taskId) = if (!(isGroupMember(i.caller)))
295295 then throw("grants working group access only")
296296 else WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
297297
298298

github/deemru/w8io/026f985 
49.16 ms