tx · B9r5JWjtgyhUTq1Lm7cHqw8XqmtXMQGfNBRKA1yigfei

3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU:  -0.04000000 Waves

2021.09.05 00:56 [1688870] smart account 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU > SELF 0.00000000 Waves

{ "type": 13, "id": "B9r5JWjtgyhUTq1Lm7cHqw8XqmtXMQGfNBRKA1yigfei", "fee": 4000000, "feeAssetId": null, "timestamp": 1630792660483, "version": 2, "chainId": 84, "sender": "3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU", "senderPublicKey": "EhGswdVQkp8SXCWyKvRCUKYDidTrRjnzTPa8CZk6GYgN", "proofs": [ "3gbgpbKcQK8zxqTREpASFnoU7HnPF2NCB5zo1ohrEEiNTgRS6bN9fzgvpzWt6RLzApuaQUqdEFmiNiCgn3Xgx61K" ], "script": "base64:AAIFAAAAAAAAADAIAhIHCgUIAQgBCBIECgIIBBIDCgEIEgMKAQgSBAoCCAESBwoFCAgBCAgSBAoCCAgAAAAuAAAAAApiYXNlRmFjdG9yAAAAAAAAAAPoAAAAAAliYXNlSW5kZXgAACOG8m/BAAAAAAAADWJsb2Nrc1BlclllYXIAAAAAAAAIBSAAAAAABmNvbmZpZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAA1jb25maWdBZGRyZXNzAgAAAAAAAAAABWFkbWluCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAAFYWRtaW4CAAAAAAAAAAALd2F2ZXRyb2xsZXIJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAt3YXZldHJvbGxlcgIAAAAAAAAAAAZvcmFjbGUJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAA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ZWdlckVudHJ5AAAAAgIAAAAMZFRva2VuU3VwcGx5AAAAAAAAAAAABQAAAANuaWwJAAACAAAAAQIAAAATUG9vbCBhbHJlYWR5IHNldHVwIQAAAAFpAQAAAAp3cml0ZUVudHJ5AAAAAgAAAARuYW1lAAAABGRhdGEJAARMAAAAAgkBAAAAC3dyaXRlU3RyaW5nAAAAAgUAAAAEbmFtZQUAAAAEZGF0YQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmXR2Rb", "height": 1688870, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 35be9FbRqrz9KCkjbGSAYMwi1UxRwJ6a3FF72WKjueqU Next: 9aMZh3irAnwWr4bmwpsvTYeNKT3Fffxnmg9EkadZjLfz Diff:
OldNewDifferences
1313
1414 let f = valueOrElse(getString(addressFromStringValue(d), "wavetroller"), "")
1515
16-let g = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!")
16+let g = valueOrElse(getString(addressFromStringValue(d), "oracle"), "")
1717
18-let h = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Decimals")), (("No key " + (g + "_Decimals")) + " was found"))
18+let h = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!")
1919
20-let i = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Multiplier")), (("No key " + (g + "_Multiplier")) + " was found"))
20+let i = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Decimals")), (("No key " + (h + "_Decimals")) + " was found"))
2121
22-let j = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Kink")), (("No key " + (g + "_Kink")) + " was found"))
22+let j = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Multiplier")), (("No key " + (h + "_Multiplier")) + " was found"))
2323
24-let k = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_JumpMultiplier")), (("No key " + (g + "_JumpMultiplier")) + " was found"))
24+let k = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Kink")), (("No key " + (h + "_Kink")) + " was found"))
2525
26-let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_BaseRate")), (("No key " + (g + "_BaseRate")) + " was found"))
26+let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_JumpMultiplier")), (("No key " + (h + "_JumpMultiplier")) + " was found"))
2727
28-let m = valueOrErrorMessage(getInteger(this, "baseExchangeRate"), "No key baseExchangeRate was found")
28+let m = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_BaseRate")), (("No key " + (h + "_BaseRate")) + " was found"))
2929
30-let n = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found"))
30+let n = valueOrErrorMessage(getInteger(this, "baseExchangeRate"), "No key baseExchangeRate was found")
3131
32-let o = valueOrElse(getInteger(this, "totalBorrow"), 0)
32+let o = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_CollateralFactor")), (("No key " + (h + "_CollateralFactor")) + " was found"))
3333
34-let p = valueOrElse(getInteger(this, "totalSupply"), 0)
34+let p = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Threshold")), (("No key " + (h + "_Threshold")) + " was found"))
3535
36-let q = valueOrElse(getInteger(this, "totalReserve"), 0)
36+let q = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_ReserveFactor")), (("No key " + (h + "_ReserveFactor")) + " was found"))
3737
38-let r = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
38+let r = valueOrElse(getInteger(this, "totalBorrow"), 0)
3939
40-let s = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
40+let s = valueOrElse(getInteger(this, "totalSupply"), 0)
4141
42-let t = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
42+let t = valueOrElse(getInteger(this, "totalReserve"), 0)
4343
44-let u = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
44+let u = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
4545
46-let v = valueOrElse(getInteger(this, "storedHeight"), height)
46+let v = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
4747
48-let w = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
48+let w = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
4949
50-func x (y) = if ((addressFromStringValue(e) == y))
50+let x = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
51+
52+let y = valueOrElse(getInteger(this, "storedHeight"), height)
53+
54+let z = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
55+
56+func A (B) = if ((addressFromStringValue(e) == B))
5157 then true
5258 else false
5359
5460
55-func z (y) = if ((addressFromStringValue(f) == y))
61+func C (B) = if ((addressFromStringValue(f) == B))
5662 then true
5763 else false
5864
5965
60-func A (B) = if ((B == g))
66+func D (E) = if ((E == h))
6167 then true
6268 else false
6369
6470
65-func C (D,E) = StringEntry(D, E)
71+func F (G,H) = StringEntry(G, H)
6672
6773
68-func F (D,G) = IntegerEntry(D, G)
74+func I (G,J) = IntegerEntry(G, J)
6975
7076
71-func H (I) = valueOrElse(getInteger(this, (I + "_locked")), 0)
77+func K (L) = valueOrElse(getInteger(this, (L + "_locked")), 0)
7278
7379
74-let J = if ((p > 0))
75- then fraction(o, a, p)
80+let M = if ((s > 0))
81+ then fraction(r, a, s)
7682 else 0
7783
78-let K = {
79- let L = [J, j]
80- let M = min(L)
81- let N = [0, (J - j)]
82- let O = max(N)
83- ((fraction(i, M, a) + fraction(k, O, a)) + l)
84+let N = {
85+ let O = [M, k]
86+ let P = min(O)
87+ let Q = [0, (M - k)]
88+ let R = max(Q)
89+ ((fraction(j, P, a) + fraction(l, R, a)) + m)
8490 }
8591
86-let P = fraction(fraction(K, J, a), (a - n), a)
92+let S = fraction(fraction(N, M, a), (a - q), a)
8793
88-let Q = fraction(K, b, (c * a))
94+let T = fraction(N, b, (c * a))
8995
90-let R = (height - v)
96+let U = (height - y)
9197
92-let S = fraction(w, (b + (Q * R)), b, CEILING)
98+let V = fraction(z, (b + (T * U)), b, CEILING)
9399
94-let T = fraction(o, S, w)
100+let W = fraction(r, V, z)
95101
96-let U = fraction(o, (Q * R), b)
102+let X = fraction(r, (T * U), b)
97103
98-let V = (p + fraction((a - n), U, a))
104+let Y = (s + fraction((a - q), X, a))
99105
100-let W = (q + fraction(n, U, a))
106+let Z = (t + fraction(q, X, a))
101107
102-let X = if ((r > 0))
108+let aa = if ((u > 0))
103109 then {
104- let Y = ((18 - s) + h)
105- let Z = pow(10, 0, Y, 0, 0, CEILING)
106- fraction(V, Z, r)
110+ let ab = ((18 - v) + i)
111+ let ac = pow(10, 0, ab, 0, 0, CEILING)
112+ fraction(Y, ac, u)
107113 }
108- else m
114+ else n
109115
110-func aa (ab) = {
111- let Y = ((18 - s) + h)
112- let Z = pow(10, 0, Y, 0, 0, CEILING)
113- fraction(ab, Z, X)
116+func ad (ae) = {
117+ let ab = ((18 - v) + i)
118+ let ac = pow(10, 0, ab, 0, 0, CEILING)
119+ fraction(ae, ac, aa)
114120 }
115121
116122
117-func ac (ad) = {
118- let Y = ((18 - s) + h)
119- let Z = pow(10, 0, Y, 0, 0, CEILING)
120- fraction(ad, X, Z)
123+func af (ag) = {
124+ let ab = ((18 - v) + i)
125+ let ac = pow(10, 0, ab, 0, 0, CEILING)
126+ fraction(ag, aa, ac)
121127 }
122128
123129
124-@Callable(ae)
125-func deposit (af,ag) = if (z(ae.caller))
130+func ah (ai) = {
131+ let aj = valueOrElse(getIntegerValue(this, (ai + "_borrow")), 0)
132+ let ak = valueOrElse(getIntegerValue(this, (ai + "_index")), 0)
133+ if ((ak > 0))
134+ then fraction(aj, V, ak)
135+ else 0
136+ }
137+
138+
139+@Callable(al)
140+func getUserHealthParameter (ai,am,an,ao,ap) = if (C(al.caller))
126141 then {
127- let ah = aa(ae.payments[0].amount)
128- let ai = (r + ah)
129- if (ag)
142+ let aq = valueOrElse(getIntegerValue(this, (ai + "_locked")), 0)
143+ let ar = if ((w == an))
144+ then (aq - am)
145+ else aq
146+ let as = if ((ap == h))
147+ then (ah(ai) + ao)
148+ else ah(ai)
149+ let at = af(ar)
150+ let au = invoke(addressFromStringValue(g), "getPrice", [h], nil)
151+ let av = au
152+ if ($isInstanceOf(av, "Int"))
130153 then {
131- let aj = (H(af) + ah)
132- $Tuple2([F((af + "_locked"), aj), F("dTokenSupply", ai), F("totalBorrow", T), F("totalSupply", (V + ae.payments[0].amount)), F("totalReserve", W), F("storedIndex", S), F("storedHeight", height), Reissue(fromBase58String(t), ah, true)], ((toString(ae.payments[0].amount) + u) + "were successfully locked"))
154+ let aw = av
155+ let ax = fraction(o, at, a)
156+ let ac = pow(10, 0, i, 0, 0, CEILING)
157+ let ay = fraction(ax, aw, ac)
158+ let az = fraction(as, aw, ac)
159+ let aA = fraction(az, a, p)
160+ $Tuple2(nil, $Tuple2(ay, aA))
133161 }
134- else $Tuple2([F("dTokenSupply", ai), F("totalBorrow", T), F("totalSupply", (V + ae.payments[0].amount)), F("totalReserve", W), F("storedIndex", S), F("storedHeight", height), Reissue(fromBase58String(t), ah, true), ScriptTransfer(ae.caller, ah, fromBase58String(t))], ah)
162+ else throw("Incorrect pricing")
135163 }
136164 else throw("Address does not match with wavetroller address!")
137165
138166
139167
140-@Callable(ae)
141-func withdraw (af) = if (z(ae.caller))
168+@Callable(al)
169+func deposit (ai,aB) = if (C(al.caller))
142170 then {
143- let ak = (V - T)
144- let al = ac(ae.payments[0].amount)
145- if ((ak >= al))
146- then $Tuple2([F("dTokenSupply", (r - ae.payments[0].amount)), F("totalBorrow", T), F("totalSupply", (V - al)), F("totalReserve", W), F("storedIndex", S), F("storedHeight", height), Burn(fromBase58String(t), ae.payments[0].amount), if ((g == "WAVES"))
147- then ScriptTransfer(ae.caller, al, unit)
148- else ScriptTransfer(ae.caller, al, fromBase58String(g))], al)
171+ let aC = ad(al.payments[0].amount)
172+ let aD = (u + aC)
173+ if (aB)
174+ then {
175+ let aE = (K(ai) + aC)
176+ $Tuple2([I((ai + "_locked"), aE), I("dTokenSupply", aD), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), aC, true)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
177+ }
178+ else $Tuple2([I("dTokenSupply", aD), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), aC, true), ScriptTransfer(al.caller, aC, fromBase58String(w))], aC)
179+ }
180+ else throw("Address does not match with wavetroller address!")
181+
182+
183+
184+@Callable(al)
185+func withdraw (ai) = if (C(al.caller))
186+ then {
187+ let aF = (Y - W)
188+ let aG = af(al.payments[0].amount)
189+ if ((aF >= aG))
190+ then $Tuple2([I("dTokenSupply", (u - al.payments[0].amount)), I("totalBorrow", W), I("totalSupply", (Y - aG)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Burn(fromBase58String(w), al.payments[0].amount), if ((h == "WAVES"))
191+ then ScriptTransfer(al.caller, aG, unit)
192+ else ScriptTransfer(al.caller, aG, fromBase58String(h))], aG)
149193 else throw("Pool liquidity is not sufficient!")
150194 }
151195 else throw("Address does not match with wavetroller address!")
152196
153197
154198
155-@Callable(ae)
156-func lockAsCollateral (af) = if (z(ae.caller))
199+@Callable(al)
200+func lockAsCollateral (ai) = if (C(al.caller))
157201 then {
158- let am = (H(af) + ae.payments[0].amount)
159- $Tuple2([F((af + "_locked"), am), F("totalBorrow", T), F("totalSupply", V), F("totalReserve", W), F("storedIndex", S), F("storedHeight", height)], ((toString(ae.payments[0].amount) + u) + "were successfully locked"))
202+ let aH = (K(ai) + al.payments[0].amount)
203+ $Tuple2([I((ai + "_locked"), aH), I("totalBorrow", W), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
160204 }
161205 else throw("Address does not match with wavetroller address!")
162206
163207
164208
165-@Callable(ae)
166-func setup (an,ao,m,ap,aq) = if (!(isDefined(getString(this, "configAddress"))))
209+@Callable(al)
210+func borrow (ai,aI) = if (C(al.caller))
167211 then {
168- let ar = Issue(ap, aq, 0, 8, true)
169- let as = calculateAssetId(ar)
170-[ar, C("assetId", an), C("configAddress", ao), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", m), C("dTokenName", ap), C("dTokenId", toBase58String(as)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
212+ let as = ah(ai)
213+ $Tuple2([I((ai + "_borrow"), (as + aI)), I((ai + "_index"), V), I("totalBorrow", (W + aI)), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), if ((h == "WAVES"))
214+ then ScriptTransfer(al.caller, aI, unit)
215+ else ScriptTransfer(al.caller, aI, fromBase58String(h))], aI)
216+ }
217+ else throw("Address does not match with wavetroller address!")
218+
219+
220+
221+@Callable(al)
222+func setup (aJ,aK,n,aL,aM) = if (!(isDefined(getString(this, "configAddress"))))
223+ then {
224+ let aN = Issue(aL, aM, 0, 8, true)
225+ let aO = calculateAssetId(aN)
226+[aN, F("assetId", aJ), F("configAddress", aK), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", n), F("dTokenName", aL), F("dTokenId", toBase58String(aO)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
171227 }
172228 else throw("Pool already setup!")
173229
174230
175-@Verifier(at)
176-func au () = sigVerify(at.bodyBytes, at.proofs[0], at.senderPublicKey)
231+
232+@Callable(al)
233+func writeEntry (aP,aQ) = [F(aP, aQ)]
234+
235+
236+@Verifier(aR)
237+func aS () = sigVerify(aR.bodyBytes, aR.proofs[0], aR.senderPublicKey)
177238
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 1000
55
66 let b = 10000000000000000
77
88 let c = 525600
99
1010 let d = valueOrElse(getString(this, "configAddress"), "")
1111
1212 let e = valueOrElse(getString(addressFromStringValue(d), "admin"), "")
1313
1414 let f = valueOrElse(getString(addressFromStringValue(d), "wavetroller"), "")
1515
16-let g = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!")
16+let g = valueOrElse(getString(addressFromStringValue(d), "oracle"), "")
1717
18-let h = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Decimals")), (("No key " + (g + "_Decimals")) + " was found"))
18+let h = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!")
1919
20-let i = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Multiplier")), (("No key " + (g + "_Multiplier")) + " was found"))
20+let i = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Decimals")), (("No key " + (h + "_Decimals")) + " was found"))
2121
22-let j = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Kink")), (("No key " + (g + "_Kink")) + " was found"))
22+let j = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Multiplier")), (("No key " + (h + "_Multiplier")) + " was found"))
2323
24-let k = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_JumpMultiplier")), (("No key " + (g + "_JumpMultiplier")) + " was found"))
24+let k = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Kink")), (("No key " + (h + "_Kink")) + " was found"))
2525
26-let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_BaseRate")), (("No key " + (g + "_BaseRate")) + " was found"))
26+let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_JumpMultiplier")), (("No key " + (h + "_JumpMultiplier")) + " was found"))
2727
28-let m = valueOrErrorMessage(getInteger(this, "baseExchangeRate"), "No key baseExchangeRate was found")
28+let m = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_BaseRate")), (("No key " + (h + "_BaseRate")) + " was found"))
2929
30-let n = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found"))
30+let n = valueOrErrorMessage(getInteger(this, "baseExchangeRate"), "No key baseExchangeRate was found")
3131
32-let o = valueOrElse(getInteger(this, "totalBorrow"), 0)
32+let o = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_CollateralFactor")), (("No key " + (h + "_CollateralFactor")) + " was found"))
3333
34-let p = valueOrElse(getInteger(this, "totalSupply"), 0)
34+let p = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_Threshold")), (("No key " + (h + "_Threshold")) + " was found"))
3535
36-let q = valueOrElse(getInteger(this, "totalReserve"), 0)
36+let q = valueOrErrorMessage(getInteger(addressFromStringValue(d), (h + "_ReserveFactor")), (("No key " + (h + "_ReserveFactor")) + " was found"))
3737
38-let r = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
38+let r = valueOrElse(getInteger(this, "totalBorrow"), 0)
3939
40-let s = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
40+let s = valueOrElse(getInteger(this, "totalSupply"), 0)
4141
42-let t = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
42+let t = valueOrElse(getInteger(this, "totalReserve"), 0)
4343
44-let u = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
44+let u = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
4545
46-let v = valueOrElse(getInteger(this, "storedHeight"), height)
46+let v = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
4747
48-let w = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
48+let w = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
4949
50-func x (y) = if ((addressFromStringValue(e) == y))
50+let x = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
51+
52+let y = valueOrElse(getInteger(this, "storedHeight"), height)
53+
54+let z = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
55+
56+func A (B) = if ((addressFromStringValue(e) == B))
5157 then true
5258 else false
5359
5460
55-func z (y) = if ((addressFromStringValue(f) == y))
61+func C (B) = if ((addressFromStringValue(f) == B))
5662 then true
5763 else false
5864
5965
60-func A (B) = if ((B == g))
66+func D (E) = if ((E == h))
6167 then true
6268 else false
6369
6470
65-func C (D,E) = StringEntry(D, E)
71+func F (G,H) = StringEntry(G, H)
6672
6773
68-func F (D,G) = IntegerEntry(D, G)
74+func I (G,J) = IntegerEntry(G, J)
6975
7076
71-func H (I) = valueOrElse(getInteger(this, (I + "_locked")), 0)
77+func K (L) = valueOrElse(getInteger(this, (L + "_locked")), 0)
7278
7379
74-let J = if ((p > 0))
75- then fraction(o, a, p)
80+let M = if ((s > 0))
81+ then fraction(r, a, s)
7682 else 0
7783
78-let K = {
79- let L = [J, j]
80- let M = min(L)
81- let N = [0, (J - j)]
82- let O = max(N)
83- ((fraction(i, M, a) + fraction(k, O, a)) + l)
84+let N = {
85+ let O = [M, k]
86+ let P = min(O)
87+ let Q = [0, (M - k)]
88+ let R = max(Q)
89+ ((fraction(j, P, a) + fraction(l, R, a)) + m)
8490 }
8591
86-let P = fraction(fraction(K, J, a), (a - n), a)
92+let S = fraction(fraction(N, M, a), (a - q), a)
8793
88-let Q = fraction(K, b, (c * a))
94+let T = fraction(N, b, (c * a))
8995
90-let R = (height - v)
96+let U = (height - y)
9197
92-let S = fraction(w, (b + (Q * R)), b, CEILING)
98+let V = fraction(z, (b + (T * U)), b, CEILING)
9399
94-let T = fraction(o, S, w)
100+let W = fraction(r, V, z)
95101
96-let U = fraction(o, (Q * R), b)
102+let X = fraction(r, (T * U), b)
97103
98-let V = (p + fraction((a - n), U, a))
104+let Y = (s + fraction((a - q), X, a))
99105
100-let W = (q + fraction(n, U, a))
106+let Z = (t + fraction(q, X, a))
101107
102-let X = if ((r > 0))
108+let aa = if ((u > 0))
103109 then {
104- let Y = ((18 - s) + h)
105- let Z = pow(10, 0, Y, 0, 0, CEILING)
106- fraction(V, Z, r)
110+ let ab = ((18 - v) + i)
111+ let ac = pow(10, 0, ab, 0, 0, CEILING)
112+ fraction(Y, ac, u)
107113 }
108- else m
114+ else n
109115
110-func aa (ab) = {
111- let Y = ((18 - s) + h)
112- let Z = pow(10, 0, Y, 0, 0, CEILING)
113- fraction(ab, Z, X)
116+func ad (ae) = {
117+ let ab = ((18 - v) + i)
118+ let ac = pow(10, 0, ab, 0, 0, CEILING)
119+ fraction(ae, ac, aa)
114120 }
115121
116122
117-func ac (ad) = {
118- let Y = ((18 - s) + h)
119- let Z = pow(10, 0, Y, 0, 0, CEILING)
120- fraction(ad, X, Z)
123+func af (ag) = {
124+ let ab = ((18 - v) + i)
125+ let ac = pow(10, 0, ab, 0, 0, CEILING)
126+ fraction(ag, aa, ac)
121127 }
122128
123129
124-@Callable(ae)
125-func deposit (af,ag) = if (z(ae.caller))
130+func ah (ai) = {
131+ let aj = valueOrElse(getIntegerValue(this, (ai + "_borrow")), 0)
132+ let ak = valueOrElse(getIntegerValue(this, (ai + "_index")), 0)
133+ if ((ak > 0))
134+ then fraction(aj, V, ak)
135+ else 0
136+ }
137+
138+
139+@Callable(al)
140+func getUserHealthParameter (ai,am,an,ao,ap) = if (C(al.caller))
126141 then {
127- let ah = aa(ae.payments[0].amount)
128- let ai = (r + ah)
129- if (ag)
142+ let aq = valueOrElse(getIntegerValue(this, (ai + "_locked")), 0)
143+ let ar = if ((w == an))
144+ then (aq - am)
145+ else aq
146+ let as = if ((ap == h))
147+ then (ah(ai) + ao)
148+ else ah(ai)
149+ let at = af(ar)
150+ let au = invoke(addressFromStringValue(g), "getPrice", [h], nil)
151+ let av = au
152+ if ($isInstanceOf(av, "Int"))
130153 then {
131- let aj = (H(af) + ah)
132- $Tuple2([F((af + "_locked"), aj), F("dTokenSupply", ai), F("totalBorrow", T), F("totalSupply", (V + ae.payments[0].amount)), F("totalReserve", W), F("storedIndex", S), F("storedHeight", height), Reissue(fromBase58String(t), ah, true)], ((toString(ae.payments[0].amount) + u) + "were successfully locked"))
154+ let aw = av
155+ let ax = fraction(o, at, a)
156+ let ac = pow(10, 0, i, 0, 0, CEILING)
157+ let ay = fraction(ax, aw, ac)
158+ let az = fraction(as, aw, ac)
159+ let aA = fraction(az, a, p)
160+ $Tuple2(nil, $Tuple2(ay, aA))
133161 }
134- else $Tuple2([F("dTokenSupply", ai), F("totalBorrow", T), F("totalSupply", (V + ae.payments[0].amount)), F("totalReserve", W), F("storedIndex", S), F("storedHeight", height), Reissue(fromBase58String(t), ah, true), ScriptTransfer(ae.caller, ah, fromBase58String(t))], ah)
162+ else throw("Incorrect pricing")
135163 }
136164 else throw("Address does not match with wavetroller address!")
137165
138166
139167
140-@Callable(ae)
141-func withdraw (af) = if (z(ae.caller))
168+@Callable(al)
169+func deposit (ai,aB) = if (C(al.caller))
142170 then {
143- let ak = (V - T)
144- let al = ac(ae.payments[0].amount)
145- if ((ak >= al))
146- then $Tuple2([F("dTokenSupply", (r - ae.payments[0].amount)), F("totalBorrow", T), F("totalSupply", (V - al)), F("totalReserve", W), F("storedIndex", S), F("storedHeight", height), Burn(fromBase58String(t), ae.payments[0].amount), if ((g == "WAVES"))
147- then ScriptTransfer(ae.caller, al, unit)
148- else ScriptTransfer(ae.caller, al, fromBase58String(g))], al)
171+ let aC = ad(al.payments[0].amount)
172+ let aD = (u + aC)
173+ if (aB)
174+ then {
175+ let aE = (K(ai) + aC)
176+ $Tuple2([I((ai + "_locked"), aE), I("dTokenSupply", aD), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), aC, true)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
177+ }
178+ else $Tuple2([I("dTokenSupply", aD), I("totalBorrow", W), I("totalSupply", (Y + al.payments[0].amount)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Reissue(fromBase58String(w), aC, true), ScriptTransfer(al.caller, aC, fromBase58String(w))], aC)
179+ }
180+ else throw("Address does not match with wavetroller address!")
181+
182+
183+
184+@Callable(al)
185+func withdraw (ai) = if (C(al.caller))
186+ then {
187+ let aF = (Y - W)
188+ let aG = af(al.payments[0].amount)
189+ if ((aF >= aG))
190+ then $Tuple2([I("dTokenSupply", (u - al.payments[0].amount)), I("totalBorrow", W), I("totalSupply", (Y - aG)), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), Burn(fromBase58String(w), al.payments[0].amount), if ((h == "WAVES"))
191+ then ScriptTransfer(al.caller, aG, unit)
192+ else ScriptTransfer(al.caller, aG, fromBase58String(h))], aG)
149193 else throw("Pool liquidity is not sufficient!")
150194 }
151195 else throw("Address does not match with wavetroller address!")
152196
153197
154198
155-@Callable(ae)
156-func lockAsCollateral (af) = if (z(ae.caller))
199+@Callable(al)
200+func lockAsCollateral (ai) = if (C(al.caller))
157201 then {
158- let am = (H(af) + ae.payments[0].amount)
159- $Tuple2([F((af + "_locked"), am), F("totalBorrow", T), F("totalSupply", V), F("totalReserve", W), F("storedIndex", S), F("storedHeight", height)], ((toString(ae.payments[0].amount) + u) + "were successfully locked"))
202+ let aH = (K(ai) + al.payments[0].amount)
203+ $Tuple2([I((ai + "_locked"), aH), I("totalBorrow", W), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height)], ((toString(al.payments[0].amount) + x) + "were successfully locked"))
160204 }
161205 else throw("Address does not match with wavetroller address!")
162206
163207
164208
165-@Callable(ae)
166-func setup (an,ao,m,ap,aq) = if (!(isDefined(getString(this, "configAddress"))))
209+@Callable(al)
210+func borrow (ai,aI) = if (C(al.caller))
167211 then {
168- let ar = Issue(ap, aq, 0, 8, true)
169- let as = calculateAssetId(ar)
170-[ar, C("assetId", an), C("configAddress", ao), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", m), C("dTokenName", ap), C("dTokenId", toBase58String(as)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
212+ let as = ah(ai)
213+ $Tuple2([I((ai + "_borrow"), (as + aI)), I((ai + "_index"), V), I("totalBorrow", (W + aI)), I("totalSupply", Y), I("totalReserve", Z), I("storedIndex", V), I("storedHeight", height), if ((h == "WAVES"))
214+ then ScriptTransfer(al.caller, aI, unit)
215+ else ScriptTransfer(al.caller, aI, fromBase58String(h))], aI)
216+ }
217+ else throw("Address does not match with wavetroller address!")
218+
219+
220+
221+@Callable(al)
222+func setup (aJ,aK,n,aL,aM) = if (!(isDefined(getString(this, "configAddress"))))
223+ then {
224+ let aN = Issue(aL, aM, 0, 8, true)
225+ let aO = calculateAssetId(aN)
226+[aN, F("assetId", aJ), F("configAddress", aK), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), IntegerEntry("baseExchangeRate", n), F("dTokenName", aL), F("dTokenId", toBase58String(aO)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
171227 }
172228 else throw("Pool already setup!")
173229
174230
175-@Verifier(at)
176-func au () = sigVerify(at.bodyBytes, at.proofs[0], at.senderPublicKey)
231+
232+@Callable(al)
233+func writeEntry (aP,aQ) = [F(aP, aQ)]
234+
235+
236+@Verifier(aR)
237+func aS () = sigVerify(aR.bodyBytes, aR.proofs[0], aR.senderPublicKey)
177238

github/deemru/w8io/169f3d6 
71.65 ms