tx · 8Gf6LecFJ8qt6Q17gNyF6mhyaXVzxDXETYvbGpEyvm2X

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.05000000 Waves

2023.03.27 11:46 [2508162] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "8Gf6LecFJ8qt6Q17gNyF6mhyaXVzxDXETYvbGpEyvm2X", "fee": 5000000, "feeAssetId": null, "timestamp": 1679906877555, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "4ZLvTy97RiqByF1Qrw1rHWB138QHet4PR1LNeGakoazBqig2pauRQD9T4T5A2LYuQLY9mRf4bkAjLeQ7N6LG79Nd" ], "script": "base64:BgIPCAISABIAEgASBQoDAQEBCQAMY29udHJhY3RGaWxlAglyZWJhbGFuY2UAD2tleXNUYXJnZXRSYXRpbwIPJXNfX3RhcmdldFJhdGlvABRrZXlBZGRpdGlvbmFsQmFsYW5jZQIbJXNfX2FkZGl0dGlvbmFsV2F2ZXNCYWxhbmNlABhrZXlTV2F2ZXNBZGRpdGlvbkJhbGFuY2UCESVzX19zV2F2ZXNCYWxhbmNlABBrZXlTV2F2ZXNBc3NldElkAhElc19fc1dhdmVzQXNzZXRJZAAPa2V5UHJveHlBZGRyZXNzAhAlc19fcHJveHlBZGRyZXNzARBnZXRJbnRlZ2VyT3JaZXJvAQppbnRlZ2VyS2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFCmludGVnZXJLZXkDCQABAgUHJG1hdGNoMAIDSW50BAN2YWwFByRtYXRjaDAFA3ZhbAAAARBnZXRTdHJpbmdPclRocm93AQlzdHJpbmdLZXkEByRtYXRjaDAJAJ0IAgUEdGhpcwUJc3RyaW5nS2V5AwkAAQIFByRtYXRjaDACBlN0cmluZwQBcwUHJG1hdGNoMAUBc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FBmNoYW5nZQkAzAgCCQCsAgICCWRlcG9zaXQ6IAkApAMBBQpzZW5kQW1vdW50BQNuaWwECnNlbmRBbW91bnQFBmNoYW5nZQkAlAoCBQNuaWwJAMwIAgUGbmV3UmVnCQDMCAIFF3RhcmdldEFkZGl0aW9uYWxCYWxhbmNlCQDMCAIFBmNoYW5nZQkAzAgCCQCsAgICCndpdGhkcmF3OiAJAKQDAQUKc2VuZEFtb3VudAUDbmlsAC4sysI=", "height": 2508162, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: QKY7KPXGK5AjA7wPDp8y2fMxF2j5owy4bQXFUSaccdR Next: 7udwsQSXbHLwcqkw8Wt1byuy3hDwZmnBPDmTp27xMMy2 Diff:
OldNewDifferences
6464 let v = fraction(t, u, 100)
6565 let w = (q - v)
6666 let x = (s + w)
67- $Tuple2(nil, [v, x, w])
67+ if ((0 > w))
68+ then {
69+ let y = (w * -1)
70+ $Tuple2(nil, [x, v, w, ("deposit: " + toString(y))])
71+ }
72+ else {
73+ let y = w
74+ $Tuple2(nil, [x, v, w, ("withdraw: " + toString(y))])
75+ }
6876 }
6977
7078
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "rebalance"
55
66 let b = "%s__targetRatio"
77
88 let c = "%s__addittionalWavesBalance"
99
1010 let d = "%s__sWavesBalance"
1111
1212 let e = "%s__sWavesAssetId"
1313
1414 let f = "%s__proxyAddress"
1515
1616 func g (h) = {
1717 let i = getInteger(this, h)
1818 if ($isInstanceOf(i, "Int"))
1919 then {
2020 let j = i
2121 j
2222 }
2323 else 0
2424 }
2525
2626
2727 func k (l) = {
2828 let i = getString(this, l)
2929 if ($isInstanceOf(i, "String"))
3030 then {
3131 let m = i
3232 m
3333 }
3434 else throw((("[" + l) + "] is empty"))
3535 }
3636
3737
3838 func n () = (wavesBalance(this).regular + g(c))
3939
4040
4141 @Callable(o)
4242 func returnWavesBalance () = $Tuple2(nil, n())
4343
4444
4545
4646 @Callable(o)
4747 func returnSWavesBalance () = $Tuple2(nil, g(d))
4848
4949
5050
5151 @Callable(o)
5252 func calcRatio () = {
5353 let p = wavesBalance(this).regular
5454 let q = g(c)
5555 let r = fraction(100, q, (q + p))
5656 $Tuple2(nil, r)
5757 }
5858
5959
6060
6161 @Callable(o)
6262 func calcRatioTest (s,q,t) = {
6363 let u = (s + q)
6464 let v = fraction(t, u, 100)
6565 let w = (q - v)
6666 let x = (s + w)
67- $Tuple2(nil, [v, x, w])
67+ if ((0 > w))
68+ then {
69+ let y = (w * -1)
70+ $Tuple2(nil, [x, v, w, ("deposit: " + toString(y))])
71+ }
72+ else {
73+ let y = w
74+ $Tuple2(nil, [x, v, w, ("withdraw: " + toString(y))])
75+ }
6876 }
6977
7078

github/deemru/w8io/169f3d6 
32.61 ms