tx · BzAL94caPBNHrJANpPWPh5JiWNeJJbnpUyHVJWT3CkyM

3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy:  -0.01000000 Waves

2023.01.16 21:18 [2407835] smart account 3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy > SELF 0.00000000 Waves

{ "type": 13, "id": "BzAL94caPBNHrJANpPWPh5JiWNeJJbnpUyHVJWT3CkyM", "fee": 1000000, "feeAssetId": null, "timestamp": 1673893202231, "version": 2, "chainId": 84, "sender": "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy", "senderPublicKey": "C3PaRKeL8AUKbwUqdniMQtThgcTh5DYHV1777Hkxy7rp", "proofs": [ "5mzZ6gm5Duau5VZrtJaFqaYQJ6HjfiLvyqyxHzc2QE9Zwt76477EXgjUriv28pn9DCYDDSFdJmWyDYjdB4jdWuBn" ], "script": "base64:BgIHCAISAwoBCAIABWNoYWluCQCwCQEJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAC3VzZG5Bc3NldElkBAckbWF0Y2gwBQVjaGFpbgMJAAACAgFXBQckbWF0Y2gwASC2JinDBPXOU5GkDkt1JC9kjFGx+t+vVCm9SNIdKrKq0QMJAAACAgFUBQckbWF0Y2gwASD3dur394PKZdtuE+4CO89YKZWpwdGN8kvabNgdYoDI3gkAAgECDVVua25vd24gY2hhaW4BAWkBEndhbGxldEluZm9SRUFET05MWQERdXNlckFkZHJlc3NTdHJPcHQEBGFkZHIJAKYIAQURdXNlckFkZHJlc3NTdHJPcHQEB2JhbGFuY2UDCQEJaXNEZWZpbmVkAQUEYWRkcgkA7wcBCQEFdmFsdWUBBQRhZGRyCQEOQmFsYW5jZURldGFpbHMEAAAAAAAAAAAEC3VzZG5CYWxhbmNlAwkBCWlzRGVmaW5lZAEFBGFkZHIJAPAHAgkBBXZhbHVlAQUEYWRkcgULdXNkbkFzc2V0SWQAAAkAlAoCBQNuaWwJALkJAgkAzAgCAgolZCVkJWQlZCVkCQDMCAIJAKQDAQgFB2JhbGFuY2UHcmVndWxhcgkAzAgCCQCkAwEIBQdiYWxhbmNlCWF2YWlsYWJsZQkAzAgCCQCkAwEIBQdiYWxhbmNlCmdlbmVyYXRpbmcJAMwIAgkApAMBCAUHYmFsYW5jZQllZmZlY3RpdmUJAMwIAgkApAMBBQt1c2RuQmFsYW5jZQUDbmlsAgFfAA6c+Q0=", "height": 2407835, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BwWH6Pr1TivNLpmQR2raf93bsSAkbk9PGNeKDh2WCWUG Next: KxeNzrMhp4EsChMTVU7HAWStTu45vwiDoBBMLACbQGh Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = ""
4+let a = toUtf8String(take(drop(this.bytes, 1), 1))
55
6-let b = "__"
7-
8-let c = ":"
9-
10-let d = 500000
11-
12-let e = "https://forum.neutrino.at/"
13-
14-let f = 160
15-
16-let g = 250
17-
18-let h = 1209600000
19-
20-let i = 1000000
21-
22-let j = 1000000000
23-
24-let k = 1000000000
25-
26-let l = 7200000
27-
28-let m = 5400000
29-
30-let n = 1
31-
32-let o = 2
33-
34-let p = 3
35-
36-let q = 4
37-
38-let r = 5
39-
40-let s = 6
41-
42-let t = 7
43-
44-let u = 8
45-
46-let v = 9
47-
48-let w = 10
49-
50-let x = 11
51-
52-let y = 1
53-
54-let z = 2
55-
56-let A = 3
57-
58-let B = 4
59-
60-let C = 5
61-
62-let D = 6
63-
64-let E = 7
65-
66-func F (G,H) = valueOrErrorMessage(getString(G, H), makeString(["mandatory ", toString(G), ".", H, " is not defined"], ""))
67-
68-
69-func I (H,J) = valueOrElse(getInteger(this, H), J)
70-
71-
72-let K = 1
73-
74-let L = 2
75-
76-let M = 3
77-
78-let N = 4
79-
80-let O = 5
81-
82-let P = 6
83-
84-let Q = 7
85-
86-let R = 8
87-
88-let S = 9
89-
90-let T = 10
91-
92-let U = 11
93-
94-let V = 12
95-
96-let W = 13
97-
98-func X () = "%s%s__config__controlAddress"
99-
100-
101-func Y () = "%s__controlConfig"
102-
103-
104-func Z (aa) = split_4C(F(aa, Y()), b)
105-
106-
107-func ab (ac,ad) = valueOrErrorMessage(addressFromString(ac[ad]), ("Control cfg doesn't contain address at index " + toString(ad)))
108-
109-
110-let ae = addressFromStringValue(valueOrElse(getString(this, X()), "3P5Bfd58PPfNvBM2Hy8QfbcDqMeNtzg7KfP"))
111-
112-let ac = Z(ae)
113-
114-let af = ab(ac, K)
115-
116-let ag = ab(ac, U)
117-
118-func ah () = "%s__quorumRequired"
119-
120-
121-func ai () = "%s__paymentRequired"
122-
123-
124-func aj () = "%s__gNsbtRequired"
125-
126-
127-func ak () = "%s__proposalId"
128-
129-
130-func al (am) = ("%s%d__proposalStatusData__" + toString(am))
131-
132-
133-func an (am) = ("%s%d__proposalData__" + toString(am))
134-
135-
136-func ao (am,ap) = makeString(["%s%d%d", "votesByOpt", toString(am), toString(ap)], b)
137-
138-
139-func aq (am,ar) = makeString(["%s%d%s", "votesByUser", toString(am), ar], b)
140-
141-
142-func as (am,ar) = makeString(["%s%d%s", "optionByUser", toString(am), ar], b)
143-
144-
145-func at () = "%s__applyInProgress"
146-
147-
148-func au (am) = ("%s%d__numVoters__" + toString(am))
149-
150-
151-func av () = "%s%s%s__stats__avg__uniqueVoters"
152-
153-
154-func aw () = "%s%s%s__stats__avg__gnsbtVoted"
155-
156-
157-func ax () = "%s%s__stats__uniqueAuthors"
158-
159-
160-func ay (az) = ("%s%s__numProposalsByAuthor__" + az)
161-
162-
163-func aA (aB) = {
164- let aC = aB
165- if ($isInstanceOf(aC, "List[Any]"))
166- then {
167- let aD = aC
168- aD
169- }
170- else throw("fail to cast into List[Any]")
6+let b = {
7+ let c = a
8+ if (("W" == c))
9+ then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
10+ else if (("T" == c))
11+ then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
12+ else throw("Unknown chain")
17113 }
17214
173-
174-func aE (aB) = {
175- let aC = aB
176- if ($isInstanceOf(aC, "Int"))
177- then {
178- let aF = aC
179- aF
180- }
181- else throw("fail to cast into Int")
182- }
183-
184-
185-func aG (aH,aI,aJ,aK,aL,aM,aN) = makeString(["%b%d%d%d%b%d%b", toString(aH), toString(aI), toString(aJ), toString(aK), toString(aL), toString(aM), toString(aN)], b)
186-
187-
188-func aO (aP,aQ,aR,aS,aT,aU,aV,aW,aX,aY,aZ) = makeString(["%s%s%s%s%s%d%d%d%s%d%s", aP, aQ, aR, aS, aT, toString(aU), toString(aV), toString(aW), aX, toString(aY), aZ], b)
189-
190-
191-func ba (bb) = if ((size(bb) > 20))
192- then throw(("Too many transactions: " + toString(size(bb))))
193- else {
194- func bc (bd,be) = if ((size(fromBase58String(be)) != 32))
195- then throw(("Wrong txId: " + be))
196- else if ((bd == ""))
197- then be
198- else ((bd + c) + be)
199-
200- let bf = bb
201- let bg = size(bf)
202- let bh = ""
203- func bi (bj,bk) = if ((bk >= bg))
204- then bj
205- else bc(bj, bf[bk])
206-
207- func bl (bj,bk) = if ((bk >= bg))
208- then bj
209- else throw("List size exceeds 20")
210-
211- bl(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bh, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
212- }
213-
214-
215-func bm (bn,aP,aQ,aR,aS,aT,aV,aW,bo,bb,bp) = if ((bn.assetId != unit))
216- then throw("Allowed WAVES payment only!")
217- else {
218- let bq = I(ai(), j)
219- if ((bq > bn.amount))
220- then throw(("Payment attached should be at least " + toString(bq)))
221- else if ((value(indexOf(aS, e)) != 0))
222- then throw("Invalid url")
223- else if ((size(aS) > g))
224- then throw("Url too long!")
225- else if ((aT == ""))
226- then throw("Title is empty")
227- else if ((size(aT) > f))
228- then throw("Too long title")
229- else {
230- let aU = lastBlock.timestamp
231- if ((aU > aV))
232- then throw(((("votingStartTime=" + toString(aV)) + " < proposalTime=") + toString(aU)))
233- else if ((aV > aW))
234- then throw(((("votingEndTime=" + toString(aW)) + " < votingStartTime=") + toString(aV)))
235- else if (((aW - aV) > h))
236- then throw(((("Voting period exceeds max: " + toString((aW - aV))) + " > ") + toString(h)))
237- else {
238- let aX = if ((aQ == "IDEA"))
239- then ""
240- else ba(bb)
241- if ((1 >= size(bp)))
242- then throw("Too few choices to vote")
243- else {
244- let br = aA(invoke(ag, "gnsbtInfoSYSREADONLY", [aR, 0, 0], nil))
245- let bs = aE(br[1])
246- let bt = aE(br[0])
247- let bu = I(aj(), k)
248- if ((bu > bt))
249- then throw((("You need at least " + toString(bu)) + " gNsbt to create voting"))
250- else {
251- let bv = invoke(af, "acceptWaves", nil, [bn])
252- if ((bv == bv))
253- then {
254- let bw = I(ah(), d)
255- let aY = fraction(bw, bs, i)
256- let am = (I(ak(), 0) + 1)
257- let bx = (I(ay(aR), 0) + 1)
258- let by = (I(ax(), 0) + (if ((bx == 1))
259- then 1
260- else 0))
261- let bz = makeString(bp, c)
262- $Tuple2([IntegerEntry(ak(), am), StringEntry(al(am), aG(false, 0, 0, 0, false, 0, false)), StringEntry(an(am), aO(aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, bz)), IntegerEntry(ay(aR), bx), IntegerEntry(ax(), by)], aP)
263- }
264- else throw("Strict value is not equal to itself.")
265- }
266- }
267- }
268- }
269- }
270-
271-
272-func bA (am,bp,bB,bC,bD,bE,bF) = {
273- func bG (bd,bH) = {
274- let ad = value(indexOf(bp, bH))
275- let bI = if (bB)
276- then if ((ad == bE))
277- then bF
278- else I(ao(am, ad), 0)
279- else if ((ad == value(bC)))
280- then bD
281- else if ((ad == bE))
282- then bF
283- else I(ao(am, ad), 0)
284- if ((bd._2 > bI))
285- then bd
286- else $Tuple2(ad, bI)
287- }
288-
289- let bf = bp
290- let bg = size(bf)
291- let bh = $Tuple2(0, 0)
292- func bi (bj,bk) = if ((bk >= bg))
293- then bj
294- else bG(bj, bf[bk])
295-
296- func bl (bj,bk) = if ((bk >= bg))
297- then bj
298- else throw("List size exceeds 10")
299-
300- bl(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bh, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
301- }
302-
303-
304-func bJ (bK,bL,bM,bN) = makeString(["%b%d%d%d%b%d%b", toString(bL), toString(bM._1), toString(bM._2), toString(bN), bK[C], bK[D], bK[E]], b)
305-
306-
307-func bO (bK) = makeString(["%b%d%d%d%b%d%b", bK[y], bK[z], bK[A], bK[B], "true", bK[D], bK[E]], b)
308-
309-
310-@Callable(aF)
311-func castVote (am,bP) = {
312- let bQ = toString(aF.caller)
313- let bR = split(F(this, al(am)), b)
314- if ((bR[E] == "true"))
315- then throw("Voting is canceled by team")
316- else {
317- let bS = split(F(this, an(am)), b)
318- let bT = parseIntValue(bS[t])
319- let bU = parseIntValue(bS[u])
320- let bV = lastBlock.timestamp
321- if ((bT > bV))
322- then throw("Voting not started yet")
323- else if ((bV >= bU))
324- then throw("Voting already finished")
325- else {
326- let bW = split(bS[x], c)
327- let bX = size(bW)
328- if ((1 >= bX))
329- then throw("Too few choices to vote")
330- else if ((bP >= bX))
331- then throw(("Unknown choice! Must be 0.." + toString((bX - 1))))
332- else {
333- let bY = aA(invoke(ag, "gnsbtInfoSYSREADONLY", [bQ, 0, 0], nil))
334- let bZ = aE(bY[0])
335- if ((0 >= bZ))
336- then throw("no gnsbt to vote")
337- else {
338- let bs = aE(bY[1])
339- let bC = getInteger(as(am, bQ))
340- let ca = if (!(isDefined(bC)))
341- then 0
342- else I(aq(am, bQ), 0)
343- let cb = if (isDefined(bC))
344- then I(ao(am, value(bC)), 0)
345- else 0
346- let cc = I(ao(am, bP), 0)
347- let cd = parseIntValue(bR[B])
348- let ce = if (!(isDefined(bC)))
349- then 0
350- else ((cb - ca) + (if ((value(bC) == bP))
351- then bZ
352- else 0))
353- let bF = if (if (isDefined(bC))
354- then (value(bC) == bP)
355- else false)
356- then ce
357- else (cc + bZ)
358- let cf = ((cd - ca) + bZ)
359- let cg = (cf > parseIntValue(bS[w]))
360- let ch = I(au(am), 0)
361- let ci = I(av(), 0)
362- let cj = getIntegerValue(ak())
363- let ck = if ((ca == 0))
364- then 1
365- else 0
366- let cl = (ci + fraction(ck, i, cj))
367- let cm = I(aw(), 0)
368- let cn = (cm + ((bZ - ca) / cj))
369- let bB = if (!(isDefined(bC)))
370- then true
371- else (value(bC) == bP)
372- let bD = if (bB)
373- then nil
374- else [IntegerEntry(ao(am, value(bC)), ce)]
375- let co = bA(am, bW, bB, bC, ce, bP, bF)
376- $Tuple2(([IntegerEntry(as(am, bQ), bP), IntegerEntry(aq(am, bQ), bZ), IntegerEntry(ao(am, bP), bF), IntegerEntry(au(am), (ch + ck)), IntegerEntry(av(), cl), IntegerEntry(aw(), cn), StringEntry(al(am), bJ(bR, cg, co, cf))] ++ bD), unit)
377- }
378- }
379- }
380- }
381- }
382-
383-
384-
385-@Callable(aF)
386-func initiateIdeaVoting (aS,aT,aV,aW,bp) = if ((size(aF.payments) != 1))
387- then throw("Exactly one payment required")
388- else bm(value(aF.payments[0]), toBase58String(aF.transactionId), "IDEA", toString(aF.caller), aS, aT, aV, aW, "PENDING", nil, bp)
389-
390-
391-
392-@Callable(aF)
393-func initiateUpdateVoting (aS,aT,aV,aW,bb) = if ((size(aF.payments) != 1))
394- then throw("Exactly one payment required")
395- else if ((1 > size(bb)))
396- then throw("Transactions list is empty")
397- else bm(value(aF.payments[0]), toBase58String(aF.transactionId), "UPDATE", toString(aF.caller), aS, aT, aV, aW, "PENDING", bb, ["NO", "YES"])
398-
399-
400-
401-@Callable(aF)
402-func cancelVoting (am) = if ((aF.caller != this))
403- then throw("not authorized")
404- else {
405- let cp = F(this, al(am))
406- let cq = ((take(cp, value(lastIndexOf(cp, b))) + b) + "true")
407- $Tuple2([StringEntry(al(am), cq)], unit)
408- }
409-
410-
411-
412-@Callable(aF)
413-func applyUpdate (am) = {
414- let bS = split(F(this, an(am)), b)
415- let bU = parseIntValue(bS[u])
416- let bV = lastBlock.timestamp
417- if ((bU > bV))
418- then throw("Voting is not finished yet")
419- else if (("UPDATE" != bS[o]))
420- then throw("Only UPDATE type can be applied")
421- else {
422- let bR = split(F(this, al(am)), b)
423- if ((bR[E] == "true"))
424- then throw("Voting is canceled")
425- else if ((bR[y] != "true"))
426- then throw("Voting status invalid")
427- else if ((bR[z] != "1"))
428- then throw("Winner is 'NO' - nothing to apply")
429- else if ((bR[C] == "true"))
430- then throw("Scripts are already applied")
431- else {
432- let cr = parseIntValue(bR[D])
433- if (((bV - l) > cr))
434- then throw((("Scripts timestamp=" + toString(cr)) + " is too far in the past, max 2 hrs allowed"))
435- else if ((cr > (bV + m)))
436- then throw((("Scripts timestamp=" + toString(cr)) + " is too far in the future, max 1.5 hrs allowed"))
437- else {
438- let cs = I(at(), -1)
439- if ((cs != -1))
440- then throw((("proposalId=" + toString(cs)) + " is already being applied. Finish it first!"))
441- else {
442- let ct = invoke(ae, "callEmergencyShutdown", ["Applying Governance UPDATE"], nil)
443- if ((ct == ct))
444- then $Tuple2([IntegerEntry(at(), am)], unit)
445- else throw("Strict value is not equal to itself.")
446- }
447- }
448- }
449- }
450- }
451-
452-
453-
454-@Callable(aF)
455-func finishApply () = {
456- let am = valueOrErrorMessage(getInteger(at()), "No apply in progress, nothing to finish")
457- let bS = split(F(this, an(am)), b)
458- let bb = split(bS[v], c)
459- let bR = split(F(this, al(am)), b)
460- if ((bR[C] == "true"))
461- then throw("Scripts are already applied")
462- else {
463- func cu (bd,be) = if (!(isDefined(transactionHeightById(fromBase58String(be)))))
464- then throw(("NOT applied txId: " + be))
465- else unit
466-
467- let cv = {
468- let bf = bb
469- let bg = size(bf)
470- let bh = unit
471- func bi (bj,bk) = if ((bk >= bg))
472- then bj
473- else cu(bj, bf[bk])
474-
475- func bl (bj,bk) = if ((bk >= bg))
476- then bj
477- else throw("List size exceeds 20")
478-
479- bl(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bi(bh, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
480- }
481- $Tuple2([DeleteEntry(at()), StringEntry(al(am), bO(bR))], cv)
482- }
15+@Callable(d)
16+func walletInfoREADONLY (e) = {
17+ let f = addressFromString(e)
18+ let g = if (isDefined(f))
19+ then wavesBalance(value(f))
20+ else BalanceDetails(0, 0, 0, 0)
21+ let h = if (isDefined(f))
22+ then assetBalance(value(f), b)
23+ else 0
24+ $Tuple2(nil, makeString(["%d%d%d%d%d", toString(g.regular), toString(g.available), toString(g.generating), toString(g.effective), toString(h)], "_"))
48325 }
48426
48527

github/deemru/w8io/026f985 
44.30 ms