tx · BXe4xkbsyqYZcukriWez3gfhvtJdyY4iHxkDNMthG8fe 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo: -0.04000000 Waves 2021.09.05 21:55 [1690134] smart account 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo > SELF 0.00000000 Waves
{ "type": 13, "id": "BXe4xkbsyqYZcukriWez3gfhvtJdyY4iHxkDNMthG8fe", "fee": 4000000, "feeAssetId": null, "timestamp": 1630868204251, "version": 2, "chainId": 84, "sender": "3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo", "senderPublicKey": "CD4N2SBeZVBUwmtsqwfmQ3ZKnBP3AxpZCvJ5QkHytUed", "proofs": [ "51jsp3K9im5EdMcgAoJrQyEh1ezQuimp8ybrBFg1KuTE9d9U7g8sV3EPzYmrKuLqKASQwBWSwqgyWmedVE1Uv4bq" ], "script": "base64:AAIFAAAAAAAAADoIAhIECgIIGBIDCgEIEgMKAQgSBAoCCAQSAwoBCBIDCgEIEgUKAwgIARIDCgEIEgUKAwgIARIDCgEIAAAADAAAAAAGY29uZmlnCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAAZjb25maWcCAAAAAAAAAAAFYWRtaW4JAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAAFYWRtaW4CAAAAAAAAAAAFcG9vbHMJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAABXBvb2xzAgAAAAABAAAAB2lzQWRtaW4AAAABAAAADWNhbGxlckFkZHJlc3MDCQAAAAAAAAIFAAAADWNhbGxlckFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABWFkb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ZQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAARuYW1lBQAAAANuaWwAAAAAdhp2MA==", "height": 1690134, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3j4sC8PjvcAqGKV9Znf6DEYrnNUiqTKC1sHnkfizoPcN Next: 8SePcoWGcguP1VHso6rjpGWaHtxSzKRdU1PN3vxGjMiX Diff:
Old | New | Differences | |
---|---|---|---|
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(V) | |
100 | - | func repayTo (n) = if (f(n)) | |
100 | + | func setup (W,c) = if (if (!(isDefined(getString(this, "config")))) | |
101 | + | then !(isDefined(getString(this, "pools"))) | |
102 | + | else false) | |
103 | + | then [h("config", W), h("pools", makeString(c, ";"))] | |
104 | + | else throw("Admin and config address already definied!") | |
105 | + | ||
106 | + | ||
107 | + | ||
108 | + | @Callable(V) | |
109 | + | func addPool (n) = if (d(V.caller)) | |
101 | 110 | then { | |
102 | - | let W = getStringValue(addressFromStringValue(n), "assetId") | |
103 | - | if ((fromBase58String(W) == V.payments[0].assetId)) | |
111 | + | let F = split(c, ";") | |
112 | + | if ((containsElement(F, n) == false)) | |
113 | + | then { | |
114 | + | let X = (F :+ n) | |
115 | + | [h("pools", makeString(X, ";"))] | |
116 | + | } | |
117 | + | else throw("Pool already exists!") | |
118 | + | } | |
119 | + | else throw("Address does not match with admin address!") | |
120 | + | ||
121 | + | ||
122 | + | ||
123 | + | @Callable(V) | |
124 | + | func updateConfig (W) = if (d(V.caller)) | |
125 | + | then [h("config", W)] | |
126 | + | else throw("Address does not match with admin address!") | |
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | @Callable(V) | |
131 | + | func depositAt (n,Y) = if (f(n)) | |
132 | + | then if ((size(V.payments) > 0)) | |
133 | + | then { | |
134 | + | let t = toBase58String(V.caller.bytes) | |
135 | + | let Z = invoke(addressFromStringValue(n), "deposit", [t, Y], V.payments) | |
136 | + | if ((Z == Z)) | |
137 | + | then { | |
138 | + | let aa = getStringValue(addressFromStringValue(n), "dTokenId") | |
139 | + | let z = Z | |
140 | + | if ($isInstanceOf(z, "Int")) | |
141 | + | then { | |
142 | + | let A = z | |
143 | + | [ScriptTransfer(V.caller, A, fromBase58String(aa))] | |
144 | + | } | |
145 | + | else if ($isInstanceOf(z, "String")) | |
146 | + | then { | |
147 | + | let A = z | |
148 | + | nil | |
149 | + | } | |
150 | + | else throw("Incorrect invoke result!") | |
151 | + | } | |
152 | + | else throw("Strict value is not equal to itself.") | |
153 | + | } | |
154 | + | else throw("No payment attached!") | |
155 | + | else throw("Pool address not found!") | |
156 | + | ||
157 | + | ||
158 | + | ||
159 | + | @Callable(V) | |
160 | + | func withdrawFrom (n) = if (f(n)) | |
161 | + | then { | |
162 | + | let ab = getStringValue(addressFromStringValue(n), "dTokenId") | |
163 | + | if ((fromBase58String(ab) == V.payments[0].assetId)) | |
104 | 164 | then if ((size(V.payments) > 0)) | |
105 | 165 | then { | |
106 | 166 | let t = toBase58String(V.caller.bytes) | |
107 | - | let | |
108 | - | if (( | |
167 | + | let Z = invoke(addressFromStringValue(n), "withdraw", [t], V.payments) | |
168 | + | if ((Z == Z)) | |
109 | 169 | then { | |
110 | - | let | |
111 | - | let z = | |
170 | + | let aa = getStringValue(addressFromStringValue(n), "assetId") | |
171 | + | let z = Z | |
112 | 172 | if ($isInstanceOf(z, "Int")) | |
113 | 173 | then { | |
114 | 174 | let A = z | |
115 | - | if (( | |
175 | + | if ((aa == "WAVES")) | |
116 | 176 | then [ScriptTransfer(V.caller, A, unit)] | |
117 | - | else [ScriptTransfer(V.caller, A, fromBase58String( | |
177 | + | else [ScriptTransfer(V.caller, A, fromBase58String(aa))] | |
118 | 178 | } | |
119 | 179 | else if ($isInstanceOf(z, "String")) | |
120 | 180 | then { | |
133 | 193 | ||
134 | 194 | ||
135 | 195 | @Callable(V) | |
136 | - | func | |
196 | + | func repayTo (n) = if (f(n)) | |
137 | 197 | then { | |
138 | - | let W = getStringValue(addressFromStringValue(n), "assetId") | |
139 | - | if ((W == X)) | |
198 | + | let ac = getStringValue(addressFromStringValue(n), "assetId") | |
199 | + | if ((fromBase58String(ac) == V.payments[0].assetId)) | |
200 | + | then if ((size(V.payments) > 0)) | |
201 | + | then { | |
202 | + | let t = toBase58String(V.caller.bytes) | |
203 | + | let o = invoke(addressFromStringValue(n), "repay", [t], V.payments) | |
204 | + | if ((o == o)) | |
205 | + | then { | |
206 | + | let ad = getStringValue(addressFromStringValue(n), "assetId") | |
207 | + | let z = o | |
208 | + | if ($isInstanceOf(z, "Int")) | |
209 | + | then { | |
210 | + | let A = z | |
211 | + | if ((ad == "WAVES")) | |
212 | + | then [ScriptTransfer(V.caller, A, unit)] | |
213 | + | else [ScriptTransfer(V.caller, A, fromBase58String(ad))] | |
214 | + | } | |
215 | + | else if ($isInstanceOf(z, "String")) | |
216 | + | then { | |
217 | + | let A = z | |
218 | + | nil | |
219 | + | } | |
220 | + | else throw("Incorrect invoke result!") | |
221 | + | } | |
222 | + | else throw("Strict value is not equal to itself.") | |
223 | + | } | |
224 | + | else throw("No payment attached!") | |
225 | + | else throw("AssetIds does not match") | |
226 | + | } | |
227 | + | else throw("Pool address not found!") | |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | @Callable(V) | |
232 | + | func borrowFrom (n,ad,o) = if (f(n)) | |
233 | + | then { | |
234 | + | let ac = getStringValue(addressFromStringValue(n), "assetId") | |
235 | + | if ((ac == ad)) | |
140 | 236 | then if (m(n, o)) | |
141 | 237 | then { | |
142 | 238 | let t = toBase58String(V.caller.bytes) | |
143 | - | if (S(t, o, | |
239 | + | if (S(t, o, ad, 0, "")) | |
144 | 240 | then { | |
145 | - | let | |
146 | - | if (( | |
241 | + | let Z = invoke(addressFromStringValue(n), "borrow", [t, o], nil) | |
242 | + | if ((Z == Z)) | |
147 | 243 | then { | |
148 | - | let z = | |
244 | + | let z = Z | |
149 | 245 | if ($isInstanceOf(z, "Int")) | |
150 | 246 | then { | |
151 | 247 | let A = z | |
152 | - | if (( | |
248 | + | if ((ac == "WAVES")) | |
153 | 249 | then [ScriptTransfer(V.caller, A, unit)] | |
154 | - | else [ScriptTransfer(V.caller, A, fromBase58String( | |
250 | + | else [ScriptTransfer(V.caller, A, fromBase58String(ac))] | |
155 | 251 | } | |
156 | 252 | else if ($isInstanceOf(z, "String")) | |
157 | 253 | then { | |
172 | 268 | ||
173 | 269 | ||
174 | 270 | @Callable(V) | |
175 | - | func setup (Z,c) = if (if (!(isDefined(getString(this, "config")))) | |
176 | - | then !(isDefined(getString(this, "pools"))) | |
177 | - | else false) | |
178 | - | then [h("config", Z), h("pools", makeString(c, ";"))] | |
179 | - | else throw("Admin and config address already definied!") | |
180 | - | ||
181 | - | ||
182 | - | ||
183 | - | @Callable(V) | |
184 | - | func addPool (n) = if (d(V.caller)) | |
185 | - | then { | |
186 | - | let F = split(c, ";") | |
187 | - | if ((containsElement(F, n) == false)) | |
188 | - | then { | |
189 | - | let aa = (F :+ n) | |
190 | - | [h("pools", makeString(aa, ";"))] | |
191 | - | } | |
192 | - | else throw("Pool already exists!") | |
193 | - | } | |
194 | - | else throw("Address does not match with admin address!") | |
195 | - | ||
196 | - | ||
197 | - | ||
198 | - | @Callable(V) | |
199 | - | func updateConfig (Z) = if (d(V.caller)) | |
200 | - | then [h("config", Z)] | |
201 | - | else throw("Address does not match with admin address!") | |
202 | - | ||
203 | - | ||
204 | - | ||
205 | - | @Callable(V) | |
206 | - | func depositAt (n,ab) = if (f(n)) | |
207 | - | then if ((size(V.payments) > 0)) | |
208 | - | then { | |
209 | - | let t = toBase58String(V.caller.bytes) | |
210 | - | let Y = invoke(addressFromStringValue(n), "deposit", [t, ab], V.payments) | |
211 | - | if ((Y == Y)) | |
212 | - | then { | |
213 | - | let ac = getStringValue(addressFromStringValue(n), "dTokenId") | |
214 | - | let z = Y | |
215 | - | if ($isInstanceOf(z, "Int")) | |
216 | - | then { | |
217 | - | let A = z | |
218 | - | [ScriptTransfer(V.caller, A, fromBase58String(ac))] | |
219 | - | } | |
220 | - | else if ($isInstanceOf(z, "String")) | |
221 | - | then { | |
222 | - | let A = z | |
223 | - | nil | |
224 | - | } | |
225 | - | else throw("Incorrect invoke result!") | |
226 | - | } | |
227 | - | else throw("Strict value is not equal to itself.") | |
228 | - | } | |
229 | - | else throw("No payment attached!") | |
230 | - | else throw("Pool address not found!") | |
231 | - | ||
232 | - | ||
233 | - | ||
234 | - | @Callable(V) | |
235 | - | func withdrawFrom (n) = if (f(n)) | |
236 | - | then { | |
237 | - | let ad = getStringValue(addressFromStringValue(n), "dTokenId") | |
238 | - | if ((fromBase58String(ad) == V.payments[0].assetId)) | |
239 | - | then if ((size(V.payments) > 0)) | |
240 | - | then { | |
241 | - | let t = toBase58String(V.caller.bytes) | |
242 | - | let Y = invoke(addressFromStringValue(n), "withdraw", [t], V.payments) | |
243 | - | if ((Y == Y)) | |
244 | - | then { | |
245 | - | let ac = getStringValue(addressFromStringValue(n), "assetId") | |
246 | - | let z = Y | |
247 | - | if ($isInstanceOf(z, "Int")) | |
248 | - | then { | |
249 | - | let A = z | |
250 | - | if ((ac == "WAVES")) | |
251 | - | then [ScriptTransfer(V.caller, A, unit)] | |
252 | - | else [ScriptTransfer(V.caller, A, fromBase58String(ac))] | |
253 | - | } | |
254 | - | else if ($isInstanceOf(z, "String")) | |
255 | - | then { | |
256 | - | let A = z | |
257 | - | nil | |
258 | - | } | |
259 | - | else throw("Incorrect invoke result!") | |
260 | - | } | |
261 | - | else throw("Strict value is not equal to itself.") | |
262 | - | } | |
263 | - | else throw("No payment attached!") | |
264 | - | else throw("AssetIds does not match") | |
265 | - | } | |
266 | - | else throw("Pool address not found!") | |
267 | - | ||
268 | - | ||
269 | - | ||
270 | - | @Callable(V) | |
271 | 271 | func lockAsCollateralAt (n) = if (f(n)) | |
272 | 272 | then { | |
273 | - | let | |
274 | - | if ((fromBase58String( | |
273 | + | let ab = getStringValue(addressFromStringValue(n), "dTokenId") | |
274 | + | if ((fromBase58String(ab) == V.payments[0].assetId)) | |
275 | 275 | then if ((size(V.payments) > 0)) | |
276 | 276 | then { | |
277 | 277 | let t = toBase58String(V.caller.bytes) | |
296 | 296 | ||
297 | 297 | ||
298 | 298 | @Callable(V) | |
299 | - | func deleteData (af) = [DeleteEntry(af)] | |
299 | + | func redeemCollateralFrom (n,af,o) = if (f(n)) | |
300 | + | then { | |
301 | + | let ag = getStringValue(addressFromStringValue(n), "dTokenId") | |
302 | + | if ((ag == af)) | |
303 | + | then { | |
304 | + | let t = toBase58String(V.caller.bytes) | |
305 | + | if (S(t, 0, "", o, af)) | |
306 | + | then { | |
307 | + | let Z = invoke(addressFromStringValue(n), "redeemCollateral", [t, o], nil) | |
308 | + | if ((Z == Z)) | |
309 | + | then { | |
310 | + | let aa = getStringValue(addressFromStringValue(n), "dTokenId") | |
311 | + | let z = Z | |
312 | + | if ($isInstanceOf(z, "Int")) | |
313 | + | then { | |
314 | + | let A = z | |
315 | + | [ScriptTransfer(V.caller, A, fromBase58String(aa))] | |
316 | + | } | |
317 | + | else if ($isInstanceOf(z, "String")) | |
318 | + | then { | |
319 | + | let A = z | |
320 | + | nil | |
321 | + | } | |
322 | + | else throw("Incorrect invoke result!") | |
323 | + | } | |
324 | + | else throw("Strict value is not equal to itself.") | |
325 | + | } | |
326 | + | else throw("Borrow exceeds user health!") | |
327 | + | } | |
328 | + | else throw("AssetIds does not match") | |
329 | + | } | |
330 | + | else throw("Pool address not found!") | |
331 | + | ||
332 | + | ||
333 | + | ||
334 | + | @Callable(V) | |
335 | + | func deleteData (ah) = [DeleteEntry(ah)] | |
300 | 336 | ||
301 | 337 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = valueOrElse(getStringValue(this, "config"), "") | |
5 | 5 | ||
6 | 6 | let b = valueOrElse(getStringValue(addressFromStringValue(a), "admin"), "") | |
7 | 7 | ||
8 | 8 | let c = valueOrElse(getStringValue(this, "pools"), "") | |
9 | 9 | ||
10 | 10 | func d (e) = if ((e == addressFromStringValue(b))) | |
11 | 11 | then true | |
12 | 12 | else false | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func f (g) = if (contains(c, g)) | |
16 | 16 | then true | |
17 | 17 | else false | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func h (i,j) = StringEntry(i, j) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func k (i,l) = IntegerEntry(i, l) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func m (n,o) = { | |
27 | 27 | let p = getIntegerValue(addressFromStringValue(n), "totalSupply") | |
28 | 28 | let q = getIntegerValue(addressFromStringValue(n), "totalBorrow") | |
29 | 29 | let r = (p - q) | |
30 | 30 | if ((r >= o)) | |
31 | 31 | then true | |
32 | 32 | else false | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func s (t,n,u,v,w,x) = { | |
37 | 37 | let y = invoke(addressFromStringValue(n), "getUserHealthParameter", [t, w, x, u, v], nil) | |
38 | 38 | let z = y | |
39 | 39 | if ($isInstanceOf(z, "(Int, Int)")) | |
40 | 40 | then { | |
41 | 41 | let A = z | |
42 | 42 | A | |
43 | 43 | } | |
44 | 44 | else throw("Return value has the wrong data type") | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func B (C,D) = fraction((C - D), 1000, C) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func E (t,u,v,w,x) = { | |
52 | 52 | let F = split(c, ";") | |
53 | 53 | let G = size(F) | |
54 | 54 | func H (I,J) = { | |
55 | 55 | let K = s(t, J, u, v, w, x) | |
56 | 56 | let z = K | |
57 | 57 | if ($isInstanceOf(z, "(Int, Int)")) | |
58 | 58 | then { | |
59 | 59 | let A = z | |
60 | 60 | $Tuple2((I._1 + K._1), (I._2 + K._1)) | |
61 | 61 | } | |
62 | 62 | else { | |
63 | 63 | let L = z | |
64 | 64 | throw("Test") | |
65 | 65 | } | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | let M = F | |
69 | 69 | let N = size(M) | |
70 | 70 | let O = $Tuple2(0, 0) | |
71 | 71 | if ((N == 0)) | |
72 | 72 | then O | |
73 | 73 | else { | |
74 | 74 | let P = H(O, M[0]) | |
75 | 75 | if ((N == 1)) | |
76 | 76 | then P | |
77 | 77 | else { | |
78 | 78 | let Q = H(P, M[1]) | |
79 | 79 | if ((N == 2)) | |
80 | 80 | then Q | |
81 | 81 | else { | |
82 | 82 | let R = H(Q, M[2]) | |
83 | 83 | throw("List size exceed 2") | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 | } | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func S (t,u,v,w,x) = { | |
91 | 91 | let T = E(t, u, v, w, x) | |
92 | 92 | let U = B(T._1, T._2) | |
93 | 93 | if ((U >= 0)) | |
94 | 94 | then true | |
95 | 95 | else false | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(V) | |
100 | - | func repayTo (n) = if (f(n)) | |
100 | + | func setup (W,c) = if (if (!(isDefined(getString(this, "config")))) | |
101 | + | then !(isDefined(getString(this, "pools"))) | |
102 | + | else false) | |
103 | + | then [h("config", W), h("pools", makeString(c, ";"))] | |
104 | + | else throw("Admin and config address already definied!") | |
105 | + | ||
106 | + | ||
107 | + | ||
108 | + | @Callable(V) | |
109 | + | func addPool (n) = if (d(V.caller)) | |
101 | 110 | then { | |
102 | - | let W = getStringValue(addressFromStringValue(n), "assetId") | |
103 | - | if ((fromBase58String(W) == V.payments[0].assetId)) | |
111 | + | let F = split(c, ";") | |
112 | + | if ((containsElement(F, n) == false)) | |
113 | + | then { | |
114 | + | let X = (F :+ n) | |
115 | + | [h("pools", makeString(X, ";"))] | |
116 | + | } | |
117 | + | else throw("Pool already exists!") | |
118 | + | } | |
119 | + | else throw("Address does not match with admin address!") | |
120 | + | ||
121 | + | ||
122 | + | ||
123 | + | @Callable(V) | |
124 | + | func updateConfig (W) = if (d(V.caller)) | |
125 | + | then [h("config", W)] | |
126 | + | else throw("Address does not match with admin address!") | |
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | @Callable(V) | |
131 | + | func depositAt (n,Y) = if (f(n)) | |
132 | + | then if ((size(V.payments) > 0)) | |
133 | + | then { | |
134 | + | let t = toBase58String(V.caller.bytes) | |
135 | + | let Z = invoke(addressFromStringValue(n), "deposit", [t, Y], V.payments) | |
136 | + | if ((Z == Z)) | |
137 | + | then { | |
138 | + | let aa = getStringValue(addressFromStringValue(n), "dTokenId") | |
139 | + | let z = Z | |
140 | + | if ($isInstanceOf(z, "Int")) | |
141 | + | then { | |
142 | + | let A = z | |
143 | + | [ScriptTransfer(V.caller, A, fromBase58String(aa))] | |
144 | + | } | |
145 | + | else if ($isInstanceOf(z, "String")) | |
146 | + | then { | |
147 | + | let A = z | |
148 | + | nil | |
149 | + | } | |
150 | + | else throw("Incorrect invoke result!") | |
151 | + | } | |
152 | + | else throw("Strict value is not equal to itself.") | |
153 | + | } | |
154 | + | else throw("No payment attached!") | |
155 | + | else throw("Pool address not found!") | |
156 | + | ||
157 | + | ||
158 | + | ||
159 | + | @Callable(V) | |
160 | + | func withdrawFrom (n) = if (f(n)) | |
161 | + | then { | |
162 | + | let ab = getStringValue(addressFromStringValue(n), "dTokenId") | |
163 | + | if ((fromBase58String(ab) == V.payments[0].assetId)) | |
104 | 164 | then if ((size(V.payments) > 0)) | |
105 | 165 | then { | |
106 | 166 | let t = toBase58String(V.caller.bytes) | |
107 | - | let | |
108 | - | if (( | |
167 | + | let Z = invoke(addressFromStringValue(n), "withdraw", [t], V.payments) | |
168 | + | if ((Z == Z)) | |
109 | 169 | then { | |
110 | - | let | |
111 | - | let z = | |
170 | + | let aa = getStringValue(addressFromStringValue(n), "assetId") | |
171 | + | let z = Z | |
112 | 172 | if ($isInstanceOf(z, "Int")) | |
113 | 173 | then { | |
114 | 174 | let A = z | |
115 | - | if (( | |
175 | + | if ((aa == "WAVES")) | |
116 | 176 | then [ScriptTransfer(V.caller, A, unit)] | |
117 | - | else [ScriptTransfer(V.caller, A, fromBase58String( | |
177 | + | else [ScriptTransfer(V.caller, A, fromBase58String(aa))] | |
118 | 178 | } | |
119 | 179 | else if ($isInstanceOf(z, "String")) | |
120 | 180 | then { | |
121 | 181 | let A = z | |
122 | 182 | nil | |
123 | 183 | } | |
124 | 184 | else throw("Incorrect invoke result!") | |
125 | 185 | } | |
126 | 186 | else throw("Strict value is not equal to itself.") | |
127 | 187 | } | |
128 | 188 | else throw("No payment attached!") | |
129 | 189 | else throw("AssetIds does not match") | |
130 | 190 | } | |
131 | 191 | else throw("Pool address not found!") | |
132 | 192 | ||
133 | 193 | ||
134 | 194 | ||
135 | 195 | @Callable(V) | |
136 | - | func | |
196 | + | func repayTo (n) = if (f(n)) | |
137 | 197 | then { | |
138 | - | let W = getStringValue(addressFromStringValue(n), "assetId") | |
139 | - | if ((W == X)) | |
198 | + | let ac = getStringValue(addressFromStringValue(n), "assetId") | |
199 | + | if ((fromBase58String(ac) == V.payments[0].assetId)) | |
200 | + | then if ((size(V.payments) > 0)) | |
201 | + | then { | |
202 | + | let t = toBase58String(V.caller.bytes) | |
203 | + | let o = invoke(addressFromStringValue(n), "repay", [t], V.payments) | |
204 | + | if ((o == o)) | |
205 | + | then { | |
206 | + | let ad = getStringValue(addressFromStringValue(n), "assetId") | |
207 | + | let z = o | |
208 | + | if ($isInstanceOf(z, "Int")) | |
209 | + | then { | |
210 | + | let A = z | |
211 | + | if ((ad == "WAVES")) | |
212 | + | then [ScriptTransfer(V.caller, A, unit)] | |
213 | + | else [ScriptTransfer(V.caller, A, fromBase58String(ad))] | |
214 | + | } | |
215 | + | else if ($isInstanceOf(z, "String")) | |
216 | + | then { | |
217 | + | let A = z | |
218 | + | nil | |
219 | + | } | |
220 | + | else throw("Incorrect invoke result!") | |
221 | + | } | |
222 | + | else throw("Strict value is not equal to itself.") | |
223 | + | } | |
224 | + | else throw("No payment attached!") | |
225 | + | else throw("AssetIds does not match") | |
226 | + | } | |
227 | + | else throw("Pool address not found!") | |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | @Callable(V) | |
232 | + | func borrowFrom (n,ad,o) = if (f(n)) | |
233 | + | then { | |
234 | + | let ac = getStringValue(addressFromStringValue(n), "assetId") | |
235 | + | if ((ac == ad)) | |
140 | 236 | then if (m(n, o)) | |
141 | 237 | then { | |
142 | 238 | let t = toBase58String(V.caller.bytes) | |
143 | - | if (S(t, o, | |
239 | + | if (S(t, o, ad, 0, "")) | |
144 | 240 | then { | |
145 | - | let | |
146 | - | if (( | |
241 | + | let Z = invoke(addressFromStringValue(n), "borrow", [t, o], nil) | |
242 | + | if ((Z == Z)) | |
147 | 243 | then { | |
148 | - | let z = | |
244 | + | let z = Z | |
149 | 245 | if ($isInstanceOf(z, "Int")) | |
150 | 246 | then { | |
151 | 247 | let A = z | |
152 | - | if (( | |
248 | + | if ((ac == "WAVES")) | |
153 | 249 | then [ScriptTransfer(V.caller, A, unit)] | |
154 | - | else [ScriptTransfer(V.caller, A, fromBase58String( | |
250 | + | else [ScriptTransfer(V.caller, A, fromBase58String(ac))] | |
155 | 251 | } | |
156 | 252 | else if ($isInstanceOf(z, "String")) | |
157 | 253 | then { | |
158 | 254 | let A = z | |
159 | 255 | nil | |
160 | 256 | } | |
161 | 257 | else throw("Incorrect invoke result!") | |
162 | 258 | } | |
163 | 259 | else throw("Strict value is not equal to itself.") | |
164 | 260 | } | |
165 | 261 | else throw("Borrow exceeds user health!") | |
166 | 262 | } | |
167 | 263 | else throw("Pool liquidity is not sufficient!") | |
168 | 264 | else throw("AssetIds does not match") | |
169 | 265 | } | |
170 | 266 | else throw("Pool address not found!") | |
171 | 267 | ||
172 | 268 | ||
173 | 269 | ||
174 | 270 | @Callable(V) | |
175 | - | func setup (Z,c) = if (if (!(isDefined(getString(this, "config")))) | |
176 | - | then !(isDefined(getString(this, "pools"))) | |
177 | - | else false) | |
178 | - | then [h("config", Z), h("pools", makeString(c, ";"))] | |
179 | - | else throw("Admin and config address already definied!") | |
180 | - | ||
181 | - | ||
182 | - | ||
183 | - | @Callable(V) | |
184 | - | func addPool (n) = if (d(V.caller)) | |
185 | - | then { | |
186 | - | let F = split(c, ";") | |
187 | - | if ((containsElement(F, n) == false)) | |
188 | - | then { | |
189 | - | let aa = (F :+ n) | |
190 | - | [h("pools", makeString(aa, ";"))] | |
191 | - | } | |
192 | - | else throw("Pool already exists!") | |
193 | - | } | |
194 | - | else throw("Address does not match with admin address!") | |
195 | - | ||
196 | - | ||
197 | - | ||
198 | - | @Callable(V) | |
199 | - | func updateConfig (Z) = if (d(V.caller)) | |
200 | - | then [h("config", Z)] | |
201 | - | else throw("Address does not match with admin address!") | |
202 | - | ||
203 | - | ||
204 | - | ||
205 | - | @Callable(V) | |
206 | - | func depositAt (n,ab) = if (f(n)) | |
207 | - | then if ((size(V.payments) > 0)) | |
208 | - | then { | |
209 | - | let t = toBase58String(V.caller.bytes) | |
210 | - | let Y = invoke(addressFromStringValue(n), "deposit", [t, ab], V.payments) | |
211 | - | if ((Y == Y)) | |
212 | - | then { | |
213 | - | let ac = getStringValue(addressFromStringValue(n), "dTokenId") | |
214 | - | let z = Y | |
215 | - | if ($isInstanceOf(z, "Int")) | |
216 | - | then { | |
217 | - | let A = z | |
218 | - | [ScriptTransfer(V.caller, A, fromBase58String(ac))] | |
219 | - | } | |
220 | - | else if ($isInstanceOf(z, "String")) | |
221 | - | then { | |
222 | - | let A = z | |
223 | - | nil | |
224 | - | } | |
225 | - | else throw("Incorrect invoke result!") | |
226 | - | } | |
227 | - | else throw("Strict value is not equal to itself.") | |
228 | - | } | |
229 | - | else throw("No payment attached!") | |
230 | - | else throw("Pool address not found!") | |
231 | - | ||
232 | - | ||
233 | - | ||
234 | - | @Callable(V) | |
235 | - | func withdrawFrom (n) = if (f(n)) | |
236 | - | then { | |
237 | - | let ad = getStringValue(addressFromStringValue(n), "dTokenId") | |
238 | - | if ((fromBase58String(ad) == V.payments[0].assetId)) | |
239 | - | then if ((size(V.payments) > 0)) | |
240 | - | then { | |
241 | - | let t = toBase58String(V.caller.bytes) | |
242 | - | let Y = invoke(addressFromStringValue(n), "withdraw", [t], V.payments) | |
243 | - | if ((Y == Y)) | |
244 | - | then { | |
245 | - | let ac = getStringValue(addressFromStringValue(n), "assetId") | |
246 | - | let z = Y | |
247 | - | if ($isInstanceOf(z, "Int")) | |
248 | - | then { | |
249 | - | let A = z | |
250 | - | if ((ac == "WAVES")) | |
251 | - | then [ScriptTransfer(V.caller, A, unit)] | |
252 | - | else [ScriptTransfer(V.caller, A, fromBase58String(ac))] | |
253 | - | } | |
254 | - | else if ($isInstanceOf(z, "String")) | |
255 | - | then { | |
256 | - | let A = z | |
257 | - | nil | |
258 | - | } | |
259 | - | else throw("Incorrect invoke result!") | |
260 | - | } | |
261 | - | else throw("Strict value is not equal to itself.") | |
262 | - | } | |
263 | - | else throw("No payment attached!") | |
264 | - | else throw("AssetIds does not match") | |
265 | - | } | |
266 | - | else throw("Pool address not found!") | |
267 | - | ||
268 | - | ||
269 | - | ||
270 | - | @Callable(V) | |
271 | 271 | func lockAsCollateralAt (n) = if (f(n)) | |
272 | 272 | then { | |
273 | - | let | |
274 | - | if ((fromBase58String( | |
273 | + | let ab = getStringValue(addressFromStringValue(n), "dTokenId") | |
274 | + | if ((fromBase58String(ab) == V.payments[0].assetId)) | |
275 | 275 | then if ((size(V.payments) > 0)) | |
276 | 276 | then { | |
277 | 277 | let t = toBase58String(V.caller.bytes) | |
278 | 278 | let ae = invoke(addressFromStringValue(n), "lockAsCollateral", [t], V.payments) | |
279 | 279 | if ((ae == ae)) | |
280 | 280 | then { | |
281 | 281 | let z = ae | |
282 | 282 | if ($isInstanceOf(z, "String")) | |
283 | 283 | then { | |
284 | 284 | let A = z | |
285 | 285 | nil | |
286 | 286 | } | |
287 | 287 | else throw("Incorrect invoke result!") | |
288 | 288 | } | |
289 | 289 | else throw("Strict value is not equal to itself.") | |
290 | 290 | } | |
291 | 291 | else throw("No payment attached!") | |
292 | 292 | else throw("AssetIds does not match") | |
293 | 293 | } | |
294 | 294 | else throw("Pool address not found!") | |
295 | 295 | ||
296 | 296 | ||
297 | 297 | ||
298 | 298 | @Callable(V) | |
299 | - | func deleteData (af) = [DeleteEntry(af)] | |
299 | + | func redeemCollateralFrom (n,af,o) = if (f(n)) | |
300 | + | then { | |
301 | + | let ag = getStringValue(addressFromStringValue(n), "dTokenId") | |
302 | + | if ((ag == af)) | |
303 | + | then { | |
304 | + | let t = toBase58String(V.caller.bytes) | |
305 | + | if (S(t, 0, "", o, af)) | |
306 | + | then { | |
307 | + | let Z = invoke(addressFromStringValue(n), "redeemCollateral", [t, o], nil) | |
308 | + | if ((Z == Z)) | |
309 | + | then { | |
310 | + | let aa = getStringValue(addressFromStringValue(n), "dTokenId") | |
311 | + | let z = Z | |
312 | + | if ($isInstanceOf(z, "Int")) | |
313 | + | then { | |
314 | + | let A = z | |
315 | + | [ScriptTransfer(V.caller, A, fromBase58String(aa))] | |
316 | + | } | |
317 | + | else if ($isInstanceOf(z, "String")) | |
318 | + | then { | |
319 | + | let A = z | |
320 | + | nil | |
321 | + | } | |
322 | + | else throw("Incorrect invoke result!") | |
323 | + | } | |
324 | + | else throw("Strict value is not equal to itself.") | |
325 | + | } | |
326 | + | else throw("Borrow exceeds user health!") | |
327 | + | } | |
328 | + | else throw("AssetIds does not match") | |
329 | + | } | |
330 | + | else throw("Pool address not found!") | |
331 | + | ||
332 | + | ||
333 | + | ||
334 | + | @Callable(V) | |
335 | + | func deleteData (ah) = [DeleteEntry(ah)] | |
300 | 336 | ||
301 | 337 |
github/deemru/w8io/026f985 57.90 ms ◑