tx · 9Qg4aBQJM14m52ctZ1MorguHHCEiygA3CeFTXcXQcrmj 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo: -0.04000000 Waves 2021.09.06 20:53 [1691520] smart account 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo > SELF 0.00000000 Waves
{ "type": 13, "id": "9Qg4aBQJM14m52ctZ1MorguHHCEiygA3CeFTXcXQcrmj", "fee": 4000000, "feeAssetId": null, "timestamp": 1630950844621, "version": 2, "chainId": 84, "sender": "3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo", "senderPublicKey": "CD4N2SBeZVBUwmtsqwfmQ3ZKnBP3AxpZCvJ5QkHytUed", "proofs": [ "3Hywj8Zn8tzciBCUMw6J3zJfKAnzWa8rBsrpeMoJiazp3HjWpCZvawawJzpV3zBQCk9eyZzZoFk7U8moCSW1PXE9" ], "script": "base64:AAIFAAAAAAAAADwIAhIAEgQKAggYEgMKAQgSAwoBCBIECgIIBBIDCgEIEgMKAQgSBQoDCAgBEgMKAQgSBQoDCAgBEgMKAQgAAAAOAAAAAAZjb25maWcJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAABmNvbmZpZwIAAAAAAAAAAAVhZG1pbgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAVhZG1pbgIAAAAAAAAAAAVwb29scwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAFcG9vbHMCAAAAAAEAAAAHaXNBZG1pbgAAAAEAAAANY2FsbGVyQWRkcmVzcwMJAAAAAAAAAgUAAAANY2FsbGVyQWRkcmVzcwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpA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QAAAAFpAAAABmNhbGxlcgUAAAABdAkAAlkAAAABBQAAAAd0b2tlbklkBQAAAANuaWwDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABdAUAAAAHJG1hdGNoMAUAAAADbmlsCQAAAgAAAAECAAAAGEluY29ycmVjdCBpbnZva2UgcmVzdWx0IQkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAbQm9ycm93IGV4Y2VlZHMgdXNlciBoZWFsdGghCQAAAgAAAAECAAAAF0Fzc2V0SWRzIGRvZXMgbm90IG1hdGNoCQAAAgAAAAECAAAAF1Bvb2wgYWRkcmVzcyBub3QgZm91bmQhAAAAAWkBAAAACmRlbGV0ZURhdGEAAAABAAAABG5hbWUJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAEbmFtZQUAAAADbmlsAAAAAHgdqco=", "height": 1691520, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CAm1n28teAFVHR9ppPjewXETEf949mbNK1JqDAKAPnu2 Next: 59iroGMSmdiPPrq3WA3euMj4yabWeyG5ij8cPhQVfgTd Diff:
Old | New | Differences | |
---|---|---|---|
122 | 122 | } | |
123 | 123 | else throw("AssetIds do not match!") | |
124 | 124 | } | |
125 | + | ||
126 | + | ||
127 | + | @Callable(ac) | |
128 | + | func checkUserHealthTest () = { | |
129 | + | let t = toBase58String(ac.caller.bytes) | |
130 | + | let T = E(t, 0, "", 0, "") | |
131 | + | let U = B(T._1, T._2) | |
132 | + | [k((t + "_health"), U)] | |
133 | + | } | |
134 | + | ||
125 | 135 | ||
126 | 136 | ||
127 | 137 | @Callable(ac) |
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) = if ((C > 0)) | |
49 | 49 | then fraction((C - D), 1000, C) | |
50 | 50 | else 0 | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func E (t,u,v,w,x) = { | |
54 | 54 | let F = split(c, ";") | |
55 | 55 | let G = size(F) | |
56 | 56 | func H (I,J) = { | |
57 | 57 | let K = s(t, J, u, v, w, x) | |
58 | 58 | let z = K | |
59 | 59 | if ($isInstanceOf(z, "(Int, Int)")) | |
60 | 60 | then { | |
61 | 61 | let A = z | |
62 | 62 | $Tuple2((I._1 + K._1), (I._2 + K._2)) | |
63 | 63 | } | |
64 | 64 | else { | |
65 | 65 | let L = z | |
66 | 66 | throw("Test") | |
67 | 67 | } | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | let M = F | |
71 | 71 | let N = size(M) | |
72 | 72 | let O = $Tuple2(0, 0) | |
73 | 73 | if ((N == 0)) | |
74 | 74 | then O | |
75 | 75 | else { | |
76 | 76 | let P = H(O, M[0]) | |
77 | 77 | if ((N == 1)) | |
78 | 78 | then P | |
79 | 79 | else { | |
80 | 80 | let Q = H(P, M[1]) | |
81 | 81 | if ((N == 2)) | |
82 | 82 | then Q | |
83 | 83 | else { | |
84 | 84 | let R = H(Q, M[2]) | |
85 | 85 | throw("List size exceed 2") | |
86 | 86 | } | |
87 | 87 | } | |
88 | 88 | } | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func S (t,u,v,w,x) = { | |
93 | 93 | let T = E(t, u, v, w, x) | |
94 | 94 | let U = B(T._1, T._2) | |
95 | 95 | if ((U >= 0)) | |
96 | 96 | then true | |
97 | 97 | else false | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func V (t,n,W) = { | |
102 | 102 | let X = getString(addressFromStringValue(n), "assetId") | |
103 | 103 | if ((X == W)) | |
104 | 104 | then { | |
105 | 105 | let Y = valueOrElse(getInteger(addressFromStringValue(n), (t + "_borrow")), 0) | |
106 | 106 | if ((Y > 0)) | |
107 | 107 | then true | |
108 | 108 | else false | |
109 | 109 | } | |
110 | 110 | else throw("AssetIds do not match!") | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func Z (t,n,aa) = { | |
115 | 115 | let X = getString(addressFromStringValue(n), "assetId") | |
116 | 116 | if ((X == aa)) | |
117 | 117 | then { | |
118 | 118 | let ab = valueOrElse(getInteger(addressFromStringValue(n), (t + "_locked")), 0) | |
119 | 119 | if ((ab > 0)) | |
120 | 120 | then true | |
121 | 121 | else false | |
122 | 122 | } | |
123 | 123 | else throw("AssetIds do not match!") | |
124 | 124 | } | |
125 | + | ||
126 | + | ||
127 | + | @Callable(ac) | |
128 | + | func checkUserHealthTest () = { | |
129 | + | let t = toBase58String(ac.caller.bytes) | |
130 | + | let T = E(t, 0, "", 0, "") | |
131 | + | let U = B(T._1, T._2) | |
132 | + | [k((t + "_health"), U)] | |
133 | + | } | |
134 | + | ||
125 | 135 | ||
126 | 136 | ||
127 | 137 | @Callable(ac) | |
128 | 138 | func setup (ad,c) = if (if (!(isDefined(getString(this, "config")))) | |
129 | 139 | then !(isDefined(getString(this, "pools"))) | |
130 | 140 | else false) | |
131 | 141 | then [h("config", ad), h("pools", makeString(c, ";"))] | |
132 | 142 | else throw("Admin and config address already definied!") | |
133 | 143 | ||
134 | 144 | ||
135 | 145 | ||
136 | 146 | @Callable(ac) | |
137 | 147 | func addPool (n) = if (d(ac.caller)) | |
138 | 148 | then { | |
139 | 149 | let F = split(c, ";") | |
140 | 150 | if ((containsElement(F, n) == false)) | |
141 | 151 | then { | |
142 | 152 | let ae = (F :+ n) | |
143 | 153 | [h("pools", makeString(ae, ";"))] | |
144 | 154 | } | |
145 | 155 | else throw("Pool already exists!") | |
146 | 156 | } | |
147 | 157 | else throw("Address does not match with admin address!") | |
148 | 158 | ||
149 | 159 | ||
150 | 160 | ||
151 | 161 | @Callable(ac) | |
152 | 162 | func updateConfig (ad) = if (d(ac.caller)) | |
153 | 163 | then [h("config", ad)] | |
154 | 164 | else throw("Address does not match with admin address!") | |
155 | 165 | ||
156 | 166 | ||
157 | 167 | ||
158 | 168 | @Callable(ac) | |
159 | 169 | func depositAt (n,af) = if (f(n)) | |
160 | 170 | then if ((size(ac.payments) > 0)) | |
161 | 171 | then { | |
162 | 172 | let t = toBase58String(ac.caller.bytes) | |
163 | 173 | let ag = invoke(addressFromStringValue(n), "deposit", [t, af], ac.payments) | |
164 | 174 | if ((ag == ag)) | |
165 | 175 | then { | |
166 | 176 | let ah = getStringValue(addressFromStringValue(n), "dTokenId") | |
167 | 177 | let z = ag | |
168 | 178 | if ($isInstanceOf(z, "Int")) | |
169 | 179 | then { | |
170 | 180 | let A = z | |
171 | 181 | [ScriptTransfer(ac.caller, A, fromBase58String(ah))] | |
172 | 182 | } | |
173 | 183 | else if ($isInstanceOf(z, "String")) | |
174 | 184 | then { | |
175 | 185 | let A = z | |
176 | 186 | nil | |
177 | 187 | } | |
178 | 188 | else throw("Incorrect invoke result!") | |
179 | 189 | } | |
180 | 190 | else throw("Strict value is not equal to itself.") | |
181 | 191 | } | |
182 | 192 | else throw("No payment attached!") | |
183 | 193 | else throw("Pool address not found!") | |
184 | 194 | ||
185 | 195 | ||
186 | 196 | ||
187 | 197 | @Callable(ac) | |
188 | 198 | func withdrawFrom (n) = if (f(n)) | |
189 | 199 | then { | |
190 | 200 | let ai = getStringValue(addressFromStringValue(n), "dTokenId") | |
191 | 201 | if ((fromBase58String(ai) == ac.payments[0].assetId)) | |
192 | 202 | then if ((size(ac.payments) > 0)) | |
193 | 203 | then { | |
194 | 204 | let t = toBase58String(ac.caller.bytes) | |
195 | 205 | let ag = invoke(addressFromStringValue(n), "withdraw", [t], ac.payments) | |
196 | 206 | if ((ag == ag)) | |
197 | 207 | then { | |
198 | 208 | let ah = getStringValue(addressFromStringValue(n), "assetId") | |
199 | 209 | let z = ag | |
200 | 210 | if ($isInstanceOf(z, "Int")) | |
201 | 211 | then { | |
202 | 212 | let A = z | |
203 | 213 | if ((ah == "WAVES")) | |
204 | 214 | then [ScriptTransfer(ac.caller, A, unit)] | |
205 | 215 | else [ScriptTransfer(ac.caller, A, fromBase58String(ah))] | |
206 | 216 | } | |
207 | 217 | else if ($isInstanceOf(z, "String")) | |
208 | 218 | then { | |
209 | 219 | let A = z | |
210 | 220 | nil | |
211 | 221 | } | |
212 | 222 | else throw("Incorrect invoke result!") | |
213 | 223 | } | |
214 | 224 | else throw("Strict value is not equal to itself.") | |
215 | 225 | } | |
216 | 226 | else throw("No payment attached!") | |
217 | 227 | else throw("AssetIds does not match") | |
218 | 228 | } | |
219 | 229 | else throw("Pool address not found!") | |
220 | 230 | ||
221 | 231 | ||
222 | 232 | ||
223 | 233 | @Callable(ac) | |
224 | 234 | func repayTo (n) = if (f(n)) | |
225 | 235 | then { | |
226 | 236 | let X = getStringValue(addressFromStringValue(n), "assetId") | |
227 | 237 | if ((fromBase58String(X) == ac.payments[0].assetId)) | |
228 | 238 | then if ((size(ac.payments) > 0)) | |
229 | 239 | then { | |
230 | 240 | let t = toBase58String(ac.caller.bytes) | |
231 | 241 | let o = invoke(addressFromStringValue(n), "repay", [t], ac.payments) | |
232 | 242 | if ((o == o)) | |
233 | 243 | then { | |
234 | 244 | let aj = getStringValue(addressFromStringValue(n), "assetId") | |
235 | 245 | let z = o | |
236 | 246 | if ($isInstanceOf(z, "Int")) | |
237 | 247 | then { | |
238 | 248 | let A = z | |
239 | 249 | if ((aj == "WAVES")) | |
240 | 250 | then [ScriptTransfer(ac.caller, A, unit)] | |
241 | 251 | else [ScriptTransfer(ac.caller, A, fromBase58String(aj))] | |
242 | 252 | } | |
243 | 253 | else if ($isInstanceOf(z, "String")) | |
244 | 254 | then { | |
245 | 255 | let A = z | |
246 | 256 | nil | |
247 | 257 | } | |
248 | 258 | else throw("Incorrect invoke result!") | |
249 | 259 | } | |
250 | 260 | else throw("Strict value is not equal to itself.") | |
251 | 261 | } | |
252 | 262 | else throw("No payment attached!") | |
253 | 263 | else throw("AssetIds does not match") | |
254 | 264 | } | |
255 | 265 | else throw("Pool address not found!") | |
256 | 266 | ||
257 | 267 | ||
258 | 268 | ||
259 | 269 | @Callable(ac) | |
260 | 270 | func borrowFrom (n,aj,o) = if (f(n)) | |
261 | 271 | then { | |
262 | 272 | let X = getStringValue(addressFromStringValue(n), "assetId") | |
263 | 273 | if ((X == aj)) | |
264 | 274 | then if (m(n, o)) | |
265 | 275 | then { | |
266 | 276 | let t = toBase58String(ac.caller.bytes) | |
267 | 277 | if ((S(t, o, aj, 0, "") == true)) | |
268 | 278 | then { | |
269 | 279 | let ag = invoke(addressFromStringValue(n), "borrow", [t, o], nil) | |
270 | 280 | if ((ag == ag)) | |
271 | 281 | then { | |
272 | 282 | let z = ag | |
273 | 283 | if ($isInstanceOf(z, "Int")) | |
274 | 284 | then { | |
275 | 285 | let A = z | |
276 | 286 | if ((X == "WAVES")) | |
277 | 287 | then [ScriptTransfer(ac.caller, A, unit)] | |
278 | 288 | else [ScriptTransfer(ac.caller, A, fromBase58String(X))] | |
279 | 289 | } | |
280 | 290 | else if ($isInstanceOf(z, "String")) | |
281 | 291 | then { | |
282 | 292 | let A = z | |
283 | 293 | nil | |
284 | 294 | } | |
285 | 295 | else throw("Incorrect invoke result!") | |
286 | 296 | } | |
287 | 297 | else throw("Strict value is not equal to itself.") | |
288 | 298 | } | |
289 | 299 | else throw("Borrow exceeds user health!") | |
290 | 300 | } | |
291 | 301 | else throw("Pool liquidity is not sufficient!") | |
292 | 302 | else throw("AssetIds does not match") | |
293 | 303 | } | |
294 | 304 | else throw("Pool address not found!") | |
295 | 305 | ||
296 | 306 | ||
297 | 307 | ||
298 | 308 | @Callable(ac) | |
299 | 309 | func lockAsCollateralAt (n) = if (f(n)) | |
300 | 310 | then { | |
301 | 311 | let ai = getStringValue(addressFromStringValue(n), "dTokenId") | |
302 | 312 | if ((fromBase58String(ai) == ac.payments[0].assetId)) | |
303 | 313 | then if ((size(ac.payments) > 0)) | |
304 | 314 | then { | |
305 | 315 | let t = toBase58String(ac.caller.bytes) | |
306 | 316 | let ak = invoke(addressFromStringValue(n), "lockAsCollateral", [t], ac.payments) | |
307 | 317 | if ((ak == ak)) | |
308 | 318 | then { | |
309 | 319 | let z = ak | |
310 | 320 | if ($isInstanceOf(z, "String")) | |
311 | 321 | then { | |
312 | 322 | let A = z | |
313 | 323 | nil | |
314 | 324 | } | |
315 | 325 | else throw("Incorrect invoke result!") | |
316 | 326 | } | |
317 | 327 | else throw("Strict value is not equal to itself.") | |
318 | 328 | } | |
319 | 329 | else throw("No payment attached!") | |
320 | 330 | else throw("AssetIds does not match") | |
321 | 331 | } | |
322 | 332 | else throw("Pool address not found!") | |
323 | 333 | ||
324 | 334 | ||
325 | 335 | ||
326 | 336 | @Callable(ac) | |
327 | 337 | func redeemCollateralFrom (n,al,o) = if (f(n)) | |
328 | 338 | then { | |
329 | 339 | let am = getStringValue(addressFromStringValue(n), "dTokenId") | |
330 | 340 | if ((am == al)) | |
331 | 341 | then { | |
332 | 342 | let t = toBase58String(ac.caller.bytes) | |
333 | 343 | if ((S(t, 0, "", o, al) == true)) | |
334 | 344 | then { | |
335 | 345 | let ag = invoke(addressFromStringValue(n), "redeemCollateral", [t, o], nil) | |
336 | 346 | if ((ag == ag)) | |
337 | 347 | then { | |
338 | 348 | let ah = getStringValue(addressFromStringValue(n), "dTokenId") | |
339 | 349 | let z = ag | |
340 | 350 | if ($isInstanceOf(z, "Int")) | |
341 | 351 | then { | |
342 | 352 | let A = z | |
343 | 353 | [ScriptTransfer(ac.caller, A, fromBase58String(ah))] | |
344 | 354 | } | |
345 | 355 | else if ($isInstanceOf(z, "String")) | |
346 | 356 | then { | |
347 | 357 | let A = z | |
348 | 358 | nil | |
349 | 359 | } | |
350 | 360 | else throw("Incorrect invoke result!") | |
351 | 361 | } | |
352 | 362 | else throw("Strict value is not equal to itself.") | |
353 | 363 | } | |
354 | 364 | else throw("Borrow exceeds user health!") | |
355 | 365 | } | |
356 | 366 | else throw("AssetIds does not match") | |
357 | 367 | } | |
358 | 368 | else throw("Pool address not found!") | |
359 | 369 | ||
360 | 370 | ||
361 | 371 | ||
362 | 372 | @Callable(ac) | |
363 | 373 | func deleteData (an) = [DeleteEntry(an)] | |
364 | 374 | ||
365 | 375 |
github/deemru/w8io/169f3d6 45.68 ms ◑