tx · E3cD8Fi9AHwT2FJKuVwYNgBzuf35EJxrbkpJUXo3FYXG

3N3VAa6qsUMLQSe8tj4ERnzGeD5WaTx2x8P:  -0.05000000 Waves

2023.07.12 15:24 [2662676] smart account 3N3VAa6qsUMLQSe8tj4ERnzGeD5WaTx2x8P > SELF 0.00000000 Waves

{ "type": 13, "id": "E3cD8Fi9AHwT2FJKuVwYNgBzuf35EJxrbkpJUXo3FYXG", "fee": 5000000, "feeAssetId": null, "timestamp": 1689164702981, "version": 2, "chainId": 84, "sender": "3N3VAa6qsUMLQSe8tj4ERnzGeD5WaTx2x8P", "senderPublicKey": "AN4eDeEgqx5GZE5mQtJeYEzomfYXDaUqx4CukaodPxF1", "proofs": [ "qSv83pWY8hisGTrKFMyNfZJF3Uw35kJ8yDPFmdywG3VqFUTCMQgrwrJR4WBLsRi2hLoUFiZ6dbPSawJctPyxYCM" ], "script": "base64:BgKdAwgCEgQKAggIEgQKAggIIgNTRVAiBGpvaW4iAmFyIg5rZXlJbml0aWFsaXplZCIVa2V5Q29vcmRpbmF0b3JBZGRyZXNzIhJrZXlWZXJpZmllckFkZHJlc3MiCWtleVNpZ25lZCIIX2FkZHJlc3MiBV90eElkIg1pc0luaXRpYWxpemVkIhJtdXN0Tm90SW5pdGlhbGl6ZWQiCG11c3RTZWxmIgFpIgh2ZXJpZmllciIHJG1hdGNoMCIBcyIMY2hlY2tBZGRyZXNzIgdhZGRyZXNzIgljaGVja1R4SWQiA19pZCIJa2V5QWRtaW5zIgprZXlBcHByb3ZlIgxfY29vcmRpbmF0b3IiB19hZG1pbnMiBmNoZWNrcyIGYWRtaW5zIgRmb2xkIgh2ZXJpZmllZCIFYWRtaW4iAiRsIgIkcyIFJGFjYzAiBSRmMF8xIgIkYSICJGkiBSRmMF8yIgphZG1pbnNMaXN0IgdhcHByb3ZlIgxhcHByb3ZlQ291bnQiCWFwcHJvdmVCeSIGc3RhdHVzIgJ0eCIGdmVyaWZ5DgABYQICX18BAWIBAWMJALkJAgU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CQCsAgIFAUwFAWEFAUMEAU8DCQBmAgUBTQkAaQIJAJADAQUBSwACBgcJAMwIAgkBC1N0cmluZ0VudHJ5AgkBAXYCBQFoBQFpBQFOCQDMCAIJAQxCb29sZWFuRW50cnkCCQEBZwIFAWgFAWkFAU8FA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgEBUAEBUQAEAW8JAQFuAAMJAAECBQFvAgZTdHJpbmcEAXIFAW8JAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUBcgkBAWcCCQClCAEFBHRoaXMJANgEAQgFAVACaWQHCQD0AwMIBQFQCWJvZHlCeXRlcwkAkQMCCAUBUAZwcm9vZnMAAAgFAVAPc2VuZGVyUHVibGljS2V5En0tTw==", "height": 2662676, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = "__"
5+
6+func b (c) = makeString(c, a)
7+
8+
9+func d () = b(["%s", "initialized"])
10+
11+
12+func e () = b(["%s", "coordinatorAddress"])
13+
14+
15+func f () = b(["%s", "verifierAddress"])
16+
17+
18+func g (h,i) = b(["%s%s%s", "signed", h, i])
19+
20+
21+func j () = valueOrElse(getBoolean(this, d()), false)
22+
23+
24+func k () = if (j())
25+ then throw("Already initialized")
26+ else unit
27+
28+
29+func l (m) = if ((m.caller != this))
30+ then throw("Only self invocation allowed.")
31+ else unit
32+
33+
34+func n () = {
35+ let o = getString(e())
36+ if ($isInstanceOf(o, "String"))
37+ then {
38+ let p = o
39+ getString(addressFromStringValue(p), f())
40+ }
41+ else if ($isInstanceOf(o, "Unit"))
42+ then unit
43+ else throw("Match error")
44+ }
45+
46+
47+func q (h) = {
48+ let o = addressFromString(h)
49+ if ($isInstanceOf(o, "Address"))
50+ then {
51+ let r = o
52+ true
53+ }
54+ else if ($isInstanceOf(o, "Unit"))
55+ then throw("Invalid address")
56+ else throw("Match error")
57+ }
58+
59+
60+func s (t) = (size(fromBase58String(t)) == 32)
61+
62+
63+func u () = b(["%s", "admins"])
64+
65+
66+func v (h,i) = b(["%s%s%s", "approve", h, i])
67+
68+
69+@Callable(m)
70+func initialize (w,x) = {
71+ let y = [k(), l(m)]
72+ if ((y == y))
73+ then {
74+ let z = split(x, ",")
75+ if ((size(z) > 10))
76+ then throw("Too many admins")
77+ else if ((1 > size(z)))
78+ then throw("At least 1 admin needed")
79+ else {
80+ func A (B,C) = if (!(B))
81+ then B
82+ else if (q(C))
83+ then (C != toString(this))
84+ else false
85+
86+ if (({
87+ let D = z
88+ let E = size(D)
89+ let F = true
90+ func G (H,I) = if ((I >= E))
91+ then H
92+ else A(H, D[I])
93+
94+ func J (H,I) = if ((I >= E))
95+ then H
96+ else throw("List size exceeds 10")
97+
98+ J(G(G(G(G(G(G(G(G(G(G(F, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
99+ } == false))
100+ then throw(("Admin cannot be this dapp " + toString(this)))
101+ else [StringEntry(f(), toString(this)), StringEntry(u(), b(z)), BooleanEntry(d(), true)]
102+ }
103+ }
104+ else throw("Strict value is not equal to itself.")
105+ }
106+
107+
108+
109+@Callable(m)
110+func approve (h,i) = {
111+ let C = toString(m.caller)
112+ let z = getStringValue(u())
113+ let K = split(z, a)
114+ if (!(contains(z, C)))
115+ then throw("Not allowed")
116+ else {
117+ let y = [q(h), s(i)]
118+ if ((y == y))
119+ then {
120+ let L = valueOrElse(getString(v(h, i)), "")
121+ if (contains(L, C))
122+ then throw(("Already approved by " + C))
123+ else {
124+ let M = (1 + (if ((L == ""))
125+ then 0
126+ else size(split(L, a))))
127+ let N = if ((L == ""))
128+ then C
129+ else ((L + a) + C)
130+ let O = if ((M > (size(K) / 2)))
131+ then true
132+ else false
133+[StringEntry(v(h, i), N), BooleanEntry(g(h, i), O)]
134+ }
135+ }
136+ else throw("Strict value is not equal to itself.")
137+ }
138+ }
139+
140+
141+@Verifier(P)
142+func Q () = {
143+ let o = n()
144+ if ($isInstanceOf(o, "String"))
145+ then {
146+ let r = o
147+ valueOrElse(getBoolean(addressFromStringValue(r), g(toString(this), toBase58String(P.id))), false)
148+ }
149+ else sigVerify(P.bodyBytes, P.proofs[0], P.senderPublicKey)
150+ }
151+

github/deemru/w8io/026f985 
16.93 ms