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+gAAAAACWJhc2VJbmRleAAAI4byb8EAAAAAAAANYmxvY2tzUGVyWWVhcgAAAAAAAAgFIAAAAAAGY29uZmlnCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAADWNvbmZpZ0FkZHJlc3MCAAAAAAAAAAAFYWRtaW4JAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAVhZG1pbgIAAAAAAAAAAAt3YXZldHJvbGxlcgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAAC3dhdmV0cm9sbGVyAgAAAAAAAAAACmFzc2V0SWRTdWIJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGl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SBzZXR1cCEAAAABaQEAAAAKZGVsZXRFbnRyeQAAAAEAAAADa2V5AwkBAAAADmlzQWRtaW5BZGRyZXNzAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAA2tleQUAAAADbmlsCQAAAgAAAAECAAAAF0NhbGxlciBpcyBub3QgYW4gYWRtaW4hAAAAAWkBAAAAEXdyaXRlSW50ZWdlckVudHJ5AAAAAgAAAANrZXkAAAAFZW50cnkDCQEAAAAOaXNBZG1pbkFkZHJlc3MAAAABCAUAAAABaQAAAAZjYWxsZXIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAA2tleQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAABdDYWxsZXIgaXMgbm90IGFuIGFkbWluIQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5h+UhOg==", "height": 1685962, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JneAGKc5DbtdZtjcx8XHiXLrDCJqDc4n9h9H4gRXXBK Next: 5iAVKj56dUnqCGbofVFBKpPip5tSFBM6zMgZgN1ZsZv9 Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | ||
26 | 26 | let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_BaseRate")), (("No key " + (g + "_BaseRate")) + " was found")) | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = valueOrElse(getInteger(this, "baseExchangeRate"), 0) | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found")) | |
31 | 31 | ||
32 | - | let o = valueOrElse(getInteger(this, " | |
32 | + | let o = valueOrElse(getInteger(this, "totalBorrow"), 0) | |
33 | 33 | ||
34 | - | let p = valueOrElse(getInteger(this, " | |
34 | + | let p = valueOrElse(getInteger(this, "totalSupply"), 0) | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = valueOrElse(getInteger(this, "totalReserve"), 0) | |
37 | 37 | ||
38 | - | let r = valueOrErrorMessage(getInteger(this, " | |
38 | + | let r = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found") | |
39 | 39 | ||
40 | - | let s = valueOrErrorMessage( | |
40 | + | let s = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found") | |
41 | 41 | ||
42 | - | let t = valueOrErrorMessage(getString(this, " | |
42 | + | let t = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found") | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found") | |
45 | 45 | ||
46 | - | let v = valueOrElse(getInteger(this, " | |
46 | + | let v = valueOrElse(getInteger(this, "storedHeight"), height) | |
47 | 47 | ||
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)) | |
49 | 51 | then true | |
50 | 52 | else false | |
51 | 53 | ||
52 | 54 | ||
53 | - | func | |
55 | + | func z (y) = if ((addressFromStringValue(f) == y)) | |
54 | 56 | then true | |
55 | 57 | else false | |
56 | 58 | ||
57 | 59 | ||
58 | - | func | |
60 | + | func A (B) = if ((B == g)) | |
59 | 61 | then true | |
60 | 62 | else false | |
61 | 63 | ||
62 | 64 | ||
63 | - | func | |
65 | + | func C (D,E) = StringEntry(D, E) | |
64 | 66 | ||
65 | 67 | ||
66 | - | func | |
68 | + | func F (D,G) = IntegerEntry(D, G) | |
67 | 69 | ||
68 | 70 | ||
69 | - | func | |
71 | + | func H (I) = valueOrElse(getInteger(this, (I + "_locked")), 0) | |
70 | 72 | ||
71 | 73 | ||
72 | - | let | |
73 | - | then fraction( | |
74 | + | let J = if ((p > 0)) | |
75 | + | then fraction(o, a, p) | |
74 | 76 | else 0 | |
75 | 77 | ||
76 | - | let | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | ((fraction(i, | |
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) | |
82 | 84 | } | |
83 | 85 | ||
84 | - | let | |
86 | + | let P = fraction(fraction(K, J, a), (a - n), a) | |
85 | 87 | ||
86 | - | let | |
88 | + | let Q = fraction(K, b, (c * a)) | |
87 | 89 | ||
88 | - | let | |
90 | + | let R = (height - v) | |
89 | 91 | ||
90 | - | let | |
92 | + | let S = fraction(w, (b + (Q * R)), b, CEILING) | |
91 | 93 | ||
92 | - | let | |
94 | + | let T = fraction(o, S, w) | |
93 | 95 | ||
94 | - | let | |
96 | + | let U = fraction(o, (Q * R), b) | |
95 | 97 | ||
96 | - | let | |
98 | + | let V = (p + fraction((a - n), U, a)) | |
97 | 99 | ||
98 | - | let | |
100 | + | let W = (q + fraction(n, U, a)) | |
99 | 101 | ||
100 | - | let | |
102 | + | let X = if ((r > 0)) | |
101 | 103 | then { | |
102 | - | let | |
103 | - | let | |
104 | - | fraction( | |
104 | + | let Y = ((18 - s) + h) | |
105 | + | let Z = pow(10, 0, Y, 0, 0, CEILING) | |
106 | + | fraction(V, Z, r) | |
105 | 107 | } | |
106 | 108 | else 20000000000000000 | |
107 | 109 | ||
108 | - | func | |
109 | - | let | |
110 | - | let | |
111 | - | fraction( | |
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) | |
112 | 114 | } | |
113 | 115 | ||
114 | 116 | ||
115 | - | func | |
116 | - | let | |
117 | - | let | |
118 | - | fraction( | |
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) | |
119 | 121 | } | |
120 | 122 | ||
121 | 123 | ||
122 | - | @Callable( | |
123 | - | func deposit ( | |
124 | + | @Callable(ae) | |
125 | + | func deposit (af,ag) = if (z(ae.caller)) | |
124 | 126 | then { | |
125 | - | let | |
126 | - | let | |
127 | - | if ( | |
127 | + | let ah = aa(ae.payments[0].amount) | |
128 | + | let ai = (r + ah) | |
129 | + | if (ag) | |
128 | 130 | then { | |
129 | - | let | |
130 | - | $Tuple2([ | |
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")) | |
131 | 133 | } | |
132 | - | else $Tuple2([ | |
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) | |
133 | 135 | } | |
134 | 136 | else throw("Address does not match with wavetroller address!") | |
135 | 137 | ||
136 | 138 | ||
137 | 139 | ||
138 | - | @Callable( | |
139 | - | func withdraw ( | |
140 | + | @Callable(ae) | |
141 | + | func withdraw (af) = if (z(ae.caller)) | |
140 | 142 | then { | |
141 | - | let | |
142 | - | let | |
143 | - | if (( | |
144 | - | then $Tuple2([ | |
145 | - | then ScriptTransfer( | |
146 | - | else ScriptTransfer( | |
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) | |
147 | 149 | else throw("Pool liquidity is not sufficient!") | |
148 | 150 | } | |
149 | 151 | else throw("Address does not match with wavetroller address!") | |
150 | 152 | ||
151 | 153 | ||
152 | 154 | ||
153 | - | @Callable( | |
154 | - | func lockAsCollateral ( | |
155 | + | @Callable(ae) | |
156 | + | func lockAsCollateral (af) = if (z(ae.caller)) | |
155 | 157 | then { | |
156 | - | let | |
157 | - | $Tuple2([ | |
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")) | |
158 | 160 | } | |
159 | 161 | else throw("Address does not match with wavetroller address!") | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | ||
163 | - | @Callable( | |
164 | - | func setup ( | |
165 | + | @Callable(ae) | |
166 | + | func setup (an,ao,m,ap,aq) = if (!(isDefined(getString(this, "configAddress")))) | |
165 | 167 | then { | |
166 | - | let | |
167 | - | let | |
168 | - | [ | |
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)] | |
169 | 171 | } | |
170 | 172 | else throw("Pool already setup!") | |
171 | 173 | ||
172 | 174 | ||
173 | 175 | ||
174 | - | @Callable( | |
175 | - | func deletEntry ( | |
176 | - | then [DeleteEntry( | |
176 | + | @Callable(ae) | |
177 | + | func deletEntry (D) = if (x(ae.caller)) | |
178 | + | then [DeleteEntry(D)] | |
177 | 179 | else throw("Caller is not an admin!") | |
178 | 180 | ||
179 | 181 | ||
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) | |
182 | 191 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 1000 | |
5 | 5 | ||
6 | 6 | let b = 10000000000000000 | |
7 | 7 | ||
8 | 8 | let c = 525600 | |
9 | 9 | ||
10 | 10 | let d = valueOrElse(getString(this, "configAddress"), "") | |
11 | 11 | ||
12 | 12 | let e = valueOrElse(getString(addressFromStringValue(d), "admin"), "") | |
13 | 13 | ||
14 | 14 | let f = valueOrElse(getString(addressFromStringValue(d), "wavetroller"), "") | |
15 | 15 | ||
16 | 16 | let g = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!") | |
17 | 17 | ||
18 | 18 | let h = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Decimals")), (("No key " + (g + "_Decimals")) + " was found")) | |
19 | 19 | ||
20 | 20 | let i = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Multiplier")), (("No key " + (g + "_Multiplier")) + " was found")) | |
21 | 21 | ||
22 | 22 | let j = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Kink")), (("No key " + (g + "_Kink")) + " was found")) | |
23 | 23 | ||
24 | 24 | let k = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_JumpMultiplier")), (("No key " + (g + "_JumpMultiplier")) + " was found")) | |
25 | 25 | ||
26 | 26 | let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_BaseRate")), (("No key " + (g + "_BaseRate")) + " was found")) | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = valueOrElse(getInteger(this, "baseExchangeRate"), 0) | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found")) | |
31 | 31 | ||
32 | - | let o = valueOrElse(getInteger(this, " | |
32 | + | let o = valueOrElse(getInteger(this, "totalBorrow"), 0) | |
33 | 33 | ||
34 | - | let p = valueOrElse(getInteger(this, " | |
34 | + | let p = valueOrElse(getInteger(this, "totalSupply"), 0) | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = valueOrElse(getInteger(this, "totalReserve"), 0) | |
37 | 37 | ||
38 | - | let r = valueOrErrorMessage(getInteger(this, " | |
38 | + | let r = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found") | |
39 | 39 | ||
40 | - | let s = valueOrErrorMessage( | |
40 | + | let s = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found") | |
41 | 41 | ||
42 | - | let t = valueOrErrorMessage(getString(this, " | |
42 | + | let t = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found") | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = valueOrErrorMessage(getString(this, "dTokenName"), "No key dTokenName was found") | |
45 | 45 | ||
46 | - | let v = valueOrElse(getInteger(this, " | |
46 | + | let v = valueOrElse(getInteger(this, "storedHeight"), height) | |
47 | 47 | ||
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)) | |
49 | 51 | then true | |
50 | 52 | else false | |
51 | 53 | ||
52 | 54 | ||
53 | - | func | |
55 | + | func z (y) = if ((addressFromStringValue(f) == y)) | |
54 | 56 | then true | |
55 | 57 | else false | |
56 | 58 | ||
57 | 59 | ||
58 | - | func | |
60 | + | func A (B) = if ((B == g)) | |
59 | 61 | then true | |
60 | 62 | else false | |
61 | 63 | ||
62 | 64 | ||
63 | - | func | |
65 | + | func C (D,E) = StringEntry(D, E) | |
64 | 66 | ||
65 | 67 | ||
66 | - | func | |
68 | + | func F (D,G) = IntegerEntry(D, G) | |
67 | 69 | ||
68 | 70 | ||
69 | - | func | |
71 | + | func H (I) = valueOrElse(getInteger(this, (I + "_locked")), 0) | |
70 | 72 | ||
71 | 73 | ||
72 | - | let | |
73 | - | then fraction( | |
74 | + | let J = if ((p > 0)) | |
75 | + | then fraction(o, a, p) | |
74 | 76 | else 0 | |
75 | 77 | ||
76 | - | let | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | ((fraction(i, | |
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) | |
82 | 84 | } | |
83 | 85 | ||
84 | - | let | |
86 | + | let P = fraction(fraction(K, J, a), (a - n), a) | |
85 | 87 | ||
86 | - | let | |
88 | + | let Q = fraction(K, b, (c * a)) | |
87 | 89 | ||
88 | - | let | |
90 | + | let R = (height - v) | |
89 | 91 | ||
90 | - | let | |
92 | + | let S = fraction(w, (b + (Q * R)), b, CEILING) | |
91 | 93 | ||
92 | - | let | |
94 | + | let T = fraction(o, S, w) | |
93 | 95 | ||
94 | - | let | |
96 | + | let U = fraction(o, (Q * R), b) | |
95 | 97 | ||
96 | - | let | |
98 | + | let V = (p + fraction((a - n), U, a)) | |
97 | 99 | ||
98 | - | let | |
100 | + | let W = (q + fraction(n, U, a)) | |
99 | 101 | ||
100 | - | let | |
102 | + | let X = if ((r > 0)) | |
101 | 103 | then { | |
102 | - | let | |
103 | - | let | |
104 | - | fraction( | |
104 | + | let Y = ((18 - s) + h) | |
105 | + | let Z = pow(10, 0, Y, 0, 0, CEILING) | |
106 | + | fraction(V, Z, r) | |
105 | 107 | } | |
106 | 108 | else 20000000000000000 | |
107 | 109 | ||
108 | - | func | |
109 | - | let | |
110 | - | let | |
111 | - | fraction( | |
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) | |
112 | 114 | } | |
113 | 115 | ||
114 | 116 | ||
115 | - | func | |
116 | - | let | |
117 | - | let | |
118 | - | fraction( | |
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) | |
119 | 121 | } | |
120 | 122 | ||
121 | 123 | ||
122 | - | @Callable( | |
123 | - | func deposit ( | |
124 | + | @Callable(ae) | |
125 | + | func deposit (af,ag) = if (z(ae.caller)) | |
124 | 126 | then { | |
125 | - | let | |
126 | - | let | |
127 | - | if ( | |
127 | + | let ah = aa(ae.payments[0].amount) | |
128 | + | let ai = (r + ah) | |
129 | + | if (ag) | |
128 | 130 | then { | |
129 | - | let | |
130 | - | $Tuple2([ | |
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")) | |
131 | 133 | } | |
132 | - | else $Tuple2([ | |
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) | |
133 | 135 | } | |
134 | 136 | else throw("Address does not match with wavetroller address!") | |
135 | 137 | ||
136 | 138 | ||
137 | 139 | ||
138 | - | @Callable( | |
139 | - | func withdraw ( | |
140 | + | @Callable(ae) | |
141 | + | func withdraw (af) = if (z(ae.caller)) | |
140 | 142 | then { | |
141 | - | let | |
142 | - | let | |
143 | - | if (( | |
144 | - | then $Tuple2([ | |
145 | - | then ScriptTransfer( | |
146 | - | else ScriptTransfer( | |
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) | |
147 | 149 | else throw("Pool liquidity is not sufficient!") | |
148 | 150 | } | |
149 | 151 | else throw("Address does not match with wavetroller address!") | |
150 | 152 | ||
151 | 153 | ||
152 | 154 | ||
153 | - | @Callable( | |
154 | - | func lockAsCollateral ( | |
155 | + | @Callable(ae) | |
156 | + | func lockAsCollateral (af) = if (z(ae.caller)) | |
155 | 157 | then { | |
156 | - | let | |
157 | - | $Tuple2([ | |
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")) | |
158 | 160 | } | |
159 | 161 | else throw("Address does not match with wavetroller address!") | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | ||
163 | - | @Callable( | |
164 | - | func setup ( | |
165 | + | @Callable(ae) | |
166 | + | func setup (an,ao,m,ap,aq) = if (!(isDefined(getString(this, "configAddress")))) | |
165 | 167 | then { | |
166 | - | let | |
167 | - | let | |
168 | - | [ | |
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)] | |
169 | 171 | } | |
170 | 172 | else throw("Pool already setup!") | |
171 | 173 | ||
172 | 174 | ||
173 | 175 | ||
174 | - | @Callable( | |
175 | - | func deletEntry ( | |
176 | - | then [DeleteEntry( | |
176 | + | @Callable(ae) | |
177 | + | func deletEntry (D) = if (x(ae.caller)) | |
178 | + | then [DeleteEntry(D)] | |
177 | 179 | else throw("Caller is not an admin!") | |
178 | 180 | ||
179 | 181 | ||
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) | |
182 | 191 |
github/deemru/w8io/026f985 69.63 ms ◑