tx · 5LcAuQVnnrSXihJsPt6AzWPfhDH2i7dUtmHcUGzQ3gwo

3N9X78QW1zAjygi2GryUJcLVRGoibUYEpkd:  -0.01000000 Waves

2020.10.20 16:09 [1228927] smart account 3N9X78QW1zAjygi2GryUJcLVRGoibUYEpkd > SELF 0.00000000 Waves

{ "type": 13, "id": "5LcAuQVnnrSXihJsPt6AzWPfhDH2i7dUtmHcUGzQ3gwo", "fee": 1000000, "feeAssetId": null, "timestamp": 1603199445931, "version": 2, "chainId": 84, "sender": "3N9X78QW1zAjygi2GryUJcLVRGoibUYEpkd", "senderPublicKey": "ZpNewnM9JQxK4r6Tstqw49SVLsKEszLuegVq4RCxXzj", "proofs": [ "3GaaHt9HXrSVAyPWe5aEU7W9rpATMBVp9Mw7e5hNwKJWUXNe4igGNnwEB9XUCrt5Rs2AJz83LgJ7w1Pxw35mZ4g4" ], "script": "base64:AAIEAAAAAAAAAAwIAhIAEgASBAoCAQEAAAAKAAAAAARVU0RUAgAAACwzRUptN1pOWlJqV25nalZRNnFqRlVlZjNpUlV5SlpvVDRWWW9DWWFlVmRxWgAAAAAEVVNETgIAAAAsMzdqVkhaSzJjZ2JOVEFrTUNMR2RyYnp2RzFyd01qVHJwRDJUR3praWN0d0wAAAAABmlkVVNETgkAAlkAAAABBQAAAARVU0ROAAAAAAZpZFVTRFQJAAJZAAAAAQUAAAAEVVNEVAAAAAANd2l0aGRyYXdEZWxheQAAAAAAAAAAAQAAAAAPZGVjaW1hbFBhcnRVU0ROAAAAAAAAD0JAAAAAAA9kZWNpbWFsUGFydFVTRFQAAAAAAAAPQkAAAAAAF21pbmltYWxBbW91bnRUb1N3YXBVU0RUCQAAaAAAAAIAAAAAAAAAJxAFAAAAD2RlY2ltYWxQYXJ0VVNETgAAAAAXbWluaW1hbEFtb3VudFRvU3dhcFVTRE4JAABoAAAAAgAAAAAAAAAnEAUAAAAPZGVjaW1hbFBhcnRVU0RUAQAAAApjb2xsZWN0S2V5AAAAAwAAAAdhZGRyZX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AAAAIAAAARYW1vdW50VG9Td2FwSW5LZXkAAAALaGVpZ2h0SW5LZXkEAAAAA2tleQkBAAAACmNvbGxlY3RLZXkAAAADCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIFAAAAEWFtb3VudFRvU3dhcEluS2V5BQAAAAtoZWlnaHRJbktleQQAAAANd2l0aGRyYXduSW5mbwQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAANd2l0aGRyYXduSW5mbwUAAAAHJG1hdGNoMAkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwUAAAADa2V5CQAAAgAAAAEJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAGHRoaXMga2V5IGRvZXNuJ3QgZXhpc3RzIAUAAAADa2V5AgAAAA0gYXQgYWRkcmVzcyAgCQAEJQAAAAEFAAAABHRoaXMDAwkAAGcAAAACBQAAAAZoZWlnaHQFAAAAC2hlaWdodEluS2V5CQAAAAAAAAIFAAAADXdpdGhkcmF3bkluZm8CAAAADW5vdF93aXRoZHJhd24HCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAA2tleQIAAAAJd2l0aGRyYXduCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgUAAAARYW1vdW50VG9Td2FwSW5LZXkFAAAABmlkVVNEVAUAAAADbmlsCQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAAB13aXRoZHJhd2FsIGlzIHBvc3NpYmxlIGFmdGVyIAkAAaQAAAABBQAAAAtoZWlnaHRJbktleQIAAAAqIGhlaWdodCBvciB5b3UgaGF2ZSBhbHJlYWR5IHdpdGhkcmF3biBVU0RUAAAAAAsgO3c=", "height": 1228927, "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) = ((((toString(k) + "_WITHDRAW_") + toString(l)) + "_HEIGHT_") + toString(m))
23+
24+
25+@Callable(n)
26+func swapUSDTtoUSDN () = {
27+ let o = value(n.payments[0])
28+ let p = o.assetId
29+ let q = o.amount
30+ let r = n.caller
31+ let s = valueOrElse(getInteger(this, (toString(r) + "_balance")), 0)
32+ if ((p != d))
33+ then throw("to swap USDT to USDN you need attach payment in USDT")
34+ else if ((h > q))
35+ then throw((("you can swap at least " + toString((h / g))) + " tokens"))
36+ else [IntegerEntry((toString(n.caller) + "_balance"), (s + q)), ScriptTransfer(n.caller, q, c)]
37+ }
38+
39+
40+
41+@Callable(n)
42+func initializationUSDNtoUSDTswap () = {
43+ let o = value(n.payments[0])
44+ let p = o.assetId
45+ let t = o.amount
46+ let r = n.caller
47+ let s = {
48+ let u = getInteger(this, (toString(r) + "_balance"))
49+ if ($isInstanceOf(u, "Int"))
50+ then {
51+ let v = u
52+ getIntegerValue(this, (toString(r) + "_balance"))
53+ }
54+ else 0
55+ }
56+ if ((p != c))
57+ then throw("to swap USDN to USDT you need attach payment in USDN")
58+ else if (if ((t > s))
59+ then true
60+ else (i > t))
61+ then throw("swap amount fail")
62+ else {
63+ let w = (height + e)
64+ if (isDefined(getString(this, j(n.caller, t, w))))
65+ then throw("you have already started withdrawal process, wait next block")
66+ else [IntegerEntry((toString(n.caller) + "_balance"), (s - t)), StringEntry(j(n.caller, t, w), "not_withdrawn")]
67+ }
68+ }
69+
70+
71+
72+@Callable(n)
73+func swapUSDNtoUSDT (l,x) = {
74+ let y = j(n.caller, l, x)
75+ let z = {
76+ let u = getString(this, y)
77+ if ($isInstanceOf(u, "String"))
78+ then {
79+ let z = u
80+ getStringValue(this, y)
81+ }
82+ else throw(((("this key doesn't exists " + y) + " at address ") + toString(this)))
83+ }
84+ if (if ((height >= x))
85+ then (z == "not_withdrawn")
86+ else false)
87+ then [StringEntry(y, "withdrawn"), ScriptTransfer(n.caller, l, d)]
88+ else throw((("withdrawal is possible after " + toString(x)) + " height or you have already withdrawn USDT"))
89+ }
90+
91+

github/deemru/w8io/026f985 
16.95 ms