tx · 3gheT5Mo9ByFriByEeXCzrD3Z8nQsPWFkoMM6fbbbydC

3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37:  -0.02400000 Waves

2024.05.17 09:03 [3109630] smart account 3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37 > SELF 0.00000000 Waves

{ "type": 13, "id": "3gheT5Mo9ByFriByEeXCzrD3Z8nQsPWFkoMM6fbbbydC", "fee": 2400000, "feeAssetId": null, "timestamp": 1715925899159, "version": 2, "chainId": 84, "sender": "3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37", "senderPublicKey": "vmMXxwQAMUAoisvL193ptPiTtaWQqL5YNu2zs1ouTbY", "proofs": [ "4sHEpkRsGHaP6Nr6XYThaW9tX5SRrbzDb2SQkVnVy8DCZa8puJ7UaKGFr7XrqL3tiiBuUyDwMsoqSZZrk6Z4JVeQ" ], "script": "base64:BwI9CAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGFcACXNlcGFyYXRvcgICX18AB2NoYWluSWQJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEACGNoYWluSWRXAQFXABBjb250cmFjdEZpbGVuYW1lAhdmdXR1cmVzX2NhbGN1bGF0b3IucmlkZQAFbXVsdDgAgMLXLwAMbXVsdDE4QmlnSW50CQC2AgEAgICQu7rWrfANAA13YXZlc0RlY2ltYWxzAAgADHVzZHREZWNpbWFscwAGAAt3YXZlc1N0cmluZwIFV0FWRVMADXF1ZXVlSXRlbVNpemUAIAAEYmlnMAkAtgIBAAAACWtNdWx0aXNpZwIMJXNfX211bHRpc2lnAQdrU3RhdHVzAgRkYXBwBHR4SWQJALkJAgkAzAgCAgolc19fc3RhdHVzCQDMCAIFBGRhcHAJAMwIAgUEdHhJZAUDbmlsBQlzZXBhcmF0b3IACWtTaHV0ZG93bgIMJXNfX3NodXRkb3duAAtrUHVibGljS2V5cwIOJXNfX3B1YmxpY0tleXMAEWtNYXRjaGVy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AJ0IAgUOZmFjdG9yeUFkZHJlc3MFCWtNdWx0aXNpZwMJAAECBQckbWF0Y2gwAgZTdHJpbmcECG11bHRpc2lnBQckbWF0Y2gwBAlzdGF0dXNLZXkJAQdrU3RhdHVzAgkApQgBBQR0aGlzCQDYBAEIBQJ0eAJpZAQGc3RhdHVzCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCG11bHRpc2lnBQlzdGF0dXNLZXkHBQZzdGF0dXMHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5dqDqVg==", "height": 3109630, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FhPupu9dM9Ji8BuNPnHRUqyhJyUeybwSfyqvoxskUjNq Next: 2Nf3iCgG9ABAJCYB6DfZVcUTgkXfHGfM3BuT8GonDx8a Diff:
OldNewDifferences
280280 }
281281
282282
283+func getRequestId (accountAddress) = {
284+ let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined")))
285+ requestId
286+ }
287+
288+
283289 func getAccountAssets (accountAddress) = {
284- let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined")))
290+ let requestId = getRequestId(accountAddress)
285291 let amountAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestAmountAssetId(requestId)), wrapErr("invalid amount asset id")))
286292 let priceAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestPriceAssetId(requestId)), wrapErr("invalid amount price id")))
287293 $Tuple2(amountAssetId, priceAssetId)
289295
290296
291297 func getAccountOwnerPublicKey (accountAddress) = {
292- let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined")))
298+ let requestId = getRequestId(accountAddress)
293299 let requestOwnerPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestOwnerPublicKey(requestId)), wrapErr("invalid amount asset id"))
294300 requestOwnerPublicKey
295301 }
334340 else throwErr(("accounts limit is " + toString(accountsLimit())))]
335341 if ((checks == checks))
336342 then {
337- let $t01151412870 = if ((size(accountsQueue()) == 0))
343+ let $t01147512831 = if ((size(accountsQueue()) == 0))
338344 then $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil)])
339345 else {
340346 let accountPublicKey = take(accountsQueue(), queueItemSize)
342348 let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key")))
343349 $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)])
344350 }
345- let actions = $t01151412870._1
346- let factoryActions = $t01151412870._2
351+ let actions = $t01147512831._1
352+ let factoryActions = $t01147512831._2
347353 $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)]))
348354 }
349355 else throw("Strict value is not equal to itself.")
376382 else throwErr("invalid script")]
377383 if ((checks == checks))
378384 then {
379- let $t01412515127 = if ((size(requestsQueue()) == 0))
385+ let $t01408615088 = if ((size(requestsQueue()) == 0))
380386 then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)])
381387 else {
382388 let requestId = take(requestsQueue(), queueItemSize)
383389 $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)])
384390 }
385- let actions = $t01412515127._1
386- let factoryActions = $t01412515127._2
391+ let actions = $t01408615088._1
392+ let factoryActions = $t01408615088._2
387393 $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)]))
388394 }
389395 else throw("Strict value is not equal to itself.")
396402 @Callable(i)
397403 func deposit (callerPublicKey,args) = {
398404 let payment = i.payments[0]
405+ let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
399406 let ckecks = [if (!(shutdown))
400407 then true
401408 else throwErr("not allowed"), mustFactory(i.caller), if ((size(i.payments) == 1))
402409 then true
403410 else throwErr("1 payment is required"), if ((payment.assetId == usdtAssetId))
404411 then true
405- else throwErr("invalid asset")]
412+ else throwErr("invalid asset"), if ((getInteger(factoryAddress, kRequestStatus(getRequestId(accountAddress))) == REQUEST_STATUS_READY))
413+ then true
414+ else throwErr("account is not ready")]
406415 if ((ckecks == ckecks))
407416 then {
408- let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
409417 let actions = [ScriptTransfer(accountAddress, payment.amount, payment.assetId)]
410418 let factoryActions = [invoke(factoryAddress, "integerEntry", [kDeposited(accountAddress), (valueOrElse(depositedOption(accountAddress), 0) + payment.amount)], nil)]
411419 $Tuple2(actions, factoryActions)
513521 let syntheticAssetId = parseAssetId(args[1])
514522 let ckecks = [if (!(shutdown))
515523 then true
516- else throwErr("not allowed"), mustFactory(i.caller), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit))
524+ else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit))
517525 then true
518526 else throwErr("invalid base asset"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit))
519527 then true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 7 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 let chainId = take(drop(this.bytes, 1), 1)
77
88 let chainIdW = base58'2W'
99
1010 let contractFilename = "futures_calculator.ride"
1111
1212 let mult8 = 100000000
1313
1414 let mult18BigInt = toBigInt(1000000000000000000)
1515
1616 let wavesDecimals = 8
1717
1818 let usdtDecimals = 6
1919
2020 let wavesString = "WAVES"
2121
2222 let queueItemSize = 32
2323
2424 let big0 = toBigInt(0)
2525
2626 let kMultisig = "%s__multisig"
2727
2828 func kStatus (dapp,txId) = makeString(["%s__status", dapp, txId], separator)
2929
3030
3131 let kShutdown = "%s__shutdown"
3232
3333 let kPublicKeys = "%s__publicKeys"
3434
3535 let kMatcherPublicKey = "%s__matcherPublicKey"
3636
3737 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), mult18BigInt, toBigInt(origScaleMult))
3838
3939
4040 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), mult18BigInt))
4141
4242
4343 func validateAddress (address) = isDefined(addressFromString(address))
4444
4545
4646 func wrapErr (s) = ((contractFilename + ": ") + s)
4747
4848
4949 func throwErr (s) = throw(wrapErr(s))
5050
5151
5252 func ensurePositive (v,s) = if ((v >= 0))
5353 then v
5454 else throwErr((s + " value should be positive"))
5555
5656
5757 func parseAssetId (input) = if ((input == wavesString))
5858 then unit
5959 else fromBase58String(input)
6060
6161
6262 func assetIdToString (input) = if ((input == unit))
6363 then wavesString
6464 else toBase58String(value(input))
6565
6666
6767 func getAssetInfoOrFail (assetId) = valueOrErrorMessage(assetInfo(assetId), wrapErr("invalid asset info"))
6868
6969
7070 func getAssetDecimalsOrFail (assetId) = match assetId {
7171 case _: Unit =>
7272 wavesDecimals
7373 case assetId: ByteVector =>
7474 getAssetInfoOrFail(assetId).decimals
7575 case _ =>
7676 throw("Match error")
7777 }
7878
7979
8080 func pow10 (n) = pow(10, 0, n, 0, 0, DOWN)
8181
8282
8383 func pow10Decimals (assetId) = pow10(getAssetDecimalsOrFail(assetId))
8484
8585
8686 let kFactoryAddress = "%s__factoryAddress"
8787
8888 let factoryAddressOption = match getString(this, kFactoryAddress) {
8989 case s: String =>
9090 addressFromString(s)
9191 case _: Unit =>
9292 unit
9393 case _ =>
9494 throw("Match error")
9595 }
9696
9797 let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
9898
9999 let kUsdtAssetId = "%s__usdtAssetId"
100100
101101 let usdtAssetIdOption = match getString(factoryAddress, kUsdtAssetId) {
102102 case s: String =>
103103 parseAssetId(s)
104104 case _: Unit =>
105105 unit
106106 case _ =>
107107 throw("Match error")
108108 }
109109
110110 let usdtAssetId = valueOrErrorMessage(usdtAssetIdOption, wrapErr("invalid usdt asset id"))
111111
112112 let kPricesAddress = "%s__calculatorAddress"
113113
114114 let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false)
115115
116116 func mustAddress (caller,address) = if ((caller == address))
117117 then true
118118 else throwErr("permission denied")
119119
120120
121121 func mustThis (caller) = mustAddress(caller, this)
122122
123123
124124 func mustFactory (caller) = mustAddress(caller, factoryAddress)
125125
126126
127127 func mustAdmin (callerPublicKey) = {
128128 let multisig = addressFromStringValue(getStringValue(factoryAddress, kMultisig))
129129 let publicKeysList = split(getStringValue(multisig, kPublicKeys), separator)
130130 if (containsElement(publicKeysList, toBase58String(callerPublicKey)))
131131 then true
132132 else throwErr("not allowed")
133133 }
134134
135135
136136 let kAccountScript = "%s__accountScript"
137137
138138 func accountScript () = valueOrErrorMessage(getBinary(factoryAddress, kAccountScript), wrapErr("account script is not set"))
139139
140140
141141 let kRewardAmount = "%s__rewardAmount"
142142
143143 func rewardAmount () = valueOrErrorMessage(getInteger(factoryAddress, kRewardAmount), wrapErr("reward amount is not set"))
144144
145145
146146 let kAccountsLimit = "%s__accountsLimit"
147147
148148 let accountsLimitDefault = 20
149149
150150 func accountsLimit () = valueOrElse(getInteger(factoryAddress, kAccountsLimit), accountsLimitDefault)
151151
152152
153153 func kDeposited (accountAddress) = makeString(["%s%s", "deposited", toString(accountAddress)], separator)
154154
155155
156156 func depositedOption (accountAddress) = getInteger(factoryAddress, kDeposited(accountAddress))
157157
158158
159159 func kCredit (accountAddress,assetId) = makeString(["%s%s%s", "credit", toString(accountAddress), assetIdToString(assetId)], separator)
160160
161161
162162 func creditOption (accountAddress,assetId) = getInteger(factoryAddress, kCredit(accountAddress, assetId))
163163
164164
165165 func kLeverage (accountAddress) = makeString(["%s%s", "leverage", toString(accountAddress)], separator)
166166
167167
168168 func kSyntheticAssetId (baseAssetId) = makeString(["%s%s", "syntheticAssetId", assetIdToString(baseAssetId)], separator)
169169
170170
171171 func kBaseAssetId (syntheticAssetId) = makeString(["%s%s", "baseAssetId", assetIdToString(syntheticAssetId)], separator)
172172
173173
174174 let REQUEST_STATUS_EMPTY = 0
175175
176176 let REQUEST_STATUS_READY = 1
177177
178178 func kRequestStatus (requestId) = makeString(["%s%s", toBase58String(requestId), "status"], separator)
179179
180180
181181 func kAccountCreatorPublicKey (accountAddress) = makeString(["%s%s", toString(accountAddress), "creatorPublicKey"], separator)
182182
183183
184184 func kRequestOwnerPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "ownerPublicKey"], separator)
185185
186186
187187 func kRequestAmountAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "amountAssetId"], separator)
188188
189189
190190 func kRequestPriceAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "priceAssetId"], separator)
191191
192192
193193 func kRequestIdToAccountPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "requestIdToAccountPublicKey"], separator)
194194
195195
196196 func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator)
197197
198198
199199 func kRequestsQueue () = makeString(["%s", "requestsQueue"], separator)
200200
201201
202202 func requestsQueue () = valueOrElse(getBinary(factoryAddress, kRequestsQueue()), base58'')
203203
204204
205205 func kAccountsQueue () = makeString(["%s", "accountsQueue"], separator)
206206
207207
208208 func accountsQueue () = valueOrElse(getBinary(factoryAddress, kAccountsQueue()), base58'')
209209
210210
211211 func kRequestsByOwner (ownerAddress) = makeString(["%s%s", "requests", toString(ownerAddress)], separator)
212212
213213
214214 func requestsByOwner (ownerAddress) = valueOrElse(getBinary(factoryAddress, kRequestsByOwner(ownerAddress)), base58'')
215215
216216
217217 func kPairAllowed (amountAssetId,priceAssetId) = makeString(["%s%s%s", assetIdToString(amountAssetId), assetIdToString(priceAssetId), "pairAllowed"], separator)
218218
219219
220220 func pairAllowed (amountAssetId,priceAssetId) = valueOrElse(getBoolean(factoryAddress, kPairAllowed(amountAssetId, priceAssetId)), false)
221221
222222
223223 func kPrice (assetId) = makeString(["%s", assetIdToString(assetId)], separator)
224224
225225
226226 func getCurrentPrice (assetId) = {
227227 let matcherPublicKey = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kMatcherPublicKey), wrapErr("invalid matcher public key")))
228228 let matcherAddress = addressFromPublicKey(matcherPublicKey)
229229 let price = valueOrErrorMessage(getInteger(matcherAddress, kPrice(assetId)), wrapErr(("invalid price, assetId = " + assetIdToString(assetId))))
230230 price
231231 }
232232
233233
234234 func calcTotalCredit (creditA,creditB,currentPrice) = (fraction(creditA, currentPrice, mult18BigInt) + creditB)
235235
236236
237237 func calcTotalBalance (balanceA,balanceB,currentPrice) = (fraction(balanceA, currentPrice, mult18BigInt) + balanceB)
238238
239239
240240 func calcPnl (totalBalance,totalCredit) = (totalBalance - totalCredit)
241241
242242
243243 func calcCreditAvailable (deposit,leverage,totalCredit) = (fraction(deposit, leverage, mult18BigInt) - totalCredit)
244244
245245
246246 func calcRealInCredit (credit,balance) = if ((credit > big0))
247247 then (credit - balance)
248248 else big0
249249
250250
251251 func calcFree (credit,balance) = if ((credit > big0))
252252 then (balance - credit)
253253 else big0
254254
255255
256256 func calcShortPrice (free,realInCredit) = if ((realInCredit > big0))
257257 then max([big0, fraction(free, mult18BigInt, realInCredit)])
258258 else big0
259259
260260
261261 func calcLongPrice (free,realInCredit) = if ((realInCredit > big0))
262262 then max([big0, fraction(realInCredit, mult18BigInt, free)])
263263 else big0
264264
265265
266266 func calcStartMargin (realInCreditA,realInCreditB,currentPrice,settingsMargin) = fraction((fraction(realInCreditA, currentPrice, mult18BigInt) + realInCreditB), settingsMargin, mult18BigInt)
267267
268268
269269 func calcMarginSupply (settingsMarginSupply,settingsMargin,startMargin) = fraction(settingsMarginSupply, startMargin, settingsMargin)
270270
271271
272272 func calcLiquidationPrice (deposit,marginSupply,realInCreditA,realInCreditB,shortPrice,longPrice) = {
273273 let liquidationPriceA = if ((realInCreditA > big0))
274274 then (((deposit - marginSupply) / realInCreditA) + shortPrice)
275275 else big0
276276 let liquidationPriceB = if ((realInCreditB > big0))
277277 then (longPrice - ((deposit - marginSupply) / (realInCreditA / longPrice)))
278278 else big0
279279 (liquidationPriceA + liquidationPriceB)
280280 }
281281
282282
283+func getRequestId (accountAddress) = {
284+ let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined")))
285+ requestId
286+ }
287+
288+
283289 func getAccountAssets (accountAddress) = {
284- let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined")))
290+ let requestId = getRequestId(accountAddress)
285291 let amountAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestAmountAssetId(requestId)), wrapErr("invalid amount asset id")))
286292 let priceAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestPriceAssetId(requestId)), wrapErr("invalid amount price id")))
287293 $Tuple2(amountAssetId, priceAssetId)
288294 }
289295
290296
291297 func getAccountOwnerPublicKey (accountAddress) = {
292- let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined")))
298+ let requestId = getRequestId(accountAddress)
293299 let requestOwnerPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestOwnerPublicKey(requestId)), wrapErr("invalid amount asset id"))
294300 requestOwnerPublicKey
295301 }
296302
297303
298304 @Callable(i)
299305 func init (factoryAddressStr) = {
300306 let checkCaller = mustThis(i.caller)
301307 if ((checkCaller == checkCaller))
302308 then $Tuple2([StringEntry(kFactoryAddress, factoryAddressStr)], unit)
303309 else throw("Strict value is not equal to itself.")
304310 }
305311
306312
307313
308314 @Callable(i)
309315 func requestAccount (callerPublicKey,args) = {
310316 let ckecks = [if (!(shutdown))
311317 then true
312318 else throwErr("not allowed"), mustFactory(i.caller)]
313319 if ((ckecks == ckecks))
314320 then {
315321 let amountAssetIdStr = args[0]
316322 let priceAssetIdStr = args[1]
317323 let userAddress = addressFromPublicKey(callerPublicKey)
318324 let requestId = sha256(((userAddress.bytes + fromBase58String(amountAssetIdStr)) + fromBase58String(priceAssetIdStr)))
319325 let amountAssetId = parseAssetId(amountAssetIdStr)
320326 let priceAssetId = parseAssetId(priceAssetIdStr)
321327 let userRequestsNumber = (size(kRequestsByOwner(userAddress)) / queueItemSize)
322328 let checks = [if ((size(i.payments) == 1))
323329 then true
324330 else throwErr("1 payment is required"), if ((i.payments[0].assetId == unit))
325331 then true
326332 else throwErr("invalid asset"), if ((i.payments[0].amount == rewardAmount()))
327333 then true
328334 else throwErr("invalid amount"), if (pairAllowed(amountAssetId, priceAssetId))
329335 then true
330336 else throwErr("pair is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit))
331337 then true
332338 else throwErr("account is already exists"), if ((accountsLimit() > userRequestsNumber))
333339 then true
334340 else throwErr(("accounts limit is " + toString(accountsLimit())))]
335341 if ((checks == checks))
336342 then {
337- let $t01151412870 = if ((size(accountsQueue()) == 0))
343+ let $t01147512831 = if ((size(accountsQueue()) == 0))
338344 then $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil)])
339345 else {
340346 let accountPublicKey = take(accountsQueue(), queueItemSize)
341347 let accountAddress = addressFromPublicKey(accountPublicKey)
342348 let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key")))
343349 $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)])
344350 }
345- let actions = $t01151412870._1
346- let factoryActions = $t01151412870._2
351+ let actions = $t01147512831._1
352+ let factoryActions = $t01147512831._2
347353 $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)]))
348354 }
349355 else throw("Strict value is not equal to itself.")
350356 }
351357 else throw("Strict value is not equal to itself.")
352358 }
353359
354360
355361
356362 @Callable(i)
357363 func addAccount (callerPublicKey,args) = {
358364 let ckecks = [if (!(shutdown))
359365 then true
360366 else throwErr("not allowed"), mustFactory(i.caller)]
361367 if ((ckecks == ckecks))
362368 then {
363369 let creatorPublicKey = fromBase58String(args[0])
364370 let accountPublicKey = callerPublicKey
365371 let accountAddress = addressFromPublicKey(callerPublicKey)
366372 let creatorAddress = addressFromPublicKey(creatorPublicKey)
367373 let checks = [if ((getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)) == unit))
368374 then true
369375 else throwErr("account is already exists"), if ( match scriptHash(accountAddress) {
370376 case b: ByteVector =>
371377 (b == blake2b256_32Kb(accountScript()))
372378 case _ =>
373379 false
374380 })
375381 then true
376382 else throwErr("invalid script")]
377383 if ((checks == checks))
378384 then {
379- let $t01412515127 = if ((size(requestsQueue()) == 0))
385+ let $t01408615088 = if ((size(requestsQueue()) == 0))
380386 then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)])
381387 else {
382388 let requestId = take(requestsQueue(), queueItemSize)
383389 $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)])
384390 }
385- let actions = $t01412515127._1
386- let factoryActions = $t01412515127._2
391+ let actions = $t01408615088._1
392+ let factoryActions = $t01408615088._2
387393 $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)]))
388394 }
389395 else throw("Strict value is not equal to itself.")
390396 }
391397 else throw("Strict value is not equal to itself.")
392398 }
393399
394400
395401
396402 @Callable(i)
397403 func deposit (callerPublicKey,args) = {
398404 let payment = i.payments[0]
405+ let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
399406 let ckecks = [if (!(shutdown))
400407 then true
401408 else throwErr("not allowed"), mustFactory(i.caller), if ((size(i.payments) == 1))
402409 then true
403410 else throwErr("1 payment is required"), if ((payment.assetId == usdtAssetId))
404411 then true
405- else throwErr("invalid asset")]
412+ else throwErr("invalid asset"), if ((getInteger(factoryAddress, kRequestStatus(getRequestId(accountAddress))) == REQUEST_STATUS_READY))
413+ then true
414+ else throwErr("account is not ready")]
406415 if ((ckecks == ckecks))
407416 then {
408- let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
409417 let actions = [ScriptTransfer(accountAddress, payment.amount, payment.assetId)]
410418 let factoryActions = [invoke(factoryAddress, "integerEntry", [kDeposited(accountAddress), (valueOrElse(depositedOption(accountAddress), 0) + payment.amount)], nil)]
411419 $Tuple2(actions, factoryActions)
412420 }
413421 else throw("Strict value is not equal to itself.")
414422 }
415423
416424
417425
418426 @Callable(i)
419427 func withdraw (callerPublicKey,args) = {
420428 let ckecks = [if (!(shutdown))
421429 then true
422430 else throwErr("not allowed"), mustFactory(i.caller)]
423431 if ((ckecks == ckecks))
424432 then {
425433 let userAddress = addressFromPublicKey(callerPublicKey)
426434 let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
427435 let amount = valueOrErrorMessage(parseInt(args[1]), wrapErr("invalid amount"))
428436 let assetId = parseAssetId(args[2])
429437 let invocations = [invoke(accountAddress, "transferAsset", [userAddress.bytes, amount, assetId], nil)]
430438 $Tuple2(nil, invocations)
431439 }
432440 else throw("Strict value is not equal to itself.")
433441 }
434442
435443
436444
437445 @Callable(i)
438446 func borrow (callerPublicKey,args) = {
439447 let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
440448 let assetIdRequested = parseAssetId(args[1])
441449 let amountRequested = ensurePositive(valueOrErrorMessage(parseInt(args[2]), wrapErr("invalid requested amount")), "requested amount")
442450 let accountOwnerPublicKey = getAccountOwnerPublicKey(accountAddress)
443451 let userAddress = addressFromPublicKey(callerPublicKey)
444452 let ckecks = [if (!(shutdown))
445453 then true
446454 else throwErr("not allowed"), mustFactory(i.caller), if ((callerPublicKey == accountOwnerPublicKey))
447455 then true
448456 else throwErr("can be called by account owner only")]
449457 if ((ckecks == ckecks))
450458 then {
451459 let amountAssetId = getAccountAssets(accountAddress)._1
452460 let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(usdtAssetId))
453461 let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(usdtAssetId))
454462 let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId))
455463 let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, usdtAssetId)), 0), pow10Decimals(usdtAssetId))
456464 let totalCredit = calcTotalCredit(creditA, creditB, currentPrice)
457465 let leverageDefault = 3
458466 let leverage = toX18(valueOrElse(getInteger(factoryAddress, kLeverage(accountAddress)), leverageDefault), 1)
459467 let creditAvailableUsdt = calcCreditAvailable(deposited, leverage, totalCredit)
460468 let creditAvailable = if ((assetIdRequested == amountAssetId))
461469 then fromX18(fraction(creditAvailableUsdt, mult18BigInt, currentPrice), pow10Decimals(amountAssetId))
462470 else if ((assetIdRequested == usdtAssetId))
463471 then fromX18(creditAvailableUsdt, pow10Decimals(usdtAssetId))
464472 else throwErr("invalid requested asset id")
465473 let syntheticAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kSyntheticAssetId(assetIdRequested)), wrapErr("synthetic asset for requested asset is undefined")))
466474 let amountToSend = if ((creditAvailable >= amountRequested))
467475 then amountRequested
468476 else throwErr(("credit available = " + toString(creditAvailable)))
469477 let factoryActions = [invoke(factoryAddress, "integerEntry", [kCredit(accountAddress, assetIdRequested), (valueOrElse(creditOption(accountAddress, assetIdRequested), 0) + amountToSend)], nil), invoke(factoryAddress, "transferAsset", [userAddress.bytes, amountToSend, syntheticAssetId], nil)]
470478 $Tuple2(nil, [factoryActions, creditAvailable])
471479 }
472480 else throw("Strict value is not equal to itself.")
473481 }
474482
475483
476484
477485 @Callable(i)
478486 func repay (callerPublicKey,args) = {
479487 let ckecks = [if (!(shutdown))
480488 then true
481489 else throwErr("not allowed"), mustFactory(i.caller)]
482490 if ((ckecks == ckecks))
483491 then $Tuple2(nil, unit)
484492 else throw("Strict value is not equal to itself.")
485493 }
486494
487495
488496
489497 @Callable(i)
490498 func setPairAllowance (callerPublicKey,args) = {
491499 let ckecks = [if (!(shutdown))
492500 then true
493501 else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey)]
494502 if ((ckecks == ckecks))
495503 then {
496504 let amountAssetIdStr = args[0]
497505 let priceAssetIdStr = args[1]
498506 let allowStr = args[2]
499507 let amountAssetId = parseAssetId(amountAssetIdStr)
500508 let priceAssetId = parseAssetId(priceAssetIdStr)
501509 let allow = (allowStr == "true")
502510 let invocations = [invoke(factoryAddress, "booleanEntry", [kPairAllowed(amountAssetId, priceAssetId), allow], nil)]
503511 $Tuple2(nil, invocations)
504512 }
505513 else throw("Strict value is not equal to itself.")
506514 }
507515
508516
509517
510518 @Callable(i)
511519 func addSyntheticAsset (callerPublicKey,args) = {
512520 let baseAssetId = parseAssetId(args[0])
513521 let syntheticAssetId = parseAssetId(args[1])
514522 let ckecks = [if (!(shutdown))
515523 then true
516- else throwErr("not allowed"), mustFactory(i.caller), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit))
524+ else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit))
517525 then true
518526 else throwErr("invalid base asset"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit))
519527 then true
520528 else throwErr("invalid synthetic asset")]
521529 if ((ckecks == ckecks))
522530 then {
523531 let invocations = [invoke(factoryAddress, "stringEntry", [kSyntheticAssetId(baseAssetId), assetIdToString(syntheticAssetId)], nil), invoke(factoryAddress, "stringEntry", [kBaseAssetId(syntheticAssetId), assetIdToString(baseAssetId)], nil)]
524532 $Tuple2(nil, invocations)
525533 }
526534 else throw("Strict value is not equal to itself.")
527535 }
528536
529537
530538
531539 @Callable(i)
532540 func doShutdown (callerPublicKey,args) = {
533541 let checks = [mustFactory(i.caller), mustAdmin(callerPublicKey)]
534542 if ((checks == checks))
535543 then {
536544 let invocations = [invoke(factoryAddress, "booleanEntry", [kShutdown, true], nil)]
537545 $Tuple2(nil, invocations)
538546 }
539547 else throw("Strict value is not equal to itself.")
540548 }
541549
542550
543551 @Verifier(tx)
544552 func verify () = if (if (isDefined(factoryAddressOption))
545553 then isDefined(getString(factoryAddress, kMultisig))
546554 else false)
547555 then match getString(factoryAddress, kMultisig) {
548556 case multisig: String =>
549557 let statusKey = kStatus(toString(this), toBase58String(tx.id))
550558 let status = valueOrElse(getBoolean(addressFromStringValue(multisig), statusKey), false)
551559 status
552560 case _ =>
553561 false
554562 }
555563 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
556564

github/deemru/w8io/169f3d6 
57.02 ms