tx · BrrPwBp1mQrE92yjfFyAgzAEuAy1qUW4E97RNWAFYqnY

3MxCNvgYGmRUBapjxYK6QJe93k3zGKmESW5:  -0.01400000 Waves

2020.08.05 15:14 [1119101] smart account 3MxCNvgYGmRUBapjxYK6QJe93k3zGKmESW5 > SELF 0.00000000 Waves

{ "type": 13, "id": "BrrPwBp1mQrE92yjfFyAgzAEuAy1qUW4E97RNWAFYqnY", "fee": 1400000, "feeAssetId": null, "timestamp": 1596629696416, "version": 1, "sender": "3MxCNvgYGmRUBapjxYK6QJe93k3zGKmESW5", "senderPublicKey": "DUAUjNB9PvmJwZsXoeDa41DLxMj8tYAfSCr5NEzkuWku", "proofs": [ "3h2NGMcbtwK5pkPbFwag5GYk5JRMZWy1RoEFEu3srSGVUUWPnL8rv4JFSedgjYV5WUju9XjZ1EgHerLNHZwKk52j" ], "script": "base64:AAIDAAAAAAAAAAwIARIAEgASBAoCAQEAAAAJAAAAAARVU0RUAgAAACxETUplTTlYSlRFbmhCbVlyTEJkVktrWXg2R2ViMzdlOXBneUVjMjZSMUpLWgAAAAAEVVNETgIAAAAsN1lXVmJydld4Qm5UU1pHUk12UkJmcTV2cUFTOWtROFVmNXY1QlN4eWE2Wm8AAAAABmlkVVNETgkAAlkAAAABBQAAAARVU0ROAAAAAAZpZFVTRFQJAAJZAAAAAQUAAAAEVVNEVAAAAAANd2l0aGRyYXdEZWxheQAAAAAAAAAAAQAAAAAPZGVjaW1hbFBhcnRVU0ROAAAAAAAAD0JAAAAAAA9kZWNpbWFsUGFydFVTRFQAAAAAAAAPQkAAAAAAF21pbmltYWxBbW91bnRUb1N3YXBVU0RUCQAAaAAAAAIAAAAAAAABhqAFAAAAD2RlY2ltYWxQYXJ0VVNETgAAAAAXbWluaW1hbEFtb3VudFRvU3dhcFVTRE4JAABoAAAAAgAAAAAAAADDUAUAAAAPZGVjaW1hbFBhcnRVU0RUAAAAAwAAAApjb250ZXh0T2JqAQAAAA5zd2FwVVNEVHRvVVNETgAAAAAEA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AAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAA2tleQIAAAAJd2l0aGRyYXduBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyBQAAABFhbW91bnRUb1N3YXBJbktleQUAAAAGaWRVU0RUBQAAAANuaWwJAAACAAAAAQkAASwAAAACCQABLAAAAAICAAAAHXdpdGhkcmF3YWwgaXMgcG9zc2libGUgYWZ0ZXIgCQABpAAAAAEFAAAAC2hlaWdodEluS2V5AgAAACogaGVpZ2h0IG9yIHlvdSBoYXZlIGFscmVhZHkgd2l0aGRyYXduIFVTRFQAAAAA45j+gg==", "chainId": 84, "height": 1119101, "spentComplexity": 0 } View: original | compacted Prev: AZjGnbZw7ZCnJQtKYJWFb1koPB1b2hnMo4NGKWHX3EmM Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "DMJeM9XJTEnhBmYrLBdVKkYx6Geb37e9pgyEc26R1JKZ"
55
66 let b = "7YWVbrvWxBnTSZGRMvRBfq5vqAS9kQ8Uf5v5BSxya6Zo"
77
88 let c = fromBase58String(b)
99
1010 let d = fromBase58String(a)
1111
1212 let e = 1
1313
1414 let f = 1000000
1515
1616 let g = 1000000
1717
1818 let h = (100000 * f)
1919
2020 let i = (50000 * g)
2121
2222 @Callable(j)
2323 func swapUSDTtoUSDN () = {
2424 let k = {
2525 let l = j.payment
2626 if ($isInstanceOf(l, "AttachedPayment"))
2727 then {
2828 let m = l
2929 m
3030 }
3131 else throw("Payment not attached")
3232 }
3333 let n = k.assetId
3434 let o = k.amount
3535 let p = j.caller
3636 let q = {
3737 let l = getInteger(this, (toString(p) + "_balance"))
3838 if ($isInstanceOf(l, "Int"))
3939 then {
4040 let r = l
4141 value(getInteger(this, (toString(p) + "_balance")))
4242 }
4343 else 0
4444 }
4545 if ((n != d))
4646 then throw("to swap USDT to USDN you need attach payment in USDT")
4747 else if ((h > o))
4848 then throw((("you can swap at least " + toString((h / f))) + " tokens"))
4949 else ScriptResult(WriteSet([DataEntry((toString(j.caller) + "_balance"), (q + o))]), TransferSet([ScriptTransfer(j.caller, o, c)]))
5050 }
5151
5252
5353
5454 @Callable(j)
5555 func initializationUSDNtoUSDTswap () = {
5656 let k = {
5757 let l = j.payment
5858 if ($isInstanceOf(l, "AttachedPayment"))
5959 then {
6060 let m = l
6161 m
6262 }
6363 else throw("Payment not attached")
6464 }
6565 let n = k.assetId
6666 let s = k.amount
6767 let p = j.caller
6868 let q = {
6969 let l = getInteger(this, (toString(p) + "_balance"))
7070 if ($isInstanceOf(l, "Int"))
7171 then {
7272 let r = l
7373 getIntegerValue(this, (toString(p) + "_balance"))
7474 }
7575 else 0
7676 }
7777 if ((n != c))
7878 then throw("to swap USDN to USDT you need attach payment in USDN")
7979 else if (if ((s > q))
8080 then true
8181 else (i > s))
8282 then throw("swap amount fail")
8383 else if (isDefined(getString(this, ((((toString(j.caller) + "_WITHDRAW_") + toString(s)) + "_HEIGHT_") + toString((height + e))))))
8484 then throw("you have already started withdrawal process, wait next block")
8585 else ScriptResult(WriteSet([DataEntry((toString(j.caller) + "_balance"), (q - s)), DataEntry(((((toString(j.caller) + "_WITHDRAW_") + toString(s)) + "_HEIGHT_") + toString((height + e))), "not_withdrawn")]), TransferSet(nil))
8686 }
8787
8888
8989
9090 @Callable(j)
9191 func swapUSDNtoUSDT (t,u) = {
9292 let v = ((((toString(j.caller) + "_WITHDRAW_") + toString(t)) + "_HEIGHT_") + toString(u))
9393 let w = {
9494 let l = getString(this, v)
9595 if ($isInstanceOf(l, "String"))
9696 then {
9797 let w = l
9898 getStringValue(this, v)
9999 }
100100 else throw(((("this key doesn't exists " + v) + " at address ") + toString(this)))
101101 }
102102 if (if ((height >= u))
103103 then (w == "not_withdrawn")
104104 else false)
105105 then ScriptResult(WriteSet([DataEntry(v, "withdrawn")]), TransferSet([ScriptTransfer(j.caller, t, d)]))
106106 else throw((("withdrawal is possible after " + toString(u)) + " height or you have already withdrawn USDT"))
107107 }
108108
109109

github/deemru/w8io/169f3d6 
27.75 ms