tx · Cn5Vz8MkuM4fVutgyYi8guu2yAYMoDSgMCZex1Csy8yh

3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8:  -0.00300000 Waves

2023.01.16 23:34 [2407981] smart account 3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8 > SELF 0.00000000 Waves

{ "type": 13, "id": "Cn5Vz8MkuM4fVutgyYi8guu2yAYMoDSgMCZex1Csy8yh", "fee": 300000, "feeAssetId": null, "timestamp": 1673901264386, "version": 2, "chainId": 84, "sender": "3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8", "senderPublicKey": "ATuPi6fn8277fNiCoRgPTav9QG15CJoW95GEGcDmfYt8", "proofs": [ "SgGLMjDSiVw5rNA6wEMTdwarubAg2raidckNbzM3E9r8TF7vk6UNQPSrvzMXFm6DGurZ9atpx8SJmxDxvT2VFGz" ], "script": "base64:BgILCAISABIDCgEIEgAUAAV3Y2RJZAIsNVdFNkhCVnNtQWJhcFRtVEtwbXlXbVVSNjdmYzE2eWJGck5qeHptREJ0UGEAC3djZERlY2ltYWxzAAIBE3RvdGFsU2hhcmVCeVVzZXJLRVkBBW93bmVyCQC5CQIJAMwIAgIGc2hhcmVzCQDMCAIFBW93bmVyBQNuaWwCAV8BFHRvdGFsU2hhcmVCeVVzZXJSRUFEAQVvd25lcgkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzCQETdG90YWxTaGFyZUJ5VXNlcktFWQEFBW93bmVyAAAAEnRvdGFsSXNzdWVkV0NEX0tFWQIQdG90YWxfaXNzdWVkX1dDRAETdG90YWxJc3N1ZWRXQ0RfUkVBRAAJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUSdG90YWxJc3N1ZWRXQ0RfS0VZAAAADnRvdGFsU2hhcmVzS0VZAgx0b3RhbF9zaGFyZXMBD3RvdGFsU2hhcmVzUkVBRAAJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUOdG90YWxTaGFyZXNLRVkAAA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ogCQCkAwEJAQdnZXRUTURVAADm0O2m", "height": 2407981, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3K9Li9Aa78jsBpLA96h865KrXmT6S8wSvRK8J95qezgZ Next: 9KdqPcwAza4QYSE1EYk4xvA1XXvfT7jxiyHANixsGPGV Diff:
OldNewDifferences
5656 func w () = v(g(), p())
5757
5858
59-func x (d) = fraction(w(), l(d), 100000000)
59+func x () = {
60+ let y = (k() - i())
61+ if ((y > 0))
62+ then t((y * 10), g(), p())
63+ else 0
64+ }
6065
6166
62-@Callable(y)
67+func z (d) = fraction(w(), l(d), 100000000)
68+
69+
70+func A (d) = fraction(x(), l(d), 100000000)
71+
72+
73+@Callable(B)
6374 func deposit_share () = {
64- let z = if ((size(y.payments) == 1))
65- then y.payments[0]
75+ let C = if ((size(B.payments) == 1))
76+ then B.payments[0]
6677 else throw("Attached payment is required")
67- if (isDefined(z.assetId))
78+ if (isDefined(C.assetId))
6879 then throw("Only WAVES is allowed.")
6980 else {
70- let A = toString(y.caller)
71- let B = e(A)
81+ let D = toString(B.caller)
82+ let E = e(D)
7283 let m = i()
73- let C = k()
74-[IntegerEntry(c(A), (B + z.amount)), IntegerEntry(h, (m + z.amount)), IntegerEntry(j, (C + z.amount))]
84+ let F = k()
85+[IntegerEntry(c(D), (E + C.amount)), IntegerEntry(h, (m + C.amount)), IntegerEntry(j, (F + C.amount))]
7586 }
7687 }
7788
7889
7990
80-@Callable(y)
81-func test (A) = throw(("Result: " + toString(x(A))))
91+@Callable(B)
92+func test (D) = throw(("Result: " + toString(z(D))))
8293
8394
8495
85-@Callable(y)
86-func test_ii (r,s) = throw(("Result: " + toString(v(r, s))))
96+@Callable(B)
97+func test_ii () = throw(("Result: " + toString(x())))
8798
8899
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "5WE6HBVsmAbapTmTKpmyWmUR67fc16ybFrNjxzmDBtPa"
55
66 let b = 2
77
88 func c (d) = makeString(["shares", d], "_")
99
1010
1111 func e (d) = valueOrElse(getInteger(this, c(d)), 0)
1212
1313
1414 let f = "total_issued_WCD"
1515
1616 func g () = valueOrElse(getInteger(this, f), 0)
1717
1818
1919 let h = "total_shares"
2020
2121 func i () = valueOrElse(getInteger(this, h), 0)
2222
2323
2424 let j = "total_collateral"
2525
2626 func k () = valueOrElse(getInteger(this, j), 0)
2727
2828
2929 func l (d) = {
3030 let m = i()
3131 if ((m > 0))
3232 then {
3333 let n = e(d)
3434 fraction(100000000, n, m)
3535 }
3636 else 0
3737 }
3838
3939
4040 let o = "A"
4141
4242 func p () = valueOrElse(getInteger(this, "A"), 100)
4343
4444
4545 func q (r,s) = (500000000 - (log(r, b, 10, 0, 6, HALFUP) * s))
4646
4747
4848 func t (u,r,s) = fraction(u, pow(10, 0, q(r, s), 8, 8, HALFUP), 100000000)
4949
5050
5151 func v (r,s) = if ((r > 10000000))
5252 then t(r, r, s)
5353 else 10000000
5454
5555
5656 func w () = v(g(), p())
5757
5858
59-func x (d) = fraction(w(), l(d), 100000000)
59+func x () = {
60+ let y = (k() - i())
61+ if ((y > 0))
62+ then t((y * 10), g(), p())
63+ else 0
64+ }
6065
6166
62-@Callable(y)
67+func z (d) = fraction(w(), l(d), 100000000)
68+
69+
70+func A (d) = fraction(x(), l(d), 100000000)
71+
72+
73+@Callable(B)
6374 func deposit_share () = {
64- let z = if ((size(y.payments) == 1))
65- then y.payments[0]
75+ let C = if ((size(B.payments) == 1))
76+ then B.payments[0]
6677 else throw("Attached payment is required")
67- if (isDefined(z.assetId))
78+ if (isDefined(C.assetId))
6879 then throw("Only WAVES is allowed.")
6980 else {
70- let A = toString(y.caller)
71- let B = e(A)
81+ let D = toString(B.caller)
82+ let E = e(D)
7283 let m = i()
73- let C = k()
74-[IntegerEntry(c(A), (B + z.amount)), IntegerEntry(h, (m + z.amount)), IntegerEntry(j, (C + z.amount))]
84+ let F = k()
85+[IntegerEntry(c(D), (E + C.amount)), IntegerEntry(h, (m + C.amount)), IntegerEntry(j, (F + C.amount))]
7586 }
7687 }
7788
7889
7990
80-@Callable(y)
81-func test (A) = throw(("Result: " + toString(x(A))))
91+@Callable(B)
92+func test (D) = throw(("Result: " + toString(z(D))))
8293
8394
8495
85-@Callable(y)
86-func test_ii (r,s) = throw(("Result: " + toString(v(r, s))))
96+@Callable(B)
97+func test_ii () = throw(("Result: " + toString(x())))
8798
8899

github/deemru/w8io/169f3d6 
53.02 ms