tx · 6csyRHykhTHwkEVvRH573VLHdhuuuFSQkC8wsP9bxiUv 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy: -0.01200000 Waves 2023.07.05 22:18 [2653022] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves
{ "type": 13, "id": "6csyRHykhTHwkEVvRH573VLHdhuuuFSQkC8wsP9bxiUv", "fee": 1200000, "feeAssetId": null, "timestamp": 1688584827534, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "61BpgGMw3DuH7QryfRRJ7DuviaaHCCyLgHCaYviELRNnLCyRumMdLsF668WHtxdpmajfJWzKMmRV7geaYxT28i3a" ], "script": "base64:BgIgCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIEgMKAQhHAQprZXlCbG9ja2VkAAIQY29udHJhY3RzQmxvY2tlZAALSWR4RWZmVG90YWwAAAAKSWR4RWZmVXNlcgABAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkdEFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDABIITaerIIAz9O0bvKju6Lk7zJgt0LXfoHlqjUI/moD/+5AwkAAAIBAVQFByRtYXRjaDABIFWx2J9yh4Lv5eNbjawFq2XemkOhLxa7BfMat4el8cUYCQACAQINVW5rbm93biBjaGFpbgAVZGVmYXVsdFJlc3RBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUFFDdXZGYnZoNExrUFVucm5VMXozam5iQTFwOW0zV05odgMJAAACAQFUBQckbWF0Y2gwAiMzTXVta0dHenRDS0FYcFdEcXhrZGRvZnFYU1VicVFrdlNKeQkAAgECDVVua25vd24gY2hhaW4ADmFyYml0cmFnZURlbGF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USd2xnSXNzdWVkQW1vdW50S2V5CQBlAgUMY3VyV2xnQW1vdW50BQZidXJuZWQJAMwIAgkBDEludGVnZXJFbnRyeQIJARRrZXlMYXN0QXJiVGltZUJ5VXNlcgEFBGFkZHIIBQlsYXN0QmxvY2sJdGltZXN0YW1wCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJARFAZXh0ck5hdGl2ZSgxMDYyKQEJAQV2YWx1ZQEJAKIIAQUNcHJvZml0QWRkcktleQUMcHJvZml0QW1vdW50BQt1c2R0QXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQZjYWxsZXIFB3VzZHRBbXQFC3VzZHRBc3NldElkBQNuaWwFDHByb2xvZ1Jlc3VsdAFpAQVjbGFpbQAEDHByb2xvZ1Jlc3VsdAkBBnByb2xvZwAEB2FjdGlvbnMICQENY2xhaW1JbnRlcm5hbAEJAKUIAQgFAWkGY2FsbGVyAl8xCQCUCgIFB2FjdGlvbnMFDHByb2xvZ1Jlc3VsdAFpAQtvblN0YWtlTGFuZAEEYWRkcgMJAQIhPQIIBQFpBmNhbGxlcgUPc3Rha2luZ0NvbnRyYWN0CQACAQIRUGVybWlzc2lvbiBkZW5pZWQJAQ1jbGFpbUludGVybmFsAQUEYWRkcgFpAQ1vblVuc3Rha2VMYW5kAQRhZGRyAwkBAiE9AggFAWkGY2FsbGVyBQ9zdGFraW5nQ29udHJhY3QJAAIBAhFQZXJtaXNzaW9uIGRlbmllZAkBDWNsYWltSW50ZXJuYWwBBQRhZGRyAOeqKPY=", "height": 2653022, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HfWA1qkGy3M7f9EkekCsFJRPjZPD3P6P3wVDAkygCXaJ Next: 9vVcraNaAcbrA8GaUbMps37NyWrXPZUgjBiRDx7N37Vf Diff:
Old | New | Differences | |
---|---|---|---|
232 | 232 | ||
233 | 233 | let aU = "lastClaimedTime_marketing" | |
234 | 234 | ||
235 | - | let aV = " | |
235 | + | let aV = "marketingAmountLeft" | |
236 | 236 | ||
237 | - | let aW = "lastClaimedTime_ | |
237 | + | let aW = "lastClaimedTime_team" | |
238 | 238 | ||
239 | - | func aX (aY) = ("lastClaimedTimeUser_" + aY) | |
239 | + | let aX = "lastClaimedTime_activities" | |
240 | + | ||
241 | + | func aY (aZ) = ("lastClaimedTimeUser_" + aZ) | |
240 | 242 | ||
241 | 243 | ||
242 | - | func | |
244 | + | func ba (aZ) = ("lastArbTimeUser_" + aZ) | |
243 | 245 | ||
244 | 246 | ||
245 | - | let | |
247 | + | let bb = "stakersAmountLeft" | |
246 | 248 | ||
247 | - | let | |
249 | + | let bc = "stakersAmountPaidTotal" | |
248 | 250 | ||
249 | - | func | |
251 | + | func bd (aZ) = ("stakersAmountPaidUser_" + aZ) | |
250 | 252 | ||
251 | 253 | ||
252 | - | func | |
254 | + | func be () = if (valueOrElse(getBoolean(G, a()), false)) | |
253 | 255 | then throw("Contracts are under maintenance") | |
254 | 256 | else U(invoke(G, "saveLastTx", nil, nil)) | |
255 | 257 | ||
256 | 258 | ||
257 | - | func | |
258 | - | let | |
259 | - | let | |
260 | - | if ((h > ( | |
259 | + | func bf (aZ) = { | |
260 | + | let bg = valueOrElse(getInteger(ba(aZ)), 0) | |
261 | + | let bh = lastBlock.timestamp | |
262 | + | if ((h > (bh - bg))) | |
261 | 263 | then throw((("Arbitrages are possible once a " + toString((h / 60000))) + "min")) | |
262 | 264 | else { | |
263 | - | let | |
264 | - | let | |
265 | - | fraction(aO, | |
265 | + | let bi = Z(aZ)[c] | |
266 | + | let bj = pow(bi, 0, aP, 8, 8, CEILING) | |
267 | + | fraction(aO, bj, k) | |
266 | 268 | } | |
267 | 269 | } | |
268 | 270 | ||
269 | 271 | ||
270 | - | func bj (aY) = { | |
271 | - | let bk = addressFromStringValue(aY) | |
272 | - | let bg = lastBlock.timestamp | |
273 | - | let bl = valueOrErrorMessage(getInteger(aQ), "Not initialized") | |
274 | - | let bm = valueOrElse(getInteger(aU), bl) | |
275 | - | let bn = addressFromStringValue(value(getString(aR))) | |
276 | - | let bo = fraction(fraction(aG, aH, j), (bg - bm), aL) | |
277 | - | let bp = valueOrElse(getInteger(aV), bl) | |
278 | - | let bq = addressFromStringValue(value(getString(aS))) | |
279 | - | let br = fraction(fraction(aG, aI, j), (bg - bp), (3 * aL)) | |
280 | - | let bs = valueOrElse(getInteger(aW), bl) | |
281 | - | let bt = fraction(fraction(aG, aJ, j), (bg - bs), (3 * aL)) | |
282 | - | let bu = ((bg - bl) / aM) | |
283 | - | if ((bu > (aN / 2))) | |
272 | + | func bk (aZ) = { | |
273 | + | let bl = addressFromStringValue(aZ) | |
274 | + | let bh = lastBlock.timestamp | |
275 | + | let bm = valueOrErrorMessage(getInteger(aQ), "Not initialized") | |
276 | + | let bn = valueOrElse(getInteger(aV), 0) | |
277 | + | let bo = valueOrElse(getInteger(aU), bm) | |
278 | + | let bp = addressFromStringValue(value(getString(aR))) | |
279 | + | let bq = min([fraction(fraction(aG, aH, j), (bh - bo), aL), bn]) | |
280 | + | let br = valueOrElse(getInteger(aW), bm) | |
281 | + | let bs = addressFromStringValue(value(getString(aS))) | |
282 | + | let bt = fraction(fraction(aG, aI, j), (bh - br), (3 * aL)) | |
283 | + | let bu = valueOrElse(getInteger(aX), bm) | |
284 | + | let bv = fraction(fraction(aG, aJ, j), (bh - bu), (3 * aL)) | |
285 | + | let bw = ((bh - bm) / aM) | |
286 | + | if ((bw > (aN / 2))) | |
284 | 287 | then throw("Please modify contract for next 1.5 years, according to stats") | |
285 | 288 | else { | |
286 | - | let | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | $Tuple2([ScriptTransfer( | |
289 | + | let bx = Z(aZ) | |
290 | + | let by = bx[b] | |
291 | + | let bz = valueOrElse(getInteger(bb), 0) | |
292 | + | let bA = fraction(bz, (2 * by), (by + (max([100000, by]) * (aN - bw)))) | |
293 | + | let bB = aY(aZ) | |
294 | + | let bC = valueOrElse(getInteger(bB), bm) | |
295 | + | let bD = fraction(fraction(bA, bx[c], by), (bh - bC), (3 * aL)) | |
296 | + | let bE = bd(aZ) | |
297 | + | $Tuple2([ScriptTransfer(bp, bq, Q), ScriptTransfer(bs, bt, Q), ScriptTransfer(F, bv, Q), ScriptTransfer(bl, bD, Q), IntegerEntry(bE, (valueOrElse(getInteger(bE), 0) + bD)), IntegerEntry(bc, (valueOrElse(getInteger(bc), 0) + bD)), IntegerEntry(bb, (bz - bD)), IntegerEntry(aV, (bn - bq)), IntegerEntry(aU, bh), IntegerEntry(aW, bh), IntegerEntry(aX, bh), IntegerEntry(bB, bh)], bD) | |
295 | 298 | } | |
296 | 299 | } | |
297 | 300 | ||
298 | 301 | ||
299 | - | @Callable( | |
300 | - | func constructorV1 ( | |
302 | + | @Callable(bF) | |
303 | + | func constructorV1 (bG,bp,bs,bH) = if ((bF.caller != this)) | |
301 | 304 | then throw("Permission denied") | |
302 | 305 | else if (isDefined(getBinary(P))) | |
303 | 306 | then throw("Already initialized") | |
304 | 307 | else { | |
305 | 308 | let aw = aG | |
306 | - | let | |
307 | - | let | |
308 | - | [ | |
309 | + | let bI = Issue("WLGOLD", "WavesLands Gold investment token", aw, 8, true, unit, 0) | |
310 | + | let bJ = calculateAssetId(bI) | |
311 | + | [bI, IntegerEntry(aQ, lastBlock.timestamp), IntegerEntry(O, aw), IntegerEntry(bc, 0), IntegerEntry(bb, fraction(aG, aK, j)), BinaryEntry(P, bJ), StringEntry(z(), bG), StringEntry(aR, bp), StringEntry(aS, bs), StringEntry(aT, bH)] | |
309 | 312 | } | |
310 | 313 | ||
311 | 314 | ||
312 | 315 | ||
313 | - | @Callable( | |
314 | - | func buyWlg ( | |
315 | - | let | |
316 | - | if ((size( | |
316 | + | @Callable(bF) | |
317 | + | func buyWlg (bK) = { | |
318 | + | let bL = be() | |
319 | + | if ((size(bF.payments) != 1)) | |
317 | 320 | then throw("exactly 1 payment must be attached") | |
318 | 321 | else { | |
319 | - | let | |
320 | - | let | |
321 | - | let | |
322 | - | if (( | |
322 | + | let bM = bF.payments[0] | |
323 | + | let bN = bM.amount | |
324 | + | let bO = valueOrErrorMessage(bM.assetId, "WAVES can't be used as payment") | |
325 | + | if ((bO != e)) | |
323 | 326 | then throw("USDT payments only!") | |
324 | 327 | else { | |
325 | - | let | |
326 | - | let | |
327 | - | let | |
328 | - | if (( | |
329 | - | then throw((("You can spend max " + aC( | |
330 | - | else if ((q > | |
328 | + | let bl = bF.caller | |
329 | + | let aZ = toString(bl) | |
330 | + | let bP = bf(aZ) | |
331 | + | if ((bN > bP)) | |
332 | + | then throw((("You can spend max " + aC(bP, 6)) + " USDT")) | |
333 | + | else if ((q > bN)) | |
331 | 334 | then throw((("You can trade min " + aC(q, 6)) + " USDT")) | |
332 | 335 | else { | |
333 | - | let | |
334 | - | let | |
335 | - | let | |
336 | - | let | |
337 | - | let | |
338 | - | let | |
339 | - | if (( | |
336 | + | let bQ = av() | |
337 | + | let bR = bQ[R] | |
338 | + | let bS = (bQ[T] - bN) | |
339 | + | let bT = fraction(bS, k, bR) | |
340 | + | let bU = fraction(bT, 6, 5) | |
341 | + | let bV = fraction(bN, k, bU) | |
342 | + | if ((bK > bV)) | |
340 | 343 | then throw("Price changed during operation, please try again") | |
341 | 344 | else { | |
342 | - | let | |
343 | - | let | |
344 | - | let | |
345 | - | $Tuple2([Reissue(Q, | |
345 | + | let bW = (bN / 6) | |
346 | + | let bX = (bN - bW) | |
347 | + | let bY = fraction(bR, bX, bS) | |
348 | + | $Tuple2([Reissue(Q, bY, true), IntegerEntry(O, (bR + bY)), IntegerEntry(ba(aZ), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(aT))), bW, e), ScriptTransfer(bl, bV, Q)], bL) | |
346 | 349 | } | |
347 | 350 | } | |
348 | 351 | } | |
351 | 354 | ||
352 | 355 | ||
353 | 356 | ||
354 | - | @Callable( | |
355 | - | func sellWlg ( | |
356 | - | let | |
357 | - | if ((size( | |
357 | + | @Callable(bF) | |
358 | + | func sellWlg (bK) = { | |
359 | + | let bL = be() | |
360 | + | if ((size(bF.payments) != 1)) | |
358 | 361 | then throw("exactly 1 payment must be attached") | |
359 | 362 | else { | |
360 | - | let | |
361 | - | let | |
362 | - | let | |
363 | - | if (( | |
363 | + | let bM = bF.payments[0] | |
364 | + | let bZ = bM.amount | |
365 | + | let bO = valueOrErrorMessage(bM.assetId, "WAVES can't be used as payment") | |
366 | + | if ((bO != Q)) | |
364 | 367 | then throw("WLGOLD payments only!") | |
365 | 368 | else { | |
366 | - | let | |
367 | - | let | |
368 | - | let | |
369 | - | let | |
370 | - | let | |
371 | - | let | |
372 | - | let | |
373 | - | if (( | |
374 | - | then throw((("You can get max " + aC( | |
375 | - | else if ((q > | |
369 | + | let bl = bF.caller | |
370 | + | let aZ = toString(bl) | |
371 | + | let bP = bf(aZ) | |
372 | + | let bQ = av() | |
373 | + | let bR = bQ[R] | |
374 | + | let ca = fraction(bQ[S], 4, 5) | |
375 | + | let bN = fraction(bZ, ca, k) | |
376 | + | if ((bN > bP)) | |
377 | + | then throw((("You can get max " + aC(bP, 6)) + " USDT")) | |
378 | + | else if ((q > bN)) | |
376 | 379 | then throw((("You can trade min " + aC(q, 6)) + " USDT")) | |
377 | - | else if (( | |
380 | + | else if ((bK > bN)) | |
378 | 381 | then throw("Price changed during operation, please try again") | |
379 | 382 | else { | |
380 | - | let | |
381 | - | let | |
382 | - | $Tuple2([Burn(Q, | |
383 | + | let bW = (bN / 4) | |
384 | + | let cb = fraction((bN + bW), bR, bQ[T]) | |
385 | + | $Tuple2([Burn(Q, cb), IntegerEntry(O, (bR - cb)), IntegerEntry(ba(aZ), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(aT))), bW, e), ScriptTransfer(bl, bN, e)], bL) | |
383 | 386 | } | |
384 | 387 | } | |
385 | 388 | } | |
387 | 390 | ||
388 | 391 | ||
389 | 392 | ||
390 | - | @Callable( | |
393 | + | @Callable(bF) | |
391 | 394 | func claim () = { | |
392 | - | let | |
393 | - | let | |
394 | - | $Tuple2( | |
395 | + | let bL = be() | |
396 | + | let cc = bk(toString(bF.caller))._1 | |
397 | + | $Tuple2(cc, bL) | |
395 | 398 | } | |
396 | 399 | ||
397 | 400 | ||
398 | 401 | ||
399 | - | @Callable( | |
400 | - | func onStakeLand ( | |
402 | + | @Callable(bF) | |
403 | + | func onStakeLand (aZ) = if ((bF.caller != G)) | |
401 | 404 | then throw("Permission denied") | |
402 | - | else | |
405 | + | else bk(aZ) | |
403 | 406 | ||
404 | 407 | ||
405 | 408 | ||
406 | - | @Callable( | |
407 | - | func onUnstakeLand ( | |
409 | + | @Callable(bF) | |
410 | + | func onUnstakeLand (aZ) = if ((bF.caller != G)) | |
408 | 411 | then throw("Permission denied") | |
409 | - | else | |
412 | + | else bk(aZ) | |
410 | 413 | ||
411 | 414 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a () = "contractsBlocked" | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let b = 0 | |
8 | 8 | ||
9 | 9 | let c = 1 | |
10 | 10 | ||
11 | 11 | let d = take(drop(this.bytes, 1), 1) | |
12 | 12 | ||
13 | 13 | let e = { | |
14 | 14 | let f = d | |
15 | 15 | if ((base58'2W' == f)) | |
16 | 16 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
17 | 17 | else if ((base58'2T' == f)) | |
18 | 18 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
19 | 19 | else throw("Unknown chain") | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | let g = { | |
23 | 23 | let f = d | |
24 | 24 | if ((base58'2W' == f)) | |
25 | 25 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
26 | 26 | else if ((base58'2T' == f)) | |
27 | 27 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
28 | 28 | else throw("Unknown chain") | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | let h = { | |
32 | 32 | let f = d | |
33 | 33 | if ((base58'2W' == f)) | |
34 | 34 | then 600000 | |
35 | 35 | else if ((base58'2T' == f)) | |
36 | 36 | then 60000 | |
37 | 37 | else throw("Unknown chain") | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | let i = "__" | |
41 | 41 | ||
42 | 42 | let j = 1000000 | |
43 | 43 | ||
44 | 44 | let k = 100000000 | |
45 | 45 | ||
46 | 46 | let l = 25 | |
47 | 47 | ||
48 | 48 | let m = 100 | |
49 | 49 | ||
50 | 50 | let n = 225 | |
51 | 51 | ||
52 | 52 | let o = 400 | |
53 | 53 | ||
54 | 54 | let p = 625 | |
55 | 55 | ||
56 | 56 | let q = 100000 | |
57 | 57 | ||
58 | 58 | func r (s,t) = valueOrErrorMessage(getString(s, t), makeString(["mandatory ", toString(s), ".", t, " is not defined"], "")) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | let u = 1 | |
62 | 62 | ||
63 | 63 | let v = 2 | |
64 | 64 | ||
65 | 65 | let w = 4 | |
66 | 66 | ||
67 | 67 | let x = 5 | |
68 | 68 | ||
69 | 69 | func y () = "%s__restConfig" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func z () = "%s__restAddr" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func A (B) = split_4C(r(B, y()), i) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func C (D,E) = valueOrErrorMessage(addressFromString(D[E]), ("Rest cfg doesn't contain address at index " + toString(E))) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | let F = addressFromStringValue(valueOrElse(getString(this, z()), g)) | |
82 | 82 | ||
83 | 83 | let D = A(F) | |
84 | 84 | ||
85 | 85 | let G = C(D, u) | |
86 | 86 | ||
87 | 87 | let H = C(D, v) | |
88 | 88 | ||
89 | 89 | let I = C(D, w) | |
90 | 90 | ||
91 | 91 | let J = C(D, x) | |
92 | 92 | ||
93 | 93 | let K = 1 | |
94 | 94 | ||
95 | 95 | func L () = "resTypesProportions" | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func M (N) = ("stakedLandsByOwner_" + N) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | let O = "wlg_issuedAmount" | |
102 | 102 | ||
103 | 103 | let P = "wlg_assetId" | |
104 | 104 | ||
105 | 105 | let Q = valueOrErrorMessage(getBinary(I, P), "Not initialized yet") | |
106 | 106 | ||
107 | 107 | let R = 0 | |
108 | 108 | ||
109 | 109 | let S = 1 | |
110 | 110 | ||
111 | 111 | let T = 2 | |
112 | 112 | ||
113 | 113 | func U (V) = { | |
114 | 114 | let f = V | |
115 | 115 | if ($isInstanceOf(f, "Int")) | |
116 | 116 | then { | |
117 | 117 | let W = f | |
118 | 118 | W | |
119 | 119 | } | |
120 | 120 | else throw("fail to cast into Int") | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func X (Y) = { | |
125 | 125 | let f = Y | |
126 | 126 | if (("S" == f)) | |
127 | 127 | then l | |
128 | 128 | else if (("M" == f)) | |
129 | 129 | then m | |
130 | 130 | else if (("L" == f)) | |
131 | 131 | then n | |
132 | 132 | else if (("XL" == f)) | |
133 | 133 | then o | |
134 | 134 | else if (("XXL" == f)) | |
135 | 135 | then p | |
136 | 136 | else throw("Unknown land size") | |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func Z (aa) = { | |
141 | 141 | let ab = split(valueOrElse(getString(G, L()), "0_0_0_0_0_0"), "_") | |
142 | 142 | func ac (ad,ae) = (ad + parseIntValue(ae)) | |
143 | 143 | ||
144 | 144 | let af = { | |
145 | 145 | let ag = ab | |
146 | 146 | let ah = size(ag) | |
147 | 147 | let ai = 0 | |
148 | 148 | func aj (ak,al) = if ((al >= ah)) | |
149 | 149 | then ak | |
150 | 150 | else ac(ak, ag[al]) | |
151 | 151 | ||
152 | 152 | func am (ak,al) = if ((al >= ah)) | |
153 | 153 | then ak | |
154 | 154 | else throw("List size exceeds 6") | |
155 | 155 | ||
156 | 156 | am(aj(aj(aj(aj(aj(aj(ai, 0), 1), 2), 3), 4), 5), 6) | |
157 | 157 | } | |
158 | 158 | let an = if ((aa == "")) | |
159 | 159 | then 0 | |
160 | 160 | else { | |
161 | 161 | let ao = getString(G, M(aa)) | |
162 | 162 | let ap = if (isDefined(ao)) | |
163 | 163 | then split_51C(value(ao), "_") | |
164 | 164 | else nil | |
165 | 165 | func aq (ad,ar) = { | |
166 | 166 | let as = value(assetInfo(fromBase58String(ar))) | |
167 | 167 | let Y = split(as.description, "_")[K] | |
168 | 168 | (ad + X(Y)) | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | let ag = ap | |
172 | 172 | let ah = size(ag) | |
173 | 173 | let ai = 0 | |
174 | 174 | func at (ak,al) = if ((al >= ah)) | |
175 | 175 | then ak | |
176 | 176 | else aq(ak, ag[al]) | |
177 | 177 | ||
178 | 178 | func au (ak,al) = if ((al >= ah)) | |
179 | 179 | then ak | |
180 | 180 | else throw("List size exceeds 100") | |
181 | 181 | ||
182 | 182 | au(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(at(ai, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
183 | 183 | } | |
184 | 184 | [af, an] | |
185 | 185 | } | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func av () = { | |
189 | 189 | let aw = valueOrErrorMessage(getInteger(I, O), "WLGOLD is not issued yet") | |
190 | 190 | let ax = assetBalance(H, e) | |
191 | 191 | let ay = assetBalance(F, e) | |
192 | 192 | let az = assetBalance(I, e) | |
193 | 193 | let aA = assetBalance(J, e) | |
194 | 194 | let aB = ((ax + ay) + az) | |
195 | 195 | [aw, fraction(aB, k, aw), aB, ax, ay, az, aA] | |
196 | 196 | } | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func aC (aD,aE) = { | |
200 | 200 | let aF = pow(10, 0, aE, 0, 0, DOWN) | |
201 | 201 | ((toString((aD / aF)) + ".") + toString((aD % aF))) | |
202 | 202 | } | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | let aG = 100000000000000 | |
206 | 206 | ||
207 | 207 | let aH = 100000 | |
208 | 208 | ||
209 | 209 | let aI = 200000 | |
210 | 210 | ||
211 | 211 | let aJ = 100000 | |
212 | 212 | ||
213 | 213 | let aK = 400000 | |
214 | 214 | ||
215 | 215 | let aL = 31557600000 | |
216 | 216 | ||
217 | 217 | let aM = 604800000 | |
218 | 218 | ||
219 | 219 | let aN = 156 | |
220 | 220 | ||
221 | 221 | let aO = 100000000 | |
222 | 222 | ||
223 | 223 | let aP = 50000000 | |
224 | 224 | ||
225 | 225 | let aQ = "wlg_issueTime" | |
226 | 226 | ||
227 | 227 | let aR = "marketingAddr" | |
228 | 228 | ||
229 | 229 | let aS = "teamAddr" | |
230 | 230 | ||
231 | 231 | let aT = "profitAddr" | |
232 | 232 | ||
233 | 233 | let aU = "lastClaimedTime_marketing" | |
234 | 234 | ||
235 | - | let aV = " | |
235 | + | let aV = "marketingAmountLeft" | |
236 | 236 | ||
237 | - | let aW = "lastClaimedTime_ | |
237 | + | let aW = "lastClaimedTime_team" | |
238 | 238 | ||
239 | - | func aX (aY) = ("lastClaimedTimeUser_" + aY) | |
239 | + | let aX = "lastClaimedTime_activities" | |
240 | + | ||
241 | + | func aY (aZ) = ("lastClaimedTimeUser_" + aZ) | |
240 | 242 | ||
241 | 243 | ||
242 | - | func | |
244 | + | func ba (aZ) = ("lastArbTimeUser_" + aZ) | |
243 | 245 | ||
244 | 246 | ||
245 | - | let | |
247 | + | let bb = "stakersAmountLeft" | |
246 | 248 | ||
247 | - | let | |
249 | + | let bc = "stakersAmountPaidTotal" | |
248 | 250 | ||
249 | - | func | |
251 | + | func bd (aZ) = ("stakersAmountPaidUser_" + aZ) | |
250 | 252 | ||
251 | 253 | ||
252 | - | func | |
254 | + | func be () = if (valueOrElse(getBoolean(G, a()), false)) | |
253 | 255 | then throw("Contracts are under maintenance") | |
254 | 256 | else U(invoke(G, "saveLastTx", nil, nil)) | |
255 | 257 | ||
256 | 258 | ||
257 | - | func | |
258 | - | let | |
259 | - | let | |
260 | - | if ((h > ( | |
259 | + | func bf (aZ) = { | |
260 | + | let bg = valueOrElse(getInteger(ba(aZ)), 0) | |
261 | + | let bh = lastBlock.timestamp | |
262 | + | if ((h > (bh - bg))) | |
261 | 263 | then throw((("Arbitrages are possible once a " + toString((h / 60000))) + "min")) | |
262 | 264 | else { | |
263 | - | let | |
264 | - | let | |
265 | - | fraction(aO, | |
265 | + | let bi = Z(aZ)[c] | |
266 | + | let bj = pow(bi, 0, aP, 8, 8, CEILING) | |
267 | + | fraction(aO, bj, k) | |
266 | 268 | } | |
267 | 269 | } | |
268 | 270 | ||
269 | 271 | ||
270 | - | func bj (aY) = { | |
271 | - | let bk = addressFromStringValue(aY) | |
272 | - | let bg = lastBlock.timestamp | |
273 | - | let bl = valueOrErrorMessage(getInteger(aQ), "Not initialized") | |
274 | - | let bm = valueOrElse(getInteger(aU), bl) | |
275 | - | let bn = addressFromStringValue(value(getString(aR))) | |
276 | - | let bo = fraction(fraction(aG, aH, j), (bg - bm), aL) | |
277 | - | let bp = valueOrElse(getInteger(aV), bl) | |
278 | - | let bq = addressFromStringValue(value(getString(aS))) | |
279 | - | let br = fraction(fraction(aG, aI, j), (bg - bp), (3 * aL)) | |
280 | - | let bs = valueOrElse(getInteger(aW), bl) | |
281 | - | let bt = fraction(fraction(aG, aJ, j), (bg - bs), (3 * aL)) | |
282 | - | let bu = ((bg - bl) / aM) | |
283 | - | if ((bu > (aN / 2))) | |
272 | + | func bk (aZ) = { | |
273 | + | let bl = addressFromStringValue(aZ) | |
274 | + | let bh = lastBlock.timestamp | |
275 | + | let bm = valueOrErrorMessage(getInteger(aQ), "Not initialized") | |
276 | + | let bn = valueOrElse(getInteger(aV), 0) | |
277 | + | let bo = valueOrElse(getInteger(aU), bm) | |
278 | + | let bp = addressFromStringValue(value(getString(aR))) | |
279 | + | let bq = min([fraction(fraction(aG, aH, j), (bh - bo), aL), bn]) | |
280 | + | let br = valueOrElse(getInteger(aW), bm) | |
281 | + | let bs = addressFromStringValue(value(getString(aS))) | |
282 | + | let bt = fraction(fraction(aG, aI, j), (bh - br), (3 * aL)) | |
283 | + | let bu = valueOrElse(getInteger(aX), bm) | |
284 | + | let bv = fraction(fraction(aG, aJ, j), (bh - bu), (3 * aL)) | |
285 | + | let bw = ((bh - bm) / aM) | |
286 | + | if ((bw > (aN / 2))) | |
284 | 287 | then throw("Please modify contract for next 1.5 years, according to stats") | |
285 | 288 | else { | |
286 | - | let | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | $Tuple2([ScriptTransfer( | |
289 | + | let bx = Z(aZ) | |
290 | + | let by = bx[b] | |
291 | + | let bz = valueOrElse(getInteger(bb), 0) | |
292 | + | let bA = fraction(bz, (2 * by), (by + (max([100000, by]) * (aN - bw)))) | |
293 | + | let bB = aY(aZ) | |
294 | + | let bC = valueOrElse(getInteger(bB), bm) | |
295 | + | let bD = fraction(fraction(bA, bx[c], by), (bh - bC), (3 * aL)) | |
296 | + | let bE = bd(aZ) | |
297 | + | $Tuple2([ScriptTransfer(bp, bq, Q), ScriptTransfer(bs, bt, Q), ScriptTransfer(F, bv, Q), ScriptTransfer(bl, bD, Q), IntegerEntry(bE, (valueOrElse(getInteger(bE), 0) + bD)), IntegerEntry(bc, (valueOrElse(getInteger(bc), 0) + bD)), IntegerEntry(bb, (bz - bD)), IntegerEntry(aV, (bn - bq)), IntegerEntry(aU, bh), IntegerEntry(aW, bh), IntegerEntry(aX, bh), IntegerEntry(bB, bh)], bD) | |
295 | 298 | } | |
296 | 299 | } | |
297 | 300 | ||
298 | 301 | ||
299 | - | @Callable( | |
300 | - | func constructorV1 ( | |
302 | + | @Callable(bF) | |
303 | + | func constructorV1 (bG,bp,bs,bH) = if ((bF.caller != this)) | |
301 | 304 | then throw("Permission denied") | |
302 | 305 | else if (isDefined(getBinary(P))) | |
303 | 306 | then throw("Already initialized") | |
304 | 307 | else { | |
305 | 308 | let aw = aG | |
306 | - | let | |
307 | - | let | |
308 | - | [ | |
309 | + | let bI = Issue("WLGOLD", "WavesLands Gold investment token", aw, 8, true, unit, 0) | |
310 | + | let bJ = calculateAssetId(bI) | |
311 | + | [bI, IntegerEntry(aQ, lastBlock.timestamp), IntegerEntry(O, aw), IntegerEntry(bc, 0), IntegerEntry(bb, fraction(aG, aK, j)), BinaryEntry(P, bJ), StringEntry(z(), bG), StringEntry(aR, bp), StringEntry(aS, bs), StringEntry(aT, bH)] | |
309 | 312 | } | |
310 | 313 | ||
311 | 314 | ||
312 | 315 | ||
313 | - | @Callable( | |
314 | - | func buyWlg ( | |
315 | - | let | |
316 | - | if ((size( | |
316 | + | @Callable(bF) | |
317 | + | func buyWlg (bK) = { | |
318 | + | let bL = be() | |
319 | + | if ((size(bF.payments) != 1)) | |
317 | 320 | then throw("exactly 1 payment must be attached") | |
318 | 321 | else { | |
319 | - | let | |
320 | - | let | |
321 | - | let | |
322 | - | if (( | |
322 | + | let bM = bF.payments[0] | |
323 | + | let bN = bM.amount | |
324 | + | let bO = valueOrErrorMessage(bM.assetId, "WAVES can't be used as payment") | |
325 | + | if ((bO != e)) | |
323 | 326 | then throw("USDT payments only!") | |
324 | 327 | else { | |
325 | - | let | |
326 | - | let | |
327 | - | let | |
328 | - | if (( | |
329 | - | then throw((("You can spend max " + aC( | |
330 | - | else if ((q > | |
328 | + | let bl = bF.caller | |
329 | + | let aZ = toString(bl) | |
330 | + | let bP = bf(aZ) | |
331 | + | if ((bN > bP)) | |
332 | + | then throw((("You can spend max " + aC(bP, 6)) + " USDT")) | |
333 | + | else if ((q > bN)) | |
331 | 334 | then throw((("You can trade min " + aC(q, 6)) + " USDT")) | |
332 | 335 | else { | |
333 | - | let | |
334 | - | let | |
335 | - | let | |
336 | - | let | |
337 | - | let | |
338 | - | let | |
339 | - | if (( | |
336 | + | let bQ = av() | |
337 | + | let bR = bQ[R] | |
338 | + | let bS = (bQ[T] - bN) | |
339 | + | let bT = fraction(bS, k, bR) | |
340 | + | let bU = fraction(bT, 6, 5) | |
341 | + | let bV = fraction(bN, k, bU) | |
342 | + | if ((bK > bV)) | |
340 | 343 | then throw("Price changed during operation, please try again") | |
341 | 344 | else { | |
342 | - | let | |
343 | - | let | |
344 | - | let | |
345 | - | $Tuple2([Reissue(Q, | |
345 | + | let bW = (bN / 6) | |
346 | + | let bX = (bN - bW) | |
347 | + | let bY = fraction(bR, bX, bS) | |
348 | + | $Tuple2([Reissue(Q, bY, true), IntegerEntry(O, (bR + bY)), IntegerEntry(ba(aZ), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(aT))), bW, e), ScriptTransfer(bl, bV, Q)], bL) | |
346 | 349 | } | |
347 | 350 | } | |
348 | 351 | } | |
349 | 352 | } | |
350 | 353 | } | |
351 | 354 | ||
352 | 355 | ||
353 | 356 | ||
354 | - | @Callable( | |
355 | - | func sellWlg ( | |
356 | - | let | |
357 | - | if ((size( | |
357 | + | @Callable(bF) | |
358 | + | func sellWlg (bK) = { | |
359 | + | let bL = be() | |
360 | + | if ((size(bF.payments) != 1)) | |
358 | 361 | then throw("exactly 1 payment must be attached") | |
359 | 362 | else { | |
360 | - | let | |
361 | - | let | |
362 | - | let | |
363 | - | if (( | |
363 | + | let bM = bF.payments[0] | |
364 | + | let bZ = bM.amount | |
365 | + | let bO = valueOrErrorMessage(bM.assetId, "WAVES can't be used as payment") | |
366 | + | if ((bO != Q)) | |
364 | 367 | then throw("WLGOLD payments only!") | |
365 | 368 | else { | |
366 | - | let | |
367 | - | let | |
368 | - | let | |
369 | - | let | |
370 | - | let | |
371 | - | let | |
372 | - | let | |
373 | - | if (( | |
374 | - | then throw((("You can get max " + aC( | |
375 | - | else if ((q > | |
369 | + | let bl = bF.caller | |
370 | + | let aZ = toString(bl) | |
371 | + | let bP = bf(aZ) | |
372 | + | let bQ = av() | |
373 | + | let bR = bQ[R] | |
374 | + | let ca = fraction(bQ[S], 4, 5) | |
375 | + | let bN = fraction(bZ, ca, k) | |
376 | + | if ((bN > bP)) | |
377 | + | then throw((("You can get max " + aC(bP, 6)) + " USDT")) | |
378 | + | else if ((q > bN)) | |
376 | 379 | then throw((("You can trade min " + aC(q, 6)) + " USDT")) | |
377 | - | else if (( | |
380 | + | else if ((bK > bN)) | |
378 | 381 | then throw("Price changed during operation, please try again") | |
379 | 382 | else { | |
380 | - | let | |
381 | - | let | |
382 | - | $Tuple2([Burn(Q, | |
383 | + | let bW = (bN / 4) | |
384 | + | let cb = fraction((bN + bW), bR, bQ[T]) | |
385 | + | $Tuple2([Burn(Q, cb), IntegerEntry(O, (bR - cb)), IntegerEntry(ba(aZ), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(aT))), bW, e), ScriptTransfer(bl, bN, e)], bL) | |
383 | 386 | } | |
384 | 387 | } | |
385 | 388 | } | |
386 | 389 | } | |
387 | 390 | ||
388 | 391 | ||
389 | 392 | ||
390 | - | @Callable( | |
393 | + | @Callable(bF) | |
391 | 394 | func claim () = { | |
392 | - | let | |
393 | - | let | |
394 | - | $Tuple2( | |
395 | + | let bL = be() | |
396 | + | let cc = bk(toString(bF.caller))._1 | |
397 | + | $Tuple2(cc, bL) | |
395 | 398 | } | |
396 | 399 | ||
397 | 400 | ||
398 | 401 | ||
399 | - | @Callable( | |
400 | - | func onStakeLand ( | |
402 | + | @Callable(bF) | |
403 | + | func onStakeLand (aZ) = if ((bF.caller != G)) | |
401 | 404 | then throw("Permission denied") | |
402 | - | else | |
405 | + | else bk(aZ) | |
403 | 406 | ||
404 | 407 | ||
405 | 408 | ||
406 | - | @Callable( | |
407 | - | func onUnstakeLand ( | |
409 | + | @Callable(bF) | |
410 | + | func onUnstakeLand (aZ) = if ((bF.caller != G)) | |
408 | 411 | then throw("Permission denied") | |
409 | - | else | |
412 | + | else bk(aZ) | |
410 | 413 | ||
411 | 414 |
github/deemru/w8io/026f985 98.12 ms ◑