tx · GYsixwkFNZww7a3Se1Y8iADGjUDTMCaATxB7GjshyQBA

3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA:  -0.10000000 Waves

2020.12.29 18:35 [1330158] smart account 3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA > SELF 0.00000000 Waves

{ "type": 13, "id": "GYsixwkFNZww7a3Se1Y8iADGjUDTMCaATxB7GjshyQBA", "fee": 10000000, "feeAssetId": null, "timestamp": 1609256142557, "version": 2, "chainId": 84, "sender": "3Mxk4Jmjd8SdE2MojSXsUQ8LVYM8vRzmFSA", "senderPublicKey": "4xMxUnfdbHYsent96ThiYC63gXHiahi6bh3urdHHntHi", "proofs": [ "5R1v86cAWK28Cp7jP8GYZ2AMyBHmTs5dnnrJ2VPTWDupymNUk64La6D5D6TGd3q9SFhhBJVQq8unfbb2vWgY2PUQ" ], "script": "base64:AAIDAAAAAAAAADsIARIECgIICBIDCgEIEgQKAggIEgMKAQgSBQoDCAgIEgUKAwgICBIDCgEIEgMKAQgSBAoCCAgSAwoBCAAAABQAAAAADG1haW5Db250cmFjdAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXdSemkyQm1xWlpYV3JDR0N3Y1JRTHNuaWMyQW9kNnpoUwAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAA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b3JrX2ZpbmlzaGVkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAGdGFza3NfBQAAAAZ0YXNrSWQCAAAAB19yZXBvcnQFAAAACnJlcG9ydExpbmsFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAC3RlYW1BZGRyZXNzBQAAAAxyZXdhcmRBbW91bnQFAAAABHVuaXQFAAAAA25pbAkAAAIAAAABAgAAABVjaGVja3MgYXJlIG5vdCBwYXNzZWQAAAABaQEAAAAKcmVqZWN0VGFzawAAAAEAAAAGdGFza0lkAwkBAAAADWlzR3JvdXBNZW1iZXIAAAABCAUAAAABaQAAAAZjYWxsZXIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZ0YXNrc18FAAAABnRhc2tJZAIAAAAHX3N0YXR1cwIAAAAIcmVqZWN0ZWQFAAAAA25pbAkAAAIAAAABAgAAACBncmFudHMgd29ya2luZyBncm91cCBhY2Nlc3Mgb25seQAAAAA1BaGP", "height": 1330158, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3nLDNf2qUeo4VoExQKXLEE8KuQq254oPUWk4V15KN5bg Next: 2CwPhZ5A3tdyedVxnJkEZTvKWaJ4hftCAdKmpAzRF4Z2 Diff:
OldNewDifferences
261261
262262 let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
263263 let applicantsList = split(listKeys, ";")
264- if (finishApplicantsVotingConditions(i.caller, taskId, applicantsList))
265- then {
266- let chosenTeamId = {
267- let $list1244912480 = [0, 1]
268- let $size1244912480 = size($list1244912480)
269- let $acc01244912480 = 0
270- if (($size1244912480 == 0))
271- then $acc01244912480
264+ let chosenTeamId = {
265+ let $list1245112482 = [0, 1]
266+ let $size1245112482 = size($list1245112482)
267+ let $acc01245112482 = 0
268+ if (($size1245112482 == 0))
269+ then $acc01245112482
270+ else {
271+ let $acc11245112482 = hasMoreScore($acc01245112482, $list1245112482[0])
272+ if (($size1245112482 == 1))
273+ then $acc11245112482
272274 else {
273- let $acc11244912480 = hasMoreScore($acc01244912480, $list1244912480[0])
274- if (($size1244912480 == 1))
275- then $acc11244912480
275+ let $acc21245112482 = hasMoreScore($acc11245112482, $list1245112482[1])
276+ if (($size1245112482 == 2))
277+ then $acc21245112482
276278 else {
277- let $acc21244912480 = hasMoreScore($acc11244912480, $list1244912480[1])
278- if (($size1244912480 == 2))
279- then $acc21244912480
280- else {
281- let $acc31244912480 = hasMoreScore($acc21244912480, $list1244912480[2])
282- throw("List size exceed 2")
283- }
279+ let $acc31245112482 = hasMoreScore($acc21245112482, $list1245112482[2])
280+ throw("List size exceed 2")
284281 }
285282 }
286283 }
287- let teamIdentifier = drop(applicantsList[chosenTeamId], 10)
288- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
289- }
290- else throw("checks are not passed")
284+ }
285+ let teamIdentifier = drop(applicantsList[chosenTeamId], 10)
286+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
291287 }
292288
293289
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")
109109 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")
113113 else true
114114
115115
116116 func finishTaskProposalVotingConditions (address,taskId) = if (!(isGroupMember(address)))
117117 then throw("grants working group access only")
118118 else if ((tryGetString((("tasks_" + taskId) + "_status")) != "proposed"))
119119 then throw("voting is not active")
120120 else if ((QUORUM > ((tryGetInteger((("tasks_" + taskId) + "_voting_amount")) * 100) / getDAOSize())))
121121 then throw((("more than " + toString(QUORUM)) + "% members have to vote before finishing the voting"))
122122 else true
123123
124124
125125 func applyForTaskConditions (address,taskId,teamIdentifier) = if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
126126 then throw("this grant has not yet been approved")
127127 else if ((tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader")) == toString(address)))
128128 then throw("you are applied")
129129 else true
130130
131131
132132 func voteForApplicantConditions (address,taskId,teamIdentifier) = {
133133 let voteHash = (drop(toString(address), 10) + drop(teamIdentifier, 10))
134134 if (!(canMemberVote(address)))
135135 then throw("you can't vote")
136136 else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
137137 then throw("voting is not active")
138138 else if ((tryGetInteger(((("tasks_" + taskId) + "_vote_") + voteHash)) != 0))
139139 then throw("you have already voted on this team")
140140 else true
141141 }
142142
143143
144144 func finishApplicantsVotingConditions (address,taskId,applicantsList) = if (!(isGroupMember(address)))
145145 then throw("grants working group access only")
146146 else if ((tryGetString((("tasks_" + taskId) + "_status")) != "ready_to_apply"))
147147 then throw("voting is not active")
148148 else if ((size(applicantsList) == 0))
149149 then throw("no one has yet responded to the grant")
150150 else true
151151
152152
153153 func startWorkConditions (address,taskId,teamIdentifier) = if ((tryGetString((("tasks_" + taskId) + "_status")) != "team_chosen"))
154154 then throw("winner is not define")
155155 else if ((toString(address) != tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))))
156156 then throw("team leader only")
157157 else true
158158
159159
160160 func acceptWorkResultConditions (address,taskId) = if (!(isGroupMember(address)))
161161 then throw("grants working group access only")
162162 else true
163163
164164
165165 @Callable(i)
166166 func addTask (title,link) = if (addTaskConditions(i.caller))
167167 then WriteSet([DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_title"), title), DataEntry((("tasks_" + toBase58String(i.transactionId)) + "_link"), link)])
168168 else throw("checks are not passed")
169169
170170
171171
172172 @Callable(i)
173173 func addReward (taskId) = if (addRewardConditions(i.caller, taskId))
174174 then {
175175 let reward = extract(i.payment).amount
176176 WriteSet([DataEntry((("tasks_" + taskId) + "_reward"), reward), DataEntry((("tasks_" + taskId) + "_status"), "proposed")])
177177 }
178178 else throw("checks are not passed")
179179
180180
181181
182182 @Callable(i)
183183 func voteForTaskProposal (taskId,voteValue) = if (voteForTaskProposalConditions(i.caller, taskId))
184184 then {
185185 let voteKey = ((("tasks_" + taskId) + "_voted_") + toString(i.caller))
186186 let votingKey = (("tasks_" + taskId) + "_voting_state")
187187 let votingState = tryGetInteger(votingKey)
188188 let votesAmountKey = (("tasks_" + taskId) + "_voting_amount")
189189 let votesAmountState = (tryGetInteger(votingKey) + 1)
190190 let voteValueInt = getVoteValue(voteValue)
191191 let newVotingState = (votingState + voteValueInt)
192192 WriteSet([DataEntry(votingKey, newVotingState), DataEntry(voteKey, voteValueInt), DataEntry(votesAmountKey, votesAmountState)])
193193 }
194194 else throw("checks are not passed")
195195
196196
197197
198198 @Callable(i)
199199 func finishTaskProposalVoting (taskId) = if (finishTaskProposalVotingConditions(i.caller, taskId))
200200 then {
201201 let votingKey = (("tasks_" + taskId) + "_voting_state")
202202 WriteSet([DataEntry((("tasks_" + taskId) + "_status"), if ((tryGetInteger(votingKey) > 0))
203203 then "ready_to_apply"
204204 else "rejected")])
205205 }
206206 else throw("checks are not passed")
207207
208208
209209
210210 @Callable(i)
211211 func applyForTask (taskId,teamName,link) = {
212212 let teamIdentifier = drop(toString(i.caller), 10)
213213 if (applyForTaskConditions(i.caller, taskId, teamIdentifier))
214214 then {
215215 let listKey = (("tasks_" + taskId) + "_applicants")
216216 let currentApplicantsList = tryGetString(listKey)
217217 let newApplicantsList = ((currentApplicantsList + ";") + toString(i.caller))
218218 WriteSet([DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_name"), teamName), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_link"), link), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"), toString(i.caller)), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_id"), teamIdentifier), DataEntry(listKey, newApplicantsList)])
219219 }
220220 else throw("checks are not passed")
221221 }
222222
223223
224224
225225 @Callable(i)
226226 func voteForApplicant (taskId,teamIdentifier,voteValue) = if (voteForApplicantConditions(i.caller, taskId, teamIdentifier))
227227 then {
228228 let listKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_voted")
229229 let newApplicantsList = ((tryGetString(listKey) + ";") + toString(i.caller))
230230 let voteHash = (drop(toString(i.caller), 20) + teamIdentifier)
231231 let voteKey = ((("tasks_" + taskId) + "_vh_") + voteHash)
232232 if ((tryGetString(voteKey) == toString(i.caller)))
233233 then throw("you have already voted on this team")
234234 else {
235235 let teamVotesAmountKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_votes")
236236 let teamScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
237237 let teamVotesAmount = (1 + tryGetInteger(teamVotesAmountKey))
238238 let newTeamScore = (getVoteValue(voteValue) + tryGetInteger(teamScoreKey))
239239 WriteSet([DataEntry(listKey, newApplicantsList), DataEntry(voteKey, toString(i.caller)), DataEntry(teamVotesAmountKey, teamVotesAmount), DataEntry(teamScoreKey, newTeamScore)])
240240 }
241241 }
242242 else throw("checks are not passed")
243243
244244
245245
246246 @Callable(i)
247247 func finishApplicantsVoting (taskId) = {
248248 func hasMoreScore (aid,aid2) = {
249249 let listKey = (("tasks_" + taskId) + "_applicants")
250250 let applicantsList = split(getStringValue(this, listKey), ";")
251251 let teamIdentifier = drop(applicantsList[aid], 10)
252252 let teamVotesScoreKey = (((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_score")
253253 let teamVotesScore = tryGetInteger(teamVotesScoreKey)
254254 let team2Identifier = drop(applicantsList[aid2], 10)
255255 let team2VotesScoreKey = (((("tasks_" + taskId) + "_app_") + team2Identifier) + "_score")
256256 let team2VotesScore = tryGetInteger(team2VotesScoreKey)
257257 if ((teamVotesScore > team2VotesScore))
258258 then aid
259259 else aid2
260260 }
261261
262262 let listKeys = tryGetString((("tasks_" + taskId) + "_applicants"))
263263 let applicantsList = split(listKeys, ";")
264- if (finishApplicantsVotingConditions(i.caller, taskId, applicantsList))
265- then {
266- let chosenTeamId = {
267- let $list1244912480 = [0, 1]
268- let $size1244912480 = size($list1244912480)
269- let $acc01244912480 = 0
270- if (($size1244912480 == 0))
271- then $acc01244912480
264+ let chosenTeamId = {
265+ let $list1245112482 = [0, 1]
266+ let $size1245112482 = size($list1245112482)
267+ let $acc01245112482 = 0
268+ if (($size1245112482 == 0))
269+ then $acc01245112482
270+ else {
271+ let $acc11245112482 = hasMoreScore($acc01245112482, $list1245112482[0])
272+ if (($size1245112482 == 1))
273+ then $acc11245112482
272274 else {
273- let $acc11244912480 = hasMoreScore($acc01244912480, $list1244912480[0])
274- if (($size1244912480 == 1))
275- then $acc11244912480
275+ let $acc21245112482 = hasMoreScore($acc11245112482, $list1245112482[1])
276+ if (($size1245112482 == 2))
277+ then $acc21245112482
276278 else {
277- let $acc21244912480 = hasMoreScore($acc11244912480, $list1244912480[1])
278- if (($size1244912480 == 2))
279- then $acc21244912480
280- else {
281- let $acc31244912480 = hasMoreScore($acc21244912480, $list1244912480[2])
282- throw("List size exceed 2")
283- }
279+ let $acc31245112482 = hasMoreScore($acc21245112482, $list1245112482[2])
280+ throw("List size exceed 2")
284281 }
285282 }
286283 }
287- let teamIdentifier = drop(applicantsList[chosenTeamId], 10)
288- WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
289- }
290- else throw("checks are not passed")
284+ }
285+ let teamIdentifier = drop(applicantsList[chosenTeamId], 10)
286+ WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "team_chosen"), DataEntry((("tasks_" + taskId) + "_performer"), teamIdentifier), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "can_begin")])
291287 }
292288
293289
294290
295291 @Callable(i)
296292 func startWork (taskId) = {
297293 let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
298294 if (startWorkConditions(i.caller, taskId, teamIdentifier))
299295 then WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "work_started"), DataEntry((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_process"), "work_started")])
300296 else throw("checks are not passed")
301297 }
302298
303299
304300
305301 @Callable(i)
306302 func acceptWorkResult (taskId,reportLink) = if (acceptWorkResultConditions(i.caller, taskId))
307303 then {
308304 let rewardAmount = tryGetInteger((("tasks_" + taskId) + "_reward"))
309305 let teamIdentifier = tryGetString((("tasks_" + taskId) + "_performer"))
310306 let teamAddress = tryGetString((((("tasks_" + taskId) + "_app_") + teamIdentifier) + "_leader"))
311307 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)]))
312308 }
313309 else throw("checks are not passed")
314310
315311
316312
317313 @Callable(i)
318314 func rejectTask (taskId) = if (isGroupMember(i.caller))
319315 then WriteSet([DataEntry((("tasks_" + taskId) + "_status"), "rejected")])
320316 else throw("grants working group access only")
321317
322318

github/deemru/w8io/026f985 
60.16 ms