tx · HJHQZ9ZMheJgCnthmmwiJhLjXWx6TB3ka7ohjnVR5FEM

3Mr3o7NWg8ALfPQBqSbDPAVxmRHmwrw7DSS:  -0.01000000 Waves

2020.10.20 17:24 [1228999] smart account 3Mr3o7NWg8ALfPQBqSbDPAVxmRHmwrw7DSS > SELF 0.00000000 Waves

{ "type": 13, "id": "HJHQZ9ZMheJgCnthmmwiJhLjXWx6TB3ka7ohjnVR5FEM", "fee": 1000000, "feeAssetId": null, "timestamp": 1603203880902, "version": 2, "chainId": 84, "sender": "3Mr3o7NWg8ALfPQBqSbDPAVxmRHmwrw7DSS", "senderPublicKey": "7Cr1Tgm1DSS9JcrtDJRQveCL3U4e2F4NbszS8aCi5SHQ", "proofs": [ "26WgGrPhDy3XzKyLmhxvaXjhJ2yQvonBsvick1MUc949zh2gw1UkTJwbzKdN6jyP5Vj4eioSGtZWRCVZqn1KfNwF" ], "script": "base64:AAIEAAAAAAAAAAwIAhIAEgASBAoCAQEAAAAOAAAAAARVU0RUAgAAACwzRUptN1pOWlJqV25nalZRNnFqRlVlZjNpUlV5SlpvVDRWWW9DWWFlVmRxWgAAAAAEVVNETgIAAAAsMzdqVkhaSzJjZ2JOVEFrTUNMR2RyYnp2RzFyd01qVHJwRDJUR3praWN0d0wAAAAABmlkVVNETgkAAlkAAAABBQAAAARVU0ROAAAAAAZpZFVTRFQJAAJZAAAAAQUAAAAEVVNEVAAAAAANd2l0aGRyYXdEZWxheQAAAAAAAAAAAQAAAAAPZGVjaW1hbFBhcnRVU0ROAAAAAAAAD0JAAAAAAA9kZWNpbWFsUGFydFVTRFQAAAAAAAAPQkAAAAAAF21pbmltYWxBbW91bnRUb1N3YXBVU0RUCQAAaAAAAAIAAAAAAAAAJxAFAAAAD2RlY2ltYWxQYXJ0VVNETgAAAAAXbWluaW1hbEFtb3VudFRvU3dhcFVTRE4JAABoAAAAAgAAAAAAAAAnEAUAAAAPZGVjaW1hbFBhcnRVU0RUAQAAAApjb2xsZWN0S2V5AAAAA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AA25pbAkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAdd2l0aGRyYXdhbCBpcyBwb3NzaWJsZSBhZnRlciAJAAGkAAAAAQUAAAALaGVpZ2h0SW5LZXkCAAAAKiBoZWlnaHQgb3IgeW91IGhhdmUgYWxyZWFkeSB3aXRoZHJhd24gVVNEVAAAAABwANWw", "height": 1228999, "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 = "3EJm7ZNZRjWngjVQ6qjFUef3iRUyJZoT4VYoCYaeVdqZ"
5+
6+let b = "37jVHZK2cgbNTAkMCLGdrbzvG1rwMjTrpD2TGzkictwL"
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([toString(k), "WITHDRAW", toString(l), "HEIGHT", toString(m)], "_")
23+
24+
25+func n (k) = makeString([toString(k), "balance"], "_")
26+
27+
28+func o (k) = makeString([toString(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((("you can swap at least " + toString((h / g))) + " tokens"))
35+
36+
37+@Callable(r)
38+func swapUSDTtoUSDN () = {
39+ let s = o(r.caller)
40+ let t = value(r.payments[0])
41+ if ((t.assetId != d))
42+ then p()
43+ else {
44+ let u = t.amount
45+ let v = valueOrElse(getInteger(this, s), 0)
46+ if ((h > u))
47+ then q()
48+ else [IntegerEntry(s, (v + u)), ScriptTransfer(r.caller, u, c)]
49+ }
50+ }
51+
52+
53+
54+@Callable(r)
55+func initializationUSDNtoUSDTswap () = {
56+ let t = value(r.payments[0])
57+ let w = t.assetId
58+ let x = t.amount
59+ let y = r.caller
60+ let s = n(r.caller)
61+ let v = {
62+ let z = getInteger(this, s)
63+ if ($isInstanceOf(z, "Int"))
64+ then {
65+ let A = z
66+ getIntegerValue(this, s)
67+ }
68+ else 0
69+ }
70+ if ((w != c))
71+ then throw("to swap USDN to USDT you need attach payment in USDN")
72+ else if (if ((x > v))
73+ then true
74+ else (i > x))
75+ then throw("swap amount fail")
76+ else {
77+ let B = (height + e)
78+ if (isDefined(getString(this, j(r.caller, x, B))))
79+ then throw("you have already started withdrawal process, wait next block")
80+ else [IntegerEntry((toString(r.caller) + "_balance"), (v - x)), StringEntry(j(r.caller, x, B), "not_withdrawn")]
81+ }
82+ }
83+
84+
85+
86+@Callable(r)
87+func swapUSDNtoUSDT (l,C) = {
88+ let D = j(r.caller, l, C)
89+ let E = {
90+ let z = getString(this, D)
91+ if ($isInstanceOf(z, "String"))
92+ then {
93+ let E = z
94+ getStringValue(this, D)
95+ }
96+ else throw(((("this key doesn't exists " + D) + " at address ") + toString(this)))
97+ }
98+ if (if ((height >= C))
99+ then (E == "not_withdrawn")
100+ else false)
101+ then [DeleteEntry(D), ScriptTransfer(r.caller, l, d)]
102+ else throw((("withdrawal is possible after " + toString(C)) + " height or you have already withdrawn USDT"))
103+ }
104+
105+

github/deemru/w8io/fabc49c 
17.03 ms