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