tx · mvBeaTcVMZgX6bMcNUspWUWGPuG2YgeKrdGoGYsLbGe

3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8:  -0.00400000 Waves

2023.01.22 16:54 [2416247] smart account 3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8 > SELF 0.00000000 Waves

{ "type": 13, "id": "mvBeaTcVMZgX6bMcNUspWUWGPuG2YgeKrdGoGYsLbGe", "fee": 400000, "feeAssetId": null, "timestamp": 1674395683925, "version": 2, "chainId": 84, "sender": "3N1XAEyg1TQGa5FCEerrRhLGi5KyVq26Xm8", "senderPublicKey": "ATuPi6fn8277fNiCoRgPTav9QG15CJoW95GEGcDmfYt8", "proofs": [ "2R1yVss8XXXmsSB4YBJw9G8QjW4Q4qVh4RPy7M2qfLMkvZBvJPvHZyN6grM463YckYfurHDKLYSv9LdB96u3xK5Z" ], "script": "base64:BgIPCAISABIAEgMKAQgSABIAGQAFd2NkSWQCLDVXRTZIQlZzbUFiYXBUbVRLcG15V21VUjY3ZmMxNnliRnJOanh6bURCdFBhAAt3Y2REZWNpbWFscwACARN0b3RhbFNoYXJlQnlVc2VyS0VZAQVvd25lcgkAuQkCCQDMCAICBnNoYXJlcwkAzAgCBQVvd25lcgUDbmlsAgFfARR0b3RhbFNoYXJlQnlVc2VyUkVBRAEFb3duZXIJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwkBE3RvdGFsU2hhcmVCeVVzZXJLRVkBBQVvd25lcgAAABJ0b3RhbElzc3VlZFdDRF9LRVkCEHRvdGFsX2lzc3VlZF9XQ0QBE3RvdGFsSXNzdWVkV0NEX1JFQUQACQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFEnRvdGFsSXNzdWVkV0NEX0tFWQAAAA50b3RhbFNoYXJlc0tFWQIMdG90YWxfc2hhcmVzAQ90b3RhbFNoYXJlc1JFQUQACQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFDnRvdGFsU2hhcmVzS0VZAAAAEnRvd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ACAgOmDsd4WBA90b3RhbENvbGxhdGVyYWwJARN0b3RhbENvbGxhdGVyYWxSRUFEAAQMdG90YWxfaXNzdWVkCQETdG90YWxJc3N1ZWRXQ0RfUkVBRAAJAMwIAgkBDEludGVnZXJFbnRyeQIFEnRvdGFsQ29sbGF0ZXJhbEtFWQkAZAIFD3RvdGFsQ29sbGF0ZXJhbAgFA3BtdAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFEnRvdGFsSXNzdWVkV0NEX0tFWQkAZAIFDHRvdGFsX2lzc3VlZAUQd2NkX2lzc3VlX2Ftb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQERQGV4dHJOYXRpdmUoMTA2MikBBQdhY2NvdW50BRB3Y2RfaXNzdWVfYW1vdW50CQDZBAEFBXdjZElkBQNuaWwBaQESdGVzdF9nZXRfdXNlcl90bWR1AQdhY2NvdW50CQACAQkArAICAghSZXN1bHQ6IAkApAMBCQEPZ2V0VXNlclRNRFVfV0NEAQUHYWNjb3VudAFpAQ10ZXN0X2dldF90bWR1AAkAAgEJAKwCAgIIUmVzdWx0OiAJAKQDAQkBB2dldFRNRFUAAWkBDXRlc3RfZ2V0X3RtZGkACQACAQkArAICAghSZXN1bHQ6IAkApAMBCQEHZ2V0VE1ESQAA+qgWZw==", "height": 2416247, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6B8yquQo5zKWp4TxiBXMmMUNszj1kwqXtNnd5NxF5xxf Next: CuuvyDUBVWrFjNi6QpNg5BYQ6Xgkot66vAjiLjxqrjtr Diff:
OldNewDifferences
6565
6666 func A () = {
6767 let B = (k() - i())
68+ w((B * 10), g(), s())
69+ }
70+
71+
72+func C () = {
73+ let B = (k() - i())
6874 if ((B > 0))
6975 then {
70- let C = w((B * 10), g(), s())
71- if ((B > C))
72- then C
73- else C
76+ let D = A()
77+ if ((B > D))
78+ then D
79+ else B
7480 }
7581 else 0
7682 }
7783
7884
79-func D (d) = (1000000 * fraction(z(), o(d), n()))
85+func E (d) = (1000000 * fraction(z(), o(d), n()))
8086
8187
82-func E (d) = fraction(A(), o(d), 100000000)
88+func F (d) = fraction(C(), o(d), 100000000)
8389
8490
85-func F (d) = fraction(fraction(A(), o(d), 100000000), n(), 100000000)
91+func G (d) = fraction(fraction(C(), o(d), 100000000), n(), 100000000)
8692
8793
88-@Callable(G)
94+@Callable(H)
8995 func deposit_share () = {
90- let H = if ((size(G.payments) == 1))
91- then G.payments[0]
96+ let I = if ((size(H.payments) == 1))
97+ then H.payments[0]
9298 else throw("Attached payment is required")
93- if (isDefined(H.assetId))
99+ if (isDefined(I.assetId))
94100 then throw("Only WAVES is allowed.")
95101 else {
96- let I = toString(G.caller)
97- let J = e(I)
102+ let J = toString(H.caller)
103+ let K = e(J)
98104 let p = i()
99- let K = k()
100-[IntegerEntry(c(I), (J + H.amount)), IntegerEntry(h, (p + H.amount)), IntegerEntry(j, (K + H.amount))]
105+ let L = k()
106+[IntegerEntry(c(J), (K + I.amount)), IntegerEntry(h, (p + I.amount)), IntegerEntry(j, (L + I.amount))]
101107 }
102108 }
103109
104110
105111
106-@Callable(G)
112+@Callable(H)
107113 func issue () = {
108- let H = if ((size(G.payments) == 1))
109- then G.payments[0]
114+ let I = if ((size(H.payments) == 1))
115+ then H.payments[0]
110116 else throw("Attached payment is required")
111- if (isDefined(H.assetId))
117+ if (isDefined(I.assetId))
112118 then throw("Only WAVES is allowed.")
113119 else {
114- let I = toString(G.caller)
115- let L = D(I)
116- if ((H.amount > L))
117- then throw((((("User lock limit is " + toString(L)) + " WAVES. Sent ") + toString(H.amount)) + " WAVES."))
120+ let J = toString(H.caller)
121+ let M = E(J)
122+ if ((I.amount > M))
123+ then throw((((("User lock limit is " + toString(M)) + " WAVES. Sent ") + toString(I.amount)) + " WAVES."))
118124 else {
119- let M = fraction(H.amount, n(), 100000000000000)
120- let K = k()
121- let N = g()
122-[IntegerEntry(j, (K + H.amount)), IntegerEntry(f, (N + M)), ScriptTransfer(addressFromStringValue(I), M, fromBase58String(a))]
125+ let N = fraction(I.amount, n(), 100000000000000)
126+ let L = k()
127+ let O = g()
128+[IntegerEntry(j, (L + I.amount)), IntegerEntry(f, (O + N)), ScriptTransfer(addressFromStringValue(J), N, fromBase58String(a))]
123129 }
124130 }
125131 }
126132
127133
128134
129-@Callable(G)
130-func test (I) = throw(("Result: " + toString(F(I))))
135+@Callable(H)
136+func test_get_user_tmdu (J) = throw(("Result: " + toString(G(J))))
131137
132138
133139
134-@Callable(G)
135-func test_ii () = throw(("Result: " + toString(A())))
140+@Callable(H)
141+func test_get_tmdu () = throw(("Result: " + toString(C())))
142+
143+
144+
145+@Callable(H)
146+func test_get_tmdi () = throw(("Result: " + toString(z())))
136147
137148
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 let l = 240000000
3030
3131 let m = "waves_reference_price"
3232
3333 func n () = valueOrElse(getInteger(this, m), l)
3434
3535
3636 func o (d) = {
3737 let p = i()
3838 if ((p > 0))
3939 then {
4040 let q = e(d)
4141 fraction(100000000, q, p)
4242 }
4343 else 0
4444 }
4545
4646
4747 let r = "A"
4848
4949 func s () = valueOrElse(getInteger(this, "A"), 100)
5050
5151
5252 func t (u,v) = (500000000 - (log(u, b, 10, 0, 6, HALFUP) * v))
5353
5454
5555 func w (x,u,v) = fraction(x, pow(10, 0, t(u, v), 8, 8, HALFUP), 100000000)
5656
5757
5858 func y (u,v) = if ((u > 10000000))
5959 then w(u, u, v)
6060 else 10000000
6161
6262
6363 func z () = y(g(), s())
6464
6565
6666 func A () = {
6767 let B = (k() - i())
68+ w((B * 10), g(), s())
69+ }
70+
71+
72+func C () = {
73+ let B = (k() - i())
6874 if ((B > 0))
6975 then {
70- let C = w((B * 10), g(), s())
71- if ((B > C))
72- then C
73- else C
76+ let D = A()
77+ if ((B > D))
78+ then D
79+ else B
7480 }
7581 else 0
7682 }
7783
7884
79-func D (d) = (1000000 * fraction(z(), o(d), n()))
85+func E (d) = (1000000 * fraction(z(), o(d), n()))
8086
8187
82-func E (d) = fraction(A(), o(d), 100000000)
88+func F (d) = fraction(C(), o(d), 100000000)
8389
8490
85-func F (d) = fraction(fraction(A(), o(d), 100000000), n(), 100000000)
91+func G (d) = fraction(fraction(C(), o(d), 100000000), n(), 100000000)
8692
8793
88-@Callable(G)
94+@Callable(H)
8995 func deposit_share () = {
90- let H = if ((size(G.payments) == 1))
91- then G.payments[0]
96+ let I = if ((size(H.payments) == 1))
97+ then H.payments[0]
9298 else throw("Attached payment is required")
93- if (isDefined(H.assetId))
99+ if (isDefined(I.assetId))
94100 then throw("Only WAVES is allowed.")
95101 else {
96- let I = toString(G.caller)
97- let J = e(I)
102+ let J = toString(H.caller)
103+ let K = e(J)
98104 let p = i()
99- let K = k()
100-[IntegerEntry(c(I), (J + H.amount)), IntegerEntry(h, (p + H.amount)), IntegerEntry(j, (K + H.amount))]
105+ let L = k()
106+[IntegerEntry(c(J), (K + I.amount)), IntegerEntry(h, (p + I.amount)), IntegerEntry(j, (L + I.amount))]
101107 }
102108 }
103109
104110
105111
106-@Callable(G)
112+@Callable(H)
107113 func issue () = {
108- let H = if ((size(G.payments) == 1))
109- then G.payments[0]
114+ let I = if ((size(H.payments) == 1))
115+ then H.payments[0]
110116 else throw("Attached payment is required")
111- if (isDefined(H.assetId))
117+ if (isDefined(I.assetId))
112118 then throw("Only WAVES is allowed.")
113119 else {
114- let I = toString(G.caller)
115- let L = D(I)
116- if ((H.amount > L))
117- then throw((((("User lock limit is " + toString(L)) + " WAVES. Sent ") + toString(H.amount)) + " WAVES."))
120+ let J = toString(H.caller)
121+ let M = E(J)
122+ if ((I.amount > M))
123+ then throw((((("User lock limit is " + toString(M)) + " WAVES. Sent ") + toString(I.amount)) + " WAVES."))
118124 else {
119- let M = fraction(H.amount, n(), 100000000000000)
120- let K = k()
121- let N = g()
122-[IntegerEntry(j, (K + H.amount)), IntegerEntry(f, (N + M)), ScriptTransfer(addressFromStringValue(I), M, fromBase58String(a))]
125+ let N = fraction(I.amount, n(), 100000000000000)
126+ let L = k()
127+ let O = g()
128+[IntegerEntry(j, (L + I.amount)), IntegerEntry(f, (O + N)), ScriptTransfer(addressFromStringValue(J), N, fromBase58String(a))]
123129 }
124130 }
125131 }
126132
127133
128134
129-@Callable(G)
130-func test (I) = throw(("Result: " + toString(F(I))))
135+@Callable(H)
136+func test_get_user_tmdu (J) = throw(("Result: " + toString(G(J))))
131137
132138
133139
134-@Callable(G)
135-func test_ii () = throw(("Result: " + toString(A())))
140+@Callable(H)
141+func test_get_tmdu () = throw(("Result: " + toString(C())))
142+
143+
144+
145+@Callable(H)
146+func test_get_tmdi () = throw(("Result: " + toString(z())))
136147
137148

github/deemru/w8io/169f3d6 
46.99 ms