tx · GPc3vtR5ERKRHmucTeuKwDzsWmYGQuqteeeFqiuHHwfx

3PCxF4JryswYYp9mpUtE725wjTgvpBmp3M9:  -0.00100000 Waves

2024.05.21 13:32 [4181727] smart account 3PCxF4JryswYYp9mpUtE725wjTgvpBmp3M9 > SELF 0.00000000 Waves

{ "type": 13, "id": "GPc3vtR5ERKRHmucTeuKwDzsWmYGQuqteeeFqiuHHwfx", "fee": 100000, "feeAssetId": null, "timestamp": 1716287535319, "version": 2, "chainId": 87, "sender": "3PCxF4JryswYYp9mpUtE725wjTgvpBmp3M9", "senderPublicKey": "ABaPDrNzForWeg3KKG9KFKPWxuihEJxK9fjZ9nDfvE26", "proofs": [ "3bznWPgJtZi2wmKdvSELGJ2NuHXrNRQiJM9Lu71xrno2MefxN75fhJ3nqsdMeKVHjShHKbK5LBTdL5DRoJv9vEEV" ], "script": null, "height": 4181727, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BmpNR8KD9DneCAPVygFDUkqHqWkmZo1DrsjbuC4zzHDr Next: none Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let d6 = 1000000
5-
6-let d8 = 100000000
7-
8-let E = base58'6phK22ztGBW127gUFmdMEHKB3CVd6ZhWox2WtwJkbqTq'
9-
10-let stE = base58'GAB8JowY9UANZ4TQy2TzJyhxjPqXX3DUrb2cdMWrrJus'
11-
12-let sW = base58'YiNbofFzC17jEHHCMwrRcpy9MrrjabMMLZxg8g5xmf7'
13-
14-let Ev = Address(base58'3PMtGnf3LXiEG6isDQLq1xMDKUqjQGqNHLb')
15-
16-let Es = Address(base58'3P2hbtheN5apNppqqUK7L7qAwmRFXy91CNa')
17-
18-let sWsc = Address(base58'3PDPzZVLhN1EuzGy4xAxjjTVkawKDLEaHiV')
19-
20-let s = Address(base58'3PKjY3hmP1BCWtmhpXw9Ly85sgiQvpgq4wC')
21-
22-let invoker = Address(base58'3P4AdC9J6MzTEi2LL9xgQN8EimMnbk4d6Nt')
23-
24-let keyRepayE = "repayE"
25-
26-let kDisable = "disabled"
27-
28-let kGlobalOrders = "global_ordersAmount"
29-
30-let s1 = "order id s1"
31-
32-let s2 = "order id s2"
33-
34-let s3 = "order id s3"
35-
36-let b1 = "order id b1"
37-
38-let b2 = "order id b2"
39-
40-let b3 = "order id b3"
41-
42-let kTradeSize = "trade size"
43-
44-let tsize = getIntegerValue(kTradeSize)
45-
46-let plimit = Address(base58'3PFB6LJyShsCKEA1AU1U1WLbDazqyj6ZL9b')
47-
48-let rome = base58'AP4Cb5xLYGH6ZigHreCZHoXpQTWDkPsG2BHqfDUx6taJ'
49-
50-let romeString = toBase58String(rome)
51-
52-let usdterc = base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
53-
54-let usdtercString = toBase58String(usdterc)
55-
56-func assetbalance (assetid) = assetBalance(this, assetid)
57-
58-
59-func bamount (assetid) = if ((assetbalance(assetid) > (tsize * d6)))
60- then (tsize * d6)
61- else assetbalance(assetid)
62-
63-
64-func createorder (sellassetid,buyassetstring,buyprice) = if ((bamount(sellassetid) > 0))
65- then invoke(plimit, "createOrder", [buyassetstring, fraction(bamount(sellassetid), buyprice, 100)], [AttachedPayment(sellassetid, bamount(sellassetid))])
66- else unit
67-
68-
69-func createorderbbmax (sellassetid,buyassetstring,buyprice) = if ((bamount(sellassetid) > 0))
70- then invoke(plimit, "createOrder", [buyassetstring, fraction(bamount(sellassetid), buyprice, 100)], [AttachedPayment(sellassetid, assetbalance(sellassetid))])
71- else unit
72-
73-
74-func orderStatus (orderId) = getStringValue(plimit, (("order_" + toString(orderId)) + "_status"))
75-
76-
77-@Callable(i)
78-func WsW () = if (if ((i.caller != this))
79- then (i.caller != s)
80- else false)
81- then throw("fu")
82- else {
83- let inv = invoke(sWsc, "withdraw", nil, [AttachedPayment(sW, assetBalance(this, sW))])
84- if ((inv == inv))
85- then nil
86- else throw("Strict value is not equal to itself.")
87- }
88-
89-
90-
91-@Callable(i)
92-func iE () = if (if ((i.caller != this))
93- then (i.caller != s)
94- else false)
95- then throw("fu")
96- else {
97- let amW = (wavesBalance(this).available - d8)
98- if ((amW == amW))
99- then {
100- let inv = invoke(Ev, "mint", nil, [AttachedPayment(unit, amW)])
101- if ((inv == inv))
102- then [IntegerEntry("amE", assetBalance(this, E)), IntegerEntry("amW", amW)]
103- else throw("Strict value is not equal to itself.")
104- }
105- else throw("Strict value is not equal to itself.")
106- }
107-
108-
109-
110-@Callable(i)
111-func sE () = if (if ((i.caller != this))
112- then (i.caller != s)
113- else false)
114- then throw("fu")
115- else {
116- let inv = invoke(Es, "stake", nil, [AttachedPayment(E, assetBalance(this, E))])
117- if ((inv == inv))
118- then nil
119- else throw("Strict value is not equal to itself.")
120- }
121-
122-
123-
124-@Callable(i)
125-func allin () = if (if (if ((i.caller != this))
126- then (i.caller != s)
127- else false)
128- then (i.caller != invoker)
129- else false)
130- then throw("fu")
131- else {
132- let inv0 = invoke(this, "WsW", nil, nil)
133- if ((inv0 == inv0))
134- then {
135- let inv1 = invoke(this, "iE", nil, nil)
136- if ((inv1 == inv1))
137- then {
138- let inv2 = invoke(this, "sE", nil, nil)
139- if ((inv2 == inv2))
140- then nil
141- else throw("Strict value is not equal to itself.")
142- }
143- else throw("Strict value is not equal to itself.")
144- }
145- else throw("Strict value is not equal to itself.")
146- }
147-
148-
149-
150-@Callable(i)
151-func uE () = if (if ((i.caller != this))
152- then (i.caller != s)
153- else false)
154- then throw("fu")
155- else {
156- let inv = invoke(Es, "unstake", nil, [AttachedPayment(stE, (assetBalance(this, stE) - (50 * d8)))])
157- if ((inv == inv))
158- then nil
159- else throw("Strict value is not equal to itself.")
160- }
161-
162-
163-
164-@Callable(i)
165-func cE () = if (if ((i.caller != this))
166- then (i.caller != s)
167- else false)
168- then throw("fu")
169- else {
170- let inv1 = invoke(Ev, "close", ["WAVES", getIntegerValue(this, "amW")], [AttachedPayment(E, if ((getBooleanValue(this, keyRepayE) == true))
171- then assetBalance(this, E)
172- else getIntegerValue(this, "amE"))])
173- if ((inv1 == inv1))
174- then nil
175- else throw("Strict value is not equal to itself.")
176- }
177-
178-
179-
180-@Callable(i)
181-func sWX () = if (if ((i.caller != this))
182- then (i.caller != s)
183- else false)
184- then throw("fu")
185- else {
186- func swapWX (assetIn,assetOut,amountIn) = invoke(Address(base58'3P68zNiufsu1viZpu1aY3cdahRRKcvV5N93'), "swap", [1, toBase58String(assetOut), toString(this)], [AttachedPayment(assetIn, amountIn)])
187-
188- let swap = if ((assetBalance(this, E) > 0))
189- then swapWX(E, base58'WAVES', assetBalance(this, E))
190- else unit
191- if ((swap == swap))
192- then nil
193- else throw("Strict value is not equal to itself.")
194- }
195-
196-
197-
198-@Callable(i)
199-func DsW () = if (if ((i.caller != this))
200- then (i.caller != s)
201- else false)
202- then throw("fu")
203- else {
204- let inv = invoke(sWsc, "deposit", nil, [AttachedPayment(unit, (wavesBalance(this).available - d8))])
205- if ((inv == inv))
206- then nil
207- else throw("Strict value is not equal to itself.")
208- }
209-
210-
211-
212-@Callable(i)
213-func allout () = if (if (if ((i.caller != this))
214- then (i.caller != s)
215- else false)
216- then (i.caller != invoker)
217- else false)
218- then throw("fu")
219- else {
220- let inv0 = invoke(this, "uE", nil, nil)
221- if ((inv0 == inv0))
222- then {
223- let inv1 = invoke(this, "cE", nil, nil)
224- if ((inv1 == inv1))
225- then {
226- let inv2 = if ((getBooleanValue(this, "compW") == true))
227- then invoke(this, "sWX", nil, nil)
228- else unit
229- if ((inv2 == inv2))
230- then {
231- let inv3 = invoke(this, "DsW", nil, nil)
232- if ((inv3 == inv3))
233- then nil
234- else throw("Strict value is not equal to itself.")
235- }
236- else throw("Strict value is not equal to itself.")
237- }
238- else throw("Strict value is not equal to itself.")
239- }
240- else throw("Strict value is not equal to itself.")
241- }
242-
243-
244-
245-@Callable(i)
246-func compW (compW) = if (if ((i.caller != this))
247- then (i.caller != s)
248- else false)
249- then throw("fu")
250- else [BooleanEntry("compW", compW)]
251-
252-
253-
254-@Callable(i)
255-func repayE (repayE) = if (if ((i.caller != this))
256- then (i.caller != s)
257- else false)
258- then throw("fu")
259- else [BooleanEntry(keyRepayE, repayE)]
260-
261-
262-
263-@Callable(i)
264-func initGrid () = if (if (if ((i.caller != this))
265- then (i.caller != s)
266- else false)
267- then (i.caller != invoker)
268- else false)
269- then throw("fu")
270- else if ((getBoolean(kDisable) == true))
271- then nil
272- else {
273- let is1 = invoke(this, "s1Rome", nil, nil)
274- if ((is1 == is1))
275- then {
276- let is2 = invoke(this, "s2Rome", nil, nil)
277- if ((is2 == is2))
278- then {
279- let is3 = invoke(this, "s3Rome", nil, nil)
280- if ((is3 == is3))
281- then {
282- let ib1 = invoke(this, "b1Rome", nil, nil)
283- if ((ib1 == ib1))
284- then {
285- let ib2 = invoke(this, "b2Rome", nil, nil)
286- if ((ib2 == ib2))
287- then {
288- let ib3 = invoke(this, "b3Rome", nil, nil)
289- if ((ib3 == ib3))
290- then [IntegerEntry(s1, (getIntegerValue(plimit, kGlobalOrders) - 5)), IntegerEntry(s2, (getIntegerValue(plimit, kGlobalOrders) - 4)), IntegerEntry(s3, (getIntegerValue(plimit, kGlobalOrders) - 3)), IntegerEntry(b1, (getIntegerValue(plimit, kGlobalOrders) - 2)), IntegerEntry(b2, (getIntegerValue(plimit, kGlobalOrders) - 1)), IntegerEntry(b3, getIntegerValue(plimit, kGlobalOrders))]
291- else throw("Strict value is not equal to itself.")
292- }
293- else throw("Strict value is not equal to itself.")
294- }
295- else throw("Strict value is not equal to itself.")
296- }
297- else throw("Strict value is not equal to itself.")
298- }
299- else throw("Strict value is not equal to itself.")
300- }
301- else throw("Strict value is not equal to itself.")
302- }
303-
304-
305-
306-@Callable(i)
307-func sGrid () = if (if (if ((i.caller != this))
308- then (i.caller != s)
309- else false)
310- then (i.caller != invoker)
311- else false)
312- then throw("fu")
313- else if ((getBoolean(kDisable) == true))
314- then nil
315- else {
316- let cs3 = if ((orderStatus(getIntegerValue(s3)) != "active"))
317- then invoke(this, "s3Rome", nil, nil)
318- else unit
319- if ((cs3 == cs3))
320- then {
321- let cs2 = if ((orderStatus(getIntegerValue(s2)) != "active"))
322- then invoke(this, "s2Rome", nil, nil)
323- else unit
324- if ((cs2 == cs2))
325- then {
326- let cs1 = if ((orderStatus(getIntegerValue(s1)) != "active"))
327- then invoke(this, "s1Rome", nil, nil)
328- else unit
329- if ((cs1 == cs1))
330- then {
331- let bbmax = createorderbbmax(rome, usdtercString, 100)
332- if ((bbmax == bbmax))
333- then nil
334- else throw("Strict value is not equal to itself.")
335- }
336- else throw("Strict value is not equal to itself.")
337- }
338- else throw("Strict value is not equal to itself.")
339- }
340- else throw("Strict value is not equal to itself.")
341- }
342-
343-
344-
345-@Callable(i)
346-func bGrid () = if (if (if ((i.caller != this))
347- then (i.caller != s)
348- else false)
349- then (i.caller != invoker)
350- else false)
351- then throw("fu")
352- else if ((getBoolean(kDisable) == true))
353- then nil
354- else {
355- let cb3 = if ((orderStatus(getIntegerValue(b3)) != "active"))
356- then invoke(this, "b3Rome", nil, nil)
357- else unit
358- if ((cb3 == cb3))
359- then {
360- let cb2 = if ((orderStatus(getIntegerValue(b2)) != "active"))
361- then invoke(this, "b2Rome", nil, nil)
362- else unit
363- if ((cb2 == cb2))
364- then {
365- let cb1 = if ((orderStatus(getIntegerValue(b1)) != "active"))
366- then invoke(this, "b1Rome", nil, nil)
367- else unit
368- if ((cb1 == cb1))
369- then {
370- let bbsmax = createorderbbmax(usdterc, romeString, 100)
371- if ((bbsmax == bbsmax))
372- then nil
373- else throw("Strict value is not equal to itself.")
374- }
375- else throw("Strict value is not equal to itself.")
376- }
377- else throw("Strict value is not equal to itself.")
378- }
379- else throw("Strict value is not equal to itself.")
380- }
381-
382-
383-
384-@Callable(i)
385-func s1Rome () = if (if (if ((i.caller != this))
386- then (i.caller != s)
387- else false)
388- then (i.caller != invoker)
389- else false)
390- then throw("fu")
391- else if ((getBoolean(kDisable) == true))
392- then nil
393- else {
394- let is1 = createorder(rome, usdtercString, 101)
395- if ((is1 == is1))
396- then [IntegerEntry(s1, getIntegerValue(plimit, kGlobalOrders))]
397- else throw("Strict value is not equal to itself.")
398- }
399-
400-
401-
402-@Callable(i)
403-func s2Rome () = if (if (if ((i.caller != this))
404- then (i.caller != s)
405- else false)
406- then (i.caller != invoker)
407- else false)
408- then throw("fu")
409- else if ((getBoolean(kDisable) == true))
410- then nil
411- else {
412- let is2 = createorder(rome, usdtercString, 102)
413- if ((is2 == is2))
414- then [IntegerEntry(s2, getIntegerValue(plimit, kGlobalOrders))]
415- else throw("Strict value is not equal to itself.")
416- }
417-
418-
419-
420-@Callable(i)
421-func s3Rome () = if (if (if ((i.caller != this))
422- then (i.caller != s)
423- else false)
424- then (i.caller != invoker)
425- else false)
426- then throw("fu")
427- else if ((getBoolean(kDisable) == true))
428- then nil
429- else {
430- let is3 = createorder(rome, usdtercString, 103)
431- if ((is3 == is3))
432- then [IntegerEntry(s3, getIntegerValue(plimit, kGlobalOrders))]
433- else throw("Strict value is not equal to itself.")
434- }
435-
436-
437-
438-@Callable(i)
439-func b1Rome () = if (if (if ((i.caller != this))
440- then (i.caller != s)
441- else false)
442- then (i.caller != invoker)
443- else false)
444- then throw("fu")
445- else if ((getBoolean(kDisable) == true))
446- then nil
447- else {
448- let ib1 = createorder(usdterc, romeString, 101)
449- if ((ib1 == ib1))
450- then [IntegerEntry(b1, getIntegerValue(plimit, kGlobalOrders))]
451- else throw("Strict value is not equal to itself.")
452- }
453-
454-
455-
456-@Callable(i)
457-func b2Rome () = if (if (if ((i.caller != this))
458- then (i.caller != s)
459- else false)
460- then (i.caller != invoker)
461- else false)
462- then throw("fu")
463- else if ((getBoolean(kDisable) == true))
464- then nil
465- else {
466- let ib2 = createorder(usdterc, romeString, 102)
467- if ((ib2 == ib2))
468- then [IntegerEntry(b2, getIntegerValue(plimit, kGlobalOrders))]
469- else throw("Strict value is not equal to itself.")
470- }
471-
472-
473-
474-@Callable(i)
475-func b3Rome () = if (if (if ((i.caller != this))
476- then (i.caller != s)
477- else false)
478- then (i.caller != invoker)
479- else false)
480- then throw("fu")
481- else if ((getBoolean(kDisable) == true))
482- then nil
483- else {
484- let ib3 = createorder(usdterc, romeString, 103)
485- if ((ib3 == ib3))
486- then [IntegerEntry(b3, getIntegerValue(plimit, kGlobalOrders))]
487- else throw("Strict value is not equal to itself.")
488- }
489-
490-
491-
492-@Callable(i)
493-func setTradeSize (amount) = if (if ((i.caller != this))
494- then (i.caller != s)
495- else false)
496- then throw("fu")
497- else [IntegerEntry(kTradeSize, amount)]
498-
499-
500-
501-@Callable(i)
502-func disable (disable) = if (if ((i.caller != this))
503- then (i.caller != s)
504- else false)
505- then throw("fu")
506- else [BooleanEntry(kDisable, disable)]
507-
508-
1+# no script

github/deemru/w8io/873ac7e 
34.51 ms