tx · 7Xs3hoUgXfnisNDCb5tHkLavZ76oCyqunMCnwcf9XjsA

3Mzmv4as7rjREUwX6wvyxvhCvWa7A8rCWgV:  -0.01000000 Waves

2020.12.18 13:49 [1314026] smart account 3Mzmv4as7rjREUwX6wvyxvhCvWa7A8rCWgV > SELF 0.00000000 Waves

{ "type": 13, "id": "7Xs3hoUgXfnisNDCb5tHkLavZ76oCyqunMCnwcf9XjsA", "fee": 1000000, "feeAssetId": null, "timestamp": 1608288587638, "version": 2, "chainId": 84, "sender": "3Mzmv4as7rjREUwX6wvyxvhCvWa7A8rCWgV", "senderPublicKey": "GDQNDMUTw534Y14NFEGBxViJoKjbhGctK2ZNHMPgHTzC", "proofs": [ "5QiLPXgZZxbVapB2RDau5Fu4RfgUoiX9TFohJPCvYPBi7h6xHxhSrrY1vFthqsNx45f73iWySC32RNCGpypAGkp8" ], "script": "base64:AAIEAAAAAAAAAAwIAhIAEgASBAoCAQEAAAATAAAAAARVU0RUAgAAACw2RFVlWTlnOTVVTjJNRXZLVUcySGQxckhSWnZvUDNISnF5bVpuNFpzdWNQcwAAAAAEVVNETgIAAAAsMjRtSFpMWmMyYlpIcW5VTFRacFdiRUVvZzNTZlNWenJkNXY0YnJ6OXFEN1QAAAAABmlkVVNETgkAAlkAAAABBQAAAARVU0ROAAAAAAZpZFVTRFQJAAJZAAAAAQUAAAAEVVNEVAAAAAANd2l0aGRyYXdEZWxheQAAAAAAAAAAAQAAAAAPZGVjaW1hbFBhcnRVU0ROAAAAAAAAD0JAAAAAAA9kZWNpbWFsUGFydFVTRFQAAAAAAAAPQkAAAAAAF21pbmltYWxBbW91bnRUb1N3YXBVU0RUCQAAaAAAAAIAAAAAAAAAJxAFAAAAD2RlY2ltYWxQYXJ0VVNETgAAAAAXbWluaW1hbEFtb3VudFRvU3dhcFVTRE4JAABoAAAAAgAAAAAAAAAnEAUAAAAPZGVjaW1hbFBhcnRVU0RUAQAAAApjb2xsZWN0S2V5AAAAAwAAAAdhZGRyZXNzA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EdGhpcwQAAAAKdG9XaXRoZHJhdwkBAAAAF2dldExpc3RFbGVtZW50T3JEZWZhdWx0AAAAAwkABLUAAAACBQAAAA13aXRoZHJhd25JbmZvAgAAAAFfAAAAAAAAAAACCQABpAAAAAEFAAAABmFtb3VudAMDCQAAZwAAAAIFAAAABmhlaWdodAUAAAALaGVpZ2h0SW5LZXkJAQAAAAhjb250YWlucwAAAAIFAAAADXdpdGhkcmF3bkluZm8CAAAADW5vdF93aXRoZHJhd24HCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAA2tleQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAGaW52b2tlAAAABmNhbGxlcgkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEtgAAAAEFAAAACnRvV2l0aGRyYXcCAAAAFFdyb25nIHdpdGhkcmF3IGRhdGEhBQAAAAZpZFVTRFQFAAAAA25pbAkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAdV2l0aGRyYXdhbCBpcyBwb3NzaWJsZSBhZnRlciAJAAGkAAAAAQUAAAALaGVpZ2h0SW5LZXkCAAAAKyBoZWlnaHQgb3IgeW91IGhhdmUgYWxyZWFkeSB3aXRoZHJhd24gVVNEVC4AAAAAAW2sPg==", "height": 1314026, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 4 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = "6DUeY9g95UN2MEvKUG2Hd1rHRZvoP3HJqymZn4ZsucPs"
5+
6+let b = "24mHZLZc2bZHqnULTZpWbEEog3SfSVzrd5v4brz9qD7T"
7+
8+let c = fromBase58String(b)
9+
10+let d = fromBase58String(a)
11+
12+let e = 1
13+
14+let f = 1000000
15+
16+let g = 1000000
17+
18+let h = (10000 * f)
19+
20+let i = (10000 * g)
21+
22+func j (k,l,m) = makeString([k, "WITHDRAW", toString(l), "HEIGHT", toString(m)], "_")
23+
24+
25+func n (k) = makeString([k, "balance"], "_")
26+
27+
28+func o (k) = makeString([k, "balance_with_fee"], "_")
29+
30+
31+func p () = throw("To swap USDT to USDN you need attach payment in USDT")
32+
33+
34+func q () = throw("To swap USDN to USDT you need attach payment in USDN")
35+
36+
37+func r () = throw((("you can swap at least " + toString((h / g))) + " tokens"))
38+
39+
40+func s (t) = if ((0 > t))
41+ then (t * -1)
42+ else t
43+
44+
45+func u (v,w) = min([v, w])
46+
47+
48+func x (y,z,A) = if ((size(y) > z))
49+ then y[z]
50+ else A
51+
52+
53+func B (k,v) = {
54+ let C = n(k)
55+ let D = o(k)
56+ let E = valueOrElse(getInteger(this, C), 0)
57+ let F = valueOrElse(getInteger(this, D), 0)
58+ let G = (E + F)
59+ if (if ((v > G))
60+ then true
61+ else (i > v))
62+ then throw("Swap amount fail, amount is to small or to big.")
63+ else {
64+ let H = u(v, E)
65+ let I = (v - H)
66+ let J = ((I / 100) * 2)
67+[H, I, J]
68+ }
69+ }
70+
71+
72+@Callable(K)
73+func swapUSDTtoUSDN () = {
74+ let C = o(toString(K.caller))
75+ let L = value(K.payments[0])
76+ if ((L.assetId != d))
77+ then p()
78+ else {
79+ let v = L.amount
80+ let J = ((v / 100) * 2)
81+ let M = valueOrElse(getInteger(this, C), 0)
82+ if ((h > v))
83+ then r()
84+ else [IntegerEntry(C, (M + v)), ScriptTransfer(K.caller, (v - J), c)]
85+ }
86+ }
87+
88+
89+
90+@Callable(K)
91+func initializationUSDNtoUSDTswap () = {
92+ let L = value(K.payments[0])
93+ let k = toString(K.caller)
94+ if ((L.assetId != c))
95+ then q()
96+ else {
97+ let v = L.amount
98+ let C = n(k)
99+ let D = o(k)
100+ let E = valueOrElse(getInteger(this, C), 0)
101+ let F = valueOrElse(getInteger(this, D), 0)
102+ let G = (E + F)
103+ let N = B(toString(K.caller), v)
104+ let H = valueOrErrorMessage(N[0], "Wrong 'currentWithdrawals' method!")
105+ let I = valueOrErrorMessage(N[1], "Wrong 'currentWithdrawals' method!")
106+ let J = valueOrErrorMessage(N[2], "Wrong 'currentWithdrawals' method!")
107+ let O = ((I + H) - J)
108+ let P = (height + e)
109+ if (isDefined(getString(this, j(toString(K.caller), v, P))))
110+ then throw("You have already started withdrawal process, wait next block.")
111+ else [IntegerEntry(C, (E - H)), IntegerEntry(D, (F - I)), StringEntry(j(toString(K.caller), v, P), makeString(["not_withdrawn", toString((v - J))], "_"))]
112+ }
113+ }
114+
115+
116+
117+@Callable(K)
118+func swapUSDNtoUSDT (v,Q) = {
119+ let R = j(toString(K.caller), v, Q)
120+ let S = valueOrErrorMessage(getString(this, R), ((("This key doesn't exists " + R) + " at address ") + toString(this)))
121+ let T = x(split(S, "_"), 2, toString(v))
122+ if (if ((height >= Q))
123+ then contains(S, "not_withdrawn")
124+ else false)
125+ then [DeleteEntry(R), ScriptTransfer(K.caller, valueOrErrorMessage(parseInt(T), "Wrong withdraw data!"), d)]
126+ else throw((("Withdrawal is possible after " + toString(Q)) + " height or you have already withdrawn USDT."))
127+ }
128+
129+

github/deemru/w8io/026f985 
20.47 ms