tx · HR7iWwCxPc8HbX878WDmwLj9JY3RCAkJZTrcLwokNHFm

3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ:  -0.10000000 Waves

2020.11.30 20:18 [1288446] smart account 3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ > SELF 0.00000000 Waves

{ "type": 13, "id": "HR7iWwCxPc8HbX878WDmwLj9JY3RCAkJZTrcLwokNHFm", "fee": 10000000, "feeAssetId": null, "timestamp": 1606756729555, "version": 2, "chainId": 84, "sender": "3MtV1AQ8fEPk76tjKgvrufuMe5aA3q4TviQ", "senderPublicKey": "3Fjao2FW1JXSPd5EkP7C3uerW18HYacYsaMYALFMGA6N", "proofs": [ "3LD9wGYKDwHopJxTAhkcAZtgJcfKLtDSnAEVC4DwRs847NorW1UADVjkRe2S5384fpE8AJrLG9zaNoe8JcY5v6KL" ], "script": "base64:AAIDAAAAAAAAAC4IARIECgIICBIECgIIARIDCgEIEgQKAggBEgMKAQgSAwoBCBIDCgEIEgQKAggIAAAACQAAAAAGUVVPUlVNAAAAAAAAAAABAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3ZhbAAAAAAMbWFpbkNvbnRyYWN0BQAAAAR0aGlzAQAAAAdpc093bmVyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXM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AAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAALdGVhbUFkZHJlc3MFAAAADHJld2FyZEFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAD5jh+k=", "height": 1288446, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5PCnFypGYzFyQDDeSAKVcua3qAfnjdXBkx2BVVymKftH Next: 5uBktXog3ByE1idHffyb4MYdrjQcr9nEfqceXndzDaVm Diff:
OldNewDifferences
3333
3434 let h = this
3535
36-func i (j) = if ((j == this))
37- then true
38- else (j == h)
36+func i (j) = (j == this)
3937
4038
4139 func k () = {
9593
9694
9795 @Callable(p)
98-func addTask (q,r) = if (!(m(p.caller)))
99- then throw("grants working group access only")
100- else WriteSet([DataEntry((("tasks_" + toBase58String(p.transactionId)) + "_title"), q), DataEntry((("tasks_" + toBase58String(p.transactionId)) + "_link"), r)])
96+func addTask (q,r) = WriteSet([DataEntry((("tasks_" + toBase58String(p.transactionId)) + "_title"), q), DataEntry((("tasks_" + toBase58String(p.transactionId)) + "_link"), r)])
10197
10298
10399
104100 @Callable(p)
105-func addTaskDetails (s,t) = if (!(m(p.caller)))
101+func addTaskDetails (s,t) = {
102+ let u = getStringValue(this, (("tasks_" + s) + "_performer"))
103+ if ((toString(p.caller) != getStringValue(this, (((("tasks_" + s) + "_app_") + u) + "_leader"))))
104+ then throw("team leader only")
105+ else WriteSet([DataEntry((("tasks_" + s) + "_requestedreward"), t)])
106+ }
107+
108+
109+
110+@Callable(p)
111+func initTaskVoting (s) = if (!(m(p.caller)))
106112 then throw("grants working group access only")
107- else {
108- let u = extract(p.payment).amount
109- WriteSet([DataEntry((("tasks_" + s) + "_reward"), u), DataEntry((("tasks_" + s) + "_details"), t), DataEntry((("tasks_" + s) + "_status"), "proposed")])
110- }
113+ else WriteSet([DataEntry((("tasks_" + s) + "_status"), "voting_started")])
111114
112115
113116
147150 let z = b(y)
148151 if ((z > 0))
149152 then {
150- let D = "ready_to_apply"
153+ let D = "approved"
151154 WriteSet([DataEntry((("tasks_" + s) + "_status"), D)])
152155 }
153156 else {
159162
160163
161164 @Callable(p)
162-func applyForTask (s,E,r) = {
163- let F = g((("tasks_" + s) + "_status"))
164- if ((F != "ready_to_apply"))
165- then throw("This grant has not yet been approved")
166- else {
167- let G = (("tasks_" + s) + "_applicants")
168- let H = g(G)
169- let I = drop(toString(p.caller), 10)
170- let J = toString(p.caller)
171- let K = ((H + ";") + J)
172- WriteSet([DataEntry((((("tasks_" + s) + "_app_") + I) + "_name"), E), DataEntry((((("tasks_" + s) + "_app_") + I) + "_link"), r), DataEntry((((("tasks_" + s) + "_app_") + I) + "_leader"), J), DataEntry((((("tasks_" + s) + "_app_") + I) + "_id"), I), DataEntry(G, K)])
173- }
165+func startWork (s) = {
166+ let u = getStringValue(this, (("tasks_" + s) + "_performer"))
167+ if ((toString(p.caller) != getStringValue(this, (((("tasks_" + s) + "_app_") + u) + "_leader"))))
168+ then throw("team leader only")
169+ else WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_started")])
174170 }
175-
176-
177-
178-@Callable(p)
179-func voteForApplicant (s,L,v) = if (!(o(p)))
180- then throw("you can't vote")
181- else {
182- let M = (drop(toString(p.caller), 10) + drop(L, 10))
183- let w = ((("tasks_" + s) + "_vote_") + M)
184- let N = b(w)
185- if ((N != 0))
186- then throw("you have already voted on this team")
187- else {
188- let O = (((("tasks_" + s) + "_app_") + L) + "_votes")
189- let P = (((("tasks_" + s) + "_app_") + L) + "_score")
190- let Q = (1 + b(O))
191- let R = (v + b(P))
192- WriteSet([DataEntry(w, v), DataEntry(P, R)])
193- }
194- }
195-
196-
197-
198-@Callable(p)
199-func finishApplicantsVoting (s) = {
200- let S = 1
201- if (!(m(p.caller)))
202- then throw("grants working group access only")
203- else {
204- let T = g((("tasks_" + s) + "_applicants"))
205- let U = split(T, ";")
206- if ((size(U) == 0))
207- then throw("No one has applied to the hackathon, yet")
208- else WriteSet([DataEntry((("tasks_" + s) + "_performer"), T), DataEntry((("tasks_" + s) + "_status"), "ready_to_submit")])
209- }
210- }
211-
212-
213-
214-@Callable(p)
215-func enableSubmissions (s,V) = if (!(m(p.caller)))
216- then throw("grants working group access only")
217- else WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_started"), DataEntry((("tasks_" + s) + "_jury"), V)])
218-
219-
220-
221-@Callable(p)
222-func submitSolution (s,W) = {
223- func X (s) = (g((("tasks_" + s) + "_status")) == "work_started")
224-
225- let L = getStringValue(this, (("tasks_" + s) + "_performer"))
226- if (!(X(s)))
227- then throw("not possible to upload solution now")
228- else if ((toString(p.caller) != getStringValue(this, (((("tasks_" + s) + "_app_") + L) + "_leader"))))
229- then throw("team leader only")
230- else WriteSet([DataEntry((((("tasks_" + s) + "_app_") + L) + "_process"), "work_submitted"), DataEntry((((("tasks_" + s) + "_app_") + L) + "_solution"), W)])
231- }
232-
233-
234-
235-@Callable(p)
236-func stopSubmissions (s) = if (!(m(p.caller)))
237- then throw("grants working group access only")
238- else WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_finished")])
239-
240-
241-
242-@Callable(p)
243-func voteForSolution (s,L,v) = {
244- func Y (p,s) = true
245-
246- if (!(Y(p, s)))
247- then throw("you can't vote")
248- else {
249- let M = (drop(toString(p.caller), 10) + drop(L, 10))
250- let w = ((("tasks_" + s) + "_solutionvote_") + M)
251- let N = b(w)
252- if ((N != 0))
253- then throw("you have already voted on this solution")
254- else {
255- let O = (((("tasks_" + s) + "_app_") + L) + "_solutionvotes")
256- let P = (((("tasks_" + s) + "_app_") + L) + "_solutionscore")
257- let Q = (1 + b(O))
258- let R = (v + b(P))
259- WriteSet([DataEntry(w, v), DataEntry(P, R)])
260- }
261- }
262- }
263-
264-
265-
266-@Callable(p)
267-func acceptWorkResult (s,Z,aa) = if (!(m(p.caller)))
268- then throw("grants working group access only")
269- else {
270- let ab = b((("tasks_" + s) + "_reward"))
271- let ac = getStringValue(this, (((("tasks_" + s) + "_app_") + Z) + "_leader"))
272- ScriptResult(WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_finished"), DataEntry((((("tasks_" + s) + "_app_") + Z) + "_process"), "winner"), DataEntry((("tasks_" + s) + "_report"), aa)]), TransferSet([ScriptTransfer(addressFromStringValue(ac), ab, unit)]))
273- }
274171
275172
276173
278175 func rejectTask (s) = if (!(m(p.caller)))
279176 then throw("grants working group access only")
280177 else {
281- let L = getStringValue(this, (("tasks_" + s) + "_performer"))
282- WriteSet([DataEntry((("tasks_" + s) + "_status"), "rejected")])
178+ let u = getStringValue(this, (("tasks_" + s) + "_performer"))
179+ WriteSet([DataEntry((("tasks_" + s) + "_status"), "rejected"), DataEntry((((("tasks_" + s) + "_app_") + u) + "_process"), "rejected")])
180+ }
181+
182+
183+
184+@Callable(p)
185+func acceptWorkResult (s,E) = if (!(m(p.caller)))
186+ then throw("grants working group access only")
187+ else {
188+ let F = b((("tasks_" + s) + "_reward"))
189+ let u = getStringValue(this, (("tasks_" + s) + "_performer"))
190+ let G = getStringValue(this, (((("tasks_" + s) + "_app_") + u) + "_leader"))
191+ ScriptResult(WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_finished"), DataEntry((((("tasks_" + s) + "_app_") + u) + "_report"), E)]), TransferSet([ScriptTransfer(addressFromStringValue(G), F, unit)]))
283192 }
284193
285194
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 1
55
66 func b (c) = {
77 let d = {
88 let e = getInteger(this, c)
99 if ($isInstanceOf(e, "Int"))
1010 then {
1111 let f = e
1212 f
1313 }
1414 else 0
1515 }
1616 d
1717 }
1818
1919
2020 func g (c) = {
2121 let d = {
2222 let e = getString(this, c)
2323 if ($isInstanceOf(e, "String"))
2424 then {
2525 let f = e
2626 f
2727 }
2828 else ""
2929 }
3030 d
3131 }
3232
3333
3434 let h = this
3535
36-func i (j) = if ((j == this))
37- then true
38- else (j == h)
36+func i (j) = (j == this)
3937
4038
4139 func k () = {
4240 let d = {
4341 let e = getString(h, "working_group_members")
4442 if ($isInstanceOf(e, "String"))
4543 then {
4644 let f = e
4745 f
4846 }
4947 else ""
5048 }
5149 d
5250 }
5351
5452
5553 func l () = {
5654 let d = {
5755 let e = getString(h, "dao_members")
5856 if ($isInstanceOf(e, "String"))
5957 then {
6058 let f = e
6159 f
6260 }
6361 else ""
6462 }
6563 d
6664 }
6765
6866
6967 func m (n) = {
7068 let d = {
7169 let e = getInteger(h, (("working_group_member_" + toString(n)) + "_weight"))
7270 if ($isInstanceOf(e, "Int"))
7371 then {
7472 let f = e
7573 f
7674 }
7775 else 0
7876 }
7977 (d > 0)
8078 }
8179
8280
8381 func o (p) = {
8482 let d = {
8583 let e = getInteger(h, (("dao_member_" + toString(p.caller)) + "_weight"))
8684 if ($isInstanceOf(e, "Int"))
8785 then {
8886 let f = e
8987 f
9088 }
9189 else 0
9290 }
9391 (d > 0)
9492 }
9593
9694
9795 @Callable(p)
98-func addTask (q,r) = if (!(m(p.caller)))
99- then throw("grants working group access only")
100- else WriteSet([DataEntry((("tasks_" + toBase58String(p.transactionId)) + "_title"), q), DataEntry((("tasks_" + toBase58String(p.transactionId)) + "_link"), r)])
96+func addTask (q,r) = WriteSet([DataEntry((("tasks_" + toBase58String(p.transactionId)) + "_title"), q), DataEntry((("tasks_" + toBase58String(p.transactionId)) + "_link"), r)])
10197
10298
10399
104100 @Callable(p)
105-func addTaskDetails (s,t) = if (!(m(p.caller)))
101+func addTaskDetails (s,t) = {
102+ let u = getStringValue(this, (("tasks_" + s) + "_performer"))
103+ if ((toString(p.caller) != getStringValue(this, (((("tasks_" + s) + "_app_") + u) + "_leader"))))
104+ then throw("team leader only")
105+ else WriteSet([DataEntry((("tasks_" + s) + "_requestedreward"), t)])
106+ }
107+
108+
109+
110+@Callable(p)
111+func initTaskVoting (s) = if (!(m(p.caller)))
106112 then throw("grants working group access only")
107- else {
108- let u = extract(p.payment).amount
109- WriteSet([DataEntry((("tasks_" + s) + "_reward"), u), DataEntry((("tasks_" + s) + "_details"), t), DataEntry((("tasks_" + s) + "_status"), "proposed")])
110- }
113+ else WriteSet([DataEntry((("tasks_" + s) + "_status"), "voting_started")])
111114
112115
113116
114117 @Callable(p)
115118 func voteForTaskProposal (s,v) = if (!(o(p)))
116119 then throw("you can't vote")
117120 else if ((getStringValue(this, (("tasks_" + s) + "_status")) != "proposed"))
118121 then throw("voting is closed or not started")
119122 else if (if ((v != -1))
120123 then (v != 1)
121124 else false)
122125 then throw("you need to vote 1 or -1")
123126 else {
124127 let w = ((("tasks_" + s) + "_voted_") + toString(p.caller))
125128 let x = b(w)
126129 if (!((x == 0)))
127130 then throw("you have already voted")
128131 else {
129132 let y = (("tasks_" + s) + "_voting_state")
130133 let z = b(y)
131134 let A = (("tasks_" + s) + "_voting_amount")
132135 let B = (b(y) + 1)
133136 let C = (z + v)
134137 ScriptResult(WriteSet([DataEntry(y, C), DataEntry(w, v), DataEntry(A, B)]), TransferSet([ScriptTransfer(p.caller, 500000, unit)]))
135138 }
136139 }
137140
138141
139142
140143 @Callable(p)
141144 func finishTaskProposalVoting (s) = if ((a > ((b((("tasks_" + s) + "_voting_amount")) * 100) / b("dao_size"))))
142145 then throw((("more than " + toString(a)) + "% members have to vote before finishing the voting"))
143146 else if (!(m(p.caller)))
144147 then throw("grants working group access only")
145148 else {
146149 let y = (("tasks_" + s) + "_voting_state")
147150 let z = b(y)
148151 if ((z > 0))
149152 then {
150- let D = "ready_to_apply"
153+ let D = "approved"
151154 WriteSet([DataEntry((("tasks_" + s) + "_status"), D)])
152155 }
153156 else {
154157 let D = "rejected"
155158 WriteSet([DataEntry((("tasks_" + s) + "_status"), D)])
156159 }
157160 }
158161
159162
160163
161164 @Callable(p)
162-func applyForTask (s,E,r) = {
163- let F = g((("tasks_" + s) + "_status"))
164- if ((F != "ready_to_apply"))
165- then throw("This grant has not yet been approved")
166- else {
167- let G = (("tasks_" + s) + "_applicants")
168- let H = g(G)
169- let I = drop(toString(p.caller), 10)
170- let J = toString(p.caller)
171- let K = ((H + ";") + J)
172- WriteSet([DataEntry((((("tasks_" + s) + "_app_") + I) + "_name"), E), DataEntry((((("tasks_" + s) + "_app_") + I) + "_link"), r), DataEntry((((("tasks_" + s) + "_app_") + I) + "_leader"), J), DataEntry((((("tasks_" + s) + "_app_") + I) + "_id"), I), DataEntry(G, K)])
173- }
165+func startWork (s) = {
166+ let u = getStringValue(this, (("tasks_" + s) + "_performer"))
167+ if ((toString(p.caller) != getStringValue(this, (((("tasks_" + s) + "_app_") + u) + "_leader"))))
168+ then throw("team leader only")
169+ else WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_started")])
174170 }
175-
176-
177-
178-@Callable(p)
179-func voteForApplicant (s,L,v) = if (!(o(p)))
180- then throw("you can't vote")
181- else {
182- let M = (drop(toString(p.caller), 10) + drop(L, 10))
183- let w = ((("tasks_" + s) + "_vote_") + M)
184- let N = b(w)
185- if ((N != 0))
186- then throw("you have already voted on this team")
187- else {
188- let O = (((("tasks_" + s) + "_app_") + L) + "_votes")
189- let P = (((("tasks_" + s) + "_app_") + L) + "_score")
190- let Q = (1 + b(O))
191- let R = (v + b(P))
192- WriteSet([DataEntry(w, v), DataEntry(P, R)])
193- }
194- }
195-
196-
197-
198-@Callable(p)
199-func finishApplicantsVoting (s) = {
200- let S = 1
201- if (!(m(p.caller)))
202- then throw("grants working group access only")
203- else {
204- let T = g((("tasks_" + s) + "_applicants"))
205- let U = split(T, ";")
206- if ((size(U) == 0))
207- then throw("No one has applied to the hackathon, yet")
208- else WriteSet([DataEntry((("tasks_" + s) + "_performer"), T), DataEntry((("tasks_" + s) + "_status"), "ready_to_submit")])
209- }
210- }
211-
212-
213-
214-@Callable(p)
215-func enableSubmissions (s,V) = if (!(m(p.caller)))
216- then throw("grants working group access only")
217- else WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_started"), DataEntry((("tasks_" + s) + "_jury"), V)])
218-
219-
220-
221-@Callable(p)
222-func submitSolution (s,W) = {
223- func X (s) = (g((("tasks_" + s) + "_status")) == "work_started")
224-
225- let L = getStringValue(this, (("tasks_" + s) + "_performer"))
226- if (!(X(s)))
227- then throw("not possible to upload solution now")
228- else if ((toString(p.caller) != getStringValue(this, (((("tasks_" + s) + "_app_") + L) + "_leader"))))
229- then throw("team leader only")
230- else WriteSet([DataEntry((((("tasks_" + s) + "_app_") + L) + "_process"), "work_submitted"), DataEntry((((("tasks_" + s) + "_app_") + L) + "_solution"), W)])
231- }
232-
233-
234-
235-@Callable(p)
236-func stopSubmissions (s) = if (!(m(p.caller)))
237- then throw("grants working group access only")
238- else WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_finished")])
239-
240-
241-
242-@Callable(p)
243-func voteForSolution (s,L,v) = {
244- func Y (p,s) = true
245-
246- if (!(Y(p, s)))
247- then throw("you can't vote")
248- else {
249- let M = (drop(toString(p.caller), 10) + drop(L, 10))
250- let w = ((("tasks_" + s) + "_solutionvote_") + M)
251- let N = b(w)
252- if ((N != 0))
253- then throw("you have already voted on this solution")
254- else {
255- let O = (((("tasks_" + s) + "_app_") + L) + "_solutionvotes")
256- let P = (((("tasks_" + s) + "_app_") + L) + "_solutionscore")
257- let Q = (1 + b(O))
258- let R = (v + b(P))
259- WriteSet([DataEntry(w, v), DataEntry(P, R)])
260- }
261- }
262- }
263-
264-
265-
266-@Callable(p)
267-func acceptWorkResult (s,Z,aa) = if (!(m(p.caller)))
268- then throw("grants working group access only")
269- else {
270- let ab = b((("tasks_" + s) + "_reward"))
271- let ac = getStringValue(this, (((("tasks_" + s) + "_app_") + Z) + "_leader"))
272- ScriptResult(WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_finished"), DataEntry((((("tasks_" + s) + "_app_") + Z) + "_process"), "winner"), DataEntry((("tasks_" + s) + "_report"), aa)]), TransferSet([ScriptTransfer(addressFromStringValue(ac), ab, unit)]))
273- }
274171
275172
276173
277174 @Callable(p)
278175 func rejectTask (s) = if (!(m(p.caller)))
279176 then throw("grants working group access only")
280177 else {
281- let L = getStringValue(this, (("tasks_" + s) + "_performer"))
282- WriteSet([DataEntry((("tasks_" + s) + "_status"), "rejected")])
178+ let u = getStringValue(this, (("tasks_" + s) + "_performer"))
179+ WriteSet([DataEntry((("tasks_" + s) + "_status"), "rejected"), DataEntry((((("tasks_" + s) + "_app_") + u) + "_process"), "rejected")])
180+ }
181+
182+
183+
184+@Callable(p)
185+func acceptWorkResult (s,E) = if (!(m(p.caller)))
186+ then throw("grants working group access only")
187+ else {
188+ let F = b((("tasks_" + s) + "_reward"))
189+ let u = getStringValue(this, (("tasks_" + s) + "_performer"))
190+ let G = getStringValue(this, (((("tasks_" + s) + "_app_") + u) + "_leader"))
191+ ScriptResult(WriteSet([DataEntry((("tasks_" + s) + "_status"), "work_finished"), DataEntry((((("tasks_" + s) + "_app_") + u) + "_report"), E)]), TransferSet([ScriptTransfer(addressFromStringValue(G), F, unit)]))
283192 }
284193
285194

github/deemru/w8io/169f3d6 
45.02 ms