tx · A7YETDhSCzJGMoQUktAxZAMXJLmVrnG4dmGnquGdajnc 3N3c8hF3E1qiSZ27uH3XZvtWSso9QFckZUb: -0.03300000 Waves 2024.09.17 11:07 [3287404] smart account 3N3c8hF3E1qiSZ27uH3XZvtWSso9QFckZUb > SELF 0.00000000 Waves
{ "type": 13, "id": "A7YETDhSCzJGMoQUktAxZAMXJLmVrnG4dmGnquGdajnc", "fee": 3300000, "feeAssetId": null, "timestamp": 1726560418229, "version": 2, "chainId": 84, "sender": "3N3c8hF3E1qiSZ27uH3XZvtWSso9QFckZUb", "senderPublicKey": "9Dkh2UiuYRqFTQrAXgJJbJuG3Q6VDPhiYHrsdfQx42Zx", "proofs": [ "66q6hZrY5vMy683MSsreoJpCYV2PKNNVw7MJZPfWLX8Gqy3vnqUQg1vtKCRFzwsUFLHATDFzSt6aXpVsDKLDZ3Rj" ], "script": "base64:BwJnCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGF4ACXNlcGFyYXRvcgICX18AB2NoYWluSWQJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEACGNoYWluSWRXAQFXABBjb250cmFjdEZpbGVuYW1lAhdmdXR1cmVzX2NhbGN1bGF0b3IucmlkZQAFbXVsdDgAgMLXLwAMbXVsdDE4QmlnSW50CQC2AgEAgICQu7rWrfANAA13YXZlc0RlY2ltYWxzAAgADHVzZHREZWNpbWFscwAGAAt3YXZlc1N0cmluZwIFV0FWRVMADXF1ZXVlSXRlbVNpemUAIAAEYmlnMAkAtgIBAAAACklOREVYX0xJU1QJAMwIAgAACQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUJAMwIAgAGCQDMCAIABwkAzAgCAAgJAMwIAgAJCQDMCAIACgkAzAgCAAsJAMwIAgAMCQDMCAIADQkAzAgCAA4JAMwIAgAPCQDMCAIAEAkAzAgC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IFDmZhY3RvcnlBZGRyZXNzBQlrTXVsdGlzaWcHBAckbWF0Y2gwCQCdCAIFDmZhY3RvcnlBZGRyZXNzBQlrTXVsdGlzaWcDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAhtdWx0aXNpZwUHJG1hdGNoMAQJc3RhdHVzS2V5CQEHa1N0YXR1cwIJAKUIAQUEdGhpcwkA2AQBCAUCdHgCaWQEBnN0YXR1cwkBC3ZhbHVlT3JFbHNlAgkAmwgCCQERQGV4dHJOYXRpdmUoMTA2MikBBQhtdWx0aXNpZwUJc3RhdHVzS2V5BwUGc3RhdHVzBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleZWY+XU=", "height": 3287404, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4JnZHetswEK2vsWqraSxe7r7vnkPPqWEAfEXWdgZV7kj Next: none Diff:
Old | New | Differences | |
---|---|---|---|
224 | 224 | func requestsQueue () = valueOrElse(getBinary(factoryAddress, kRequestsQueue()), base58'') | |
225 | 225 | ||
226 | 226 | ||
227 | - | func kAccountsQueue () = makeString(["%s", "accountsQueue"], separator) | |
228 | - | ||
229 | - | ||
230 | - | func accountsQueue () = valueOrElse(getBinary(factoryAddress, kAccountsQueue()), base58'') | |
231 | - | ||
232 | - | ||
233 | 227 | func kRequestsByOwner (ownerAddress) = makeString(["%s%s", "requests", toString(ownerAddress)], separator) | |
234 | 228 | ||
235 | 229 | ||
338 | 332 | ||
339 | 333 | ||
340 | 334 | func getAccountInfoInternal (accountAddress) = { | |
341 | - | let $ | |
342 | - | let amountAssetId = $ | |
343 | - | let priceAssetId = $ | |
335 | + | let $t01125511323 = getAccountAssets(accountAddress) | |
336 | + | let amountAssetId = $t01125511323._1 | |
337 | + | let priceAssetId = $t01125511323._2 | |
344 | 338 | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kLeverage(accountAddress)), wrapErr("leverage should be defined")) | |
345 | 339 | let requestId = getRequestId(accountAddress) | |
346 | 340 | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
447 | 441 | let priceAssetIdStr = args[1] | |
448 | 442 | let leverage = valueOrErrorMessage(parseInt(args[2]), wrapErr("invalid leverage")) | |
449 | 443 | let userAddress = addressFromPublicKey(callerPublicKey) | |
450 | - | let requestId = sha256( | |
444 | + | let requestId = sha256(i.transactionId) | |
451 | 445 | let amountAssetId = parseAssetId(amountAssetIdStr) | |
452 | 446 | let priceAssetId = parseAssetId(priceAssetIdStr) | |
453 | 447 | let userRequestsNumber = (size(kRequestsByOwner(userAddress)) / queueItemSize) | |
459 | 453 | then true | |
460 | 454 | else throwErr("invalid amount"), if (pairAllowed(amountAssetId, priceAssetId)) | |
461 | 455 | then true | |
462 | - | else throwErr("pair is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit)) | |
456 | + | else throwErr("pair is not allowed"), if ((leverage == 2)) | |
457 | + | then true | |
458 | + | else throwErr("leverage is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit)) | |
463 | 459 | then true | |
464 | 460 | else throwErr("account is already exists"), if ((accountsLimit() > userRequestsNumber)) | |
465 | 461 | then true | |
466 | 462 | else throwErr(("accounts limit is " + toString(accountsLimit())))] | |
467 | 463 | if ((checks == checks)) | |
468 | 464 | then { | |
469 | - | let $t01862820083 = $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil), invoke(factoryAddress, "integerEntry", [kRequestLeverage(requestId), leverage], nil)]) | |
470 | - | let actions = $t01862820083._1 | |
471 | - | let factoryActions = $t01862820083._2 | |
472 | - | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kRequestOwnerPublicKey(requestId), callerPublicKey], nil), invoke(factoryAddress, "binaryEntry", [kRequestsByOwner(userAddress), (requestsByOwner(userAddress) + requestId)], nil), invoke(factoryAddress, "stringEntry", [kRequestAmountAssetId(requestId), amountAssetIdStr], nil), invoke(factoryAddress, "stringEntry", [kRequestPriceAssetId(requestId), priceAssetIdStr], nil)])) | |
465 | + | let actions = [ScriptTransfer(factoryAddress, rewardAmount(), unit)] | |
466 | + | $Tuple2(actions, [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil), invoke(factoryAddress, "binaryEntry", [kRequestsByOwner(userAddress), (requestsByOwner(userAddress) + requestId)], nil), invoke(factoryAddress, "binaryEntry", [kRequestOwnerPublicKey(requestId), callerPublicKey], nil), invoke(factoryAddress, "stringEntry", [kRequestAmountAssetId(requestId), amountAssetIdStr], nil), invoke(factoryAddress, "stringEntry", [kRequestPriceAssetId(requestId), priceAssetIdStr], nil), invoke(factoryAddress, "integerEntry", [kRequestLeverage(requestId), leverage], nil)]) | |
473 | 467 | } | |
474 | 468 | else throw("Strict value is not equal to itself.") | |
475 | 469 | } | |
470 | + | else throw("Strict value is not equal to itself.") | |
471 | + | } | |
472 | + | ||
473 | + | ||
474 | + | ||
475 | + | @Callable(i) | |
476 | + | func editAccount (callerPublicKey,args) = { | |
477 | + | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
478 | + | let amountAssetIdStr = args[1] | |
479 | + | let priceAssetIdStr = args[2] | |
480 | + | let leverage = valueOrErrorMessage(parseInt(args[3]), wrapErr("invalid leverage")) | |
481 | + | let requestId = getRequestId(accountAddress) | |
482 | + | let ownerPublicKey = getAccountOwnerPublicKey(accountAddress) | |
483 | + | let amountAssetId = parseAssetId(amountAssetIdStr) | |
484 | + | let priceAssetId = parseAssetId(priceAssetIdStr) | |
485 | + | let checks = [if (!(shutdown)) | |
486 | + | then true | |
487 | + | else throwErr("not allowed"), mustFactory(i.caller), if ((callerPublicKey == ownerPublicKey)) | |
488 | + | then true | |
489 | + | else throwErr("caller is not an account owner"), if (pairAllowed(amountAssetId, priceAssetId)) | |
490 | + | then true | |
491 | + | else throwErr("pair is not allowed"), if ((leverage == 2)) | |
492 | + | then true | |
493 | + | else throwErr("leverage is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == REQUEST_STATUS_READY)) | |
494 | + | then true | |
495 | + | else throwErr("account is not ready")] | |
496 | + | if ((checks == checks)) | |
497 | + | then $Tuple2(nil, [invoke(factoryAddress, "stringEntry", [kRequestAmountAssetId(requestId), amountAssetIdStr], nil), invoke(factoryAddress, "stringEntry", [kRequestPriceAssetId(requestId), priceAssetIdStr], nil), invoke(factoryAddress, "integerEntry", [kRequestLeverage(requestId), leverage], nil)]) | |
476 | 498 | else throw("Strict value is not equal to itself.") | |
477 | 499 | } | |
478 | 500 | ||
501 | 523 | else throwErr("invalid script")] | |
502 | 524 | if ((checks == checks)) | |
503 | 525 | then { | |
504 | - | let $ | |
505 | - | then $Tuple2( | |
526 | + | let $t02126422409 = if ((size(requestsQueue()) == 0)) | |
527 | + | then $Tuple2(throwErr("requests queue is empty"), nil) | |
506 | 528 | else { | |
507 | 529 | let requestId = take(requestsQueue(), queueItemSize) | |
508 | 530 | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kRequestLeverage(requestId)), wrapErr("request's leverage is undefined")) | |
509 | 531 | $Tuple2(nil, [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_READY], nil), invoke(factoryAddress, "binaryEntry", [kRequestIdToAccountPublicKey(requestId), accountPublicKey], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), drop(requestsQueue(), queueItemSize)], nil), invoke(factoryAddress, "stringEntry", [kAccountAddressToRequestId(accountAddress), toBase58String(requestId)], nil), invoke(factoryAddress, "transferWaves", [creatorAddress.bytes, rewardAmount()], nil), invoke(factoryAddress, "integerEntry", [kLeverage(accountAddress), leverage], nil)]) | |
510 | 532 | } | |
511 | - | let actions = $ | |
512 | - | let factoryActions = $ | |
533 | + | let actions = $t02126422409._1 | |
534 | + | let factoryActions = $t02126422409._2 | |
513 | 535 | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)])) | |
514 | 536 | } | |
515 | 537 | else throw("Strict value is not equal to itself.") | |
540 | 562 | ||
541 | 563 | @Callable(i) | |
542 | 564 | func deposit (callerPublicKey,args) = { | |
543 | - | let $ | |
544 | - | let actions = $ | |
545 | - | let factoryActions = $ | |
565 | + | let $t02343023503 = depositINTERNAL(callerPublicKey, args, i) | |
566 | + | let actions = $t02343023503._1 | |
567 | + | let factoryActions = $t02343023503._2 | |
546 | 568 | $Tuple2(actions, factoryActions) | |
547 | 569 | } | |
548 | 570 | ||
550 | 572 | ||
551 | 573 | @Callable(i) | |
552 | 574 | func borrow (callerPublicKey,args) = { | |
553 | - | let $ | |
554 | - | let actions = $ | |
555 | - | let factoryActions = $ | |
575 | + | let $t02365823730 = borrowINTERNAL(callerPublicKey, args, i) | |
576 | + | let actions = $t02365823730._1 | |
577 | + | let factoryActions = $t02365823730._2 | |
556 | 578 | $Tuple2(actions, factoryActions) | |
557 | 579 | } | |
558 | 580 | ||
561 | 583 | @Callable(i) | |
562 | 584 | func depositAndBorrow (callerPublicKey,args) = { | |
563 | 585 | let accountAddress = args[0] | |
564 | - | let $ | |
565 | - | let depositActions = $ | |
566 | - | let depositFactoryActions = $ | |
567 | - | let $ | |
568 | - | let borrowActions = $ | |
569 | - | let borrowFactoryActions = $ | |
586 | + | let $t02392624025 = depositINTERNAL(callerPublicKey, [accountAddress], i) | |
587 | + | let depositActions = $t02392624025._1 | |
588 | + | let depositFactoryActions = $t02392624025._2 | |
589 | + | let $t02402824112 = borrowINTERNAL(callerPublicKey, args, i) | |
590 | + | let borrowActions = $t02402824112._1 | |
591 | + | let borrowFactoryActions = $t02402824112._2 | |
570 | 592 | $Tuple2((depositActions ++ borrowActions), (depositFactoryActions ++ borrowFactoryActions)) | |
571 | 593 | } | |
572 | 594 | ||
662 | 684 | let userRequests = valueOrElse(getBinary(factoryAddress, kRequestsByOwner(userAddress)), base58'') | |
663 | 685 | let userRequestsNumber = (size(userRequests) / queueItemSize) | |
664 | 686 | func getAccountsData (acc,count) = { | |
665 | - | let $ | |
666 | - | let accDataList = $ | |
667 | - | let rawBytes = $ | |
668 | - | let maxSize = $ | |
687 | + | let $t02704527087 = acc | |
688 | + | let accDataList = $t02704527087._1 | |
689 | + | let rawBytes = $t02704527087._2 | |
690 | + | let maxSize = $t02704527087._3 | |
669 | 691 | if ((maxSize > count)) | |
670 | 692 | then { | |
671 | 693 | let requestId = take(rawBytes, queueItemSize) | |
678 | 700 | else acc | |
679 | 701 | } | |
680 | 702 | ||
681 | - | let $ | |
703 | + | let $t02759127696 = { | |
682 | 704 | let $l = INDEX_LIST | |
683 | 705 | let $s = size($l) | |
684 | 706 | let $acc0 = $Tuple3(nil, userRequests, userRequestsNumber) | |
692 | 714 | ||
693 | 715 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
694 | 716 | } | |
695 | - | let accDataList = $ | |
696 | - | let _a = $ | |
697 | - | let _b = $ | |
717 | + | let accDataList = $t02759127696._1 | |
718 | + | let _a = $t02759127696._2 | |
719 | + | let _b = $t02759127696._3 | |
698 | 720 | $Tuple2(nil, accDataList) | |
699 | 721 | } | |
700 | 722 | else throw("Strict value is not equal to itself.") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let chainId = take(drop(this.bytes, 1), 1) | |
7 | 7 | ||
8 | 8 | let chainIdW = base58'2W' | |
9 | 9 | ||
10 | 10 | let contractFilename = "futures_calculator.ride" | |
11 | 11 | ||
12 | 12 | let mult8 = 100000000 | |
13 | 13 | ||
14 | 14 | let mult18BigInt = toBigInt(1000000000000000000) | |
15 | 15 | ||
16 | 16 | let wavesDecimals = 8 | |
17 | 17 | ||
18 | 18 | let usdtDecimals = 6 | |
19 | 19 | ||
20 | 20 | let wavesString = "WAVES" | |
21 | 21 | ||
22 | 22 | let queueItemSize = 32 | |
23 | 23 | ||
24 | 24 | let big0 = toBigInt(0) | |
25 | 25 | ||
26 | 26 | let INDEX_LIST = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
27 | 27 | ||
28 | 28 | let kMultisig = "%s__multisig" | |
29 | 29 | ||
30 | 30 | func kStatus (dapp,txId) = makeString(["%s__status", dapp, txId], separator) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | let kShutdown = "%s__shutdown" | |
34 | 34 | ||
35 | 35 | let kPublicKeys = "%s__publicKeys" | |
36 | 36 | ||
37 | 37 | let kMatcherPublicKey = "%s__matcherPublicKey" | |
38 | 38 | ||
39 | 39 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), mult18BigInt, toBigInt(origScaleMult)) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), mult18BigInt)) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func validateAddress (address) = isDefined(addressFromString(address)) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func throwErr (s) = throw(wrapErr(s)) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func ensurePositive (v,s) = if ((v >= 0)) | |
55 | 55 | then v | |
56 | 56 | else throwErr((s + " value should be positive")) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func parseAssetId (input) = if ((input == wavesString)) | |
60 | 60 | then unit | |
61 | 61 | else fromBase58String(input) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func assetIdToString (input) = if ((input == unit)) | |
65 | 65 | then wavesString | |
66 | 66 | else toBase58String(value(input)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getAssetInfoOrFail (assetId) = valueOrErrorMessage(assetInfo(assetId), wrapErr("invalid asset info")) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func getAssetDecimalsOrFail (assetId) = match assetId { | |
73 | 73 | case _: Unit => | |
74 | 74 | wavesDecimals | |
75 | 75 | case assetId: ByteVector => | |
76 | 76 | getAssetInfoOrFail(assetId).decimals | |
77 | 77 | case _ => | |
78 | 78 | throw("Match error") | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getAssetBalance (assetId,address) = match assetId { | |
83 | 83 | case _: Unit => | |
84 | 84 | wavesBalance(address).available | |
85 | 85 | case assetId: ByteVector => | |
86 | 86 | assetBalance(address, assetId) | |
87 | 87 | case _ => | |
88 | 88 | throw("Match error") | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func pow10 (n) = pow(10, 0, n, 0, 0, DOWN) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func pow10Decimals (assetId) = pow10(getAssetDecimalsOrFail(assetId)) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | let kFactoryAddress = "%s__factoryAddress" | |
99 | 99 | ||
100 | 100 | let factoryAddressOption = match getString(this, kFactoryAddress) { | |
101 | 101 | case s: String => | |
102 | 102 | addressFromString(s) | |
103 | 103 | case _: Unit => | |
104 | 104 | unit | |
105 | 105 | case _ => | |
106 | 106 | throw("Match error") | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address")) | |
110 | 110 | ||
111 | 111 | let kUsdtAssetId = "%s__usdtAssetId" | |
112 | 112 | ||
113 | 113 | let usdtAssetIdOption = match getString(factoryAddress, kUsdtAssetId) { | |
114 | 114 | case s: String => | |
115 | 115 | parseAssetId(s) | |
116 | 116 | case _: Unit => | |
117 | 117 | unit | |
118 | 118 | case _ => | |
119 | 119 | throw("Match error") | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | let usdtAssetId = valueOrErrorMessage(usdtAssetIdOption, wrapErr("invalid usdt asset id")) | |
123 | 123 | ||
124 | 124 | let kPricesAddress = "%s__calculatorAddress" | |
125 | 125 | ||
126 | 126 | let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false) | |
127 | 127 | ||
128 | 128 | func mustAddress (caller,address) = if ((caller == address)) | |
129 | 129 | then true | |
130 | 130 | else throwErr("permission denied") | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func mustThis (caller) = mustAddress(caller, this) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func mustFactory (caller) = mustAddress(caller, factoryAddress) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func mustAdmin (callerPublicKey) = { | |
140 | 140 | let multisigAddressString = getString(factoryAddress, kMultisig) | |
141 | 141 | let isAdmin = match multisigAddressString { | |
142 | 142 | case addressString: String => | |
143 | 143 | let multisig = addressFromStringValue(addressString) | |
144 | 144 | let publicKeysList = split(getStringValue(multisig, kPublicKeys), separator) | |
145 | 145 | containsElement(publicKeysList, toBase58String(callerPublicKey)) | |
146 | 146 | case _ => | |
147 | 147 | (addressFromPublicKey(callerPublicKey) == factoryAddress) | |
148 | 148 | } | |
149 | 149 | if (isAdmin) | |
150 | 150 | then true | |
151 | 151 | else throwErr("not allowed") | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | let kAccountScript = "%s__accountScript" | |
156 | 156 | ||
157 | 157 | func accountScript () = valueOrErrorMessage(getBinary(factoryAddress, kAccountScript), wrapErr("account script is not set")) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | let kRewardAmount = "%s__rewardAmount" | |
161 | 161 | ||
162 | 162 | func rewardAmount () = valueOrErrorMessage(getInteger(factoryAddress, kRewardAmount), wrapErr("reward amount is not set")) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | let kAccountsLimit = "%s__accountsLimit" | |
166 | 166 | ||
167 | 167 | let accountsLimitDefault = 20 | |
168 | 168 | ||
169 | 169 | func accountsLimit () = valueOrElse(getInteger(factoryAddress, kAccountsLimit), accountsLimitDefault) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func kDeposited (accountAddress) = makeString(["%s%s", "deposited", toString(accountAddress)], separator) | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func depositedOption (accountAddress) = getInteger(factoryAddress, kDeposited(accountAddress)) | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func kCredit (accountAddress,assetId) = makeString(["%s%s%s", "credit", toString(accountAddress), assetIdToString(assetId)], separator) | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func creditOption (accountAddress,assetId) = getInteger(factoryAddress, kCredit(accountAddress, assetId)) | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func kLeverage (accountAddress) = makeString(["%s%s", "leverage", toString(accountAddress)], separator) | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func kRequestLeverage (requestId) = makeString(["%s%s", "requestLeverage", toBase58String(requestId)], separator) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func kSyntheticAssetId (baseAssetId) = makeString(["%s%s", "syntheticAssetId", assetIdToString(baseAssetId)], separator) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func kBaseAssetId (syntheticAssetId) = makeString(["%s%s", "baseAssetId", assetIdToString(syntheticAssetId)], separator) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | let REQUEST_STATUS_EMPTY = 0 | |
197 | 197 | ||
198 | 198 | let REQUEST_STATUS_READY = 1 | |
199 | 199 | ||
200 | 200 | func kRequestStatus (requestId) = makeString(["%s%s", toBase58String(requestId), "status"], separator) | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func kAccountCreatorPublicKey (accountAddress) = makeString(["%s%s", toString(accountAddress), "creatorPublicKey"], separator) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func kRequestOwnerPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "ownerPublicKey"], separator) | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func kRequestAmountAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "amountAssetId"], separator) | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func kRequestPriceAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "priceAssetId"], separator) | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func kRequestIdToAccountPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "requestIdToAccountPublicKey"], separator) | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator) | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | func kRequestsQueue () = makeString(["%s", "requestsQueue"], separator) | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | func requestsQueue () = valueOrElse(getBinary(factoryAddress, kRequestsQueue()), base58'') | |
225 | 225 | ||
226 | 226 | ||
227 | - | func kAccountsQueue () = makeString(["%s", "accountsQueue"], separator) | |
228 | - | ||
229 | - | ||
230 | - | func accountsQueue () = valueOrElse(getBinary(factoryAddress, kAccountsQueue()), base58'') | |
231 | - | ||
232 | - | ||
233 | 227 | func kRequestsByOwner (ownerAddress) = makeString(["%s%s", "requests", toString(ownerAddress)], separator) | |
234 | 228 | ||
235 | 229 | ||
236 | 230 | func requestsByOwner (ownerAddress) = valueOrElse(getBinary(factoryAddress, kRequestsByOwner(ownerAddress)), base58'') | |
237 | 231 | ||
238 | 232 | ||
239 | 233 | func kPairAllowed (amountAssetId,priceAssetId) = makeString(["%s%s%s", assetIdToString(amountAssetId), assetIdToString(priceAssetId), "pairAllowed"], separator) | |
240 | 234 | ||
241 | 235 | ||
242 | 236 | func pairAllowed (amountAssetId,priceAssetId) = valueOrElse(getBoolean(factoryAddress, kPairAllowed(amountAssetId, priceAssetId)), false) | |
243 | 237 | ||
244 | 238 | ||
245 | 239 | func kPrice (assetId) = makeString(["%s", assetIdToString(assetId)], separator) | |
246 | 240 | ||
247 | 241 | ||
248 | 242 | func kPairPricesListKey (amountAssetId,priceAssetId) = makeString(["%s%s%s", assetIdToString(amountAssetId), assetIdToString(priceAssetId), "pairSettingPrices"], separator) | |
249 | 243 | ||
250 | 244 | ||
251 | 245 | func getPairPricesList (amountAssetId,priceAssetId) = match getString(factoryAddress, kPairPricesListKey(amountAssetId, priceAssetId)) { | |
252 | 246 | case s: String => | |
253 | 247 | split(s, separator) | |
254 | 248 | case _ => | |
255 | 249 | nil | |
256 | 250 | } | |
257 | 251 | ||
258 | 252 | ||
259 | 253 | func kPairSettingsKey (amountAssetId,priceAssetId,priceString) = makeString(["%s%s%d%s", assetIdToString(amountAssetId), assetIdToString(priceAssetId), priceString, "settings"], separator) | |
260 | 254 | ||
261 | 255 | ||
262 | 256 | func getCurrentPrice (assetId) = { | |
263 | 257 | let matcherPublicKey = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kMatcherPublicKey), wrapErr("invalid matcher public key"))) | |
264 | 258 | let matcherAddress = addressFromPublicKey(matcherPublicKey) | |
265 | 259 | let price = valueOrErrorMessage(getInteger(matcherAddress, kPrice(assetId)), wrapErr(("invalid price, assetId = " + assetIdToString(assetId)))) | |
266 | 260 | price | |
267 | 261 | } | |
268 | 262 | ||
269 | 263 | ||
270 | 264 | func calcTotalCredit (creditA,creditB,currentPrice) = (fraction(creditA, currentPrice, mult18BigInt) + creditB) | |
271 | 265 | ||
272 | 266 | ||
273 | 267 | func calcTotalBalance (balanceA,balanceB,currentPrice) = (fraction(balanceA, currentPrice, mult18BigInt) + balanceB) | |
274 | 268 | ||
275 | 269 | ||
276 | 270 | func calcPnl (totalBalance,totalCredit) = (totalBalance - totalCredit) | |
277 | 271 | ||
278 | 272 | ||
279 | 273 | func calcCreditAvailable (deposit,leverage,totalCredit) = (fraction(deposit, leverage, mult18BigInt) - totalCredit) | |
280 | 274 | ||
281 | 275 | ||
282 | 276 | func calcRealInCredit (credit,balance) = if ((credit > big0)) | |
283 | 277 | then (credit - balance) | |
284 | 278 | else big0 | |
285 | 279 | ||
286 | 280 | ||
287 | 281 | func calcFree (credit,balance) = if ((credit > big0)) | |
288 | 282 | then (balance - credit) | |
289 | 283 | else big0 | |
290 | 284 | ||
291 | 285 | ||
292 | 286 | func calcShortPrice (free,realInCredit) = if ((realInCredit > big0)) | |
293 | 287 | then max([big0, fraction(free, mult18BigInt, realInCredit)]) | |
294 | 288 | else big0 | |
295 | 289 | ||
296 | 290 | ||
297 | 291 | func calcLongPrice (free,realInCredit) = if ((realInCredit > big0)) | |
298 | 292 | then max([big0, fraction(realInCredit, mult18BigInt, free)]) | |
299 | 293 | else big0 | |
300 | 294 | ||
301 | 295 | ||
302 | 296 | func calcStartMargin (realInCreditA,realInCreditB,currentPrice,settingsMargin) = fraction((fraction(realInCreditA, currentPrice, mult18BigInt) + realInCreditB), settingsMargin, mult18BigInt) | |
303 | 297 | ||
304 | 298 | ||
305 | 299 | func calcMarginSupply (settingsMarginSupply,settingsMargin,startMargin) = fraction(settingsMarginSupply, startMargin, settingsMargin) | |
306 | 300 | ||
307 | 301 | ||
308 | 302 | func calcLiquidationPrice (deposit,marginSupply,realInCreditA,realInCreditB,shortPrice,longPrice) = { | |
309 | 303 | let liquidationPriceA = if ((realInCreditA > big0)) | |
310 | 304 | then (((deposit - marginSupply) / realInCreditA) + shortPrice) | |
311 | 305 | else big0 | |
312 | 306 | let liquidationPriceB = if ((realInCreditB > big0)) | |
313 | 307 | then (longPrice - ((deposit - marginSupply) / (realInCreditA / longPrice))) | |
314 | 308 | else big0 | |
315 | 309 | (liquidationPriceA + liquidationPriceB) | |
316 | 310 | } | |
317 | 311 | ||
318 | 312 | ||
319 | 313 | func getRequestId (accountAddress) = { | |
320 | 314 | let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined"))) | |
321 | 315 | requestId | |
322 | 316 | } | |
323 | 317 | ||
324 | 318 | ||
325 | 319 | func getAccountAssets (accountAddress) = { | |
326 | 320 | let requestId = getRequestId(accountAddress) | |
327 | 321 | let amountAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestAmountAssetId(requestId)), wrapErr("invalid amount asset id"))) | |
328 | 322 | let priceAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestPriceAssetId(requestId)), wrapErr("invalid amount price id"))) | |
329 | 323 | $Tuple2(amountAssetId, priceAssetId) | |
330 | 324 | } | |
331 | 325 | ||
332 | 326 | ||
333 | 327 | func getAccountOwnerPublicKey (accountAddress) = { | |
334 | 328 | let requestId = getRequestId(accountAddress) | |
335 | 329 | let requestOwnerPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestOwnerPublicKey(requestId)), wrapErr("invalid amount asset id")) | |
336 | 330 | requestOwnerPublicKey | |
337 | 331 | } | |
338 | 332 | ||
339 | 333 | ||
340 | 334 | func getAccountInfoInternal (accountAddress) = { | |
341 | - | let $ | |
342 | - | let amountAssetId = $ | |
343 | - | let priceAssetId = $ | |
335 | + | let $t01125511323 = getAccountAssets(accountAddress) | |
336 | + | let amountAssetId = $t01125511323._1 | |
337 | + | let priceAssetId = $t01125511323._2 | |
344 | 338 | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kLeverage(accountAddress)), wrapErr("leverage should be defined")) | |
345 | 339 | let requestId = getRequestId(accountAddress) | |
346 | 340 | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
347 | 341 | let deposited = valueOrElse(depositedOption(accountAddress), 0) | |
348 | 342 | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(priceAssetId)) | |
349 | 343 | let creditA = valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0) | |
350 | 344 | let creditB = valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, priceAssetId)), 0) | |
351 | 345 | let status = valueOrErrorMessage(getInteger(factoryAddress, kRequestStatus(requestId)), ("status not found. RequestId = " + toBase58String(requestId))) | |
352 | 346 | let synthAmountAssetId = getString(factoryAddress, kSyntheticAssetId(amountAssetId)) | |
353 | 347 | let synthAmountAssetBalance = match synthAmountAssetId { | |
354 | 348 | case s: String => | |
355 | 349 | getAssetBalance(parseAssetId(s), accountAddress) | |
356 | 350 | case _ => | |
357 | 351 | 0 | |
358 | 352 | } | |
359 | 353 | let synthPriceAssetId = getString(factoryAddress, kSyntheticAssetId(priceAssetId)) | |
360 | 354 | let synthPriceAssetBalance = match synthPriceAssetId { | |
361 | 355 | case s: String => | |
362 | 356 | getAssetBalance(parseAssetId(s), accountAddress) | |
363 | 357 | case _ => | |
364 | 358 | 0 | |
365 | 359 | } | |
366 | 360 | $Tuple12(assetIdToString(amountAssetId), assetIdToString(priceAssetId), toString(accountAddress), toBase58String(accountPublicKey), leverage, toBase58String(requestId), deposited, creditA, creditB, synthAmountAssetBalance, synthPriceAssetBalance, status) | |
367 | 361 | } | |
368 | 362 | ||
369 | 363 | ||
370 | 364 | func depositINTERNAL (callerPublicKey,args,i) = { | |
371 | 365 | let payment = i.payments[0] | |
372 | 366 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
373 | 367 | let ckecks = [if (!(shutdown)) | |
374 | 368 | then true | |
375 | 369 | else throwErr("not allowed"), mustFactory(i.caller), if ((size(i.payments) == 1)) | |
376 | 370 | then true | |
377 | 371 | else throwErr("1 payment is required"), if ((payment.assetId == usdtAssetId)) | |
378 | 372 | then true | |
379 | 373 | else throwErr("invalid asset"), if ((getInteger(factoryAddress, kRequestStatus(getRequestId(accountAddress))) == REQUEST_STATUS_READY)) | |
380 | 374 | then true | |
381 | 375 | else throwErr("account is not ready")] | |
382 | 376 | if ((ckecks == ckecks)) | |
383 | 377 | then { | |
384 | 378 | let actions = [ScriptTransfer(accountAddress, payment.amount, payment.assetId)] | |
385 | 379 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kDeposited(accountAddress), (valueOrElse(depositedOption(accountAddress), 0) + payment.amount)], nil)] | |
386 | 380 | $Tuple2(actions, factoryActions) | |
387 | 381 | } | |
388 | 382 | else throw("Strict value is not equal to itself.") | |
389 | 383 | } | |
390 | 384 | ||
391 | 385 | ||
392 | 386 | func borrowINTERNAL (callerPublicKey,args,i) = { | |
393 | 387 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
394 | 388 | let assetIdRequested = parseAssetId(args[1]) | |
395 | 389 | let amountRequested = ensurePositive(valueOrErrorMessage(parseInt(args[2]), wrapErr("invalid requested amount")), "requested amount") | |
396 | 390 | let accountOwnerPublicKey = getAccountOwnerPublicKey(accountAddress) | |
397 | 391 | let userAddress = addressFromPublicKey(callerPublicKey) | |
398 | 392 | let ckecks = [if (!(shutdown)) | |
399 | 393 | then true | |
400 | 394 | else throwErr("not allowed"), mustFactory(i.caller), if ((callerPublicKey == accountOwnerPublicKey)) | |
401 | 395 | then true | |
402 | 396 | else throwErr("can be called by account owner only")] | |
403 | 397 | if ((ckecks == ckecks)) | |
404 | 398 | then { | |
405 | 399 | let amountAssetId = getAccountAssets(accountAddress)._1 | |
406 | 400 | let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(usdtAssetId)) | |
407 | 401 | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(usdtAssetId)) | |
408 | 402 | let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId)) | |
409 | 403 | let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, usdtAssetId)), 0), pow10Decimals(usdtAssetId)) | |
410 | 404 | let totalCredit = calcTotalCredit(creditA, creditB, currentPrice) | |
411 | 405 | let leverage = toX18(valueOrErrorMessage(getInteger(factoryAddress, kLeverage(accountAddress)), wrapErr("leverage should be defined")), 1) | |
412 | 406 | let creditAvailableUsdt = calcCreditAvailable(deposited, leverage, totalCredit) | |
413 | 407 | let creditAvailable = if ((assetIdRequested == amountAssetId)) | |
414 | 408 | then fromX18(fraction(creditAvailableUsdt, mult18BigInt, currentPrice), pow10Decimals(amountAssetId)) | |
415 | 409 | else if ((assetIdRequested == usdtAssetId)) | |
416 | 410 | then fromX18(creditAvailableUsdt, pow10Decimals(usdtAssetId)) | |
417 | 411 | else throwErr("invalid requested asset id") | |
418 | 412 | let syntheticAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kSyntheticAssetId(assetIdRequested)), wrapErr("synthetic asset for requested asset is undefined"))) | |
419 | 413 | let amountToSend = if ((creditAvailable >= amountRequested)) | |
420 | 414 | then amountRequested | |
421 | 415 | else throwErr(("credit available = " + toString(creditAvailable))) | |
422 | 416 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kCredit(accountAddress, assetIdRequested), (valueOrElse(creditOption(accountAddress, assetIdRequested), 0) + amountToSend)], nil), invoke(factoryAddress, "transferAsset", [accountAddress.bytes, amountToSend, syntheticAssetId], nil)] | |
423 | 417 | $Tuple2(nil, [factoryActions, creditAvailable]) | |
424 | 418 | } | |
425 | 419 | else throw("Strict value is not equal to itself.") | |
426 | 420 | } | |
427 | 421 | ||
428 | 422 | ||
429 | 423 | @Callable(i) | |
430 | 424 | func init (factoryAddressStr) = { | |
431 | 425 | let checkCaller = mustThis(i.caller) | |
432 | 426 | if ((checkCaller == checkCaller)) | |
433 | 427 | then $Tuple2([StringEntry(kFactoryAddress, factoryAddressStr)], unit) | |
434 | 428 | else throw("Strict value is not equal to itself.") | |
435 | 429 | } | |
436 | 430 | ||
437 | 431 | ||
438 | 432 | ||
439 | 433 | @Callable(i) | |
440 | 434 | func requestAccount (callerPublicKey,args) = { | |
441 | 435 | let ckecks = [if (!(shutdown)) | |
442 | 436 | then true | |
443 | 437 | else throwErr("not allowed"), mustFactory(i.caller)] | |
444 | 438 | if ((ckecks == ckecks)) | |
445 | 439 | then { | |
446 | 440 | let amountAssetIdStr = args[0] | |
447 | 441 | let priceAssetIdStr = args[1] | |
448 | 442 | let leverage = valueOrErrorMessage(parseInt(args[2]), wrapErr("invalid leverage")) | |
449 | 443 | let userAddress = addressFromPublicKey(callerPublicKey) | |
450 | - | let requestId = sha256( | |
444 | + | let requestId = sha256(i.transactionId) | |
451 | 445 | let amountAssetId = parseAssetId(amountAssetIdStr) | |
452 | 446 | let priceAssetId = parseAssetId(priceAssetIdStr) | |
453 | 447 | let userRequestsNumber = (size(kRequestsByOwner(userAddress)) / queueItemSize) | |
454 | 448 | let checks = [if ((size(i.payments) == 1)) | |
455 | 449 | then true | |
456 | 450 | else throwErr("1 payment is required"), if ((i.payments[0].assetId == unit)) | |
457 | 451 | then true | |
458 | 452 | else throwErr("invalid asset"), if ((i.payments[0].amount == rewardAmount())) | |
459 | 453 | then true | |
460 | 454 | else throwErr("invalid amount"), if (pairAllowed(amountAssetId, priceAssetId)) | |
461 | 455 | then true | |
462 | - | else throwErr("pair is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit)) | |
456 | + | else throwErr("pair is not allowed"), if ((leverage == 2)) | |
457 | + | then true | |
458 | + | else throwErr("leverage is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit)) | |
463 | 459 | then true | |
464 | 460 | else throwErr("account is already exists"), if ((accountsLimit() > userRequestsNumber)) | |
465 | 461 | then true | |
466 | 462 | else throwErr(("accounts limit is " + toString(accountsLimit())))] | |
467 | 463 | if ((checks == checks)) | |
468 | 464 | then { | |
469 | - | let $t01862820083 = $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil), invoke(factoryAddress, "integerEntry", [kRequestLeverage(requestId), leverage], nil)]) | |
470 | - | let actions = $t01862820083._1 | |
471 | - | let factoryActions = $t01862820083._2 | |
472 | - | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kRequestOwnerPublicKey(requestId), callerPublicKey], nil), invoke(factoryAddress, "binaryEntry", [kRequestsByOwner(userAddress), (requestsByOwner(userAddress) + requestId)], nil), invoke(factoryAddress, "stringEntry", [kRequestAmountAssetId(requestId), amountAssetIdStr], nil), invoke(factoryAddress, "stringEntry", [kRequestPriceAssetId(requestId), priceAssetIdStr], nil)])) | |
465 | + | let actions = [ScriptTransfer(factoryAddress, rewardAmount(), unit)] | |
466 | + | $Tuple2(actions, [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil), invoke(factoryAddress, "binaryEntry", [kRequestsByOwner(userAddress), (requestsByOwner(userAddress) + requestId)], nil), invoke(factoryAddress, "binaryEntry", [kRequestOwnerPublicKey(requestId), callerPublicKey], nil), invoke(factoryAddress, "stringEntry", [kRequestAmountAssetId(requestId), amountAssetIdStr], nil), invoke(factoryAddress, "stringEntry", [kRequestPriceAssetId(requestId), priceAssetIdStr], nil), invoke(factoryAddress, "integerEntry", [kRequestLeverage(requestId), leverage], nil)]) | |
473 | 467 | } | |
474 | 468 | else throw("Strict value is not equal to itself.") | |
475 | 469 | } | |
470 | + | else throw("Strict value is not equal to itself.") | |
471 | + | } | |
472 | + | ||
473 | + | ||
474 | + | ||
475 | + | @Callable(i) | |
476 | + | func editAccount (callerPublicKey,args) = { | |
477 | + | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
478 | + | let amountAssetIdStr = args[1] | |
479 | + | let priceAssetIdStr = args[2] | |
480 | + | let leverage = valueOrErrorMessage(parseInt(args[3]), wrapErr("invalid leverage")) | |
481 | + | let requestId = getRequestId(accountAddress) | |
482 | + | let ownerPublicKey = getAccountOwnerPublicKey(accountAddress) | |
483 | + | let amountAssetId = parseAssetId(amountAssetIdStr) | |
484 | + | let priceAssetId = parseAssetId(priceAssetIdStr) | |
485 | + | let checks = [if (!(shutdown)) | |
486 | + | then true | |
487 | + | else throwErr("not allowed"), mustFactory(i.caller), if ((callerPublicKey == ownerPublicKey)) | |
488 | + | then true | |
489 | + | else throwErr("caller is not an account owner"), if (pairAllowed(amountAssetId, priceAssetId)) | |
490 | + | then true | |
491 | + | else throwErr("pair is not allowed"), if ((leverage == 2)) | |
492 | + | then true | |
493 | + | else throwErr("leverage is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == REQUEST_STATUS_READY)) | |
494 | + | then true | |
495 | + | else throwErr("account is not ready")] | |
496 | + | if ((checks == checks)) | |
497 | + | then $Tuple2(nil, [invoke(factoryAddress, "stringEntry", [kRequestAmountAssetId(requestId), amountAssetIdStr], nil), invoke(factoryAddress, "stringEntry", [kRequestPriceAssetId(requestId), priceAssetIdStr], nil), invoke(factoryAddress, "integerEntry", [kRequestLeverage(requestId), leverage], nil)]) | |
476 | 498 | else throw("Strict value is not equal to itself.") | |
477 | 499 | } | |
478 | 500 | ||
479 | 501 | ||
480 | 502 | ||
481 | 503 | @Callable(i) | |
482 | 504 | func addAccount (callerPublicKey,args) = { | |
483 | 505 | let ckecks = [if (!(shutdown)) | |
484 | 506 | then true | |
485 | 507 | else throwErr("not allowed"), mustFactory(i.caller)] | |
486 | 508 | if ((ckecks == ckecks)) | |
487 | 509 | then { | |
488 | 510 | let creatorPublicKey = fromBase58String(args[0]) | |
489 | 511 | let accountPublicKey = callerPublicKey | |
490 | 512 | let accountAddress = addressFromPublicKey(callerPublicKey) | |
491 | 513 | let creatorAddress = addressFromPublicKey(creatorPublicKey) | |
492 | 514 | let checks = [if ((getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)) == unit)) | |
493 | 515 | then true | |
494 | 516 | else throwErr("account is already exists"), if ( match scriptHash(accountAddress) { | |
495 | 517 | case b: ByteVector => | |
496 | 518 | (b == blake2b256_32Kb(accountScript())) | |
497 | 519 | case _ => | |
498 | 520 | false | |
499 | 521 | }) | |
500 | 522 | then true | |
501 | 523 | else throwErr("invalid script")] | |
502 | 524 | if ((checks == checks)) | |
503 | 525 | then { | |
504 | - | let $ | |
505 | - | then $Tuple2( | |
526 | + | let $t02126422409 = if ((size(requestsQueue()) == 0)) | |
527 | + | then $Tuple2(throwErr("requests queue is empty"), nil) | |
506 | 528 | else { | |
507 | 529 | let requestId = take(requestsQueue(), queueItemSize) | |
508 | 530 | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kRequestLeverage(requestId)), wrapErr("request's leverage is undefined")) | |
509 | 531 | $Tuple2(nil, [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_READY], nil), invoke(factoryAddress, "binaryEntry", [kRequestIdToAccountPublicKey(requestId), accountPublicKey], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), drop(requestsQueue(), queueItemSize)], nil), invoke(factoryAddress, "stringEntry", [kAccountAddressToRequestId(accountAddress), toBase58String(requestId)], nil), invoke(factoryAddress, "transferWaves", [creatorAddress.bytes, rewardAmount()], nil), invoke(factoryAddress, "integerEntry", [kLeverage(accountAddress), leverage], nil)]) | |
510 | 532 | } | |
511 | - | let actions = $ | |
512 | - | let factoryActions = $ | |
533 | + | let actions = $t02126422409._1 | |
534 | + | let factoryActions = $t02126422409._2 | |
513 | 535 | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)])) | |
514 | 536 | } | |
515 | 537 | else throw("Strict value is not equal to itself.") | |
516 | 538 | } | |
517 | 539 | else throw("Strict value is not equal to itself.") | |
518 | 540 | } | |
519 | 541 | ||
520 | 542 | ||
521 | 543 | ||
522 | 544 | @Callable(i) | |
523 | 545 | func withdraw (callerPublicKey,args) = { | |
524 | 546 | let checks = [if (!(shutdown)) | |
525 | 547 | then true | |
526 | 548 | else throwErr("not allowed"), mustFactory(i.caller)] | |
527 | 549 | if ((checks == checks)) | |
528 | 550 | then { | |
529 | 551 | let userAddress = addressFromPublicKey(callerPublicKey) | |
530 | 552 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
531 | 553 | let amount = valueOrErrorMessage(parseInt(args[1]), wrapErr("invalid amount")) | |
532 | 554 | let assetId = parseAssetId(args[2]) | |
533 | 555 | let invocations = [invoke(accountAddress, "transferAsset", [userAddress.bytes, amount, assetId], nil)] | |
534 | 556 | $Tuple2(nil, invocations) | |
535 | 557 | } | |
536 | 558 | else throw("Strict value is not equal to itself.") | |
537 | 559 | } | |
538 | 560 | ||
539 | 561 | ||
540 | 562 | ||
541 | 563 | @Callable(i) | |
542 | 564 | func deposit (callerPublicKey,args) = { | |
543 | - | let $ | |
544 | - | let actions = $ | |
545 | - | let factoryActions = $ | |
565 | + | let $t02343023503 = depositINTERNAL(callerPublicKey, args, i) | |
566 | + | let actions = $t02343023503._1 | |
567 | + | let factoryActions = $t02343023503._2 | |
546 | 568 | $Tuple2(actions, factoryActions) | |
547 | 569 | } | |
548 | 570 | ||
549 | 571 | ||
550 | 572 | ||
551 | 573 | @Callable(i) | |
552 | 574 | func borrow (callerPublicKey,args) = { | |
553 | - | let $ | |
554 | - | let actions = $ | |
555 | - | let factoryActions = $ | |
575 | + | let $t02365823730 = borrowINTERNAL(callerPublicKey, args, i) | |
576 | + | let actions = $t02365823730._1 | |
577 | + | let factoryActions = $t02365823730._2 | |
556 | 578 | $Tuple2(actions, factoryActions) | |
557 | 579 | } | |
558 | 580 | ||
559 | 581 | ||
560 | 582 | ||
561 | 583 | @Callable(i) | |
562 | 584 | func depositAndBorrow (callerPublicKey,args) = { | |
563 | 585 | let accountAddress = args[0] | |
564 | - | let $ | |
565 | - | let depositActions = $ | |
566 | - | let depositFactoryActions = $ | |
567 | - | let $ | |
568 | - | let borrowActions = $ | |
569 | - | let borrowFactoryActions = $ | |
586 | + | let $t02392624025 = depositINTERNAL(callerPublicKey, [accountAddress], i) | |
587 | + | let depositActions = $t02392624025._1 | |
588 | + | let depositFactoryActions = $t02392624025._2 | |
589 | + | let $t02402824112 = borrowINTERNAL(callerPublicKey, args, i) | |
590 | + | let borrowActions = $t02402824112._1 | |
591 | + | let borrowFactoryActions = $t02402824112._2 | |
570 | 592 | $Tuple2((depositActions ++ borrowActions), (depositFactoryActions ++ borrowFactoryActions)) | |
571 | 593 | } | |
572 | 594 | ||
573 | 595 | ||
574 | 596 | ||
575 | 597 | @Callable(i) | |
576 | 598 | func repay (callerPublicKey,args) = { | |
577 | 599 | let ckecks = [if (!(shutdown)) | |
578 | 600 | then true | |
579 | 601 | else throwErr("not allowed"), mustFactory(i.caller)] | |
580 | 602 | if ((ckecks == ckecks)) | |
581 | 603 | then $Tuple2(nil, unit) | |
582 | 604 | else throw("Strict value is not equal to itself.") | |
583 | 605 | } | |
584 | 606 | ||
585 | 607 | ||
586 | 608 | ||
587 | 609 | @Callable(i) | |
588 | 610 | func setPairAllowance (callerPublicKey,args) = { | |
589 | 611 | let ckecks = [if (!(shutdown)) | |
590 | 612 | then true | |
591 | 613 | else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey)] | |
592 | 614 | if ((ckecks == ckecks)) | |
593 | 615 | then { | |
594 | 616 | let amountAssetIdStr = args[0] | |
595 | 617 | let priceAssetIdStr = args[1] | |
596 | 618 | let allowStr = args[2] | |
597 | 619 | let amountAssetId = parseAssetId(amountAssetIdStr) | |
598 | 620 | let priceAssetId = parseAssetId(priceAssetIdStr) | |
599 | 621 | let allow = (allowStr == "true") | |
600 | 622 | let invocations = [invoke(factoryAddress, "booleanEntry", [kPairAllowed(amountAssetId, priceAssetId), allow], nil)] | |
601 | 623 | $Tuple2(nil, invocations) | |
602 | 624 | } | |
603 | 625 | else throw("Strict value is not equal to itself.") | |
604 | 626 | } | |
605 | 627 | ||
606 | 628 | ||
607 | 629 | ||
608 | 630 | @Callable(i) | |
609 | 631 | func addSyntheticAsset (callerPublicKey,args) = { | |
610 | 632 | let baseAssetId = parseAssetId(args[0]) | |
611 | 633 | let syntheticAssetId = parseAssetId(args[1]) | |
612 | 634 | let ckecks = [if (!(shutdown)) | |
613 | 635 | then true | |
614 | 636 | else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit)) | |
615 | 637 | then true | |
616 | 638 | else throwErr("invalid base asset"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit)) | |
617 | 639 | then true | |
618 | 640 | else throwErr("invalid synthetic asset")] | |
619 | 641 | if ((ckecks == ckecks)) | |
620 | 642 | then { | |
621 | 643 | let invocations = [invoke(factoryAddress, "stringEntry", [kSyntheticAssetId(baseAssetId), assetIdToString(syntheticAssetId)], nil), invoke(factoryAddress, "stringEntry", [kBaseAssetId(syntheticAssetId), assetIdToString(baseAssetId)], nil)] | |
622 | 644 | $Tuple2(nil, invocations) | |
623 | 645 | } | |
624 | 646 | else throw("Strict value is not equal to itself.") | |
625 | 647 | } | |
626 | 648 | ||
627 | 649 | ||
628 | 650 | ||
629 | 651 | @Callable(i) | |
630 | 652 | func doShutdown (callerPublicKey,args) = { | |
631 | 653 | let checks = [mustFactory(i.caller), mustAdmin(callerPublicKey)] | |
632 | 654 | if ((checks == checks)) | |
633 | 655 | then { | |
634 | 656 | let invocations = [invoke(factoryAddress, "booleanEntry", [kShutdown, true], nil)] | |
635 | 657 | $Tuple2(nil, invocations) | |
636 | 658 | } | |
637 | 659 | else throw("Strict value is not equal to itself.") | |
638 | 660 | } | |
639 | 661 | ||
640 | 662 | ||
641 | 663 | ||
642 | 664 | @Callable(i) | |
643 | 665 | func getAccountInfoREADONLY (callerPublicKey,args) = { | |
644 | 666 | let checks = [mustFactory(i.caller)] | |
645 | 667 | if ((checks == checks)) | |
646 | 668 | then { | |
647 | 669 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
648 | 670 | let data = getAccountInfoInternal(accountAddress) | |
649 | 671 | $Tuple2(nil, data) | |
650 | 672 | } | |
651 | 673 | else throw("Strict value is not equal to itself.") | |
652 | 674 | } | |
653 | 675 | ||
654 | 676 | ||
655 | 677 | ||
656 | 678 | @Callable(i) | |
657 | 679 | func getUserInfoREADONLY (callerPublicKey,args) = { | |
658 | 680 | let checks = [mustFactory(i.caller)] | |
659 | 681 | if ((checks == checks)) | |
660 | 682 | then { | |
661 | 683 | let userAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid user address")) | |
662 | 684 | let userRequests = valueOrElse(getBinary(factoryAddress, kRequestsByOwner(userAddress)), base58'') | |
663 | 685 | let userRequestsNumber = (size(userRequests) / queueItemSize) | |
664 | 686 | func getAccountsData (acc,count) = { | |
665 | - | let $ | |
666 | - | let accDataList = $ | |
667 | - | let rawBytes = $ | |
668 | - | let maxSize = $ | |
687 | + | let $t02704527087 = acc | |
688 | + | let accDataList = $t02704527087._1 | |
689 | + | let rawBytes = $t02704527087._2 | |
690 | + | let maxSize = $t02704527087._3 | |
669 | 691 | if ((maxSize > count)) | |
670 | 692 | then { | |
671 | 693 | let requestId = take(rawBytes, queueItemSize) | |
672 | 694 | let newRawBytes = drop(rawBytes, queueItemSize) | |
673 | 695 | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
674 | 696 | let accountAddress = addressFromPublicKey(accountPublicKey) | |
675 | 697 | let data = getAccountInfoInternal(accountAddress) | |
676 | 698 | $Tuple3((accDataList :+ data), newRawBytes, maxSize) | |
677 | 699 | } | |
678 | 700 | else acc | |
679 | 701 | } | |
680 | 702 | ||
681 | - | let $ | |
703 | + | let $t02759127696 = { | |
682 | 704 | let $l = INDEX_LIST | |
683 | 705 | let $s = size($l) | |
684 | 706 | let $acc0 = $Tuple3(nil, userRequests, userRequestsNumber) | |
685 | 707 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
686 | 708 | then $a | |
687 | 709 | else getAccountsData($a, $l[$i]) | |
688 | 710 | ||
689 | 711 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
690 | 712 | then $a | |
691 | 713 | else throw("List size exceeds 20") | |
692 | 714 | ||
693 | 715 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
694 | 716 | } | |
695 | - | let accDataList = $ | |
696 | - | let _a = $ | |
697 | - | let _b = $ | |
717 | + | let accDataList = $t02759127696._1 | |
718 | + | let _a = $t02759127696._2 | |
719 | + | let _b = $t02759127696._3 | |
698 | 720 | $Tuple2(nil, accDataList) | |
699 | 721 | } | |
700 | 722 | else throw("Strict value is not equal to itself.") | |
701 | 723 | } | |
702 | 724 | ||
703 | 725 | ||
704 | 726 | ||
705 | 727 | @Callable(i) | |
706 | 728 | func getPairSettingsInfoREADONLY (callerPublicKey,args) = { | |
707 | 729 | let amountAsset = parseAssetId(args[0]) | |
708 | 730 | let priceAsset = parseAssetId(args[1]) | |
709 | 731 | let pricesList = getPairPricesList(amountAsset, priceAsset) | |
710 | 732 | func getPairSettings (acc,pricesString) = { | |
711 | 733 | let settingsKey = kPairSettingsKey(amountAsset, priceAsset, pricesString) | |
712 | 734 | let settingsStringValue = getStringValue(factoryAddress, settingsKey) | |
713 | 735 | let sList = split(settingsStringValue, separator) | |
714 | 736 | let price = parseInt(pricesString) | |
715 | 737 | let maxLeverage = parseInt(sList[1]) | |
716 | 738 | let initialMargin = parseInt(sList[2]) | |
717 | 739 | let maintenanceMargin = parseInt(sList[3]) | |
718 | 740 | (acc :+ $Tuple4(price, maxLeverage, initialMargin, maintenanceMargin)) | |
719 | 741 | } | |
720 | 742 | ||
721 | 743 | let data = { | |
722 | 744 | let $l = pricesList | |
723 | 745 | let $s = size($l) | |
724 | 746 | let $acc0 = nil | |
725 | 747 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
726 | 748 | then $a | |
727 | 749 | else getPairSettings($a, $l[$i]) | |
728 | 750 | ||
729 | 751 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
730 | 752 | then $a | |
731 | 753 | else throw("List size exceeds 20") | |
732 | 754 | ||
733 | 755 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
734 | 756 | } | |
735 | 757 | $Tuple2(nil, data) | |
736 | 758 | } | |
737 | 759 | ||
738 | 760 | ||
739 | 761 | ||
740 | 762 | @Callable(i) | |
741 | 763 | func editPairSettings (callerPublicKey,args) = { | |
742 | 764 | let checks = [mustFactory(i.caller), mustAdmin(callerPublicKey)] | |
743 | 765 | if ((checks == checks)) | |
744 | 766 | then { | |
745 | 767 | let amountAsset = parseAssetId(args[0]) | |
746 | 768 | let priceAsset = parseAssetId(args[1]) | |
747 | 769 | let price = args[2] | |
748 | 770 | let maxLeverage = args[3] | |
749 | 771 | let initialMargin = args[4] | |
750 | 772 | let maintenanceMargin = args[5] | |
751 | 773 | let pairPricesListKey = kPairPricesListKey(amountAsset, priceAsset) | |
752 | 774 | let settingsKey = kPairSettingsKey(amountAsset, priceAsset, price) | |
753 | 775 | let pricesList = getPairPricesList(amountAsset, priceAsset) | |
754 | 776 | let newList = match indexOf(pricesList, price) { | |
755 | 777 | case ind: Int => | |
756 | 778 | pricesList | |
757 | 779 | case _ => | |
758 | 780 | (pricesList :+ price) | |
759 | 781 | } | |
760 | 782 | let check2 = [valueOrErrorMessage(parseInt(price), wrapErr("price value is not an Int")), valueOrErrorMessage(maxLeverage, wrapErr("maxLeverage value is not an Int")), valueOrErrorMessage(initialMargin, wrapErr("initialMargin value is not an Int")), valueOrErrorMessage(maintenanceMargin, wrapErr("maintenanceMargin value is not an Int")), if ((20 >= size(newList))) | |
761 | 783 | then true | |
762 | 784 | else throwErr("exceeded max prices list size (20)")] | |
763 | 785 | if ((check2 == check2)) | |
764 | 786 | then { | |
765 | 787 | let pairSettingValue = makeString(["%s%s%s", maxLeverage, initialMargin, maintenanceMargin], separator) | |
766 | 788 | let invocations = [invoke(factoryAddress, "stringEntry", [kPairPricesListKey(amountAsset, priceAsset), makeString(newList, separator)], nil), invoke(factoryAddress, "stringEntry", [kPairSettingsKey(amountAsset, priceAsset, price), pairSettingValue], nil)] | |
767 | 789 | $Tuple2(nil, invocations) | |
768 | 790 | } | |
769 | 791 | else throw("Strict value is not equal to itself.") | |
770 | 792 | } | |
771 | 793 | else throw("Strict value is not equal to itself.") | |
772 | 794 | } | |
773 | 795 | ||
774 | 796 | ||
775 | 797 | ||
776 | 798 | @Callable(i) | |
777 | 799 | func deletePairSettings (callerPublicKey,args) = { | |
778 | 800 | let checks = [mustFactory(i.caller), mustAdmin(callerPublicKey)] | |
779 | 801 | if ((checks == checks)) | |
780 | 802 | then { | |
781 | 803 | let amountAsset = parseAssetId(args[0]) | |
782 | 804 | let priceAsset = parseAssetId(args[1]) | |
783 | 805 | let price = args[2] | |
784 | 806 | let settingsKey = kPairSettingsKey(amountAsset, priceAsset, price) | |
785 | 807 | let pairPricesListKey = kPairPricesListKey(amountAsset, priceAsset) | |
786 | 808 | let pricesList = getPairPricesList(amountAsset, priceAsset) | |
787 | 809 | let newList = match indexOf(pricesList, price) { | |
788 | 810 | case ind: Int => | |
789 | 811 | removeByIndex(pricesList, ind) | |
790 | 812 | case _ => | |
791 | 813 | pricesList | |
792 | 814 | } | |
793 | 815 | let invocations = [invoke(factoryAddress, "deleteEntry", [settingsKey], nil), if ((size(newList) == 0)) | |
794 | 816 | then invoke(factoryAddress, "deleteEntry", [kPairPricesListKey(amountAsset, priceAsset)], nil) | |
795 | 817 | else invoke(factoryAddress, "stringEntry", [kPairPricesListKey(amountAsset, priceAsset), makeString(newList, separator)], nil)] | |
796 | 818 | $Tuple2(nil, invocations) | |
797 | 819 | } | |
798 | 820 | else throw("Strict value is not equal to itself.") | |
799 | 821 | } | |
800 | 822 | ||
801 | 823 | ||
802 | 824 | @Verifier(tx) | |
803 | 825 | func verify () = if (if (isDefined(factoryAddressOption)) | |
804 | 826 | then isDefined(getString(factoryAddress, kMultisig)) | |
805 | 827 | else false) | |
806 | 828 | then match getString(factoryAddress, kMultisig) { | |
807 | 829 | case multisig: String => | |
808 | 830 | let statusKey = kStatus(toString(this), toBase58String(tx.id)) | |
809 | 831 | let status = valueOrElse(getBoolean(addressFromStringValue(multisig), statusKey), false) | |
810 | 832 | status | |
811 | 833 | case _ => | |
812 | 834 | false | |
813 | 835 | } | |
814 | 836 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
815 | 837 |
github/deemru/w8io/026f985 98.25 ms ◑