tx · A233XTEiF5FEpvnXHgj9LjwR8h9u37eTKp2qNQGJhmAW

3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn:  -0.01000000 Waves

2023.06.11 17:29 [2618132] smart account 3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn > SELF 0.00000000 Waves

{ "type": 13, "id": "A233XTEiF5FEpvnXHgj9LjwR8h9u37eTKp2qNQGJhmAW", "fee": 1000000, "feeAssetId": null, "timestamp": 1686493793968, "version": 2, "chainId": 84, "sender": "3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn", "senderPublicKey": "6oJuynzr7rKRYRDWhDrENciDLidQuVGfe82pK7hr5nev", "proofs": [ "4QphFSGs9yAxwmC7CunjSs9XT2XQLsqTpytkd1MQ5JUkdzXHY3iVy3LKRC3xTU7ARAqCYKTwwQrwy4x16wVgq1YM" ], "script": "base64:BgIJCAISABIDCgEBBAALcmFuZG9tRGVsYXkAAgEJa2V5Q29tbWl0AQdhZGRyZXNzCQCsAgICE2ZpbmlzaEJsb2NrRm9yQWRkcl8FB2FkZHJlc3MBD2dldFJhbmRvbU51bWJlcgIIbWF4VmFsdWUMZmluaXNoSGVpZ2h0BA9yYW5kb21TZWVkQmxvY2sJAQV2YWx1ZQEJAO0HAQUMZmluaXNoSGVpZ2h0BApyYW5kb21IYXNoCQD3AwEJAQV2YWx1ZQEIBQ9yYW5kb21TZWVkQmxvY2sDdnJmCQBqAgkAsgkCBQpyYW5kb21IYXNoABAFCG1heFZhbHVlAQZwc2V1ZG8BAW4ECnJhbmRvbUhhc2gJAPcDAQkAywECCQEFdmFsdWUBCAkBBXZhbHVlAQkA7QcBBQZoZWlnaHQDdnJmCQCaAwEFAW4JAGoCCQCyCQIFCnJhbmRvbUhhc2gAGQAlAgFpAQZjb21taXQABAtmaW5pc2hCbG9jawkAZAIFBmhlaWdodAULcmFuZG9tRGVsYXkJAJQKAgkAzAgCCQEMSW50ZWdlckVudHJ5AgkBCWtleUNvbW1pdAEJAKUIAQgFAWkGY2FsbGVyBQtmaW5pc2hCbG9jawUDbmlsBQtmaW5pc2hCbG9jawFpAQZyZXZlYWwBCG1heFZhbHVlBAdjb21tS2V5CQEJa2V5Q29tbWl0AQkApQgBCAUBaQZjYWxsZXIEC2ZpbmlzaEJsb2NrCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ8IAQUHY29tbUtleQIbWW91IGhhdmUgdG8gY29tbWl0KCkgZmlyc3QhAwkAZgIFC2ZpbmlzaEJsb2NrBQZoZWlnaHQJAAIBAh5SYW5kb20gbnVtYmVyIGlzIG5vdCByZWFkeSB5ZXQEBHJhbmQJAQ9nZXRSYW5kb21OdW1iZXICBQhtYXhWYWx1ZQULZmluaXNoQmxvY2sJAJQKAgkAzAgCCQELRGVsZXRlRW50cnkBBQdjb21tS2V5BQNuaWwFBHJhbmQAAaPBxg==", "height": 2618132, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HBZF8D3gA7RVB67Mp2SaPTQLDbdDowi3zhE7Q2BJ45nW Next: 2g1LSyZQYnkTk1SpMxLGcv9GwGBdPFMShqphRtf9KVzi Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = this
4+let a = 2
55
6-let b = this
7-
8-let c = "__"
9-
10-let d = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
11-
12-func e (f,g) = valueOrErrorMessage(getString(f, g), makeString(["mandatory ", toString(f), ".", g, " is not defined"], ""))
6+func b (c) = ("finishBlockForAddr_" + c)
137
148
15-func h (g) = valueOrElse(getInteger(this, g), 0)
16-
17-
18-func i (j) = makeString(["%s%d%s", "leaseGroup", toString(j), "nodeList"], c)
19-
20-
21-func k (l) = makeString(["%s%d%s", "lease", toString(l), "amount"], c)
22-
23-
24-func m (l) = makeString(["%s%d%s", "lease", toString(l), "id"], c)
25-
26-
27-func n (o) = makeString(["%s%s%s", "leaseByAddress", o, "id"], c)
28-
29-
30-func p (o) = makeString(["%s%s%s", "leaseByAddress", o, "amount"], c)
31-
32-
33-func q (r) = valueOrElse(getString(makeString(["%s%d%s", "lease", toString(r), "nodeAddress"], c)), "")
34-
35-
36-func s (t) = {
37- let o = addressFromStringValue(q(t))
38- let u = k(t)
39- let v = h(u)
40- let w = m(t)
41- let x = value(getBinary(this, w))
42- $Tuple5(o, u, v, w, x)
9+func d (e,f) = {
10+ let g = value(blockInfoByHeight(f))
11+ let h = sha256(value(g.vrf))
12+ (toInt(h, 16) % e)
4313 }
4414
4515
46-let y = 1
47-
48-let z = 2
49-
50-let A = 3
51-
52-let B = 4
53-
54-let C = 5
55-
56-let D = 6
57-
58-let E = 7
59-
60-let F = 8
61-
62-func G (f) = ("%s__" + f)
63-
64-
65-func H () = "%s__approvedNodeList"
66-
67-
68-func I () = "%s%s__cfg__beneficiaryAddress"
69-
70-
71-func J (K,L) = {
72- let M = getString(G(K))
73- if (!(isDefined(M)))
74- then throw(("Unknown Node " + K))
75- else {
76- let N = value(M)
77- let O = split(N, c)
78- let P = if ((size(O) >= 9))
79- then O[D]
80- else "PENDING"
81- if ((P != L))
82- then throw(((((("Node " + K) + " status should be ") + L) + ", but actually ") + P))
83- else N
84- }
16+func i (j) = {
17+ let h = sha256((value(value(blockInfoByHeight(height)).vrf) + toBytes(j)))
18+ (toInt(h, 25) % 37)
8519 }
8620
8721
88-func Q (R,S) = {
89- let T = split(R, c)
90- makeString(["%s%d%d%d%d%s%d%d", T[y], T[z], T[A], T[B], T[C], S, toString(lastBlock.height), toString(lastBlock.timestamp)], c)
91- }
92-
93-
94-func U (V,W) = {
95- let X = addressFromStringValue(e(V, I()))
96- if ((scriptHash(V) == unit))
97- then W
98- else X
99- }
100-
101-
102-func Y (K,Z,aa,ab,ac) = {
103- let ad = Lease(K, Z)
104-[LeaseCancel(aa), ad, BinaryEntry(ab, calculateLeaseId(ad)), IntegerEntry(ac, Z)]
105- }
106-
107-
108-@Callable(ae)
109-func rebalanceLeasings (af,j) = {
110- let ag = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7yMWoR9Je2xrAcgGg9QrqLAQqEGhyfCjfATjktaNdqpk")
111- if ((ae.callerPublicKey != fromBase58String(ag)))
112- then throw("rebalanceLeasings not authorized")
113- else {
114- let ah = i(j)
115- let ai = split(e(this, ah), c)
116- if ((1 > size(ai)))
117- then throw(("Empty group " + toString(j)))
118- else {
119- let aj = ((af / size(ai)) + 1)
120- let ak = s(0)
121- let al = ak._1
122- let am = ak._2
123- let an = ak._3
124- let ao = ak._4
125- let ap = ak._5
126- func aq (ar,as) = {
127- let at = n(as)
128- let au = getBinaryValue(this, at)
129- let av = p(as)
130- let aw = getIntegerValue(this, av)
131- (ar ++ Y(addressFromStringValue(as), (aw - aj), au, at, av))
132- }
133-
134- ({
135- let ax = ai
136- let ay = size(ax)
137- let az = nil
138- func aA (aB,aC) = if ((aC >= ay))
139- then aB
140- else aq(aB, ax[aC])
141-
142- func aD (aB,aC) = if ((aC >= ay))
143- then aB
144- else throw("List size exceeds 8")
145-
146- aD(aA(aA(aA(aA(aA(aA(aA(aA(az, 0), 1), 2), 3), 4), 5), 6), 7), 8)
147- } ++ Y(al, (an + (aj * size(ai))), ap, ao, am))
148- }
149- }
22+@Callable(k)
23+func commit () = {
24+ let l = (height + a)
25+ $Tuple2([IntegerEntry(b(toString(k.caller)), l)], l)
15026 }
15127
15228
15329
154-@Callable(ae)
155-func replaceCommunityNode (aE,aF,j,aG) = {
156- let ag = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7yMWoR9Je2xrAcgGg9QrqLAQqEGhyfCjfATjktaNdqpk")
157- let aH = fromBase58String(ag)
158- if ((ae.callerPublicKey != aH))
159- then throw("replaceCommunityNode not authorized")
30+@Callable(k)
31+func reveal (e) = {
32+ let m = b(toString(k.caller))
33+ let l = valueOrErrorMessage(getInteger(m), "You have to commit() first!")
34+ if ((l > height))
35+ then throw("Random number is not ready yet")
16036 else {
161- let aI = i(j)
162- let aJ = e(this, aI)
163- if (!(contains(aJ, aE)))
164- then throw(((("Group " + toString(j)) + " does not contain address ") + aE))
165- else {
166- let aK = invoke(a, "replaceApprovedNode", [aE, aF, j, aG], nil)
167- if ((aK == aK))
168- then {
169- let aL = n(aE)
170- let aM = p(aE)
171- let aN = getIntegerValue(aM)
172- let aO = n(aF)
173- let aP = p(aF)
174- let aQ = makeString(split(aJ, aE), aF)
175- $Tuple2(([DeleteEntry(aL), DeleteEntry(aM), StringEntry(aI, aQ)] ++ Y(addressFromStringValue(aF), aN, getBinaryValue(aL), aO, aP)), unit)
176- }
177- else throw("Strict value is not equal to itself.")
178- }
37+ let n = d(e, l)
38+ $Tuple2([DeleteEntry(m)], n)
17939 }
18040 }
181-
182-
183-
184-@Callable(ae)
185-func removeCommunityNode (aE,j,aG) = {
186- let ag = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7yMWoR9Je2xrAcgGg9QrqLAQqEGhyfCjfATjktaNdqpk")
187- let aH = fromBase58String(ag)
188- if ((ae.callerPublicKey != aH))
189- then throw("removeCommunityNode not authorized")
190- else {
191- let aI = i(j)
192- let aJ = e(this, aI)
193- if (!(contains(aJ, aE)))
194- then throw(((("Group " + toString(j)) + " does not contain address ") + aE))
195- else {
196- let aR = invoke(a, "removeApprovedNode", [aE, aG], nil)
197- if ((aR == aR))
198- then {
199- let aL = n(aE)
200- let aM = p(aE)
201- let aN = getIntegerValue(aM)
202- let aS = s(0)
203- let al = aS._1
204- let am = aS._2
205- let an = aS._3
206- let ao = aS._4
207- let ap = aS._5
208- let aQ = makeString(split(aJ, aE), "")
209- $Tuple2(([DeleteEntry(aL), DeleteEntry(aM), StringEntry(aI, aQ)] ++ Y(al, (an + aN), getBinaryValue(aL), ao, am)), unit)
210- }
211- else throw("Strict value is not equal to itself.")
212- }
213- }
214- }
215-
216-
217-
218-@Callable(ae)
219-func replaceApprovedNode (aT,aU,j,aG) = if ((ae.caller != b))
220- then throw("permissions denied")
221- else {
222- let aV = J(aT, "APPROVED")
223- let aW = J(aU, "PENDING")
224- let aX = e(this, H())
225- if (!(contains(aX, aT)))
226- then throw(("approvedNodeList does not contain " + aT))
227- else {
228- let aY = makeString_2C(split_4C(aX, aT), aU)
229- let aZ = addressFromStringValue(aT)
230- let ba = U(aZ, aZ)
231- let bb = parseIntValue(split(aV, c)[B])
232- let bc = [StringEntry(H(), aY), DeleteEntry(G(aT)), StringEntry(G(aU), Q(aW, "APPROVED"))]
233- $Tuple2(if ((bb > aG))
234- then (bc :+ ScriptTransfer(ba, (bb - aG), unit))
235- else bc, unit)
236- }
237- }
238-
239-
240-
241-@Callable(ae)
242-func removeApprovedNode (bd,aG) = if ((ae.caller != b))
243- then throw("permissions denied")
244- else {
245- let aV = J(bd, "APPROVED")
246- let aX = e(this, H())
247- if (!(contains(aX, bd)))
248- then throw(("approvedNodeList does not contain " + bd))
249- else {
250- let aY = makeString_2C(split_4C(aX, bd), "")
251- let K = addressFromStringValue(bd)
252- let ba = U(K, K)
253- let bb = parseIntValue(split(aV, c)[B])
254- let bc = [StringEntry(H(), aY), DeleteEntry(G(bd))]
255- $Tuple2(if ((bb > aG))
256- then (bc :+ ScriptTransfer(ba, (bb - aG), unit))
257- else bc, unit)
258- }
259- }
260-
261-
262-
263-@Callable(ae)
264-func returnDeposit (be) = if ((size(ae.payments) != 0))
265- then throw("No payments allowed")
266- else {
267- let bf = ae.caller
268- let bg = G(be)
269- let M = getString(this, bg)
270- if (!(isDefined(M)))
271- then throw(("Address is not applied as neutrino node: " + be))
272- else {
273- let bh = e(this, H())
274- if (contains(bh, be))
275- then throw("Impossible to return deposit from approved Node, please contact support team")
276- else {
277- let O = split(value(M), c)
278- let bi = if ((size(O) >= 9))
279- then O[D]
280- else "PENDING"
281- if ((bi != "PENDING"))
282- then throw("Application status is not PENDING!")
283- else {
284- let bb = parseIntValue(O[B])
285- let o = addressFromStringValue(be)
286- let ba = U(o, o)
287- if (!(if (if ((bf == this))
288- then true
289- else if ((ba != o))
290- then (bf == ba)
291- else false)
292- then true
293- else if ((ba == o))
294- then (bf == o)
295- else false))
296- then throw("returnDeposit permissions denied")
297- else [DeleteEntry(bg), ScriptTransfer(ba, bb, unit)]
298- }
299- }
300- }
301- }
30241
30342

github/deemru/w8io/169f3d6 
37.36 ms