tx · C2KWePqFpWzbh3nXiupHDe9CjsHkrNhBQgun6vSR2WPA

3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU:  -0.04000000 Waves

2021.09.03 00:32 [1685962] smart account 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU > SELF 0.00000000 Waves

{ "type": 13, "id": "C2KWePqFpWzbh3nXiupHDe9CjsHkrNhBQgun6vSR2WPA", "fee": 4000000, "feeAssetId": null, "timestamp": 1630618336722, "version": 2, "chainId": 84, "sender": "3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU", "senderPublicKey": "EhGswdVQkp8SXCWyKvRCUKYDidTrRjnzTPa8CZk6GYgN", "proofs": [ "4ZZXbBn5WiTofayXEfeosqTzaMcY3JqqPAuPMHxFdZqgiZUU1CnWockSZttd413jmA1i5z6nWVgbqZhGrSmPQhax" ], "script": "base64:AAIFAAAAAAAAACYIAhIECgIIBBIDCgEIEgMKAQgSBwoFCAgBCAgSAwoBCBIECgIIAQAAACoAAAAACmJhc2VGYWN0b3IAAAAAAAAAA+gAAAAACWJhc2VJbmRleAAAI4byb8EAAAAAAAANYmxvY2tzUGVyWWVhcgAAAAAAAAgFIAAAAAAGY29uZmlnCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAADWNvbmZpZ0FkZHJlc3MCAAAAAAAAAAAFYWRtaW4JAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAVhZG1pbgIAAAAAAAAAAAt3YXZldHJvbGxlcgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAAC3dhdmV0cm9sbGVyAgAAAAAAAAAACmFzc2V0SWRTdWIJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aG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eSBzZXR1cCEAAAABaQEAAAAKZGVsZXRFbnRyeQAAAAEAAAADa2V5AwkBAAAADmlzQWRtaW5BZGRyZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAA2tleQUAAAADbmlsCQAAAgAAAAECAAAAF0NhbGxlciBpcyBub3QgYW4gYWRtaW4hAAAAAWkBAAAAEXdyaXRlSW50ZWdlckVudHJ5AAAAAgAAAANrZXkAAAAFZW50cnkDCQEAAAAOaXNBZG1pbkFkZHJlc3MAAAABCAUAAAABaQAAAAZjYWxsZXIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAA2tleQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAABdDYWxsZXIgaXMgbm90IGFuIGFkbWluIQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5h+UhOg==", "height": 1685962, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JneAGKc5DbtdZtjcx8XHiXLrDCJqDc4n9h9H4gRXXBK Next: 5iAVKj56dUnqCGbofVFBKpPip5tSFBM6zMgZgN1ZsZv9 Diff:
OldNewDifferences
2525
2626 let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_BaseRate")), (("No key " + (g + "_BaseRate")) + " was found"))
2727
28-let m = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found"))
28+let m = valueOrElse(getInteger(this, "baseExchangeRate"), 0)
2929
30-let n = valueOrElse(getInteger(this, "totalBorrow"), 0)
30+let n = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found"))
3131
32-let o = valueOrElse(getInteger(this, "totalSupply"), 0)
32+let o = valueOrElse(getInteger(this, "totalBorrow"), 0)
3333
34-let p = valueOrElse(getInteger(this, "totalReserve"), 0)
34+let p = valueOrElse(getInteger(this, "totalSupply"), 0)
3535
36-let q = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
36+let q = valueOrElse(getInteger(this, "totalReserve"), 0)
3737
38-let r = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
38+let r = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
3939
40-let s = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
40+let s = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
4141
42-let t = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
42+let t = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
4343
44-let u = valueOrElse(getInteger(this, "storedHeight"), height)
44+let u = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
4545
46-let v = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
46+let v = valueOrElse(getInteger(this, "storedHeight"), height)
4747
48-func w (x) = if ((addressFromStringValue(e) == x))
48+let w = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
49+
50+func x (y) = if ((addressFromStringValue(e) == y))
4951 then true
5052 else false
5153
5254
53-func y (x) = if ((addressFromStringValue(f) == x))
55+func z (y) = if ((addressFromStringValue(f) == y))
5456 then true
5557 else false
5658
5759
58-func z (A) = if ((A == g))
60+func A (B) = if ((B == g))
5961 then true
6062 else false
6163
6264
63-func B (C,D) = StringEntry(C, D)
65+func C (D,E) = StringEntry(D, E)
6466
6567
66-func E (C,F) = IntegerEntry(C, F)
68+func F (D,G) = IntegerEntry(D, G)
6769
6870
69-func G (H) = valueOrElse(getInteger(this, (H + "_locked")), 0)
71+func H (I) = valueOrElse(getInteger(this, (I + "_locked")), 0)
7072
7173
72-let I = if ((o > 0))
73- then fraction(n, a, o)
74+let J = if ((p > 0))
75+ then fraction(o, a, p)
7476 else 0
7577
76-let J = {
77- let K = [I, j]
78- let L = min(K)
79- let M = [0, (I - j)]
80- let N = max(M)
81- ((fraction(i, L, a) + fraction(k, N, a)) + l)
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)
8284 }
8385
84-let O = fraction(fraction(J, I, a), (a - m), a)
86+let P = fraction(fraction(K, J, a), (a - n), a)
8587
86-let P = fraction(J, b, (c * a))
88+let Q = fraction(K, b, (c * a))
8789
88-let Q = (height - u)
90+let R = (height - v)
8991
90-let R = fraction(v, (b + (P * Q)), b, CEILING)
92+let S = fraction(w, (b + (Q * R)), b, CEILING)
9193
92-let S = fraction(n, R, v)
94+let T = fraction(o, S, w)
9395
94-let T = fraction(n, (P * Q), b)
96+let U = fraction(o, (Q * R), b)
9597
96-let U = (o + fraction((a - m), T, a))
98+let V = (p + fraction((a - n), U, a))
9799
98-let V = (p + fraction(m, T, a))
100+let W = (q + fraction(n, U, a))
99101
100-let W = if ((q > 0))
102+let X = if ((r > 0))
101103 then {
102- let X = ((18 - r) + h)
103- let Y = pow(10, 0, X, 0, 0, CEILING)
104- fraction(U, Y, q)
104+ let Y = ((18 - s) + h)
105+ let Z = pow(10, 0, Y, 0, 0, CEILING)
106+ fraction(V, Z, r)
105107 }
106108 else 20000000000000000
107109
108-func Z (aa) = {
109- let X = ((18 - r) + h)
110- let Y = pow(10, 0, X, 0, 0, CEILING)
111- fraction(aa, Y, W)
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)
112114 }
113115
114116
115-func ab (ac) = {
116- let X = ((18 - r) + h)
117- let Y = pow(10, 0, X, 0, 0, CEILING)
118- fraction(ac, W, Y)
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)
119121 }
120122
121123
122-@Callable(ad)
123-func deposit (ae,af) = if (y(ad.caller))
124+@Callable(ae)
125+func deposit (af,ag) = if (z(ae.caller))
124126 then {
125- let ag = Z(ad.payments[0].amount)
126- let ah = (q + ag)
127- if (af)
127+ let ah = aa(ae.payments[0].amount)
128+ let ai = (r + ah)
129+ if (ag)
128130 then {
129- let ai = (G(ae) + ag)
130- $Tuple2([E((ae + "_locked"), ai), E("dTokenSupply", ah), E("totalBorrow", S), E("totalSupply", (U + ad.payments[0].amount)), E("totalReserve", V), E("storedIndex", R), E("storedHeight", height), Reissue(fromBase58String(s), ag, true)], ((toString(ad.payments[0].amount) + t) + "were successfully locked"))
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"))
131133 }
132- else $Tuple2([E("dTokenSupply", ah), E("totalBorrow", S), E("totalSupply", (U + ad.payments[0].amount)), E("totalReserve", V), E("storedIndex", R), E("storedHeight", height), Reissue(fromBase58String(s), ag, true), ScriptTransfer(ad.caller, ag, fromBase58String(s))], ag)
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)
133135 }
134136 else throw("Address does not match with wavetroller address!")
135137
136138
137139
138-@Callable(ad)
139-func withdraw (ae) = if (y(ad.caller))
140+@Callable(ae)
141+func withdraw (af) = if (z(ae.caller))
140142 then {
141- let aj = (U - S)
142- let ak = ab(ad.payments[0].amount)
143- if ((aj >= ak))
144- then $Tuple2([E("dTokenSupply", (q - ad.payments[0].amount)), E("totalBorrow", S), E("totalSupply", (U - ak)), E("totalReserve", V), E("storedIndex", R), E("storedHeight", height), Burn(fromBase58String(s), ad.payments[0].amount), if ((g == "WAVES"))
145- then ScriptTransfer(ad.caller, ak, unit)
146- else ScriptTransfer(ad.caller, ak, fromBase58String(g))], ak)
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)
147149 else throw("Pool liquidity is not sufficient!")
148150 }
149151 else throw("Address does not match with wavetroller address!")
150152
151153
152154
153-@Callable(ad)
154-func lockAsCollateral (ae) = if (y(ad.caller))
155+@Callable(ae)
156+func lockAsCollateral (af) = if (z(ae.caller))
155157 then {
156- let al = (G(ae) + ad.payments[0].amount)
157- $Tuple2([E((ae + "_locked"), al), E("totalBorrow", S), E("totalSupply", U), E("totalReserve", V), E("storedIndex", R), E("storedHeight", height)], ((toString(ad.payments[0].amount) + t) + "were successfully locked"))
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"))
158160 }
159161 else throw("Address does not match with wavetroller address!")
160162
161163
162164
163-@Callable(ad)
164-func setup (am,an,ao,ap) = if (!(isDefined(getString(this, "configAddress"))))
165+@Callable(ae)
166+func setup (an,ao,m,ap,aq) = if (!(isDefined(getString(this, "configAddress"))))
165167 then {
166- let aq = Issue(ao, ap, 0, 8, true)
167- let ar = calculateAssetId(aq)
168-[aq, B("assetId", am), B("configAddress", an), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), B("dTokenName", ao), B("dTokenId", toBase58String(ar)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
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)]
169171 }
170172 else throw("Pool already setup!")
171173
172174
173175
174-@Callable(ad)
175-func deletEntry (C) = if (w(ad.caller))
176- then [DeleteEntry(C)]
176+@Callable(ae)
177+func deletEntry (D) = if (x(ae.caller))
178+ then [DeleteEntry(D)]
177179 else throw("Caller is not an admin!")
178180
179181
180-@Verifier(as)
181-func at () = sigVerify(as.bodyBytes, as.proofs[0], as.senderPublicKey)
182+
183+@Callable(ae)
184+func writeIntegerEntry (D,at) = if (x(ae.caller))
185+ then [IntegerEntry(D, at)]
186+ else throw("Caller is not an admin!")
187+
188+
189+@Verifier(au)
190+func av () = sigVerify(au.bodyBytes, au.proofs[0], au.senderPublicKey)
182191
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
1616 let g = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!")
1717
1818 let h = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Decimals")), (("No key " + (g + "_Decimals")) + " was found"))
1919
2020 let i = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Multiplier")), (("No key " + (g + "_Multiplier")) + " was found"))
2121
2222 let j = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Kink")), (("No key " + (g + "_Kink")) + " was found"))
2323
2424 let k = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_JumpMultiplier")), (("No key " + (g + "_JumpMultiplier")) + " was found"))
2525
2626 let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_BaseRate")), (("No key " + (g + "_BaseRate")) + " was found"))
2727
28-let m = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found"))
28+let m = valueOrElse(getInteger(this, "baseExchangeRate"), 0)
2929
30-let n = valueOrElse(getInteger(this, "totalBorrow"), 0)
30+let n = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found"))
3131
32-let o = valueOrElse(getInteger(this, "totalSupply"), 0)
32+let o = valueOrElse(getInteger(this, "totalBorrow"), 0)
3333
34-let p = valueOrElse(getInteger(this, "totalReserve"), 0)
34+let p = valueOrElse(getInteger(this, "totalSupply"), 0)
3535
36-let q = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
36+let q = valueOrElse(getInteger(this, "totalReserve"), 0)
3737
38-let r = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
38+let r = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found")
3939
40-let s = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
40+let s = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found")
4141
42-let t = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
42+let t = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found")
4343
44-let u = valueOrElse(getInteger(this, "storedHeight"), height)
44+let u = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found")
4545
46-let v = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
46+let v = valueOrElse(getInteger(this, "storedHeight"), height)
4747
48-func w (x) = if ((addressFromStringValue(e) == x))
48+let w = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000)
49+
50+func x (y) = if ((addressFromStringValue(e) == y))
4951 then true
5052 else false
5153
5254
53-func y (x) = if ((addressFromStringValue(f) == x))
55+func z (y) = if ((addressFromStringValue(f) == y))
5456 then true
5557 else false
5658
5759
58-func z (A) = if ((A == g))
60+func A (B) = if ((B == g))
5961 then true
6062 else false
6163
6264
63-func B (C,D) = StringEntry(C, D)
65+func C (D,E) = StringEntry(D, E)
6466
6567
66-func E (C,F) = IntegerEntry(C, F)
68+func F (D,G) = IntegerEntry(D, G)
6769
6870
69-func G (H) = valueOrElse(getInteger(this, (H + "_locked")), 0)
71+func H (I) = valueOrElse(getInteger(this, (I + "_locked")), 0)
7072
7173
72-let I = if ((o > 0))
73- then fraction(n, a, o)
74+let J = if ((p > 0))
75+ then fraction(o, a, p)
7476 else 0
7577
76-let J = {
77- let K = [I, j]
78- let L = min(K)
79- let M = [0, (I - j)]
80- let N = max(M)
81- ((fraction(i, L, a) + fraction(k, N, a)) + l)
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)
8284 }
8385
84-let O = fraction(fraction(J, I, a), (a - m), a)
86+let P = fraction(fraction(K, J, a), (a - n), a)
8587
86-let P = fraction(J, b, (c * a))
88+let Q = fraction(K, b, (c * a))
8789
88-let Q = (height - u)
90+let R = (height - v)
8991
90-let R = fraction(v, (b + (P * Q)), b, CEILING)
92+let S = fraction(w, (b + (Q * R)), b, CEILING)
9193
92-let S = fraction(n, R, v)
94+let T = fraction(o, S, w)
9395
94-let T = fraction(n, (P * Q), b)
96+let U = fraction(o, (Q * R), b)
9597
96-let U = (o + fraction((a - m), T, a))
98+let V = (p + fraction((a - n), U, a))
9799
98-let V = (p + fraction(m, T, a))
100+let W = (q + fraction(n, U, a))
99101
100-let W = if ((q > 0))
102+let X = if ((r > 0))
101103 then {
102- let X = ((18 - r) + h)
103- let Y = pow(10, 0, X, 0, 0, CEILING)
104- fraction(U, Y, q)
104+ let Y = ((18 - s) + h)
105+ let Z = pow(10, 0, Y, 0, 0, CEILING)
106+ fraction(V, Z, r)
105107 }
106108 else 20000000000000000
107109
108-func Z (aa) = {
109- let X = ((18 - r) + h)
110- let Y = pow(10, 0, X, 0, 0, CEILING)
111- fraction(aa, Y, W)
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)
112114 }
113115
114116
115-func ab (ac) = {
116- let X = ((18 - r) + h)
117- let Y = pow(10, 0, X, 0, 0, CEILING)
118- fraction(ac, W, Y)
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)
119121 }
120122
121123
122-@Callable(ad)
123-func deposit (ae,af) = if (y(ad.caller))
124+@Callable(ae)
125+func deposit (af,ag) = if (z(ae.caller))
124126 then {
125- let ag = Z(ad.payments[0].amount)
126- let ah = (q + ag)
127- if (af)
127+ let ah = aa(ae.payments[0].amount)
128+ let ai = (r + ah)
129+ if (ag)
128130 then {
129- let ai = (G(ae) + ag)
130- $Tuple2([E((ae + "_locked"), ai), E("dTokenSupply", ah), E("totalBorrow", S), E("totalSupply", (U + ad.payments[0].amount)), E("totalReserve", V), E("storedIndex", R), E("storedHeight", height), Reissue(fromBase58String(s), ag, true)], ((toString(ad.payments[0].amount) + t) + "were successfully locked"))
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"))
131133 }
132- else $Tuple2([E("dTokenSupply", ah), E("totalBorrow", S), E("totalSupply", (U + ad.payments[0].amount)), E("totalReserve", V), E("storedIndex", R), E("storedHeight", height), Reissue(fromBase58String(s), ag, true), ScriptTransfer(ad.caller, ag, fromBase58String(s))], ag)
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)
133135 }
134136 else throw("Address does not match with wavetroller address!")
135137
136138
137139
138-@Callable(ad)
139-func withdraw (ae) = if (y(ad.caller))
140+@Callable(ae)
141+func withdraw (af) = if (z(ae.caller))
140142 then {
141- let aj = (U - S)
142- let ak = ab(ad.payments[0].amount)
143- if ((aj >= ak))
144- then $Tuple2([E("dTokenSupply", (q - ad.payments[0].amount)), E("totalBorrow", S), E("totalSupply", (U - ak)), E("totalReserve", V), E("storedIndex", R), E("storedHeight", height), Burn(fromBase58String(s), ad.payments[0].amount), if ((g == "WAVES"))
145- then ScriptTransfer(ad.caller, ak, unit)
146- else ScriptTransfer(ad.caller, ak, fromBase58String(g))], ak)
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)
147149 else throw("Pool liquidity is not sufficient!")
148150 }
149151 else throw("Address does not match with wavetroller address!")
150152
151153
152154
153-@Callable(ad)
154-func lockAsCollateral (ae) = if (y(ad.caller))
155+@Callable(ae)
156+func lockAsCollateral (af) = if (z(ae.caller))
155157 then {
156- let al = (G(ae) + ad.payments[0].amount)
157- $Tuple2([E((ae + "_locked"), al), E("totalBorrow", S), E("totalSupply", U), E("totalReserve", V), E("storedIndex", R), E("storedHeight", height)], ((toString(ad.payments[0].amount) + t) + "were successfully locked"))
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"))
158160 }
159161 else throw("Address does not match with wavetroller address!")
160162
161163
162164
163-@Callable(ad)
164-func setup (am,an,ao,ap) = if (!(isDefined(getString(this, "configAddress"))))
165+@Callable(ae)
166+func setup (an,ao,m,ap,aq) = if (!(isDefined(getString(this, "configAddress"))))
165167 then {
166- let aq = Issue(ao, ap, 0, 8, true)
167- let ar = calculateAssetId(aq)
168-[aq, B("assetId", am), B("configAddress", an), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), B("dTokenName", ao), B("dTokenId", toBase58String(ar)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)]
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)]
169171 }
170172 else throw("Pool already setup!")
171173
172174
173175
174-@Callable(ad)
175-func deletEntry (C) = if (w(ad.caller))
176- then [DeleteEntry(C)]
176+@Callable(ae)
177+func deletEntry (D) = if (x(ae.caller))
178+ then [DeleteEntry(D)]
177179 else throw("Caller is not an admin!")
178180
179181
180-@Verifier(as)
181-func at () = sigVerify(as.bodyBytes, as.proofs[0], as.senderPublicKey)
182+
183+@Callable(ae)
184+func writeIntegerEntry (D,at) = if (x(ae.caller))
185+ then [IntegerEntry(D, at)]
186+ else throw("Caller is not an admin!")
187+
188+
189+@Verifier(au)
190+func av () = sigVerify(au.bodyBytes, au.proofs[0], au.senderPublicKey)
182191

github/deemru/w8io/026f985 
68.23 ms