tx · 2Z2SgHS6pDspCAmDguJ14fuomG936f66N9ovpAFpnLEF 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd: -0.04000000 Waves 2022.08.09 19:47 [2177184] smart account 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd > SELF 0.00000000 Waves
{ "type": 13, "id": "2Z2SgHS6pDspCAmDguJ14fuomG936f66N9ovpAFpnLEF", "fee": 4000000, "feeAssetId": null, "timestamp": 1660063676460, "version": 1, "sender": "3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd", "senderPublicKey": "CdnTmMHxT68Qa4MtHEnAiUhsdKTi2YkHPGn92ThinVNt", "proofs": [ "5iRLsfXuVKjmJxXHAJcyNh8DyJkHm3M2RGBNSPDUXJDARmSgfvUyDKs2WNxKXJAK4N43i9kG81vA1GKapoWbQ7wP", "3eFwYXC4g7qZpU8n5TiaRmqshePyV9UCRwB2BkPotMcAD1sqXkymDKNtTND8DBNCLHBv6WftD5h1DKLoszYimuRx", "5cJhY8v1hjCH4svGqz2QqAGcnNYkvpbhJgLMZCi7TtdzU95uppeubAYE6Yb8YvMjHmgtRRJe86UUogUEwpQSZwAu" ], "script": "base64:AAIFAAAAAAAAADEIAhIFCgMIAQESBQoDAQEIEgASABIDCgEIEgASABIAEgASBQoDAQEEEgMKAQESABIAAAAAbQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AgAAAAABAAAAFmdldEJvb2xCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQcBAA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AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAIAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAwkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAMAAAAAAAAAAAIAAAAAAAAAAAAJAABnAAAAAgUAAAAFY291bnQAAAAAAAAAAAMVF031", "chainId": 84, "height": 2177184, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4hGF58kqxdwBsuwC3cP9gXh68bPAgRLzyENxw5wJK4SD Next: B1ERuQyd6dbVkUuRuUWj2Ly9G1SiD7yoLkkgrxr2yM7 Diff:
Old | New | Differences | |
---|---|---|---|
298 | 298 | ||
299 | 299 | ||
300 | 300 | @Callable(bH) | |
301 | - | func constructorV2 (bK,bL) = if ((bH.caller != this)) | |
301 | + | func constructorV2 (bK,bL,bM) = if ((bH.caller != this)) | |
302 | 302 | then throw("Permission denied") | |
303 | 303 | else { | |
304 | - | let | |
305 | - | let | |
306 | - | [ | |
304 | + | let bN = Issue("SURF", bM, 0, 6, true, unit, 0) | |
305 | + | let bO = calculateAssetId(bN) | |
306 | + | [bN, StringEntry(ay, toBase58String(bO)), IntegerEntry(aG, bK), IntegerEntry(aH, bL)] | |
307 | 307 | } | |
308 | 308 | ||
309 | 309 | ||
310 | 310 | ||
311 | 311 | @Callable(bH) | |
312 | 312 | func buyNsbt () = { | |
313 | - | let | |
314 | - | let | |
315 | - | let | |
313 | + | let bP = value(bH.payments[0]) | |
314 | + | let bQ = bP.amount | |
315 | + | let bR = bQ | |
316 | 316 | if (bd) | |
317 | 317 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
318 | - | else if (isDefined( | |
318 | + | else if (isDefined(bP.assetId)) | |
319 | 319 | then throw("can use waves only") | |
320 | - | else if ((be > | |
320 | + | else if ((be > bQ)) | |
321 | 321 | then throw((("min " + toString((be / t))) + " waves expected")) | |
322 | 322 | else { | |
323 | - | let | |
324 | - | let | |
325 | - | let bB = n( | |
326 | - | let bE = h(invoke(as, "curveFunctionREADONLY", [ | |
327 | - | let | |
328 | - | if ((0 >= | |
323 | + | let bS = bH.caller | |
324 | + | let bT = h(invoke(as, "calcNeutinoMetricsREADONLY", nil, nil)) | |
325 | + | let bB = n(bT[0]) | |
326 | + | let bE = h(invoke(as, "curveFunctionREADONLY", [bR], nil)) | |
327 | + | let bU = n(bE[0]) | |
328 | + | if ((0 >= bU)) | |
329 | 329 | then throw("nsbtAmount <= 0") | |
330 | 330 | else { | |
331 | - | let | |
331 | + | let bV = bs(bR, bU) | |
332 | 332 | let bA = 0 | |
333 | - | let | |
334 | - | if (( | |
335 | - | then $Tuple2((bv(toBase58String(bH.transactionId), | |
333 | + | let bW = invoke(at, "acceptWaves", nil, bH.payments) | |
334 | + | if ((bW == bW)) | |
335 | + | then $Tuple2((bv(toBase58String(bH.transactionId), bQ, bQ, toString(bS), z, bA, bV, bB) ++ [ScriptTransfer(bS, bU, bc), StringEntry("debug_curveResult", bC("curveResult", bE))]), bU) | |
336 | 336 | else throw("Strict value is not equal to itself.") | |
337 | 337 | } | |
338 | 338 | } | |
344 | 344 | func sellNsbt () = if (bd) | |
345 | 345 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
346 | 346 | else { | |
347 | - | let | |
348 | - | let | |
349 | - | if (( | |
347 | + | let bP = value(bH.payments[0]) | |
348 | + | let bQ = bP.amount | |
349 | + | if ((bP.assetId != bc)) | |
350 | 350 | then throw("can use NSBT only") | |
351 | - | else if ((bf > | |
351 | + | else if ((bf > bQ)) | |
352 | 352 | then throw((("min " + toString((bf / s))) + " nsbt expected")) | |
353 | 353 | else { | |
354 | - | let | |
355 | - | if ((s > | |
356 | - | then throw((("resulting nsbt price would be < 1 (" + toString( | |
354 | + | let bX = n(h(invoke(as, "calcContractNsbtPriceSYSREADONLY", [-(bQ)], nil))[0]) | |
355 | + | if ((s > bX)) | |
356 | + | then throw((("resulting nsbt price would be < 1 (" + toString(bX)) + " usdn)")) | |
357 | 357 | else { | |
358 | - | let | |
359 | - | if (( | |
360 | - | then $Tuple2(nil, | |
358 | + | let bY = invoke(at, "transferUsdnToUser", [bQ, toString(bH.caller)], nil) | |
359 | + | if ((bY == bY)) | |
360 | + | then $Tuple2(nil, bX) | |
361 | 361 | else throw("Strict value is not equal to itself.") | |
362 | 362 | } | |
363 | 363 | } | |
369 | 369 | func cancelOrder (aJ) = { | |
370 | 370 | let by = bm(aJ) | |
371 | 371 | let aT = (bl(aJ) - bo(aJ)) | |
372 | - | let | |
373 | - | let | |
374 | - | let | |
372 | + | let bZ = toString(bH.caller) | |
373 | + | let ca = bq(aJ) | |
374 | + | let cb = bp(aJ) | |
375 | 375 | if ((bn(aJ) != y)) | |
376 | 376 | then throw("invalid order status") | |
377 | 377 | else [StringEntry(aC, if ((bi == aJ)) | |
378 | - | then | |
379 | - | else bi), StringEntry(aR( | |
378 | + | then ca | |
379 | + | else bi), StringEntry(aR(cb), ca), StringEntry(aQ(ca), cb), StringEntry(aO(aJ), x), ScriptTransfer(bH.caller, aT, unit)] | |
380 | 380 | } | |
381 | 381 | ||
382 | 382 | ||
402 | 402 | ||
403 | 403 | ||
404 | 404 | @Callable(bH) | |
405 | - | func buySurf (cb,cc,cd) = if ((size(bH.payments) != 1)) | |
406 | - | then throw("exactly 1 payment must be attached") | |
407 | - | else if ((0 >= cb)) | |
408 | - | then throw("averagePriceWanted should be positive") | |
409 | - | else if ((0 >= cc)) | |
410 | - | then throw("maxTolerancePerc should be positive") | |
411 | - | else { | |
412 | - | let bO = bH.payments[0] | |
413 | - | let ce = bO.amount | |
414 | - | let cf = valueOrElse(bO.assetId, A) | |
415 | - | if (if ((cf != bb)) | |
416 | - | then (cf != A) | |
417 | - | else false) | |
418 | - | then throw("Unsupported payment asset") | |
419 | - | else if (if ((cf == bb)) | |
420 | - | then (bh > ce) | |
421 | - | else false) | |
422 | - | then throw((("min " + toString((bh / s))) + " USDN expected")) | |
423 | - | else if (if ((cf == A)) | |
424 | - | then (bg > ce) | |
425 | - | else false) | |
426 | - | then throw((("min " + toString((bg / t))) + " WAVES expected")) | |
427 | - | else { | |
428 | - | let bG = h(invoke(as, "surfFunctionREADONLY", [ce, cf], nil)) | |
429 | - | let cg = n(bG[O]) | |
430 | - | let ch = n(bG[P]) | |
431 | - | let ci = n(bG[N]) | |
432 | - | let cj = toBigInt(ci) | |
433 | - | let ck = if ((cf == A)) | |
434 | - | then (toBigInt(cg) * u) | |
435 | - | else (toBigInt(ch) * v) | |
436 | - | if ((ck > ((toBigInt((cc + s)) * toBigInt(cb)) * cj))) | |
437 | - | then throw((((((("Tolerance " + toString(cc)) + " exceeded: spent ") + (if ((cf == A)) | |
438 | - | then (toString(cg) + " WAVES") | |
439 | - | else (toString(ch) + " USDN"))) + " for ") + toString(ci)) + " SURF")) | |
440 | - | else { | |
441 | - | let cl = n(bG[W]) | |
442 | - | let cm = if ((cf == A)) | |
443 | - | then { | |
444 | - | let cn = invoke(at, "acceptWaves", nil, [AttachedPayment(unit, (ce - cl))]) | |
445 | - | if ((cn == cn)) | |
446 | - | then if ((cl > 0)) | |
447 | - | then [ScriptTransfer(bH.caller, cl, unit)] | |
448 | - | else nil | |
449 | - | else throw("Strict value is not equal to itself.") | |
450 | - | } | |
451 | - | else if ((cl > 0)) | |
452 | - | then [ScriptTransfer(at, (ce - cl), bb), ScriptTransfer(bH.caller, cl, bb)] | |
453 | - | else [ScriptTransfer(at, (ce - cl), bb)] | |
454 | - | let co = p(invoke(this, "issueSurf", [ci], nil)) | |
455 | - | let cp = if (cd) | |
456 | - | then { | |
457 | - | let cq = invoke(au, "stakeByOriginCaller", nil, [AttachedPayment(co, ci)]) | |
458 | - | if ((cq == cq)) | |
459 | - | then nil | |
460 | - | else throw("Strict value is not equal to itself.") | |
461 | - | } | |
462 | - | else [ScriptTransfer(bH.caller, ci, co)] | |
463 | - | ((cm ++ [bF(bG)]) ++ cp) | |
464 | - | } | |
465 | - | } | |
466 | - | } | |
405 | + | func buySurf (cc,cd,ce) = { | |
406 | + | let cf = valueOrElse(getString(this, "testAccounts"), "") | |
407 | + | if (if ((cf != "")) | |
408 | + | then !(contains(cf, toString(bH.caller))) | |
409 | + | else false) | |
410 | + | then throw("Be patient! Need to test in mainnet before launch.") | |
411 | + | else if ((size(bH.payments) != 1)) | |
412 | + | then throw("exactly 1 payment must be attached") | |
413 | + | else if ((0 >= cc)) | |
414 | + | then throw("averagePriceWanted should be positive") | |
415 | + | else if ((0 >= cd)) | |
416 | + | then throw("maxTolerancePerc should be positive") | |
417 | + | else if (bd) | |
418 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
419 | + | else { | |
420 | + | let bP = bH.payments[0] | |
421 | + | let cg = bP.amount | |
422 | + | let ch = valueOrElse(bP.assetId, A) | |
423 | + | if (if ((ch != bb)) | |
424 | + | then (ch != A) | |
425 | + | else false) | |
426 | + | then throw("Unsupported payment asset") | |
427 | + | else if (if ((ch == bb)) | |
428 | + | then (bh > cg) | |
429 | + | else false) | |
430 | + | then throw((("min " + toString((bh / s))) + " USDN expected")) | |
431 | + | else if (if ((ch == A)) | |
432 | + | then (bg > cg) | |
433 | + | else false) | |
434 | + | then throw((("min " + toString((bg / t))) + " WAVES expected")) | |
435 | + | else { | |
436 | + | let bG = h(invoke(as, "surfFunctionREADONLY", [cg, ch], nil)) | |
437 | + | let ci = n(bG[O]) | |
438 | + | let cj = n(bG[P]) | |
439 | + | let ck = n(bG[N]) | |
440 | + | let cl = toBigInt(ck) | |
441 | + | let cm = if ((ch == A)) | |
442 | + | then (toBigInt(ci) * u) | |
443 | + | else (toBigInt(cj) * v) | |
444 | + | if ((cm > ((toBigInt((cd + s)) * toBigInt(cc)) * cl))) | |
445 | + | then throw((((((("Tolerance " + toString(cd)) + " exceeded: spent ") + (if ((ch == A)) | |
446 | + | then (toString(ci) + " WAVES") | |
447 | + | else (toString(cj) + " USDN"))) + " for ") + toString(ck)) + " SURF")) | |
448 | + | else { | |
449 | + | let cn = n(bG[W]) | |
450 | + | let co = if ((ch == A)) | |
451 | + | then { | |
452 | + | let cp = invoke(at, "acceptWaves", nil, [AttachedPayment(unit, (cg - cn))]) | |
453 | + | if ((cp == cp)) | |
454 | + | then if ((cn > 0)) | |
455 | + | then [ScriptTransfer(bH.caller, cn, unit)] | |
456 | + | else nil | |
457 | + | else throw("Strict value is not equal to itself.") | |
458 | + | } | |
459 | + | else if ((cn > 0)) | |
460 | + | then [ScriptTransfer(at, (cg - cn), bb), ScriptTransfer(bH.caller, cn, bb)] | |
461 | + | else [ScriptTransfer(at, (cg - cn), bb)] | |
462 | + | let cq = p(invoke(this, "issueSurf", [ck], nil)) | |
463 | + | let cr = if (ce) | |
464 | + | then { | |
465 | + | let cs = invoke(au, "stakeByOriginCaller", nil, [AttachedPayment(cq, ck)]) | |
466 | + | if ((cs == cs)) | |
467 | + | then nil | |
468 | + | else throw("Strict value is not equal to itself.") | |
469 | + | } | |
470 | + | else [ScriptTransfer(bH.caller, ck, cq)] | |
471 | + | ((co ++ [bF(bG)]) ++ cr) | |
472 | + | } | |
473 | + | } | |
474 | + | } | |
475 | + | } | |
467 | 476 | ||
468 | 477 | ||
469 | 478 | ||
470 | 479 | @Callable(bH) | |
471 | - | func issueSurf ( | |
472 | - | let | |
480 | + | func issueSurf (ck) = { | |
481 | + | let cq = fromBase58String(getStringValue(ay)) | |
473 | 482 | if ((bH.caller != this)) | |
474 | 483 | then throw("issueSurf - permission denied") | |
475 | - | else $Tuple2([Reissue( | |
484 | + | else $Tuple2([Reissue(cq, ck, true)], cq) | |
476 | 485 | } | |
477 | 486 | ||
478 | 487 | ||
479 | 488 | ||
480 | 489 | @Callable(bH) | |
481 | 490 | func updateReservesAndNeutrinoSupply () = { | |
482 | - | func | |
491 | + | func ct (b) = { | |
483 | 492 | let j = getInteger(this, b) | |
484 | 493 | if ($isInstanceOf(j, "Int")) | |
485 | 494 | then { | |
486 | - | let | |
487 | - | | |
495 | + | let cu = j | |
496 | + | cu | |
488 | 497 | } | |
489 | 498 | else 0 | |
490 | 499 | } | |
491 | 500 | ||
492 | - | let | |
493 | - | let aq = | |
494 | - | let | |
495 | - | [IntegerEntry("updateReservesAndNeutrinoSupplyIdx", | |
501 | + | let cv = h(invoke(as, "calcNeutinoMetricsREADONLY", nil, nil)) | |
502 | + | let aq = ct("updateReservesAndNeutrinoSupplyIdx") | |
503 | + | let cw = (aq + 1) | |
504 | + | [IntegerEntry("updateReservesAndNeutrinoSupplyIdx", cw), IntegerEntry("reserve", n(cv[3])), IntegerEntry("neutrinoSupply", n(cv[5])), IntegerEntry("reservesInUsdn", aV(n(cv[3]), n(cv[0]))), IntegerEntry("deficit", -(n(cv[6])))] | |
496 | 505 | } | |
497 | 506 | ||
498 | 507 | ||
499 | 508 | ||
500 | 509 | @Callable(bH) | |
501 | 510 | func wavesBalancesVsPayment () = { | |
502 | - | let | |
503 | - | [IntegerEntry("wavesBalance_available", | |
511 | + | let cx = wavesBalance(this) | |
512 | + | [IntegerEntry("wavesBalance_available", cx.available), IntegerEntry("wavesBalance_regular", cx.regular), IntegerEntry("wavesBalance_generating", cx.generating), IntegerEntry("wavesBalance_effective", cx.effective), IntegerEntry("waves_payment", value(bH.payments[0]).amount)] | |
504 | 513 | } | |
505 | 514 | ||
506 | 515 | ||
507 | - | @Verifier( | |
508 | - | func | |
509 | - | let | |
510 | - | let | |
511 | - | let | |
516 | + | @Verifier(cy) | |
517 | + | func cz () = { | |
518 | + | let cA = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], r) | |
519 | + | let cB = split(valueOrElse(getString(ar, "%s__multisig"), cA), r) | |
520 | + | let cC = ((((if (sigVerify(cy.bodyBytes, cy.proofs[0], fromBase58String(cB[0]))) | |
512 | 521 | then 1 | |
513 | - | else 0) + (if (sigVerify( | |
522 | + | else 0) + (if (sigVerify(cy.bodyBytes, cy.proofs[1], fromBase58String(cB[1]))) | |
514 | 523 | then 1 | |
515 | - | else 0)) + (if (sigVerify( | |
524 | + | else 0)) + (if (sigVerify(cy.bodyBytes, cy.proofs[2], fromBase58String(cB[2]))) | |
516 | 525 | then 1 | |
517 | - | else 0)) + (if (sigVerify( | |
526 | + | else 0)) + (if (sigVerify(cy.bodyBytes, cy.proofs[3], fromBase58String(cB[3]))) | |
518 | 527 | then 2 | |
519 | 528 | else 0)) | |
520 | - | ( | |
529 | + | (cC >= 3) | |
521 | 530 | } | |
522 | 531 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = valueOrElse(getInteger(this, b), 0) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func c (b) = valueOrElse(getString(this, b), "") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func d (e,b) = valueOrElse(getBoolean(e, b), false) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func f (e,b) = valueOrElse(getString(e, b), "") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func g (e,b) = valueOrElse(getInteger(e, b), 0) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func h (i) = { | |
20 | 20 | let j = i | |
21 | 21 | if ($isInstanceOf(j, "List[Any]")) | |
22 | 22 | then { | |
23 | 23 | let k = j | |
24 | 24 | k | |
25 | 25 | } | |
26 | 26 | else throw("fail to cast into List[Any]") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func l (i) = { | |
31 | 31 | let j = i | |
32 | 32 | if ($isInstanceOf(j, "String")) | |
33 | 33 | then { | |
34 | 34 | let m = j | |
35 | 35 | m | |
36 | 36 | } | |
37 | 37 | else throw("fail to cast into String") | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func n (i) = { | |
42 | 42 | let j = i | |
43 | 43 | if ($isInstanceOf(j, "Int")) | |
44 | 44 | then { | |
45 | 45 | let o = j | |
46 | 46 | o | |
47 | 47 | } | |
48 | 48 | else throw("fail to cast into Int") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func p (i) = { | |
53 | 53 | let j = i | |
54 | 54 | if ($isInstanceOf(j, "ByteVector")) | |
55 | 55 | then { | |
56 | 56 | let q = j | |
57 | 57 | q | |
58 | 58 | } | |
59 | 59 | else throw("fail to cast into Int") | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | let r = "__" | |
64 | 64 | ||
65 | 65 | let s = 1000000 | |
66 | 66 | ||
67 | 67 | let t = 100000000 | |
68 | 68 | ||
69 | 69 | let u = toBigInt(10000000000) | |
70 | 70 | ||
71 | 71 | let v = toBigInt(1000000000000) | |
72 | 72 | ||
73 | 73 | let w = toBigInt(10000000000000000) | |
74 | 74 | ||
75 | 75 | let x = "canceled" | |
76 | 76 | ||
77 | 77 | let y = "new" | |
78 | 78 | ||
79 | 79 | let z = "filled" | |
80 | 80 | ||
81 | 81 | let A = fromBase58String("WAVES") | |
82 | 82 | ||
83 | 83 | let B = 0 | |
84 | 84 | ||
85 | 85 | let C = 1 | |
86 | 86 | ||
87 | 87 | let D = 2 | |
88 | 88 | ||
89 | 89 | let E = 3 | |
90 | 90 | ||
91 | 91 | let F = 4 | |
92 | 92 | ||
93 | 93 | let G = 5 | |
94 | 94 | ||
95 | 95 | let H = 6 | |
96 | 96 | ||
97 | 97 | let I = 7 | |
98 | 98 | ||
99 | 99 | let J = 8 | |
100 | 100 | ||
101 | 101 | let K = 9 | |
102 | 102 | ||
103 | 103 | let L = 10 | |
104 | 104 | ||
105 | 105 | let M = 11 | |
106 | 106 | ||
107 | 107 | let N = 0 | |
108 | 108 | ||
109 | 109 | let O = 1 | |
110 | 110 | ||
111 | 111 | let P = 2 | |
112 | 112 | ||
113 | 113 | let Q = 3 | |
114 | 114 | ||
115 | 115 | let R = 4 | |
116 | 116 | ||
117 | 117 | let S = 5 | |
118 | 118 | ||
119 | 119 | let T = 6 | |
120 | 120 | ||
121 | 121 | let U = 7 | |
122 | 122 | ||
123 | 123 | let V = 8 | |
124 | 124 | ||
125 | 125 | let W = 9 | |
126 | 126 | ||
127 | 127 | let X = 10 | |
128 | 128 | ||
129 | 129 | let Y = 1 | |
130 | 130 | ||
131 | 131 | let Z = 2 | |
132 | 132 | ||
133 | 133 | let aa = 3 | |
134 | 134 | ||
135 | 135 | let ab = 4 | |
136 | 136 | ||
137 | 137 | let ac = 5 | |
138 | 138 | ||
139 | 139 | let ad = 6 | |
140 | 140 | ||
141 | 141 | let ae = 7 | |
142 | 142 | ||
143 | 143 | let af = 8 | |
144 | 144 | ||
145 | 145 | let ag = 9 | |
146 | 146 | ||
147 | 147 | let ah = 10 | |
148 | 148 | ||
149 | 149 | let ai = 11 | |
150 | 150 | ||
151 | 151 | func aj (e,b) = valueOrErrorMessage(getString(e, b), (((("mandatory " + toString(e)) + ".") + b) + " is not defined")) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func ak () = "%s%s__config__controlAddress" | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func al () = "%s__controlConfig" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func am (an) = split(aj(an, al()), r) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func ao (ap,aq) = valueOrErrorMessage(addressFromString(ap[aq]), ("Control cfg doesn't contain address at index " + toString(aq))) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | let ar = addressFromStringValue(valueOrElse(getString(this, ak()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
167 | 167 | ||
168 | 168 | let ap = am(ar) | |
169 | 169 | ||
170 | 170 | let as = ao(ap, ab) | |
171 | 171 | ||
172 | 172 | let at = ao(ap, Y) | |
173 | 173 | ||
174 | 174 | let au = ao(ap, ah) | |
175 | 175 | ||
176 | 176 | let av = "price" | |
177 | 177 | ||
178 | 178 | let aw = "bond_asset_id" | |
179 | 179 | ||
180 | 180 | let ax = "neutrino_asset_id" | |
181 | 181 | ||
182 | 182 | let ay = "surf_asset_id" | |
183 | 183 | ||
184 | 184 | let az = "balance_lock_" | |
185 | 185 | ||
186 | 186 | let aA = (az + "waves") | |
187 | 187 | ||
188 | 188 | let aB = (az + "neutrino") | |
189 | 189 | ||
190 | 190 | let aC = "order_first" | |
191 | 191 | ||
192 | 192 | let aD = "math_contract" | |
193 | 193 | ||
194 | 194 | let aE = "min_waves_nsbt_buy" | |
195 | 195 | ||
196 | 196 | let aF = "min_nsbt_sell" | |
197 | 197 | ||
198 | 198 | let aG = "min_waves_surf_buy" | |
199 | 199 | ||
200 | 200 | let aH = "min_usdn_surf_buy" | |
201 | 201 | ||
202 | 202 | func aI (aJ) = ("debug_order_roi_" + aJ) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func aK (aJ) = ("order_price_" + aJ) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func aL (aJ) = ("order_total_" + aJ) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func aM (aJ) = ("order_owner_" + aJ) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func aN (aJ) = ("order_height_" + aJ) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func aO (aJ) = ("order_status_" + aJ) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func aP (aJ) = ("order_filled_total_" + aJ) | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func aQ (aJ) = ("order_prev_" + aJ) | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func aR (aJ) = ("order_next_" + aJ) | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func aS (aT,aU) = fraction(aT, t, aU) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | func aV (aT,aU) = fraction(aT, aU, t) | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func aW (aX,aY) = fraction(toBigInt(aX), w, toBigInt(aY)) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func aZ (i,ba) = toInt(fraction(i, toBigInt(ba), w)) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | let bb = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
242 | 242 | ||
243 | 243 | let bc = base58'F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z' | |
244 | 244 | ||
245 | 245 | let bd = d(ar, "is_blocked") | |
246 | 246 | ||
247 | 247 | let be = valueOrElse(getInteger(this, aE), 1000000000) | |
248 | 248 | ||
249 | 249 | let bf = valueOrElse(getInteger(this, aF), 1000000) | |
250 | 250 | ||
251 | 251 | let bg = valueOrElse(getInteger(this, aG), 100000000) | |
252 | 252 | ||
253 | 253 | let bh = valueOrElse(getInteger(this, aH), 10000000) | |
254 | 254 | ||
255 | 255 | let bi = c(aC) | |
256 | 256 | ||
257 | 257 | func bj (bk) = a(aK(bk)) | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func bl (bk) = a(aL(bk)) | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | func bm (bk) = c(aM(bk)) | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func bn (bk) = c(aO(bk)) | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func bo (bk) = a(aP(bk)) | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func bp (bk) = c(aQ(bk)) | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func bq (bk) = c(aR(bk)) | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | func br (aU) = ((s * s) / aU) | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | func bs (bt,bu) = fraction(toBigInt(bt), toBigInt((s * s)), toBigInt(bu)) | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | func bv (aJ,bw,bx,by,bz,bA,aU,bB) = [StringEntry(aK(aJ), toString(aU)), IntegerEntry(aL(aJ), bw), IntegerEntry(aP(aJ), bx), StringEntry(aM(aJ), by), IntegerEntry(aN(aJ), height), StringEntry(aO(aJ), bz), IntegerEntry(("debug_order_currentPrice_" + aJ), bB), IntegerEntry(aI(aJ), bA)] | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | func bC (bD,bE) = (((((((((((((((((((((((((((((((((((bD + "[nsbtAmountRaw=") + toString(n(bE[0]))) + " usdnPayment=") + toString(n(bE[1]))) + " wRaw=") + toString(n(bE[2]))) + " uRaw=") + toString(n(bE[3]))) + " mRaw=") + toString(n(bE[4]))) + " sRaw=") + toString(n(bE[5]))) + " nsbtCurveParam_a=") + toString(n(bE[6]))) + " nsbtCurveParam_b=") + toString(n(bE[7]))) + " wReservesInUsdn=") + toString(n(bE[8]))) + " price=") + toString(n(bE[9]))) + " multBR=") + toString(n(bE[10]))) + " multPower=") + toString(n(bE[11]))) + " multExpInPower=") + l(bE[12])) + " multK=") + l(bE[13])) + " step1=") + l(bE[14])) + " step2=") + l(bE[15])) + " step3=") + toString(n(bE[16]))) + "]") | |
288 | 288 | ||
289 | 289 | ||
290 | 290 | func bF (bG) = StringEntry("debug_surfResult", makeString(["%d%d%d%d%d%d%d%d%d%d%d", toString(n(bG[N])), toString(n(bG[O])), toString(n(bG[P])), toString(n(bG[Q])), toString(n(bG[R])), toString(n(bG[S])), toString(n(bG[T])), toString(n(bG[U])), toString(n(bG[V])), toString(n(bG[W])), toString(n(bG[X]))], r)) | |
291 | 291 | ||
292 | 292 | ||
293 | 293 | @Callable(bH) | |
294 | 294 | func constructor (bI,bJ,bf) = if ((bH.caller != this)) | |
295 | 295 | then throw("Permission denied") | |
296 | 296 | else [StringEntry(aD, bI), IntegerEntry(aF, bf), IntegerEntry(aE, bJ)] | |
297 | 297 | ||
298 | 298 | ||
299 | 299 | ||
300 | 300 | @Callable(bH) | |
301 | - | func constructorV2 (bK,bL) = if ((bH.caller != this)) | |
301 | + | func constructorV2 (bK,bL,bM) = if ((bH.caller != this)) | |
302 | 302 | then throw("Permission denied") | |
303 | 303 | else { | |
304 | - | let | |
305 | - | let | |
306 | - | [ | |
304 | + | let bN = Issue("SURF", bM, 0, 6, true, unit, 0) | |
305 | + | let bO = calculateAssetId(bN) | |
306 | + | [bN, StringEntry(ay, toBase58String(bO)), IntegerEntry(aG, bK), IntegerEntry(aH, bL)] | |
307 | 307 | } | |
308 | 308 | ||
309 | 309 | ||
310 | 310 | ||
311 | 311 | @Callable(bH) | |
312 | 312 | func buyNsbt () = { | |
313 | - | let | |
314 | - | let | |
315 | - | let | |
313 | + | let bP = value(bH.payments[0]) | |
314 | + | let bQ = bP.amount | |
315 | + | let bR = bQ | |
316 | 316 | if (bd) | |
317 | 317 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
318 | - | else if (isDefined( | |
318 | + | else if (isDefined(bP.assetId)) | |
319 | 319 | then throw("can use waves only") | |
320 | - | else if ((be > | |
320 | + | else if ((be > bQ)) | |
321 | 321 | then throw((("min " + toString((be / t))) + " waves expected")) | |
322 | 322 | else { | |
323 | - | let | |
324 | - | let | |
325 | - | let bB = n( | |
326 | - | let bE = h(invoke(as, "curveFunctionREADONLY", [ | |
327 | - | let | |
328 | - | if ((0 >= | |
323 | + | let bS = bH.caller | |
324 | + | let bT = h(invoke(as, "calcNeutinoMetricsREADONLY", nil, nil)) | |
325 | + | let bB = n(bT[0]) | |
326 | + | let bE = h(invoke(as, "curveFunctionREADONLY", [bR], nil)) | |
327 | + | let bU = n(bE[0]) | |
328 | + | if ((0 >= bU)) | |
329 | 329 | then throw("nsbtAmount <= 0") | |
330 | 330 | else { | |
331 | - | let | |
331 | + | let bV = bs(bR, bU) | |
332 | 332 | let bA = 0 | |
333 | - | let | |
334 | - | if (( | |
335 | - | then $Tuple2((bv(toBase58String(bH.transactionId), | |
333 | + | let bW = invoke(at, "acceptWaves", nil, bH.payments) | |
334 | + | if ((bW == bW)) | |
335 | + | then $Tuple2((bv(toBase58String(bH.transactionId), bQ, bQ, toString(bS), z, bA, bV, bB) ++ [ScriptTransfer(bS, bU, bc), StringEntry("debug_curveResult", bC("curveResult", bE))]), bU) | |
336 | 336 | else throw("Strict value is not equal to itself.") | |
337 | 337 | } | |
338 | 338 | } | |
339 | 339 | } | |
340 | 340 | ||
341 | 341 | ||
342 | 342 | ||
343 | 343 | @Callable(bH) | |
344 | 344 | func sellNsbt () = if (bd) | |
345 | 345 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
346 | 346 | else { | |
347 | - | let | |
348 | - | let | |
349 | - | if (( | |
347 | + | let bP = value(bH.payments[0]) | |
348 | + | let bQ = bP.amount | |
349 | + | if ((bP.assetId != bc)) | |
350 | 350 | then throw("can use NSBT only") | |
351 | - | else if ((bf > | |
351 | + | else if ((bf > bQ)) | |
352 | 352 | then throw((("min " + toString((bf / s))) + " nsbt expected")) | |
353 | 353 | else { | |
354 | - | let | |
355 | - | if ((s > | |
356 | - | then throw((("resulting nsbt price would be < 1 (" + toString( | |
354 | + | let bX = n(h(invoke(as, "calcContractNsbtPriceSYSREADONLY", [-(bQ)], nil))[0]) | |
355 | + | if ((s > bX)) | |
356 | + | then throw((("resulting nsbt price would be < 1 (" + toString(bX)) + " usdn)")) | |
357 | 357 | else { | |
358 | - | let | |
359 | - | if (( | |
360 | - | then $Tuple2(nil, | |
358 | + | let bY = invoke(at, "transferUsdnToUser", [bQ, toString(bH.caller)], nil) | |
359 | + | if ((bY == bY)) | |
360 | + | then $Tuple2(nil, bX) | |
361 | 361 | else throw("Strict value is not equal to itself.") | |
362 | 362 | } | |
363 | 363 | } | |
364 | 364 | } | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | ||
368 | 368 | @Callable(bH) | |
369 | 369 | func cancelOrder (aJ) = { | |
370 | 370 | let by = bm(aJ) | |
371 | 371 | let aT = (bl(aJ) - bo(aJ)) | |
372 | - | let | |
373 | - | let | |
374 | - | let | |
372 | + | let bZ = toString(bH.caller) | |
373 | + | let ca = bq(aJ) | |
374 | + | let cb = bp(aJ) | |
375 | 375 | if ((bn(aJ) != y)) | |
376 | 376 | then throw("invalid order status") | |
377 | 377 | else [StringEntry(aC, if ((bi == aJ)) | |
378 | - | then | |
379 | - | else bi), StringEntry(aR( | |
378 | + | then ca | |
379 | + | else bi), StringEntry(aR(cb), ca), StringEntry(aQ(ca), cb), StringEntry(aO(aJ), x), ScriptTransfer(bH.caller, aT, unit)] | |
380 | 380 | } | |
381 | 381 | ||
382 | 382 | ||
383 | 383 | ||
384 | 384 | @Callable(bH) | |
385 | 385 | func minWavesAmountNsbtBuySYSREADONLY () = $Tuple2(nil, be) | |
386 | 386 | ||
387 | 387 | ||
388 | 388 | ||
389 | 389 | @Callable(bH) | |
390 | 390 | func minNsbtAmountForSellSYSREADONLY () = $Tuple2(nil, bf) | |
391 | 391 | ||
392 | 392 | ||
393 | 393 | ||
394 | 394 | @Callable(bH) | |
395 | 395 | func minWavesAmountSurfBuySYSREADONLY () = $Tuple2(nil, bg) | |
396 | 396 | ||
397 | 397 | ||
398 | 398 | ||
399 | 399 | @Callable(bH) | |
400 | 400 | func minUsdnAmountSurfBuySYSREADONLY () = $Tuple2(nil, bh) | |
401 | 401 | ||
402 | 402 | ||
403 | 403 | ||
404 | 404 | @Callable(bH) | |
405 | - | func buySurf (cb,cc,cd) = if ((size(bH.payments) != 1)) | |
406 | - | then throw("exactly 1 payment must be attached") | |
407 | - | else if ((0 >= cb)) | |
408 | - | then throw("averagePriceWanted should be positive") | |
409 | - | else if ((0 >= cc)) | |
410 | - | then throw("maxTolerancePerc should be positive") | |
411 | - | else { | |
412 | - | let bO = bH.payments[0] | |
413 | - | let ce = bO.amount | |
414 | - | let cf = valueOrElse(bO.assetId, A) | |
415 | - | if (if ((cf != bb)) | |
416 | - | then (cf != A) | |
417 | - | else false) | |
418 | - | then throw("Unsupported payment asset") | |
419 | - | else if (if ((cf == bb)) | |
420 | - | then (bh > ce) | |
421 | - | else false) | |
422 | - | then throw((("min " + toString((bh / s))) + " USDN expected")) | |
423 | - | else if (if ((cf == A)) | |
424 | - | then (bg > ce) | |
425 | - | else false) | |
426 | - | then throw((("min " + toString((bg / t))) + " WAVES expected")) | |
427 | - | else { | |
428 | - | let bG = h(invoke(as, "surfFunctionREADONLY", [ce, cf], nil)) | |
429 | - | let cg = n(bG[O]) | |
430 | - | let ch = n(bG[P]) | |
431 | - | let ci = n(bG[N]) | |
432 | - | let cj = toBigInt(ci) | |
433 | - | let ck = if ((cf == A)) | |
434 | - | then (toBigInt(cg) * u) | |
435 | - | else (toBigInt(ch) * v) | |
436 | - | if ((ck > ((toBigInt((cc + s)) * toBigInt(cb)) * cj))) | |
437 | - | then throw((((((("Tolerance " + toString(cc)) + " exceeded: spent ") + (if ((cf == A)) | |
438 | - | then (toString(cg) + " WAVES") | |
439 | - | else (toString(ch) + " USDN"))) + " for ") + toString(ci)) + " SURF")) | |
440 | - | else { | |
441 | - | let cl = n(bG[W]) | |
442 | - | let cm = if ((cf == A)) | |
443 | - | then { | |
444 | - | let cn = invoke(at, "acceptWaves", nil, [AttachedPayment(unit, (ce - cl))]) | |
445 | - | if ((cn == cn)) | |
446 | - | then if ((cl > 0)) | |
447 | - | then [ScriptTransfer(bH.caller, cl, unit)] | |
448 | - | else nil | |
449 | - | else throw("Strict value is not equal to itself.") | |
450 | - | } | |
451 | - | else if ((cl > 0)) | |
452 | - | then [ScriptTransfer(at, (ce - cl), bb), ScriptTransfer(bH.caller, cl, bb)] | |
453 | - | else [ScriptTransfer(at, (ce - cl), bb)] | |
454 | - | let co = p(invoke(this, "issueSurf", [ci], nil)) | |
455 | - | let cp = if (cd) | |
456 | - | then { | |
457 | - | let cq = invoke(au, "stakeByOriginCaller", nil, [AttachedPayment(co, ci)]) | |
458 | - | if ((cq == cq)) | |
459 | - | then nil | |
460 | - | else throw("Strict value is not equal to itself.") | |
461 | - | } | |
462 | - | else [ScriptTransfer(bH.caller, ci, co)] | |
463 | - | ((cm ++ [bF(bG)]) ++ cp) | |
464 | - | } | |
465 | - | } | |
466 | - | } | |
405 | + | func buySurf (cc,cd,ce) = { | |
406 | + | let cf = valueOrElse(getString(this, "testAccounts"), "") | |
407 | + | if (if ((cf != "")) | |
408 | + | then !(contains(cf, toString(bH.caller))) | |
409 | + | else false) | |
410 | + | then throw("Be patient! Need to test in mainnet before launch.") | |
411 | + | else if ((size(bH.payments) != 1)) | |
412 | + | then throw("exactly 1 payment must be attached") | |
413 | + | else if ((0 >= cc)) | |
414 | + | then throw("averagePriceWanted should be positive") | |
415 | + | else if ((0 >= cd)) | |
416 | + | then throw("maxTolerancePerc should be positive") | |
417 | + | else if (bd) | |
418 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
419 | + | else { | |
420 | + | let bP = bH.payments[0] | |
421 | + | let cg = bP.amount | |
422 | + | let ch = valueOrElse(bP.assetId, A) | |
423 | + | if (if ((ch != bb)) | |
424 | + | then (ch != A) | |
425 | + | else false) | |
426 | + | then throw("Unsupported payment asset") | |
427 | + | else if (if ((ch == bb)) | |
428 | + | then (bh > cg) | |
429 | + | else false) | |
430 | + | then throw((("min " + toString((bh / s))) + " USDN expected")) | |
431 | + | else if (if ((ch == A)) | |
432 | + | then (bg > cg) | |
433 | + | else false) | |
434 | + | then throw((("min " + toString((bg / t))) + " WAVES expected")) | |
435 | + | else { | |
436 | + | let bG = h(invoke(as, "surfFunctionREADONLY", [cg, ch], nil)) | |
437 | + | let ci = n(bG[O]) | |
438 | + | let cj = n(bG[P]) | |
439 | + | let ck = n(bG[N]) | |
440 | + | let cl = toBigInt(ck) | |
441 | + | let cm = if ((ch == A)) | |
442 | + | then (toBigInt(ci) * u) | |
443 | + | else (toBigInt(cj) * v) | |
444 | + | if ((cm > ((toBigInt((cd + s)) * toBigInt(cc)) * cl))) | |
445 | + | then throw((((((("Tolerance " + toString(cd)) + " exceeded: spent ") + (if ((ch == A)) | |
446 | + | then (toString(ci) + " WAVES") | |
447 | + | else (toString(cj) + " USDN"))) + " for ") + toString(ck)) + " SURF")) | |
448 | + | else { | |
449 | + | let cn = n(bG[W]) | |
450 | + | let co = if ((ch == A)) | |
451 | + | then { | |
452 | + | let cp = invoke(at, "acceptWaves", nil, [AttachedPayment(unit, (cg - cn))]) | |
453 | + | if ((cp == cp)) | |
454 | + | then if ((cn > 0)) | |
455 | + | then [ScriptTransfer(bH.caller, cn, unit)] | |
456 | + | else nil | |
457 | + | else throw("Strict value is not equal to itself.") | |
458 | + | } | |
459 | + | else if ((cn > 0)) | |
460 | + | then [ScriptTransfer(at, (cg - cn), bb), ScriptTransfer(bH.caller, cn, bb)] | |
461 | + | else [ScriptTransfer(at, (cg - cn), bb)] | |
462 | + | let cq = p(invoke(this, "issueSurf", [ck], nil)) | |
463 | + | let cr = if (ce) | |
464 | + | then { | |
465 | + | let cs = invoke(au, "stakeByOriginCaller", nil, [AttachedPayment(cq, ck)]) | |
466 | + | if ((cs == cs)) | |
467 | + | then nil | |
468 | + | else throw("Strict value is not equal to itself.") | |
469 | + | } | |
470 | + | else [ScriptTransfer(bH.caller, ck, cq)] | |
471 | + | ((co ++ [bF(bG)]) ++ cr) | |
472 | + | } | |
473 | + | } | |
474 | + | } | |
475 | + | } | |
467 | 476 | ||
468 | 477 | ||
469 | 478 | ||
470 | 479 | @Callable(bH) | |
471 | - | func issueSurf ( | |
472 | - | let | |
480 | + | func issueSurf (ck) = { | |
481 | + | let cq = fromBase58String(getStringValue(ay)) | |
473 | 482 | if ((bH.caller != this)) | |
474 | 483 | then throw("issueSurf - permission denied") | |
475 | - | else $Tuple2([Reissue( | |
484 | + | else $Tuple2([Reissue(cq, ck, true)], cq) | |
476 | 485 | } | |
477 | 486 | ||
478 | 487 | ||
479 | 488 | ||
480 | 489 | @Callable(bH) | |
481 | 490 | func updateReservesAndNeutrinoSupply () = { | |
482 | - | func | |
491 | + | func ct (b) = { | |
483 | 492 | let j = getInteger(this, b) | |
484 | 493 | if ($isInstanceOf(j, "Int")) | |
485 | 494 | then { | |
486 | - | let | |
487 | - | | |
495 | + | let cu = j | |
496 | + | cu | |
488 | 497 | } | |
489 | 498 | else 0 | |
490 | 499 | } | |
491 | 500 | ||
492 | - | let | |
493 | - | let aq = | |
494 | - | let | |
495 | - | [IntegerEntry("updateReservesAndNeutrinoSupplyIdx", | |
501 | + | let cv = h(invoke(as, "calcNeutinoMetricsREADONLY", nil, nil)) | |
502 | + | let aq = ct("updateReservesAndNeutrinoSupplyIdx") | |
503 | + | let cw = (aq + 1) | |
504 | + | [IntegerEntry("updateReservesAndNeutrinoSupplyIdx", cw), IntegerEntry("reserve", n(cv[3])), IntegerEntry("neutrinoSupply", n(cv[5])), IntegerEntry("reservesInUsdn", aV(n(cv[3]), n(cv[0]))), IntegerEntry("deficit", -(n(cv[6])))] | |
496 | 505 | } | |
497 | 506 | ||
498 | 507 | ||
499 | 508 | ||
500 | 509 | @Callable(bH) | |
501 | 510 | func wavesBalancesVsPayment () = { | |
502 | - | let | |
503 | - | [IntegerEntry("wavesBalance_available", | |
511 | + | let cx = wavesBalance(this) | |
512 | + | [IntegerEntry("wavesBalance_available", cx.available), IntegerEntry("wavesBalance_regular", cx.regular), IntegerEntry("wavesBalance_generating", cx.generating), IntegerEntry("wavesBalance_effective", cx.effective), IntegerEntry("waves_payment", value(bH.payments[0]).amount)] | |
504 | 513 | } | |
505 | 514 | ||
506 | 515 | ||
507 | - | @Verifier( | |
508 | - | func | |
509 | - | let | |
510 | - | let | |
511 | - | let | |
516 | + | @Verifier(cy) | |
517 | + | func cz () = { | |
518 | + | let cA = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], r) | |
519 | + | let cB = split(valueOrElse(getString(ar, "%s__multisig"), cA), r) | |
520 | + | let cC = ((((if (sigVerify(cy.bodyBytes, cy.proofs[0], fromBase58String(cB[0]))) | |
512 | 521 | then 1 | |
513 | - | else 0) + (if (sigVerify( | |
522 | + | else 0) + (if (sigVerify(cy.bodyBytes, cy.proofs[1], fromBase58String(cB[1]))) | |
514 | 523 | then 1 | |
515 | - | else 0)) + (if (sigVerify( | |
524 | + | else 0)) + (if (sigVerify(cy.bodyBytes, cy.proofs[2], fromBase58String(cB[2]))) | |
516 | 525 | then 1 | |
517 | - | else 0)) + (if (sigVerify( | |
526 | + | else 0)) + (if (sigVerify(cy.bodyBytes, cy.proofs[3], fromBase58String(cB[3]))) | |
518 | 527 | then 2 | |
519 | 528 | else 0)) | |
520 | - | ( | |
529 | + | (cC >= 3) | |
521 | 530 | } | |
522 | 531 |
github/deemru/w8io/026f985 94.30 ms ◑