tx · HhD2BVD5Nrzp9NkMnioivX7qSq4THeTBajYR1mXwDVQZ

3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq:  -0.01000000 Waves

2024.03.07 12:11 [3007424] smart account 3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq > SELF 0.00000000 Waves

{ "type": 13, "id": "HhD2BVD5Nrzp9NkMnioivX7qSq4THeTBajYR1mXwDVQZ", "fee": 1000000, "feeAssetId": null, "timestamp": 1709802704104, "version": 2, "chainId": 84, "sender": "3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq", "senderPublicKey": "HdwFH8HPYu3HG27yK6bszu1CdR4uik4HgzyTimeSfcYf", "proofs": [ "4WxeMLDqNi97kukGR5guLan4wqAFD8h8gPGt14iUzHZmaBzVbgh3yKgSrHtKCuWRCghF1Fs4bDCAAioNHf8oLa42" ], "script": "base64:BgIOCAISABIDCgEBEgMKAQgQABBhbW91bnRBc3NldElkS2V5Ag1hbW91bnRBc3NldElkAA9wcmljZUFzc2V0SWRLZXkCDHByaWNlQXNzZXRJZAAKZmVlUmF0ZUtleQIHZmVlUmF0ZQEKZ2V0QXNzZXRJZAENYXNzZXRJZFN0cmluZwMJAAACBQ1hc3NldElkU3RyaW5nAgVXQVZFUwUEdW5pdAkA2QQBBQ1hc3NldElkU3RyaW5nAQ9nZXRBc3NldEJhbGFuY2UBB2Fzc2V0SWQEByRtYXRjaDAFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCaWQFByRtYXRjaDAJAPAHAgUEdGhpcwUCaWQICQDvBwEFBHRoaXMJYXZhaWxhYmxlABNhbW91bnRBc3NldElkU3RyaW5nCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzBRBhbW91bnRBc3NldElkS2V5AA1hbW91bnRBc3NldElkCQEKZ2V0QXNzZXRJZAEFE2Ftb3VudEFzc2V0SWRTdHJpbmcAEnByaWNlQXNzZXRJZFN0cmluZwkBEUBleHRyTmF0aX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bW91bnQIBQskdDAzMzE5MzM4MgJfMQQJZmVlQW1vdW50CAULJHQwMzMxOTMzODICXzIEC3NlbmRBc3NldElkCAULJHQwMzMxOTMzODICXzMEDXVzZXJSZWFsUHJpY2UIBQskdDAzMzE5MzM4MgJfNAMJAGYCBQltaW5BbW91bnQFCnNlbmRBbW91bnQJAAIBCQC5CQIJAMwIAgIaUHJpY2Ugc2xpcHBlZC4gbWluQW1vdW50OiAJAMwIAgkApAMBBQltaW5BbW91bnQJAMwIAgINIHN3YXBBbW91bnQ6IAkAzAgCCQCkAwEFCnNlbmRBbW91bnQFA25pbAIACQCUCgIFC3NlbmRBY3Rpb25zBQV0dXBsZQFpAQdzd2FwRm9yAQdhZGRyZXNzCQEMc3dhcEludGVybmFsAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUHYWRkcmVzcwUBaQDrQitC", "height": 3007424, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Dsqx1vYTXVkoXgB9eMjse8rbhQVLaRQWBXzWRvWnPsp Next: 3EkWVLxCyv7nZ5cY3GPJsqTUodzdYsD61AY3FN76aeZc Diff:
OldNewDifferences
9090 }
9191
9292
93+func N (O,t) = {
94+ let P = x(d(O), t, true)
95+ let w = P._1
96+ let E = P._2
97+ let B = P._3
98+ let F = P._4
99+ $Tuple3(w, F, B)
100+ }
101+
102+
93103 @Callable(I)
94104 func swap () = G(I.caller, I)
95105
96106
97107
98108 @Callable(I)
99-func swapNoLess (N) = {
100- let O = G(I.caller, I)
101- let M = O._1
102- let P = O._2
103- let Q = P
104- let w = Q._1
105- let E = Q._2
106- let L = Q._3
107- let F = Q._4
108- if ((N > w))
109- then throw(makeString(["Price slipped. minAmount: ", toString(N), " swapAmount: ", toString(w)], ""))
110- else $Tuple2(M, P)
109+func swapNoLess (Q) = {
110+ let R = G(I.caller, I)
111+ let M = R._1
112+ let S = R._2
113+ let T = S
114+ let w = T._1
115+ let E = T._2
116+ let L = T._3
117+ let F = T._4
118+ if ((Q > w))
119+ then throw(makeString(["Price slipped. minAmount: ", toString(Q), " swapAmount: ", toString(w)], ""))
120+ else $Tuple2(M, S)
111121 }
112122
113123
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "amountAssetId"
55
66 let b = "priceAssetId"
77
88 let c = "feeRate"
99
1010 func d (e) = if ((e == "WAVES"))
1111 then unit
1212 else fromBase58String(e)
1313
1414
1515 func f (g) = {
1616 let h = g
1717 if ($isInstanceOf(h, "ByteVector"))
1818 then {
1919 let i = h
2020 assetBalance(this, i)
2121 }
2222 else wavesBalance(this).available
2323 }
2424
2525
2626 let j = getStringValue(this, a)
2727
2828 let k = d(j)
2929
3030 let l = getStringValue(this, b)
3131
3232 let m = d(l)
3333
3434 let n = 100000000
3535
3636 let o = valueOrElse(getInteger(this, c), 200000)
3737
3838 func p () = fraction(f(m), n, f(k))
3939
4040
4141 func q (r,s,t) = {
4242 let u = (s + t)
4343 let v = fraction(r, s, u)
4444 let w = (r - v)
4545 w
4646 }
4747
4848
4949 func x (y,t,z) = {
5050 let A = if ((y == k))
5151 then $Tuple2(m, k)
5252 else $Tuple2(k, m)
5353 let B = A._1
5454 let C = A._2
5555 let r = f(B)
5656 let s = (f(C) - (if (z)
5757 then 0
5858 else t))
5959 let D = q(r, s, t)
6060 let E = fraction(D, o, n)
6161 let w = (D - E)
6262 let F = if ((y == k))
6363 then fraction(w, n, t)
6464 else fraction(t, n, w)
6565 $Tuple4(w, E, B, F)
6666 }
6767
6868
6969 func G (H,I) = {
7070 let J = [if ((size(I.payments) > 0))
7171 then true
7272 else throw("should be with 1 payment"), if (containsElement([k, m], I.payments[0].assetId))
7373 then true
7474 else throw(makeString(["payment assetId should be", j, "or", l], " "))]
7575 if ((J == J))
7676 then {
7777 let y = I.payments[0].assetId
7878 let t = I.payments[0].amount
7979 let K = x(y, t, false)
8080 let w = K._1
8181 let E = K._2
8282 let L = K._3
8383 let F = K._4
8484 let M = if ((E > 0))
8585 then [ScriptTransfer(H, w, L)]
8686 else throw("amount is too low")
8787 $Tuple2(M, $Tuple4(w, E, L, F))
8888 }
8989 else throw("Strict value is not equal to itself.")
9090 }
9191
9292
93+func N (O,t) = {
94+ let P = x(d(O), t, true)
95+ let w = P._1
96+ let E = P._2
97+ let B = P._3
98+ let F = P._4
99+ $Tuple3(w, F, B)
100+ }
101+
102+
93103 @Callable(I)
94104 func swap () = G(I.caller, I)
95105
96106
97107
98108 @Callable(I)
99-func swapNoLess (N) = {
100- let O = G(I.caller, I)
101- let M = O._1
102- let P = O._2
103- let Q = P
104- let w = Q._1
105- let E = Q._2
106- let L = Q._3
107- let F = Q._4
108- if ((N > w))
109- then throw(makeString(["Price slipped. minAmount: ", toString(N), " swapAmount: ", toString(w)], ""))
110- else $Tuple2(M, P)
109+func swapNoLess (Q) = {
110+ let R = G(I.caller, I)
111+ let M = R._1
112+ let S = R._2
113+ let T = S
114+ let w = T._1
115+ let E = T._2
116+ let L = T._3
117+ let F = T._4
118+ if ((Q > w))
119+ then throw(makeString(["Price slipped. minAmount: ", toString(Q), " swapAmount: ", toString(w)], ""))
120+ else $Tuple2(M, S)
111121 }
112122
113123
114124
115125 @Callable(I)
116126 func swapFor (H) = G(addressFromStringValue(H), I)
117127
118128

github/deemru/w8io/169f3d6 
30.62 ms