tx · 6KYVAw5XzxsofqQhM5rsfFRR6im2PGwTENNmbNiZmJiA

3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq:  -0.01000000 Waves

2024.03.04 12:40 [3003089] smart account 3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq > SELF 0.00000000 Waves

{ "type": 13, "id": "6KYVAw5XzxsofqQhM5rsfFRR6im2PGwTENNmbNiZmJiA", "fee": 1000000, "feeAssetId": null, "timestamp": 1709545213972, "version": 2, "chainId": 84, "sender": "3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq", "senderPublicKey": "HdwFH8HPYu3HG27yK6bszu1CdR4uik4HgzyTimeSfcYf", "proofs": [ "v2aBg47zsymhTHg6bYBXrTM8m5UNFdWGQFeUNh4VqVMZVHUE7fpQU21a5k84qR6FdwRfQnJZtQcUaoijc2LX7qM" ], "script": "base64:BgIJCAISABIDCgEIEQAQYW1vdW50QXNzZXRJZEtleQINYW1vdW50QXNzZXRJZAAPcHJpY2VBc3NldElkS2V5AgxwcmljZUFzc2V0SWQACmZlZVJhdGVLZXkCB2ZlZVJhdGUBCmdldEFzc2V0SWQBDWFzc2V0SWRTdHJpbmcDCQAAAgUNYXNzZXRJZFN0cmluZwIFV0FWRVMFBHVuaXQJANkEAQUNYXNzZXRJZFN0cmluZwEPZ2V0QXNzZXRCYWxhbmNlAQdhc3NldElkBAckbWF0Y2gwBQdhc3NldElkAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAmlkBQckbWF0Y2gwCQDwBwIFBHRoaXMFAmlkCAkA7wcBBQR0aGlzCWF2YWlsYWJsZQATYW1vdW50QXNzZXRJZFN0cmluZwkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwUQYW1vdW50QXNzZXRJZEtleQANYW1vdW50QXNzZXRJZAkBCmdldEFzc2V0SWQBBRNhbW91bnRBc3NldElkU3RyaW5nABJhbW91bnRBc3NldEJhbGFuY2UJAQ9nZXRBc3NldEJhbGFuY2UBBQ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mUoMTA2MikBBQdhZGRyZXNzBQFpAKhIVsM=", "height": 3003089, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3RSuSX2HnzPk9WDn8is6wWyhe6fPwMcxBZvWSQF8mABE Next: 84HimeExGbNgyFFNkU9A4yjPrvhocm7dgrGYy3yxz3vb Diff:
OldNewDifferences
4141
4242 func r (s,t,u) = {
4343 let v = (t + u)
44- let w = (s - fraction(s, t, v))
44+ let w = fraction(s, t, v)
4545 let x = (s - w)
4646 let y = (w * v)
4747 let z = (s * t)
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 = f(k)
3131
3232 let m = getStringValue(this, b)
3333
3434 let n = d(m)
3535
3636 let o = f(n)
3737
3838 let p = 100000000
3939
4040 let q = valueOrElse(getInteger(this, c), 1000000)
4141
4242 func r (s,t,u) = {
4343 let v = (t + u)
44- let w = (s - fraction(s, t, v))
44+ let w = fraction(s, t, v)
4545 let x = (s - w)
4646 let y = (w * v)
4747 let z = (s * t)
4848 $Tuple7(x, s, t, z, w, v, y)
4949 }
5050
5151
5252 func A (B,C,u) = {
5353 let D = r(B, C, u)
5454 let x = D._1
5555 let s = D._2
5656 let t = D._3
5757 let z = D._4
5858 let w = D._5
5959 let v = D._6
6060 let y = D._7
6161 x
6262 }
6363
6464
6565 func E (F,u) = {
6666 let G = if ((F == k))
6767 then $Tuple2(n, k)
6868 else $Tuple2(k, n)
6969 let H = G._1
7070 let I = G._2
7171 let s = f(H)
7272 let t = (f(I) - u)
7373 let J = A(s, t, u)
7474 let K = fraction(J, q, p)
7575 let x = (J - K)
7676 let L = if ((F == k))
7777 then fraction(x, p, u)
7878 else fraction(u, p, x)
7979 $Tuple4(x, K, H, L)
8080 }
8181
8282
8383 func M (N,O) = {
8484 let P = [if ((size(O.payments) > 0))
8585 then true
8686 else throw("should be with 1 payment"), if (if ((O.payments[0].assetId == k))
8787 then true
8888 else (O.payments[0].assetId == n))
8989 then true
9090 else throw(makeString(["payment assetId should be (", j, ") or (", m, ")"], " "))]
9191 if ((P == P))
9292 then {
9393 let F = O.payments[0].assetId
9494 let u = O.payments[0].amount
9595 let Q = E(F, u)
9696 let x = Q._1
9797 let K = Q._2
9898 let R = Q._3
9999 let L = Q._4
100100 let S = if ((K != 0))
101101 then [ScriptTransfer(N, x, R)]
102102 else throw("amount is too low")
103103 $Tuple2(S, $Tuple4(x, K, R, L))
104104 }
105105 else throw("Strict value is not equal to itself.")
106106 }
107107
108108
109109 @Callable(O)
110110 func swap () = M(O.caller, O)
111111
112112
113113
114114 @Callable(O)
115115 func swapFor (N) = M(addressFromStringValue(N), O)
116116
117117

github/deemru/w8io/026f985 
30.34 ms