tx · HTfawEvDjXoyAAMqobWkMwKdrf1whxkMw35grEAo9vjY 3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37: -0.02700000 Waves 2024.07.09 09:27 [3186108] smart account 3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37 > SELF 0.00000000 Waves
{ "type": 13, "id": "HTfawEvDjXoyAAMqobWkMwKdrf1whxkMw35grEAo9vjY", "fee": 2700000, "feeAssetId": null, "timestamp": 1720506438362, "version": 1, "sender": "3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37", "senderPublicKey": "vmMXxwQAMUAoisvL193ptPiTtaWQqL5YNu2zs1ouTbY", "proofs": [ "4AzSYD5sJMVLFmjYtuGdAXaWPBBN6PSQb54d1pbDPouineyBa7LsGL4ZhBE6xwjsQkUaXqMkZ9jEzFVk1ow1pFeQ" ], "script": "base64:BwJJCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGFoACXNlcGFyYXRvcgICX18AB2NoYWluSWQJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEACGNoYWluSWRXAQFXABBjb250cmFjdEZpbGVuYW1lAhdmdXR1cmVzX2NhbGN1bGF0b3IucmlkZQAFbXVsdDgAgMLXLwAMbXVsdDE4QmlnSW50CQC2AgEAgICQu7rWrfANAA13YXZlc0RlY2ltYWxzAAgADHVzZHREZWNpbWFscwAGAAt3YXZlc1N0cmluZwIFV0FWRVMADXF1ZXVlSXRlbVNpemUAIAAEYmlnMAkAtgIBAAAACWtNdWx0aXNpZwIMJXNfX211bHRpc2lnAQdrU3RhdHVzAgRkYXBwBHR4SWQJALkJAgkAzAgCAgolc19fc3RhdHVzCQDMCAIFBGRhcHAJAMwIAgUEdHhJZAUDbmlsBQlzZXBhcmF0b3IACWtTaHV0ZG93bgIMJXNfX3NodXRkb3duAAtrUHVibGljS2V5cwIOJXNfX3B1YmxpY0tleXMAEWtNYXRjaGVyUHVibGljS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sBQthY2NEYXRhTGlzdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQADAwkBCWlzRGVmaW5lZAEFFGZhY3RvcnlBZGRyZXNzT3B0aW9uCQEJaXNEZWZpbmVkAQkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUJa011bHRpc2lnBwQHJG1hdGNoMAkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUJa011bHRpc2lnAwkAAQIFByRtYXRjaDACBlN0cmluZwQIbXVsdGlzaWcFByRtYXRjaDAECXN0YXR1c0tleQkBB2tTdGF0dXMCCQClCAEFBHRoaXMJANgEAQgFAnR4AmlkBAZzdGF0dXMJAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUIbXVsdGlzaWcFCXN0YXR1c0tleQcFBnN0YXR1cwcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXndR8TT", "chainId": 84, "height": 3186108, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9hGMB5qPwWrXz1ZQSnRXpA3W8UZ6LRCeEdiqRwEHuEtd Next: 4nXj1QNCDqkbazwVwiK3g7BYJAx814Jmx574L4dBXxa9 Diff:
Old | New | Differences | |
---|---|---|---|
72 | 72 | wavesDecimals | |
73 | 73 | case assetId: ByteVector => | |
74 | 74 | getAssetInfoOrFail(assetId).decimals | |
75 | + | case _ => | |
76 | + | throw("Match error") | |
77 | + | } | |
78 | + | ||
79 | + | ||
80 | + | func getAssetBalance (assetId,address) = match assetId { | |
81 | + | case _: Unit => | |
82 | + | wavesBalance(address).available | |
83 | + | case assetId: ByteVector => | |
84 | + | assetBalance(address, assetId) | |
75 | 85 | case _ => | |
76 | 86 | throw("Match error") | |
77 | 87 | } | |
304 | 314 | } | |
305 | 315 | ||
306 | 316 | ||
317 | + | func getAccountInfoInternal (accountAddress) = { | |
318 | + | let $t01038510453 = getAccountAssets(accountAddress) | |
319 | + | let amountAssetId = $t01038510453._1 | |
320 | + | let priceAssetId = $t01038510453._2 | |
321 | + | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kLeverage(accountAddress)), wrapErr("leverage should be defined")) | |
322 | + | let requestId = getRequestId(accountAddress) | |
323 | + | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
324 | + | let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(priceAssetId)) | |
325 | + | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(priceAssetId)) | |
326 | + | let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId)) | |
327 | + | let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, priceAssetId)), 0), pow10Decimals(priceAssetId)) | |
328 | + | let status = valueOrErrorMessage(getInteger(factoryAddress, kRequestStatus(requestId)), ("status not found. RequestId = " + toBase58String(requestId))) | |
329 | + | $Tuple12(assetIdToString(amountAssetId), assetIdToString(priceAssetId), toString(accountAddress), toBase58String(accountPublicKey), leverage, toBase58String(requestId), deposited, creditA, creditB, getAssetBalance(amountAssetId, accountAddress), getAssetBalance(priceAssetId, accountAddress), status) | |
330 | + | } | |
331 | + | ||
332 | + | ||
307 | 333 | @Callable(i) | |
308 | 334 | func init (factoryAddressStr) = { | |
309 | 335 | let checkCaller = mustThis(i.caller) | |
344 | 370 | else throwErr(("accounts limit is " + toString(accountsLimit())))] | |
345 | 371 | if ((checks == checks)) | |
346 | 372 | then { | |
347 | - | let $ | |
373 | + | let $t01339314926 = if ((size(accountsQueue()) == 0)) | |
348 | 374 | 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)]) | |
349 | 375 | else { | |
350 | 376 | let accountPublicKey = take(accountsQueue(), queueItemSize) | |
352 | 378 | let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key"))) | |
353 | 379 | $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)]) | |
354 | 380 | } | |
355 | - | let actions = $ | |
356 | - | let factoryActions = $ | |
381 | + | let actions = $t01339314926._1 | |
382 | + | let factoryActions = $t01339314926._2 | |
357 | 383 | $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)])) | |
358 | 384 | } | |
359 | 385 | else throw("Strict value is not equal to itself.") | |
386 | 412 | else throwErr("invalid script")] | |
387 | 413 | if ((checks == checks)) | |
388 | 414 | then { | |
389 | - | let $ | |
415 | + | let $t01618117422 = if ((size(requestsQueue()) == 0)) | |
390 | 416 | then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)]) | |
391 | 417 | else { | |
392 | 418 | let requestId = take(requestsQueue(), queueItemSize) | |
393 | 419 | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kRequestLeverage(requestId)), wrapErr("request's leverage is undefined")) | |
394 | 420 | $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)]) | |
395 | 421 | } | |
396 | - | let actions = $ | |
397 | - | let factoryActions = $ | |
422 | + | let actions = $t01618117422._1 | |
423 | + | let factoryActions = $t01618117422._2 | |
398 | 424 | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)])) | |
399 | 425 | } | |
400 | 426 | else throw("Strict value is not equal to itself.") | |
559 | 585 | if ((checks == checks)) | |
560 | 586 | then { | |
561 | 587 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
562 | - | let $t02263322701 = getAccountAssets(accountAddress) | |
563 | - | let amountAssetId = $t02263322701._1 | |
564 | - | let priceAssetId = $t02263322701._2 | |
565 | - | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kLeverage(accountAddress)), wrapErr("leverage should be defined")) | |
566 | - | let userAddress = addressFromPublicKey(callerPublicKey) | |
567 | - | let requestId = getRequestId(accountAddress) | |
568 | - | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
569 | - | let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(usdtAssetId)) | |
570 | - | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(usdtAssetId)) | |
571 | - | let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId)) | |
572 | - | let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, usdtAssetId)), 0), pow10Decimals(usdtAssetId)) | |
573 | - | let data = $Tuple11(assetIdToString(amountAssetId), assetIdToString(priceAssetId), toString(accountAddress), toBase58String(accountPublicKey), leverage, toBase58String(requestId), deposited, creditA, creditB, toX18(0, pow10Decimals(amountAssetId)), toX18(0, pow10Decimals(usdtAssetId))) | |
588 | + | let data = getAccountInfoInternal(accountAddress) | |
574 | 589 | $Tuple2(nil, data) | |
590 | + | } | |
591 | + | else throw("Strict value is not equal to itself.") | |
592 | + | } | |
593 | + | ||
594 | + | ||
595 | + | ||
596 | + | @Callable(i) | |
597 | + | func getUserInfoREADONLY (callerPublicKey,args) = { | |
598 | + | let checks = [mustFactory(i.caller)] | |
599 | + | if ((checks == checks)) | |
600 | + | then { | |
601 | + | let userAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid user address")) | |
602 | + | let userRequests = valueOrErrorMessage(getBinary(factoryAddress, kRequestsByOwner(userAddress)), "kRequestsByOwner not found") | |
603 | + | let userRequestsNumber = (size(userRequests) / queueItemSize) | |
604 | + | let nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
605 | + | func getAccountsData (acc,count) = { | |
606 | + | let $t02497125013 = acc | |
607 | + | let accDataList = $t02497125013._1 | |
608 | + | let rawBytes = $t02497125013._2 | |
609 | + | let maxSize = $t02497125013._3 | |
610 | + | if ((maxSize > count)) | |
611 | + | then { | |
612 | + | let requestId = take(rawBytes, queueItemSize) | |
613 | + | let newRawBytes = drop(rawBytes, queueItemSize) | |
614 | + | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
615 | + | let accountAddress = addressFromPublicKey(accountPublicKey) | |
616 | + | let data = getAccountInfoInternal(accountAddress) | |
617 | + | $Tuple3((accDataList :+ data), newRawBytes, maxSize) | |
618 | + | } | |
619 | + | else acc | |
620 | + | } | |
621 | + | ||
622 | + | let $t02551725616 = { | |
623 | + | let $l = nums | |
624 | + | let $s = size($l) | |
625 | + | let $acc0 = $Tuple3(nil, userRequests, userRequestsNumber) | |
626 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
627 | + | then $a | |
628 | + | else getAccountsData($a, $l[$i]) | |
629 | + | ||
630 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
631 | + | then $a | |
632 | + | else throw("List size exceeds 20") | |
633 | + | ||
634 | + | $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) | |
635 | + | } | |
636 | + | let accDataList = $t02551725616._1 | |
637 | + | let _a = $t02551725616._2 | |
638 | + | let _b = $t02551725616._3 | |
639 | + | $Tuple2(nil, accDataList) | |
575 | 640 | } | |
576 | 641 | else throw("Strict value is not equal to itself.") | |
577 | 642 | } |
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 kMultisig = "%s__multisig" | |
27 | 27 | ||
28 | 28 | func kStatus (dapp,txId) = makeString(["%s__status", dapp, txId], separator) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | let kShutdown = "%s__shutdown" | |
32 | 32 | ||
33 | 33 | let kPublicKeys = "%s__publicKeys" | |
34 | 34 | ||
35 | 35 | let kMatcherPublicKey = "%s__matcherPublicKey" | |
36 | 36 | ||
37 | 37 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), mult18BigInt, toBigInt(origScaleMult)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), mult18BigInt)) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func validateAddress (address) = isDefined(addressFromString(address)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func throwErr (s) = throw(wrapErr(s)) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func ensurePositive (v,s) = if ((v >= 0)) | |
53 | 53 | then v | |
54 | 54 | else throwErr((s + " value should be positive")) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func parseAssetId (input) = if ((input == wavesString)) | |
58 | 58 | then unit | |
59 | 59 | else fromBase58String(input) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func assetIdToString (input) = if ((input == unit)) | |
63 | 63 | then wavesString | |
64 | 64 | else toBase58String(value(input)) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getAssetInfoOrFail (assetId) = valueOrErrorMessage(assetInfo(assetId), wrapErr("invalid asset info")) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getAssetDecimalsOrFail (assetId) = match assetId { | |
71 | 71 | case _: Unit => | |
72 | 72 | wavesDecimals | |
73 | 73 | case assetId: ByteVector => | |
74 | 74 | getAssetInfoOrFail(assetId).decimals | |
75 | + | case _ => | |
76 | + | throw("Match error") | |
77 | + | } | |
78 | + | ||
79 | + | ||
80 | + | func getAssetBalance (assetId,address) = match assetId { | |
81 | + | case _: Unit => | |
82 | + | wavesBalance(address).available | |
83 | + | case assetId: ByteVector => | |
84 | + | assetBalance(address, assetId) | |
75 | 85 | case _ => | |
76 | 86 | throw("Match error") | |
77 | 87 | } | |
78 | 88 | ||
79 | 89 | ||
80 | 90 | func pow10 (n) = pow(10, 0, n, 0, 0, DOWN) | |
81 | 91 | ||
82 | 92 | ||
83 | 93 | func pow10Decimals (assetId) = pow10(getAssetDecimalsOrFail(assetId)) | |
84 | 94 | ||
85 | 95 | ||
86 | 96 | let kFactoryAddress = "%s__factoryAddress" | |
87 | 97 | ||
88 | 98 | let factoryAddressOption = match getString(this, kFactoryAddress) { | |
89 | 99 | case s: String => | |
90 | 100 | addressFromString(s) | |
91 | 101 | case _: Unit => | |
92 | 102 | unit | |
93 | 103 | case _ => | |
94 | 104 | throw("Match error") | |
95 | 105 | } | |
96 | 106 | ||
97 | 107 | let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address")) | |
98 | 108 | ||
99 | 109 | let kUsdtAssetId = "%s__usdtAssetId" | |
100 | 110 | ||
101 | 111 | let usdtAssetIdOption = match getString(factoryAddress, kUsdtAssetId) { | |
102 | 112 | case s: String => | |
103 | 113 | parseAssetId(s) | |
104 | 114 | case _: Unit => | |
105 | 115 | unit | |
106 | 116 | case _ => | |
107 | 117 | throw("Match error") | |
108 | 118 | } | |
109 | 119 | ||
110 | 120 | let usdtAssetId = valueOrErrorMessage(usdtAssetIdOption, wrapErr("invalid usdt asset id")) | |
111 | 121 | ||
112 | 122 | let kPricesAddress = "%s__calculatorAddress" | |
113 | 123 | ||
114 | 124 | let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false) | |
115 | 125 | ||
116 | 126 | func mustAddress (caller,address) = if ((caller == address)) | |
117 | 127 | then true | |
118 | 128 | else throwErr("permission denied") | |
119 | 129 | ||
120 | 130 | ||
121 | 131 | func mustThis (caller) = mustAddress(caller, this) | |
122 | 132 | ||
123 | 133 | ||
124 | 134 | func mustFactory (caller) = mustAddress(caller, factoryAddress) | |
125 | 135 | ||
126 | 136 | ||
127 | 137 | func mustAdmin (callerPublicKey) = { | |
128 | 138 | let multisig = addressFromStringValue(getStringValue(factoryAddress, kMultisig)) | |
129 | 139 | let publicKeysList = split(getStringValue(multisig, kPublicKeys), separator) | |
130 | 140 | if (containsElement(publicKeysList, toBase58String(callerPublicKey))) | |
131 | 141 | then true | |
132 | 142 | else throwErr("not allowed") | |
133 | 143 | } | |
134 | 144 | ||
135 | 145 | ||
136 | 146 | let kAccountScript = "%s__accountScript" | |
137 | 147 | ||
138 | 148 | func accountScript () = valueOrErrorMessage(getBinary(factoryAddress, kAccountScript), wrapErr("account script is not set")) | |
139 | 149 | ||
140 | 150 | ||
141 | 151 | let kRewardAmount = "%s__rewardAmount" | |
142 | 152 | ||
143 | 153 | func rewardAmount () = valueOrErrorMessage(getInteger(factoryAddress, kRewardAmount), wrapErr("reward amount is not set")) | |
144 | 154 | ||
145 | 155 | ||
146 | 156 | let kAccountsLimit = "%s__accountsLimit" | |
147 | 157 | ||
148 | 158 | let accountsLimitDefault = 20 | |
149 | 159 | ||
150 | 160 | func accountsLimit () = valueOrElse(getInteger(factoryAddress, kAccountsLimit), accountsLimitDefault) | |
151 | 161 | ||
152 | 162 | ||
153 | 163 | func kDeposited (accountAddress) = makeString(["%s%s", "deposited", toString(accountAddress)], separator) | |
154 | 164 | ||
155 | 165 | ||
156 | 166 | func depositedOption (accountAddress) = getInteger(factoryAddress, kDeposited(accountAddress)) | |
157 | 167 | ||
158 | 168 | ||
159 | 169 | func kCredit (accountAddress,assetId) = makeString(["%s%s%s", "credit", toString(accountAddress), assetIdToString(assetId)], separator) | |
160 | 170 | ||
161 | 171 | ||
162 | 172 | func creditOption (accountAddress,assetId) = getInteger(factoryAddress, kCredit(accountAddress, assetId)) | |
163 | 173 | ||
164 | 174 | ||
165 | 175 | func kLeverage (accountAddress) = makeString(["%s%s", "leverage", toString(accountAddress)], separator) | |
166 | 176 | ||
167 | 177 | ||
168 | 178 | func kRequestLeverage (requestId) = makeString(["%s%s", "requestLeverage", toBase58String(requestId)], separator) | |
169 | 179 | ||
170 | 180 | ||
171 | 181 | func kSyntheticAssetId (baseAssetId) = makeString(["%s%s", "syntheticAssetId", assetIdToString(baseAssetId)], separator) | |
172 | 182 | ||
173 | 183 | ||
174 | 184 | func kBaseAssetId (syntheticAssetId) = makeString(["%s%s", "baseAssetId", assetIdToString(syntheticAssetId)], separator) | |
175 | 185 | ||
176 | 186 | ||
177 | 187 | let REQUEST_STATUS_EMPTY = 0 | |
178 | 188 | ||
179 | 189 | let REQUEST_STATUS_READY = 1 | |
180 | 190 | ||
181 | 191 | func kRequestStatus (requestId) = makeString(["%s%s", toBase58String(requestId), "status"], separator) | |
182 | 192 | ||
183 | 193 | ||
184 | 194 | func kAccountCreatorPublicKey (accountAddress) = makeString(["%s%s", toString(accountAddress), "creatorPublicKey"], separator) | |
185 | 195 | ||
186 | 196 | ||
187 | 197 | func kRequestOwnerPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "ownerPublicKey"], separator) | |
188 | 198 | ||
189 | 199 | ||
190 | 200 | func kRequestAmountAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "amountAssetId"], separator) | |
191 | 201 | ||
192 | 202 | ||
193 | 203 | func kRequestPriceAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "priceAssetId"], separator) | |
194 | 204 | ||
195 | 205 | ||
196 | 206 | func kRequestIdToAccountPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "requestIdToAccountPublicKey"], separator) | |
197 | 207 | ||
198 | 208 | ||
199 | 209 | func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator) | |
200 | 210 | ||
201 | 211 | ||
202 | 212 | func kRequestsQueue () = makeString(["%s", "requestsQueue"], separator) | |
203 | 213 | ||
204 | 214 | ||
205 | 215 | func requestsQueue () = valueOrElse(getBinary(factoryAddress, kRequestsQueue()), base58'') | |
206 | 216 | ||
207 | 217 | ||
208 | 218 | func kAccountsQueue () = makeString(["%s", "accountsQueue"], separator) | |
209 | 219 | ||
210 | 220 | ||
211 | 221 | func accountsQueue () = valueOrElse(getBinary(factoryAddress, kAccountsQueue()), base58'') | |
212 | 222 | ||
213 | 223 | ||
214 | 224 | func kRequestsByOwner (ownerAddress) = makeString(["%s%s", "requests", toString(ownerAddress)], separator) | |
215 | 225 | ||
216 | 226 | ||
217 | 227 | func requestsByOwner (ownerAddress) = valueOrElse(getBinary(factoryAddress, kRequestsByOwner(ownerAddress)), base58'') | |
218 | 228 | ||
219 | 229 | ||
220 | 230 | func kPairAllowed (amountAssetId,priceAssetId) = makeString(["%s%s%s", assetIdToString(amountAssetId), assetIdToString(priceAssetId), "pairAllowed"], separator) | |
221 | 231 | ||
222 | 232 | ||
223 | 233 | func pairAllowed (amountAssetId,priceAssetId) = valueOrElse(getBoolean(factoryAddress, kPairAllowed(amountAssetId, priceAssetId)), false) | |
224 | 234 | ||
225 | 235 | ||
226 | 236 | func kPrice (assetId) = makeString(["%s", assetIdToString(assetId)], separator) | |
227 | 237 | ||
228 | 238 | ||
229 | 239 | func getCurrentPrice (assetId) = { | |
230 | 240 | let matcherPublicKey = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kMatcherPublicKey), wrapErr("invalid matcher public key"))) | |
231 | 241 | let matcherAddress = addressFromPublicKey(matcherPublicKey) | |
232 | 242 | let price = valueOrErrorMessage(getInteger(matcherAddress, kPrice(assetId)), wrapErr(("invalid price, assetId = " + assetIdToString(assetId)))) | |
233 | 243 | price | |
234 | 244 | } | |
235 | 245 | ||
236 | 246 | ||
237 | 247 | func calcTotalCredit (creditA,creditB,currentPrice) = (fraction(creditA, currentPrice, mult18BigInt) + creditB) | |
238 | 248 | ||
239 | 249 | ||
240 | 250 | func calcTotalBalance (balanceA,balanceB,currentPrice) = (fraction(balanceA, currentPrice, mult18BigInt) + balanceB) | |
241 | 251 | ||
242 | 252 | ||
243 | 253 | func calcPnl (totalBalance,totalCredit) = (totalBalance - totalCredit) | |
244 | 254 | ||
245 | 255 | ||
246 | 256 | func calcCreditAvailable (deposit,leverage,totalCredit) = (fraction(deposit, leverage, mult18BigInt) - totalCredit) | |
247 | 257 | ||
248 | 258 | ||
249 | 259 | func calcRealInCredit (credit,balance) = if ((credit > big0)) | |
250 | 260 | then (credit - balance) | |
251 | 261 | else big0 | |
252 | 262 | ||
253 | 263 | ||
254 | 264 | func calcFree (credit,balance) = if ((credit > big0)) | |
255 | 265 | then (balance - credit) | |
256 | 266 | else big0 | |
257 | 267 | ||
258 | 268 | ||
259 | 269 | func calcShortPrice (free,realInCredit) = if ((realInCredit > big0)) | |
260 | 270 | then max([big0, fraction(free, mult18BigInt, realInCredit)]) | |
261 | 271 | else big0 | |
262 | 272 | ||
263 | 273 | ||
264 | 274 | func calcLongPrice (free,realInCredit) = if ((realInCredit > big0)) | |
265 | 275 | then max([big0, fraction(realInCredit, mult18BigInt, free)]) | |
266 | 276 | else big0 | |
267 | 277 | ||
268 | 278 | ||
269 | 279 | func calcStartMargin (realInCreditA,realInCreditB,currentPrice,settingsMargin) = fraction((fraction(realInCreditA, currentPrice, mult18BigInt) + realInCreditB), settingsMargin, mult18BigInt) | |
270 | 280 | ||
271 | 281 | ||
272 | 282 | func calcMarginSupply (settingsMarginSupply,settingsMargin,startMargin) = fraction(settingsMarginSupply, startMargin, settingsMargin) | |
273 | 283 | ||
274 | 284 | ||
275 | 285 | func calcLiquidationPrice (deposit,marginSupply,realInCreditA,realInCreditB,shortPrice,longPrice) = { | |
276 | 286 | let liquidationPriceA = if ((realInCreditA > big0)) | |
277 | 287 | then (((deposit - marginSupply) / realInCreditA) + shortPrice) | |
278 | 288 | else big0 | |
279 | 289 | let liquidationPriceB = if ((realInCreditB > big0)) | |
280 | 290 | then (longPrice - ((deposit - marginSupply) / (realInCreditA / longPrice))) | |
281 | 291 | else big0 | |
282 | 292 | (liquidationPriceA + liquidationPriceB) | |
283 | 293 | } | |
284 | 294 | ||
285 | 295 | ||
286 | 296 | func getRequestId (accountAddress) = { | |
287 | 297 | let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined"))) | |
288 | 298 | requestId | |
289 | 299 | } | |
290 | 300 | ||
291 | 301 | ||
292 | 302 | func getAccountAssets (accountAddress) = { | |
293 | 303 | let requestId = getRequestId(accountAddress) | |
294 | 304 | let amountAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestAmountAssetId(requestId)), wrapErr("invalid amount asset id"))) | |
295 | 305 | let priceAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestPriceAssetId(requestId)), wrapErr("invalid amount price id"))) | |
296 | 306 | $Tuple2(amountAssetId, priceAssetId) | |
297 | 307 | } | |
298 | 308 | ||
299 | 309 | ||
300 | 310 | func getAccountOwnerPublicKey (accountAddress) = { | |
301 | 311 | let requestId = getRequestId(accountAddress) | |
302 | 312 | let requestOwnerPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestOwnerPublicKey(requestId)), wrapErr("invalid amount asset id")) | |
303 | 313 | requestOwnerPublicKey | |
304 | 314 | } | |
305 | 315 | ||
306 | 316 | ||
317 | + | func getAccountInfoInternal (accountAddress) = { | |
318 | + | let $t01038510453 = getAccountAssets(accountAddress) | |
319 | + | let amountAssetId = $t01038510453._1 | |
320 | + | let priceAssetId = $t01038510453._2 | |
321 | + | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kLeverage(accountAddress)), wrapErr("leverage should be defined")) | |
322 | + | let requestId = getRequestId(accountAddress) | |
323 | + | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
324 | + | let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(priceAssetId)) | |
325 | + | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(priceAssetId)) | |
326 | + | let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId)) | |
327 | + | let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, priceAssetId)), 0), pow10Decimals(priceAssetId)) | |
328 | + | let status = valueOrErrorMessage(getInteger(factoryAddress, kRequestStatus(requestId)), ("status not found. RequestId = " + toBase58String(requestId))) | |
329 | + | $Tuple12(assetIdToString(amountAssetId), assetIdToString(priceAssetId), toString(accountAddress), toBase58String(accountPublicKey), leverage, toBase58String(requestId), deposited, creditA, creditB, getAssetBalance(amountAssetId, accountAddress), getAssetBalance(priceAssetId, accountAddress), status) | |
330 | + | } | |
331 | + | ||
332 | + | ||
307 | 333 | @Callable(i) | |
308 | 334 | func init (factoryAddressStr) = { | |
309 | 335 | let checkCaller = mustThis(i.caller) | |
310 | 336 | if ((checkCaller == checkCaller)) | |
311 | 337 | then $Tuple2([StringEntry(kFactoryAddress, factoryAddressStr)], unit) | |
312 | 338 | else throw("Strict value is not equal to itself.") | |
313 | 339 | } | |
314 | 340 | ||
315 | 341 | ||
316 | 342 | ||
317 | 343 | @Callable(i) | |
318 | 344 | func requestAccount (callerPublicKey,args) = { | |
319 | 345 | let ckecks = [if (!(shutdown)) | |
320 | 346 | then true | |
321 | 347 | else throwErr("not allowed"), mustFactory(i.caller)] | |
322 | 348 | if ((ckecks == ckecks)) | |
323 | 349 | then { | |
324 | 350 | let amountAssetIdStr = args[0] | |
325 | 351 | let priceAssetIdStr = args[1] | |
326 | 352 | let leverage = valueOrErrorMessage(parseInt(args[2]), wrapErr("invalid leverage")) | |
327 | 353 | let userAddress = addressFromPublicKey(callerPublicKey) | |
328 | 354 | let requestId = sha256(((userAddress.bytes + fromBase58String(amountAssetIdStr)) + fromBase58String(priceAssetIdStr))) | |
329 | 355 | let amountAssetId = parseAssetId(amountAssetIdStr) | |
330 | 356 | let priceAssetId = parseAssetId(priceAssetIdStr) | |
331 | 357 | let userRequestsNumber = (size(kRequestsByOwner(userAddress)) / queueItemSize) | |
332 | 358 | let checks = [if ((size(i.payments) == 1)) | |
333 | 359 | then true | |
334 | 360 | else throwErr("1 payment is required"), if ((i.payments[0].assetId == unit)) | |
335 | 361 | then true | |
336 | 362 | else throwErr("invalid asset"), if ((i.payments[0].amount == rewardAmount())) | |
337 | 363 | then true | |
338 | 364 | else throwErr("invalid amount"), if (pairAllowed(amountAssetId, priceAssetId)) | |
339 | 365 | then true | |
340 | 366 | else throwErr("pair is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit)) | |
341 | 367 | then true | |
342 | 368 | else throwErr("account is already exists"), if ((accountsLimit() > userRequestsNumber)) | |
343 | 369 | then true | |
344 | 370 | else throwErr(("accounts limit is " + toString(accountsLimit())))] | |
345 | 371 | if ((checks == checks)) | |
346 | 372 | then { | |
347 | - | let $ | |
373 | + | let $t01339314926 = if ((size(accountsQueue()) == 0)) | |
348 | 374 | 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)]) | |
349 | 375 | else { | |
350 | 376 | let accountPublicKey = take(accountsQueue(), queueItemSize) | |
351 | 377 | let accountAddress = addressFromPublicKey(accountPublicKey) | |
352 | 378 | let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key"))) | |
353 | 379 | $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)]) | |
354 | 380 | } | |
355 | - | let actions = $ | |
356 | - | let factoryActions = $ | |
381 | + | let actions = $t01339314926._1 | |
382 | + | let factoryActions = $t01339314926._2 | |
357 | 383 | $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)])) | |
358 | 384 | } | |
359 | 385 | else throw("Strict value is not equal to itself.") | |
360 | 386 | } | |
361 | 387 | else throw("Strict value is not equal to itself.") | |
362 | 388 | } | |
363 | 389 | ||
364 | 390 | ||
365 | 391 | ||
366 | 392 | @Callable(i) | |
367 | 393 | func addAccount (callerPublicKey,args) = { | |
368 | 394 | let ckecks = [if (!(shutdown)) | |
369 | 395 | then true | |
370 | 396 | else throwErr("not allowed"), mustFactory(i.caller)] | |
371 | 397 | if ((ckecks == ckecks)) | |
372 | 398 | then { | |
373 | 399 | let creatorPublicKey = fromBase58String(args[0]) | |
374 | 400 | let accountPublicKey = callerPublicKey | |
375 | 401 | let accountAddress = addressFromPublicKey(callerPublicKey) | |
376 | 402 | let creatorAddress = addressFromPublicKey(creatorPublicKey) | |
377 | 403 | let checks = [if ((getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)) == unit)) | |
378 | 404 | then true | |
379 | 405 | else throwErr("account is already exists"), if ( match scriptHash(accountAddress) { | |
380 | 406 | case b: ByteVector => | |
381 | 407 | (b == blake2b256_32Kb(accountScript())) | |
382 | 408 | case _ => | |
383 | 409 | false | |
384 | 410 | }) | |
385 | 411 | then true | |
386 | 412 | else throwErr("invalid script")] | |
387 | 413 | if ((checks == checks)) | |
388 | 414 | then { | |
389 | - | let $ | |
415 | + | let $t01618117422 = if ((size(requestsQueue()) == 0)) | |
390 | 416 | then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)]) | |
391 | 417 | else { | |
392 | 418 | let requestId = take(requestsQueue(), queueItemSize) | |
393 | 419 | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kRequestLeverage(requestId)), wrapErr("request's leverage is undefined")) | |
394 | 420 | $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)]) | |
395 | 421 | } | |
396 | - | let actions = $ | |
397 | - | let factoryActions = $ | |
422 | + | let actions = $t01618117422._1 | |
423 | + | let factoryActions = $t01618117422._2 | |
398 | 424 | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)])) | |
399 | 425 | } | |
400 | 426 | else throw("Strict value is not equal to itself.") | |
401 | 427 | } | |
402 | 428 | else throw("Strict value is not equal to itself.") | |
403 | 429 | } | |
404 | 430 | ||
405 | 431 | ||
406 | 432 | ||
407 | 433 | @Callable(i) | |
408 | 434 | func deposit (callerPublicKey,args) = { | |
409 | 435 | let payment = i.payments[0] | |
410 | 436 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
411 | 437 | let ckecks = [if (!(shutdown)) | |
412 | 438 | then true | |
413 | 439 | else throwErr("not allowed"), mustFactory(i.caller), if ((size(i.payments) == 1)) | |
414 | 440 | then true | |
415 | 441 | else throwErr("1 payment is required"), if ((payment.assetId == usdtAssetId)) | |
416 | 442 | then true | |
417 | 443 | else throwErr("invalid asset"), if ((getInteger(factoryAddress, kRequestStatus(getRequestId(accountAddress))) == REQUEST_STATUS_READY)) | |
418 | 444 | then true | |
419 | 445 | else throwErr("account is not ready")] | |
420 | 446 | if ((ckecks == ckecks)) | |
421 | 447 | then { | |
422 | 448 | let actions = [ScriptTransfer(accountAddress, payment.amount, payment.assetId)] | |
423 | 449 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kDeposited(accountAddress), (valueOrElse(depositedOption(accountAddress), 0) + payment.amount)], nil)] | |
424 | 450 | $Tuple2(actions, factoryActions) | |
425 | 451 | } | |
426 | 452 | else throw("Strict value is not equal to itself.") | |
427 | 453 | } | |
428 | 454 | ||
429 | 455 | ||
430 | 456 | ||
431 | 457 | @Callable(i) | |
432 | 458 | func withdraw (callerPublicKey,args) = { | |
433 | 459 | let ckecks = [if (!(shutdown)) | |
434 | 460 | then true | |
435 | 461 | else throwErr("not allowed"), mustFactory(i.caller)] | |
436 | 462 | if ((ckecks == ckecks)) | |
437 | 463 | then { | |
438 | 464 | let userAddress = addressFromPublicKey(callerPublicKey) | |
439 | 465 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
440 | 466 | let amount = valueOrErrorMessage(parseInt(args[1]), wrapErr("invalid amount")) | |
441 | 467 | let assetId = parseAssetId(args[2]) | |
442 | 468 | let invocations = [invoke(accountAddress, "transferAsset", [userAddress.bytes, amount, assetId], nil)] | |
443 | 469 | $Tuple2(nil, invocations) | |
444 | 470 | } | |
445 | 471 | else throw("Strict value is not equal to itself.") | |
446 | 472 | } | |
447 | 473 | ||
448 | 474 | ||
449 | 475 | ||
450 | 476 | @Callable(i) | |
451 | 477 | func borrow (callerPublicKey,args) = { | |
452 | 478 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
453 | 479 | let assetIdRequested = parseAssetId(args[1]) | |
454 | 480 | let amountRequested = ensurePositive(valueOrErrorMessage(parseInt(args[2]), wrapErr("invalid requested amount")), "requested amount") | |
455 | 481 | let accountOwnerPublicKey = getAccountOwnerPublicKey(accountAddress) | |
456 | 482 | let userAddress = addressFromPublicKey(callerPublicKey) | |
457 | 483 | let ckecks = [if (!(shutdown)) | |
458 | 484 | then true | |
459 | 485 | else throwErr("not allowed"), mustFactory(i.caller), if ((callerPublicKey == accountOwnerPublicKey)) | |
460 | 486 | then true | |
461 | 487 | else throwErr("can be called by account owner only")] | |
462 | 488 | if ((ckecks == ckecks)) | |
463 | 489 | then { | |
464 | 490 | let amountAssetId = getAccountAssets(accountAddress)._1 | |
465 | 491 | let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(usdtAssetId)) | |
466 | 492 | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(usdtAssetId)) | |
467 | 493 | let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId)) | |
468 | 494 | let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, usdtAssetId)), 0), pow10Decimals(usdtAssetId)) | |
469 | 495 | let totalCredit = calcTotalCredit(creditA, creditB, currentPrice) | |
470 | 496 | let leverage = toX18(valueOrErrorMessage(getInteger(factoryAddress, kLeverage(accountAddress)), wrapErr("leverage should be defined")), 1) | |
471 | 497 | let creditAvailableUsdt = calcCreditAvailable(deposited, leverage, totalCredit) | |
472 | 498 | let creditAvailable = if ((assetIdRequested == amountAssetId)) | |
473 | 499 | then fromX18(fraction(creditAvailableUsdt, mult18BigInt, currentPrice), pow10Decimals(amountAssetId)) | |
474 | 500 | else if ((assetIdRequested == usdtAssetId)) | |
475 | 501 | then fromX18(creditAvailableUsdt, pow10Decimals(usdtAssetId)) | |
476 | 502 | else throwErr("invalid requested asset id") | |
477 | 503 | let syntheticAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kSyntheticAssetId(assetIdRequested)), wrapErr("synthetic asset for requested asset is undefined"))) | |
478 | 504 | let amountToSend = if ((creditAvailable >= amountRequested)) | |
479 | 505 | then amountRequested | |
480 | 506 | else throwErr(("credit available = " + toString(creditAvailable))) | |
481 | 507 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kCredit(accountAddress, assetIdRequested), (valueOrElse(creditOption(accountAddress, assetIdRequested), 0) + amountToSend)], nil), invoke(factoryAddress, "transferAsset", [userAddress.bytes, amountToSend, syntheticAssetId], nil)] | |
482 | 508 | $Tuple2(nil, [factoryActions, creditAvailable]) | |
483 | 509 | } | |
484 | 510 | else throw("Strict value is not equal to itself.") | |
485 | 511 | } | |
486 | 512 | ||
487 | 513 | ||
488 | 514 | ||
489 | 515 | @Callable(i) | |
490 | 516 | func repay (callerPublicKey,args) = { | |
491 | 517 | let ckecks = [if (!(shutdown)) | |
492 | 518 | then true | |
493 | 519 | else throwErr("not allowed"), mustFactory(i.caller)] | |
494 | 520 | if ((ckecks == ckecks)) | |
495 | 521 | then $Tuple2(nil, unit) | |
496 | 522 | else throw("Strict value is not equal to itself.") | |
497 | 523 | } | |
498 | 524 | ||
499 | 525 | ||
500 | 526 | ||
501 | 527 | @Callable(i) | |
502 | 528 | func setPairAllowance (callerPublicKey,args) = { | |
503 | 529 | let ckecks = [if (!(shutdown)) | |
504 | 530 | then true | |
505 | 531 | else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey)] | |
506 | 532 | if ((ckecks == ckecks)) | |
507 | 533 | then { | |
508 | 534 | let amountAssetIdStr = args[0] | |
509 | 535 | let priceAssetIdStr = args[1] | |
510 | 536 | let allowStr = args[2] | |
511 | 537 | let amountAssetId = parseAssetId(amountAssetIdStr) | |
512 | 538 | let priceAssetId = parseAssetId(priceAssetIdStr) | |
513 | 539 | let allow = (allowStr == "true") | |
514 | 540 | let invocations = [invoke(factoryAddress, "booleanEntry", [kPairAllowed(amountAssetId, priceAssetId), allow], nil)] | |
515 | 541 | $Tuple2(nil, invocations) | |
516 | 542 | } | |
517 | 543 | else throw("Strict value is not equal to itself.") | |
518 | 544 | } | |
519 | 545 | ||
520 | 546 | ||
521 | 547 | ||
522 | 548 | @Callable(i) | |
523 | 549 | func addSyntheticAsset (callerPublicKey,args) = { | |
524 | 550 | let baseAssetId = parseAssetId(args[0]) | |
525 | 551 | let syntheticAssetId = parseAssetId(args[1]) | |
526 | 552 | let ckecks = [if (!(shutdown)) | |
527 | 553 | then true | |
528 | 554 | else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit)) | |
529 | 555 | then true | |
530 | 556 | else throwErr("invalid base asset"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit)) | |
531 | 557 | then true | |
532 | 558 | else throwErr("invalid synthetic asset")] | |
533 | 559 | if ((ckecks == ckecks)) | |
534 | 560 | then { | |
535 | 561 | let invocations = [invoke(factoryAddress, "stringEntry", [kSyntheticAssetId(baseAssetId), assetIdToString(syntheticAssetId)], nil), invoke(factoryAddress, "stringEntry", [kBaseAssetId(syntheticAssetId), assetIdToString(baseAssetId)], nil)] | |
536 | 562 | $Tuple2(nil, invocations) | |
537 | 563 | } | |
538 | 564 | else throw("Strict value is not equal to itself.") | |
539 | 565 | } | |
540 | 566 | ||
541 | 567 | ||
542 | 568 | ||
543 | 569 | @Callable(i) | |
544 | 570 | func doShutdown (callerPublicKey,args) = { | |
545 | 571 | let checks = [mustFactory(i.caller), mustAdmin(callerPublicKey)] | |
546 | 572 | if ((checks == checks)) | |
547 | 573 | then { | |
548 | 574 | let invocations = [invoke(factoryAddress, "booleanEntry", [kShutdown, true], nil)] | |
549 | 575 | $Tuple2(nil, invocations) | |
550 | 576 | } | |
551 | 577 | else throw("Strict value is not equal to itself.") | |
552 | 578 | } | |
553 | 579 | ||
554 | 580 | ||
555 | 581 | ||
556 | 582 | @Callable(i) | |
557 | 583 | func getAccountInfoREADONLY (callerPublicKey,args) = { | |
558 | 584 | let checks = [mustFactory(i.caller)] | |
559 | 585 | if ((checks == checks)) | |
560 | 586 | then { | |
561 | 587 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
562 | - | let $t02263322701 = getAccountAssets(accountAddress) | |
563 | - | let amountAssetId = $t02263322701._1 | |
564 | - | let priceAssetId = $t02263322701._2 | |
565 | - | let leverage = valueOrErrorMessage(getInteger(factoryAddress, kLeverage(accountAddress)), wrapErr("leverage should be defined")) | |
566 | - | let userAddress = addressFromPublicKey(callerPublicKey) | |
567 | - | let requestId = getRequestId(accountAddress) | |
568 | - | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
569 | - | let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(usdtAssetId)) | |
570 | - | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(usdtAssetId)) | |
571 | - | let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId)) | |
572 | - | let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, usdtAssetId)), 0), pow10Decimals(usdtAssetId)) | |
573 | - | let data = $Tuple11(assetIdToString(amountAssetId), assetIdToString(priceAssetId), toString(accountAddress), toBase58String(accountPublicKey), leverage, toBase58String(requestId), deposited, creditA, creditB, toX18(0, pow10Decimals(amountAssetId)), toX18(0, pow10Decimals(usdtAssetId))) | |
588 | + | let data = getAccountInfoInternal(accountAddress) | |
574 | 589 | $Tuple2(nil, data) | |
590 | + | } | |
591 | + | else throw("Strict value is not equal to itself.") | |
592 | + | } | |
593 | + | ||
594 | + | ||
595 | + | ||
596 | + | @Callable(i) | |
597 | + | func getUserInfoREADONLY (callerPublicKey,args) = { | |
598 | + | let checks = [mustFactory(i.caller)] | |
599 | + | if ((checks == checks)) | |
600 | + | then { | |
601 | + | let userAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid user address")) | |
602 | + | let userRequests = valueOrErrorMessage(getBinary(factoryAddress, kRequestsByOwner(userAddress)), "kRequestsByOwner not found") | |
603 | + | let userRequestsNumber = (size(userRequests) / queueItemSize) | |
604 | + | let nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
605 | + | func getAccountsData (acc,count) = { | |
606 | + | let $t02497125013 = acc | |
607 | + | let accDataList = $t02497125013._1 | |
608 | + | let rawBytes = $t02497125013._2 | |
609 | + | let maxSize = $t02497125013._3 | |
610 | + | if ((maxSize > count)) | |
611 | + | then { | |
612 | + | let requestId = take(rawBytes, queueItemSize) | |
613 | + | let newRawBytes = drop(rawBytes, queueItemSize) | |
614 | + | let accountPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestIdToAccountPublicKey(requestId)), "kRequestIdToAccountPublicKey not found") | |
615 | + | let accountAddress = addressFromPublicKey(accountPublicKey) | |
616 | + | let data = getAccountInfoInternal(accountAddress) | |
617 | + | $Tuple3((accDataList :+ data), newRawBytes, maxSize) | |
618 | + | } | |
619 | + | else acc | |
620 | + | } | |
621 | + | ||
622 | + | let $t02551725616 = { | |
623 | + | let $l = nums | |
624 | + | let $s = size($l) | |
625 | + | let $acc0 = $Tuple3(nil, userRequests, userRequestsNumber) | |
626 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
627 | + | then $a | |
628 | + | else getAccountsData($a, $l[$i]) | |
629 | + | ||
630 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
631 | + | then $a | |
632 | + | else throw("List size exceeds 20") | |
633 | + | ||
634 | + | $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) | |
635 | + | } | |
636 | + | let accDataList = $t02551725616._1 | |
637 | + | let _a = $t02551725616._2 | |
638 | + | let _b = $t02551725616._3 | |
639 | + | $Tuple2(nil, accDataList) | |
575 | 640 | } | |
576 | 641 | else throw("Strict value is not equal to itself.") | |
577 | 642 | } | |
578 | 643 | ||
579 | 644 | ||
580 | 645 | @Verifier(tx) | |
581 | 646 | func verify () = if (if (isDefined(factoryAddressOption)) | |
582 | 647 | then isDefined(getString(factoryAddress, kMultisig)) | |
583 | 648 | else false) | |
584 | 649 | then match getString(factoryAddress, kMultisig) { | |
585 | 650 | case multisig: String => | |
586 | 651 | let statusKey = kStatus(toString(this), toBase58String(tx.id)) | |
587 | 652 | let status = valueOrElse(getBoolean(addressFromStringValue(multisig), statusKey), false) | |
588 | 653 | status | |
589 | 654 | case _ => | |
590 | 655 | false | |
591 | 656 | } | |
592 | 657 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
593 | 658 |
github/deemru/w8io/026f985 77.05 ms ◑