tx · HbHJtiTr29qYXBqd6mpeChfpyEF6xP2Rgjf9sBknSczN 3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37: -0.02100000 Waves 2024.05.15 13:29 [3107017] smart account 3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37 > SELF 0.00000000 Waves
{ "type": 13, "id": "HbHJtiTr29qYXBqd6mpeChfpyEF6xP2Rgjf9sBknSczN", "fee": 2100000, "feeAssetId": null, "timestamp": 1715768971175, "version": 2, "chainId": 84, "sender": "3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37", "senderPublicKey": "vmMXxwQAMUAoisvL193ptPiTtaWQqL5YNu2zs1ouTbY", "proofs": [ "3z1uDVuMSHb5C5K6p4JEcxWybxs9MvQmyRWvcqkc3aqtCdnPKuUtJGR6xf2F1XUB9Rv2GVEezHdqbKWVVCwrVzTr" ], "script": "base64:BwI9CAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGFMACXNlcGFyYXRvcgICX18AB2NoYWluSWQJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEACGNoYWluSWRXAQFXABBjb250cmFjdEZpbGVuYW1lAhdmdXR1cmVzX2NhbGN1bGF0b3IucmlkZQAFbXVsdDgAgMLXLwAMbXVsdDE4QmlnSW50CQC2AgEAgICQu7rWrfANAA13YXZlc0RlY2ltYWxzAAgADHVzZHREZWNpbWFscwAGAAt3YXZlc1N0cmluZwIFV0FWRVMADXF1ZXVlSXRlbVNpemUAIAAEYmlnMAkAtgIBAAAACWtNdWx0aXNpZwIMJXNfX211bHRpc2lnAQdrU3RhdHVzAgRkYXBwBHR4SWQJALkJAgkAzAgCAgolc19fc3RhdHVzCQDMCAIFBGRhcHAJAMwIAgUEdHhJZAUDbmlsBQlzZXBhcmF0b3IACWtTaHV0ZG93bgIMJXNfX3NodXRkb3duAAtrUHVibGljS2V5cwIOJXNfX3B1YmxpY0tleXMAEWtNYXRjaGVyUHVibGljS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AUCdHgCaWQEBnN0YXR1cwkBC3ZhbHVlT3JFbHNlAgkAmwgCCQERQGV4dHJOYXRpdmUoMTA2MikBBQhtdWx0aXNpZwUJc3RhdHVzS2V5BwUGc3RhdHVzBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleauwFXg=", "height": 3107017, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CD5g85vYA2m5vvcK62RtTKu1afc3XFYE1UFzpK4KHEit Next: DWTqoGQSuGF6NAXgKqhvQSAXoa2ZikgzsGJF9ao5Mq5F Diff:
Old | New | Differences | |
---|---|---|---|
273 | 273 | ||
274 | 274 | ||
275 | 275 | func getAssetsByAccountAddress (accountAddress) = { | |
276 | - | let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address"))) | |
276 | + | let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined"))) | |
277 | 277 | let amountAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestAmountAssetId(requestId)), wrapErr("invalid amount asset id"))) | |
278 | 278 | let priceAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestPriceAssetId(requestId)), wrapErr("invalid amount price id"))) | |
279 | 279 | $Tuple2(amountAssetId, priceAssetId) | |
319 | 319 | else throwErr(("accounts limit is " + toString(accountsLimit())))] | |
320 | 320 | if ((checks == checks)) | |
321 | 321 | then { | |
322 | - | let $ | |
322 | + | let $t01078212138 = if ((size(accountsQueue()) == 0)) | |
323 | 323 | then $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil)]) | |
324 | 324 | else { | |
325 | 325 | let accountPublicKey = take(accountsQueue(), queueItemSize) | |
327 | 327 | let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key"))) | |
328 | 328 | $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)]) | |
329 | 329 | } | |
330 | - | let actions = $ | |
331 | - | let factoryActions = $ | |
330 | + | let actions = $t01078212138._1 | |
331 | + | let factoryActions = $t01078212138._2 | |
332 | 332 | $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)])) | |
333 | 333 | } | |
334 | 334 | else throw("Strict value is not equal to itself.") | |
361 | 361 | else throwErr("invalid script")] | |
362 | 362 | if ((checks == checks)) | |
363 | 363 | then { | |
364 | - | let $ | |
364 | + | let $t01339314395 = if ((size(requestsQueue()) == 0)) | |
365 | 365 | then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)]) | |
366 | 366 | else { | |
367 | 367 | let requestId = take(requestsQueue(), queueItemSize) | |
368 | 368 | $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)]) | |
369 | 369 | } | |
370 | - | let actions = $ | |
371 | - | let factoryActions = $ | |
370 | + | let actions = $t01339314395._1 | |
371 | + | let factoryActions = $t01339314395._2 | |
372 | 372 | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)])) | |
373 | 373 | } | |
374 | 374 | else throw("Strict value is not equal to itself.") | |
429 | 429 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
430 | 430 | let assetId = parseAssetId(args[1]) | |
431 | 431 | let amountRaw = parseInt(args[2]) | |
432 | - | let $ | |
433 | - | let amountAssetId = $ | |
434 | - | let priceAssetId = $ | |
432 | + | let $t01650216579 = getAssetsByAccountAddress(accountAddress) | |
433 | + | let amountAssetId = $t01650216579._1 | |
434 | + | let priceAssetId = $t01650216579._2 | |
435 | 435 | let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(priceAssetId)) | |
436 | 436 | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(usdtAssetId)) | |
437 | 437 | let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId)) |
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 parseAssetId (input) = if ((input == wavesString)) | |
53 | 53 | then unit | |
54 | 54 | else fromBase58String(input) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func assetIdToString (input) = if ((input == unit)) | |
58 | 58 | then wavesString | |
59 | 59 | else toBase58String(value(input)) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getAssetInfoOrFail (assetId) = valueOrErrorMessage(assetInfo(assetId), wrapErr("invalid asset info")) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getAssetDecimalsOrFail (assetId) = match assetId { | |
66 | 66 | case _: Unit => | |
67 | 67 | wavesDecimals | |
68 | 68 | case assetId: ByteVector => | |
69 | 69 | getAssetInfoOrFail(assetId).decimals | |
70 | 70 | case _ => | |
71 | 71 | throw("Match error") | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func pow10 (n) = pow(10, 0, n, 0, 0, DOWN) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func pow10Decimals (assetId) = pow10(getAssetDecimalsOrFail(assetId)) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | let kFactoryAddress = "%s__factoryAddress" | |
82 | 82 | ||
83 | 83 | let factoryAddressOption = match getString(this, kFactoryAddress) { | |
84 | 84 | case s: String => | |
85 | 85 | addressFromString(s) | |
86 | 86 | case _: Unit => | |
87 | 87 | unit | |
88 | 88 | case _ => | |
89 | 89 | throw("Match error") | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address")) | |
93 | 93 | ||
94 | 94 | let kUsdtAssetId = "%s__usdtAssetId" | |
95 | 95 | ||
96 | 96 | let usdtAssetIdOption = match getString(factoryAddress, kUsdtAssetId) { | |
97 | 97 | case s: String => | |
98 | 98 | parseAssetId(s) | |
99 | 99 | case _: Unit => | |
100 | 100 | unit | |
101 | 101 | case _ => | |
102 | 102 | throw("Match error") | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | let usdtAssetId = valueOrErrorMessage(usdtAssetIdOption, wrapErr("invalid usdt asset id")) | |
106 | 106 | ||
107 | 107 | let kPricesAddress = "%s__calculatorAddress" | |
108 | 108 | ||
109 | 109 | let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false) | |
110 | 110 | ||
111 | 111 | func mustAddress (caller,address) = if ((caller == address)) | |
112 | 112 | then true | |
113 | 113 | else throwErr("permission denied") | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func mustThis (caller) = mustAddress(caller, this) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func mustFactory (caller) = mustAddress(caller, factoryAddress) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func mustAdmin (callerPublicKey) = { | |
123 | 123 | let multisig = addressFromStringValue(getStringValue(factoryAddress, kMultisig)) | |
124 | 124 | let publicKeysList = split(getStringValue(multisig, kPublicKeys), separator) | |
125 | 125 | if (containsElement(publicKeysList, toBase58String(callerPublicKey))) | |
126 | 126 | then true | |
127 | 127 | else throwErr("not allowed") | |
128 | 128 | } | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | let kAccountScript = "%s__accountScript" | |
132 | 132 | ||
133 | 133 | func accountScript () = valueOrErrorMessage(getBinary(factoryAddress, kAccountScript), wrapErr("account script is not set")) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | let kRewardAmount = "%s__rewardAmount" | |
137 | 137 | ||
138 | 138 | func rewardAmount () = valueOrErrorMessage(getInteger(factoryAddress, kRewardAmount), wrapErr("reward amount is not set")) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | let kAccountsLimit = "%s__accountsLimit" | |
142 | 142 | ||
143 | 143 | let accountsLimitDefault = 20 | |
144 | 144 | ||
145 | 145 | func accountsLimit () = valueOrElse(getInteger(factoryAddress, kAccountsLimit), accountsLimitDefault) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func kDeposited (accountAddress) = makeString(["%s%s", "deposited", toString(accountAddress)], separator) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func depositedOption (accountAddress) = getInteger(factoryAddress, kDeposited(accountAddress)) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func kCredit (accountAddress,assetId) = makeString(["%s%s%s", "credit", toString(accountAddress), assetIdToString(assetId)], separator) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func kLeverage (accountAddress) = makeString(["%s%s", "leverage", toString(accountAddress)], separator) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func kSyntheticAssetId (baseAssetId) = makeString(["%s%s", "syntheticAssetId", assetIdToString(baseAssetId)], separator) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func kBaseAssetId (syntheticAssetId) = makeString(["%s%s", "baseAssetId", assetIdToString(syntheticAssetId)], separator) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | let REQUEST_STATUS_EMPTY = 0 | |
167 | 167 | ||
168 | 168 | let REQUEST_STATUS_READY = 1 | |
169 | 169 | ||
170 | 170 | func kRequestStatus (requestId) = makeString(["%s%s", toBase58String(requestId), "status"], separator) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | func kAccountCreatorPublicKey (accountAddress) = makeString(["%s%s", toString(accountAddress), "creatorPublicKey"], separator) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func kRequestOwnerPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "ownerPublicKey"], separator) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func kRequestAmountAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "amountAssetId"], separator) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func kRequestPriceAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "priceAssetId"], separator) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func kRequestIdToAccountPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "requestIdToAccountPublicKey"], separator) | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator) | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | func kRequestsQueue () = makeString(["%s", "requestsQueue"], separator) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func requestsQueue () = valueOrElse(getBinary(factoryAddress, kRequestsQueue()), base58'') | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func kAccountsQueue () = makeString(["%s", "accountsQueue"], separator) | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func accountsQueue () = valueOrElse(getBinary(factoryAddress, kAccountsQueue()), base58'') | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func kRequestsByOwner (ownerAddress) = makeString(["%s%s", "requests", toString(ownerAddress)], separator) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func requestsByOwner (ownerAddress) = valueOrElse(getBinary(factoryAddress, kRequestsByOwner(ownerAddress)), base58'') | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func kPairAllowed (amountAssetId,priceAssetId) = makeString(["%s%s%s", assetIdToString(amountAssetId), assetIdToString(priceAssetId), "pairAllowed"], separator) | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func pairAllowed (amountAssetId,priceAssetId) = valueOrElse(getBoolean(factoryAddress, kPairAllowed(amountAssetId, priceAssetId)), false) | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func kPrice (assetId) = makeString(["%s", assetIdToString(assetId)], separator) | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | func getCurrentPrice (assetId) = { | |
219 | 219 | let matcherPublicKey = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kMatcherPublicKey), wrapErr("invalid matcher public key"))) | |
220 | 220 | let matcherAddress = addressFromPublicKey(matcherPublicKey) | |
221 | 221 | let price = valueOrErrorMessage(getInteger(matcherAddress, kPrice(assetId)), wrapErr(("invalid price, assetId = " + assetIdToString(assetId)))) | |
222 | 222 | price | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func calcTotalCredit (creditA,creditB,currentPrice) = (fraction(creditA, currentPrice, mult18BigInt) + creditB) | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func calcTotalBalance (balanceA,balanceB,currentPrice) = (fraction(balanceA, currentPrice, mult18BigInt) + balanceB) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | func calcPnl (totalBalance,totalCredit) = (totalBalance - totalCredit) | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func calcCreditAvailable (deposit,leverage,totalCredit) = (fraction(deposit, leverage, mult18BigInt) - totalCredit) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func calcRealInCredit (credit,balance) = if ((credit > big0)) | |
239 | 239 | then (credit - balance) | |
240 | 240 | else big0 | |
241 | 241 | ||
242 | 242 | ||
243 | 243 | func calcFree (credit,balance) = if ((credit > big0)) | |
244 | 244 | then (balance - credit) | |
245 | 245 | else big0 | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func calcShortPrice (free,realInCredit) = if ((realInCredit > big0)) | |
249 | 249 | then max([big0, fraction(free, mult18BigInt, realInCredit)]) | |
250 | 250 | else big0 | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func calcLongPrice (free,realInCredit) = if ((realInCredit > big0)) | |
254 | 254 | then max([big0, fraction(realInCredit, mult18BigInt, free)]) | |
255 | 255 | else big0 | |
256 | 256 | ||
257 | 257 | ||
258 | 258 | func calcStartMargin (realInCreditA,realInCreditB,currentPrice,settingsMargin) = fraction((fraction(realInCreditA, currentPrice, mult18BigInt) + realInCreditB), settingsMargin, mult18BigInt) | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | func calcMarginSupply (settingsMarginSupply,settingsMargin,startMargin) = fraction(settingsMarginSupply, startMargin, settingsMargin) | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func calcLiquidationPrice (deposit,marginSupply,realInCreditA,realInCreditB,shortPrice,longPrice) = { | |
265 | 265 | let liquidationPriceA = if ((realInCreditA > 0)) | |
266 | 266 | then (((deposit - marginSupply) / realInCreditA) + shortPrice) | |
267 | 267 | else 0 | |
268 | 268 | let liquidationPriceB = if ((realInCreditB > 0)) | |
269 | 269 | then (longPrice - ((deposit - marginSupply) / (realInCreditA / longPrice))) | |
270 | 270 | else 0 | |
271 | 271 | (liquidationPriceA + liquidationPriceB) | |
272 | 272 | } | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func getAssetsByAccountAddress (accountAddress) = { | |
276 | - | let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address"))) | |
276 | + | let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined"))) | |
277 | 277 | let amountAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestAmountAssetId(requestId)), wrapErr("invalid amount asset id"))) | |
278 | 278 | let priceAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestPriceAssetId(requestId)), wrapErr("invalid amount price id"))) | |
279 | 279 | $Tuple2(amountAssetId, priceAssetId) | |
280 | 280 | } | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | @Callable(i) | |
284 | 284 | func init (factoryAddressStr) = { | |
285 | 285 | let checkCaller = mustThis(i.caller) | |
286 | 286 | if ((checkCaller == checkCaller)) | |
287 | 287 | then $Tuple2([StringEntry(kFactoryAddress, factoryAddressStr)], unit) | |
288 | 288 | else throw("Strict value is not equal to itself.") | |
289 | 289 | } | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | ||
293 | 293 | @Callable(i) | |
294 | 294 | func requestAccount (callerPublicKey,args) = { | |
295 | 295 | let ckecks = [if (!(shutdown)) | |
296 | 296 | then true | |
297 | 297 | else throwErr("not allowed"), mustFactory(i.caller)] | |
298 | 298 | if ((ckecks == ckecks)) | |
299 | 299 | then { | |
300 | 300 | let amountAssetIdStr = args[0] | |
301 | 301 | let priceAssetIdStr = args[1] | |
302 | 302 | let userAddress = addressFromPublicKey(callerPublicKey) | |
303 | 303 | let requestId = sha256(((userAddress.bytes + fromBase58String(amountAssetIdStr)) + fromBase58String(priceAssetIdStr))) | |
304 | 304 | let amountAssetId = parseAssetId(amountAssetIdStr) | |
305 | 305 | let priceAssetId = parseAssetId(priceAssetIdStr) | |
306 | 306 | let userRequestsNumber = (size(kRequestsByOwner(userAddress)) / queueItemSize) | |
307 | 307 | let checks = [if ((size(i.payments) == 1)) | |
308 | 308 | then true | |
309 | 309 | else throwErr("1 payment is required"), if ((i.payments[0].assetId == unit)) | |
310 | 310 | then true | |
311 | 311 | else throwErr("invalid asset"), if ((i.payments[0].amount == rewardAmount())) | |
312 | 312 | then true | |
313 | 313 | else throwErr("invalid amount"), if (pairAllowed(amountAssetId, priceAssetId)) | |
314 | 314 | then true | |
315 | 315 | else throwErr("pair is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit)) | |
316 | 316 | then true | |
317 | 317 | else throwErr("account is already exists"), if ((accountsLimit() > userRequestsNumber)) | |
318 | 318 | then true | |
319 | 319 | else throwErr(("accounts limit is " + toString(accountsLimit())))] | |
320 | 320 | if ((checks == checks)) | |
321 | 321 | then { | |
322 | - | let $ | |
322 | + | let $t01078212138 = if ((size(accountsQueue()) == 0)) | |
323 | 323 | then $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil)]) | |
324 | 324 | else { | |
325 | 325 | let accountPublicKey = take(accountsQueue(), queueItemSize) | |
326 | 326 | let accountAddress = addressFromPublicKey(accountPublicKey) | |
327 | 327 | let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key"))) | |
328 | 328 | $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)]) | |
329 | 329 | } | |
330 | - | let actions = $ | |
331 | - | let factoryActions = $ | |
330 | + | let actions = $t01078212138._1 | |
331 | + | let factoryActions = $t01078212138._2 | |
332 | 332 | $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)])) | |
333 | 333 | } | |
334 | 334 | else throw("Strict value is not equal to itself.") | |
335 | 335 | } | |
336 | 336 | else throw("Strict value is not equal to itself.") | |
337 | 337 | } | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | ||
341 | 341 | @Callable(i) | |
342 | 342 | func addAccount (callerPublicKey,args) = { | |
343 | 343 | let ckecks = [if (!(shutdown)) | |
344 | 344 | then true | |
345 | 345 | else throwErr("not allowed"), mustFactory(i.caller)] | |
346 | 346 | if ((ckecks == ckecks)) | |
347 | 347 | then { | |
348 | 348 | let creatorPublicKey = fromBase58String(args[0]) | |
349 | 349 | let accountPublicKey = callerPublicKey | |
350 | 350 | let accountAddress = addressFromPublicKey(callerPublicKey) | |
351 | 351 | let creatorAddress = addressFromPublicKey(creatorPublicKey) | |
352 | 352 | let checks = [if ((getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)) == unit)) | |
353 | 353 | then true | |
354 | 354 | else throwErr("account is already exists"), if ( match scriptHash(accountAddress) { | |
355 | 355 | case b: ByteVector => | |
356 | 356 | (b == blake2b256_32Kb(accountScript())) | |
357 | 357 | case _ => | |
358 | 358 | false | |
359 | 359 | }) | |
360 | 360 | then true | |
361 | 361 | else throwErr("invalid script")] | |
362 | 362 | if ((checks == checks)) | |
363 | 363 | then { | |
364 | - | let $ | |
364 | + | let $t01339314395 = if ((size(requestsQueue()) == 0)) | |
365 | 365 | then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)]) | |
366 | 366 | else { | |
367 | 367 | let requestId = take(requestsQueue(), queueItemSize) | |
368 | 368 | $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)]) | |
369 | 369 | } | |
370 | - | let actions = $ | |
371 | - | let factoryActions = $ | |
370 | + | let actions = $t01339314395._1 | |
371 | + | let factoryActions = $t01339314395._2 | |
372 | 372 | $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)])) | |
373 | 373 | } | |
374 | 374 | else throw("Strict value is not equal to itself.") | |
375 | 375 | } | |
376 | 376 | else throw("Strict value is not equal to itself.") | |
377 | 377 | } | |
378 | 378 | ||
379 | 379 | ||
380 | 380 | ||
381 | 381 | @Callable(i) | |
382 | 382 | func deposit (callerPublicKey,args) = { | |
383 | 383 | let payment = i.payments[0] | |
384 | 384 | let ckecks = [if (!(shutdown)) | |
385 | 385 | then true | |
386 | 386 | else throwErr("not allowed"), mustFactory(i.caller), if ((size(i.payments) == 1)) | |
387 | 387 | then true | |
388 | 388 | else throwErr("1 payment is required"), if ((payment.assetId == usdtAssetId)) | |
389 | 389 | then true | |
390 | 390 | else throwErr("invalid asset")] | |
391 | 391 | if ((ckecks == ckecks)) | |
392 | 392 | then { | |
393 | 393 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
394 | 394 | let actions = [ScriptTransfer(accountAddress, payment.amount, payment.assetId)] | |
395 | 395 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kDeposited(accountAddress), (valueOrElse(depositedOption(accountAddress), 0) + payment.amount)], nil)] | |
396 | 396 | $Tuple2(actions, factoryActions) | |
397 | 397 | } | |
398 | 398 | else throw("Strict value is not equal to itself.") | |
399 | 399 | } | |
400 | 400 | ||
401 | 401 | ||
402 | 402 | ||
403 | 403 | @Callable(i) | |
404 | 404 | func withdraw (callerPublicKey,args) = { | |
405 | 405 | let ckecks = [if (!(shutdown)) | |
406 | 406 | then true | |
407 | 407 | else throwErr("not allowed"), mustFactory(i.caller)] | |
408 | 408 | if ((ckecks == ckecks)) | |
409 | 409 | then { | |
410 | 410 | let userAddress = addressFromPublicKey(callerPublicKey) | |
411 | 411 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
412 | 412 | let amount = valueOrErrorMessage(parseInt(args[1]), wrapErr("invalid amount")) | |
413 | 413 | let assetId = parseAssetId(args[2]) | |
414 | 414 | let invocations = [invoke(accountAddress, "transferAsset", [userAddress.bytes, amount, assetId], nil)] | |
415 | 415 | $Tuple2(nil, invocations) | |
416 | 416 | } | |
417 | 417 | else throw("Strict value is not equal to itself.") | |
418 | 418 | } | |
419 | 419 | ||
420 | 420 | ||
421 | 421 | ||
422 | 422 | @Callable(i) | |
423 | 423 | func borrow (callerPublicKey,args) = { | |
424 | 424 | let ckecks = [if (!(shutdown)) | |
425 | 425 | then true | |
426 | 426 | else throwErr("not allowed"), mustFactory(i.caller)] | |
427 | 427 | if ((ckecks == ckecks)) | |
428 | 428 | then { | |
429 | 429 | let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address")) | |
430 | 430 | let assetId = parseAssetId(args[1]) | |
431 | 431 | let amountRaw = parseInt(args[2]) | |
432 | - | let $ | |
433 | - | let amountAssetId = $ | |
434 | - | let priceAssetId = $ | |
432 | + | let $t01650216579 = getAssetsByAccountAddress(accountAddress) | |
433 | + | let amountAssetId = $t01650216579._1 | |
434 | + | let priceAssetId = $t01650216579._2 | |
435 | 435 | let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(priceAssetId)) | |
436 | 436 | let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(usdtAssetId)) | |
437 | 437 | let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId)) | |
438 | 438 | let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, priceAssetId)), 0), pow10Decimals(priceAssetId)) | |
439 | 439 | let totalCredit = calcTotalCredit(creditA, creditB, currentPrice) | |
440 | 440 | let leverageDefault = 3 | |
441 | 441 | let leverage = toX18(valueOrElse(getInteger(factoryAddress, kLeverage(accountAddress)), leverageDefault), 1) | |
442 | 442 | let creditAvailable = calcCreditAvailable(deposited, leverage, totalCredit) | |
443 | 443 | $Tuple2(nil, [fromX18(creditAvailable, pow10Decimals(priceAssetId))]) | |
444 | 444 | } | |
445 | 445 | else throw("Strict value is not equal to itself.") | |
446 | 446 | } | |
447 | 447 | ||
448 | 448 | ||
449 | 449 | ||
450 | 450 | @Callable(i) | |
451 | 451 | func repay (callerPublicKey,args) = { | |
452 | 452 | let ckecks = [if (!(shutdown)) | |
453 | 453 | then true | |
454 | 454 | else throwErr("not allowed"), mustFactory(i.caller)] | |
455 | 455 | if ((ckecks == ckecks)) | |
456 | 456 | then $Tuple2(nil, unit) | |
457 | 457 | else throw("Strict value is not equal to itself.") | |
458 | 458 | } | |
459 | 459 | ||
460 | 460 | ||
461 | 461 | ||
462 | 462 | @Callable(i) | |
463 | 463 | func setPairAllowance (callerPublicKey,args) = { | |
464 | 464 | let ckecks = [if (!(shutdown)) | |
465 | 465 | then true | |
466 | 466 | else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey)] | |
467 | 467 | if ((ckecks == ckecks)) | |
468 | 468 | then { | |
469 | 469 | let amountAssetIdStr = args[0] | |
470 | 470 | let priceAssetIdStr = args[1] | |
471 | 471 | let allowStr = args[2] | |
472 | 472 | let amountAssetId = parseAssetId(amountAssetIdStr) | |
473 | 473 | let priceAssetId = parseAssetId(priceAssetIdStr) | |
474 | 474 | let allow = (allowStr == "true") | |
475 | 475 | let invocations = [invoke(factoryAddress, "booleanEntry", [kPairAllowed(amountAssetId, priceAssetId), allow], nil)] | |
476 | 476 | $Tuple2(nil, invocations) | |
477 | 477 | } | |
478 | 478 | else throw("Strict value is not equal to itself.") | |
479 | 479 | } | |
480 | 480 | ||
481 | 481 | ||
482 | 482 | ||
483 | 483 | @Callable(i) | |
484 | 484 | func addSyntheticAsset (callerPublicKey,args) = { | |
485 | 485 | let baseAssetIdStr = args[0] | |
486 | 486 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
487 | 487 | let syntheticAssetId = i.payments[0].assetId | |
488 | 488 | let ckecks = [if (!(shutdown)) | |
489 | 489 | then true | |
490 | 490 | else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit)) | |
491 | 491 | then true | |
492 | 492 | else throwErr("invalid base asset"), if ((size(i.payments) == 1)) | |
493 | 493 | then true | |
494 | 494 | else throwErr("invalid payments"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit)) | |
495 | 495 | then true | |
496 | 496 | else throwErr("invalid synthetic asset")] | |
497 | 497 | if ((ckecks == ckecks)) | |
498 | 498 | then { | |
499 | 499 | let invocations = [invoke(factoryAddress, "stringEntry", [kSyntheticAssetId(baseAssetId), assetIdToString(syntheticAssetId)], nil), invoke(factoryAddress, "stringEntry", [kBaseAssetId(syntheticAssetId), assetIdToString(baseAssetId)], nil)] | |
500 | 500 | $Tuple2(nil, invocations) | |
501 | 501 | } | |
502 | 502 | else throw("Strict value is not equal to itself.") | |
503 | 503 | } | |
504 | 504 | ||
505 | 505 | ||
506 | 506 | ||
507 | 507 | @Callable(i) | |
508 | 508 | func doShutdown (callerPublicKey,args) = { | |
509 | 509 | let checks = [mustFactory(i.caller), mustAdmin(callerPublicKey)] | |
510 | 510 | if ((checks == checks)) | |
511 | 511 | then { | |
512 | 512 | let invocations = [invoke(factoryAddress, "booleanEntry", [kShutdown, true], nil)] | |
513 | 513 | $Tuple2(nil, invocations) | |
514 | 514 | } | |
515 | 515 | else throw("Strict value is not equal to itself.") | |
516 | 516 | } | |
517 | 517 | ||
518 | 518 | ||
519 | 519 | @Verifier(tx) | |
520 | 520 | func verify () = if (if (isDefined(factoryAddressOption)) | |
521 | 521 | then isDefined(getString(factoryAddress, kMultisig)) | |
522 | 522 | else false) | |
523 | 523 | then match getString(factoryAddress, kMultisig) { | |
524 | 524 | case multisig: String => | |
525 | 525 | let statusKey = kStatus(toString(this), toBase58String(tx.id)) | |
526 | 526 | let status = valueOrElse(getBoolean(addressFromStringValue(multisig), statusKey), false) | |
527 | 527 | status | |
528 | 528 | case _ => | |
529 | 529 | false | |
530 | 530 | } | |
531 | 531 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
532 | 532 |
github/deemru/w8io/169f3d6 63.52 ms ◑