tx · 4HpvvGtqvaRVPasnj8MMLd2DP4KwQNzXM2iwctLJUWgM

3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37:  -0.02300000 Waves

2024.05.16 14:34 [3108524] smart account 3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37 > SELF 0.00000000 Waves

{ "type": 13, "id": "4HpvvGtqvaRVPasnj8MMLd2DP4KwQNzXM2iwctLJUWgM", "fee": 2300000, "feeAssetId": null, "timestamp": 1715859328343, "version": 2, "chainId": 84, "sender": "3N3kKNoJohjVQYNLTrYTGTesr3nq3PZNh37", "senderPublicKey": "vmMXxwQAMUAoisvL193ptPiTtaWQqL5YNu2zs1ouTbY", "proofs": [ "4epCos7E9RfsFqcTZkPeiW7MoyhSRwC1hNo4rpEFSe4rgPW4fAhaqtgd5vdXp8A9Kfm4swKzUKMfsRwAT8xusJp" ], "script": "base64:BwI9CAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGFYACXNlcGFyYXRvcgICX18AB2NoYWluSWQJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEACGNoYWluSWRXAQFXABBjb250cmFjdEZpbGVuYW1lAhdmdXR1cmVzX2NhbGN1bGF0b3IucmlkZQAFbXVsdDgAgMLXLwAMbXVsdDE4QmlnSW50CQC2AgEAgICQu7rWrfANAA13YXZlc0RlY2ltYWxzAAgADHVzZHREZWNpbWFscwAGAAt3YXZlc1N0cmluZwIFV0FWRVMADXF1ZXVlSXRlbVNpemUAIAAEYmlnMAkAtgIBAAAACWtNdWx0aXNpZwIMJXNfX211bHRpc2lnAQdrU3RhdHVzAgRkYXBwBHR4SWQJALkJAgkAzAgCAgolc19fc3RhdHVzCQDMCAIFBGRhcHAJAMwIAgUEdHhJZAUDbmlsBQlzZXBhcmF0b3IACWtTaHV0ZG93bgIMJXNfX3NodXRkb3duAAtrUHVibGljS2V5cwIOJXNfX3B1YmxpY0tleXMAEWtNYXRjaGVyUHVibGlj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B0aW9uCQEJaXNEZWZpbmVkAQkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUJa011bHRpc2lnBwQHJG1hdGNoMAkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUJa011bHRpc2lnAwkAAQIFByRtYXRjaDACBlN0cmluZwQIbXVsdGlzaWcFByRtYXRjaDAECXN0YXR1c0tleQkBB2tTdGF0dXMCCQClCAEFBHRoaXMJANgEAQgFAnR4AmlkBAZzdGF0dXMJAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUIbXVsdGlzaWcFCXN0YXR1c0tleQcFBnN0YXR1cwcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlEhI1n", "height": 3108524, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: arz6AmuQYw7BPXmUcnzegecHsm2hKftLYeV1VpLu4qD Next: FhPupu9dM9Ji8BuNPnHRUqyhJyUeybwSfyqvoxskUjNq Diff:
OldNewDifferences
340340 else throwErr(("accounts limit is " + toString(accountsLimit())))]
341341 if ((checks == checks))
342342 then {
343- let $t01171613072 = if ((size(accountsQueue()) == 0))
343+ let $t01171213068 = if ((size(accountsQueue()) == 0))
344344 then $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil)])
345345 else {
346346 let accountPublicKey = take(accountsQueue(), queueItemSize)
348348 let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key")))
349349 $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)])
350350 }
351- let actions = $t01171613072._1
352- let factoryActions = $t01171613072._2
351+ let actions = $t01171213068._1
352+ let factoryActions = $t01171213068._2
353353 $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)]))
354354 }
355355 else throw("Strict value is not equal to itself.")
382382 else throwErr("invalid script")]
383383 if ((checks == checks))
384384 then {
385- let $t01432715329 = if ((size(requestsQueue()) == 0))
385+ let $t01432315325 = if ((size(requestsQueue()) == 0))
386386 then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)])
387387 else {
388388 let requestId = take(requestsQueue(), queueItemSize)
389389 $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)])
390390 }
391- let actions = $t01432715329._1
392- let factoryActions = $t01432715329._2
391+ let actions = $t01432315325._1
392+ let factoryActions = $t01432315325._2
393393 $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)]))
394394 }
395395 else throw("Strict value is not equal to itself.")
515515
516516 @Callable(i)
517517 func addSyntheticAsset (callerPublicKey,args) = {
518- let baseAssetIdStr = args[0]
519- let baseAssetId = parseAssetId(baseAssetIdStr)
520- let syntheticAssetId = i.payments[0].assetId
518+ let baseAssetId = parseAssetId(args[0])
519+ let syntheticAssetId = parseAssetId(args[1])
521520 let ckecks = [if (!(shutdown))
522521 then true
523522 else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit))
524523 then true
525- else throwErr("invalid base asset"), if ((size(i.payments) == 1))
526- then true
527- else throwErr("invalid payments"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit))
524+ else throwErr("invalid base asset"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit))
528525 then true
529526 else throwErr("invalid synthetic asset")]
530527 if ((ckecks == ckecks))
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) = match getString(factoryAddress, kMultisig) {
128128 case multisig: String =>
129129 let publicKeysList = split(getStringValue(addressFromStringValue(multisig), kPublicKeys), separator)
130130 if (containsElement(publicKeysList, toBase58String(callerPublicKey)))
131131 then true
132132 else throwErr("should be called by admin")
133133 case _: Unit =>
134134 if ((addressFromPublicKey(callerPublicKey) == factoryAddress))
135135 then true
136136 else throwErr("should be called by factory or admin")
137137 case _ =>
138138 throw("Match error")
139139 }
140140
141141
142142 let kAccountScript = "%s__accountScript"
143143
144144 func accountScript () = valueOrErrorMessage(getBinary(factoryAddress, kAccountScript), wrapErr("account script is not set"))
145145
146146
147147 let kRewardAmount = "%s__rewardAmount"
148148
149149 func rewardAmount () = valueOrErrorMessage(getInteger(factoryAddress, kRewardAmount), wrapErr("reward amount is not set"))
150150
151151
152152 let kAccountsLimit = "%s__accountsLimit"
153153
154154 let accountsLimitDefault = 20
155155
156156 func accountsLimit () = valueOrElse(getInteger(factoryAddress, kAccountsLimit), accountsLimitDefault)
157157
158158
159159 func kDeposited (accountAddress) = makeString(["%s%s", "deposited", toString(accountAddress)], separator)
160160
161161
162162 func depositedOption (accountAddress) = getInteger(factoryAddress, kDeposited(accountAddress))
163163
164164
165165 func kCredit (accountAddress,assetId) = makeString(["%s%s%s", "credit", toString(accountAddress), assetIdToString(assetId)], separator)
166166
167167
168168 func creditOption (accountAddress,assetId) = getInteger(factoryAddress, kCredit(accountAddress, assetId))
169169
170170
171171 func kLeverage (accountAddress) = makeString(["%s%s", "leverage", toString(accountAddress)], separator)
172172
173173
174174 func kSyntheticAssetId (baseAssetId) = makeString(["%s%s", "syntheticAssetId", assetIdToString(baseAssetId)], separator)
175175
176176
177177 func kBaseAssetId (syntheticAssetId) = makeString(["%s%s", "baseAssetId", assetIdToString(syntheticAssetId)], separator)
178178
179179
180180 let REQUEST_STATUS_EMPTY = 0
181181
182182 let REQUEST_STATUS_READY = 1
183183
184184 func kRequestStatus (requestId) = makeString(["%s%s", toBase58String(requestId), "status"], separator)
185185
186186
187187 func kAccountCreatorPublicKey (accountAddress) = makeString(["%s%s", toString(accountAddress), "creatorPublicKey"], separator)
188188
189189
190190 func kRequestOwnerPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "ownerPublicKey"], separator)
191191
192192
193193 func kRequestAmountAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "amountAssetId"], separator)
194194
195195
196196 func kRequestPriceAssetId (requestId) = makeString(["%s%s", toBase58String(requestId), "priceAssetId"], separator)
197197
198198
199199 func kRequestIdToAccountPublicKey (requestId) = makeString(["%s%s", toBase58String(requestId), "requestIdToAccountPublicKey"], separator)
200200
201201
202202 func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator)
203203
204204
205205 func kRequestsQueue () = makeString(["%s", "requestsQueue"], separator)
206206
207207
208208 func requestsQueue () = valueOrElse(getBinary(factoryAddress, kRequestsQueue()), base58'')
209209
210210
211211 func kAccountsQueue () = makeString(["%s", "accountsQueue"], separator)
212212
213213
214214 func accountsQueue () = valueOrElse(getBinary(factoryAddress, kAccountsQueue()), base58'')
215215
216216
217217 func kRequestsByOwner (ownerAddress) = makeString(["%s%s", "requests", toString(ownerAddress)], separator)
218218
219219
220220 func requestsByOwner (ownerAddress) = valueOrElse(getBinary(factoryAddress, kRequestsByOwner(ownerAddress)), base58'')
221221
222222
223223 func kPairAllowed (amountAssetId,priceAssetId) = makeString(["%s%s%s", assetIdToString(amountAssetId), assetIdToString(priceAssetId), "pairAllowed"], separator)
224224
225225
226226 func pairAllowed (amountAssetId,priceAssetId) = valueOrElse(getBoolean(factoryAddress, kPairAllowed(amountAssetId, priceAssetId)), false)
227227
228228
229229 func kPrice (assetId) = makeString(["%s", assetIdToString(assetId)], separator)
230230
231231
232232 func getCurrentPrice (assetId) = {
233233 let matcherPublicKey = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kMatcherPublicKey), wrapErr("invalid matcher public key")))
234234 let matcherAddress = addressFromPublicKey(matcherPublicKey)
235235 let price = valueOrErrorMessage(getInteger(matcherAddress, kPrice(assetId)), wrapErr(("invalid price, assetId = " + assetIdToString(assetId))))
236236 price
237237 }
238238
239239
240240 func calcTotalCredit (creditA,creditB,currentPrice) = (fraction(creditA, currentPrice, mult18BigInt) + creditB)
241241
242242
243243 func calcTotalBalance (balanceA,balanceB,currentPrice) = (fraction(balanceA, currentPrice, mult18BigInt) + balanceB)
244244
245245
246246 func calcPnl (totalBalance,totalCredit) = (totalBalance - totalCredit)
247247
248248
249249 func calcCreditAvailable (deposit,leverage,totalCredit) = (fraction(deposit, leverage, mult18BigInt) - totalCredit)
250250
251251
252252 func calcRealInCredit (credit,balance) = if ((credit > big0))
253253 then (credit - balance)
254254 else big0
255255
256256
257257 func calcFree (credit,balance) = if ((credit > big0))
258258 then (balance - credit)
259259 else big0
260260
261261
262262 func calcShortPrice (free,realInCredit) = if ((realInCredit > big0))
263263 then max([big0, fraction(free, mult18BigInt, realInCredit)])
264264 else big0
265265
266266
267267 func calcLongPrice (free,realInCredit) = if ((realInCredit > big0))
268268 then max([big0, fraction(realInCredit, mult18BigInt, free)])
269269 else big0
270270
271271
272272 func calcStartMargin (realInCreditA,realInCreditB,currentPrice,settingsMargin) = fraction((fraction(realInCreditA, currentPrice, mult18BigInt) + realInCreditB), settingsMargin, mult18BigInt)
273273
274274
275275 func calcMarginSupply (settingsMarginSupply,settingsMargin,startMargin) = fraction(settingsMarginSupply, startMargin, settingsMargin)
276276
277277
278278 func calcLiquidationPrice (deposit,marginSupply,realInCreditA,realInCreditB,shortPrice,longPrice) = {
279279 let liquidationPriceA = if ((realInCreditA > big0))
280280 then (((deposit - marginSupply) / realInCreditA) + shortPrice)
281281 else big0
282282 let liquidationPriceB = if ((realInCreditB > big0))
283283 then (longPrice - ((deposit - marginSupply) / (realInCreditA / longPrice)))
284284 else big0
285285 (liquidationPriceA + liquidationPriceB)
286286 }
287287
288288
289289 func getAccountAssets (accountAddress) = {
290290 let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined")))
291291 let amountAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestAmountAssetId(requestId)), wrapErr("invalid amount asset id")))
292292 let priceAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kRequestPriceAssetId(requestId)), wrapErr("invalid amount price id")))
293293 $Tuple2(amountAssetId, priceAssetId)
294294 }
295295
296296
297297 func getAccountOwnerPublicKey (accountAddress) = {
298298 let requestId = fromBase58String(valueOrErrorMessage(getString(factoryAddress, kAccountAddressToRequestId(accountAddress)), wrapErr("invalid account address: request id is undefined")))
299299 let requestOwnerPublicKey = valueOrErrorMessage(getBinary(factoryAddress, kRequestOwnerPublicKey(requestId)), wrapErr("invalid amount asset id"))
300300 requestOwnerPublicKey
301301 }
302302
303303
304304 @Callable(i)
305305 func init (factoryAddressStr) = {
306306 let checkCaller = mustThis(i.caller)
307307 if ((checkCaller == checkCaller))
308308 then $Tuple2([StringEntry(kFactoryAddress, factoryAddressStr)], unit)
309309 else throw("Strict value is not equal to itself.")
310310 }
311311
312312
313313
314314 @Callable(i)
315315 func requestAccount (callerPublicKey,args) = {
316316 let ckecks = [if (!(shutdown))
317317 then true
318318 else throwErr("not allowed"), mustFactory(i.caller)]
319319 if ((ckecks == ckecks))
320320 then {
321321 let amountAssetIdStr = args[0]
322322 let priceAssetIdStr = args[1]
323323 let userAddress = addressFromPublicKey(callerPublicKey)
324324 let requestId = sha256(((userAddress.bytes + fromBase58String(amountAssetIdStr)) + fromBase58String(priceAssetIdStr)))
325325 let amountAssetId = parseAssetId(amountAssetIdStr)
326326 let priceAssetId = parseAssetId(priceAssetIdStr)
327327 let userRequestsNumber = (size(kRequestsByOwner(userAddress)) / queueItemSize)
328328 let checks = [if ((size(i.payments) == 1))
329329 then true
330330 else throwErr("1 payment is required"), if ((i.payments[0].assetId == unit))
331331 then true
332332 else throwErr("invalid asset"), if ((i.payments[0].amount == rewardAmount()))
333333 then true
334334 else throwErr("invalid amount"), if (pairAllowed(amountAssetId, priceAssetId))
335335 then true
336336 else throwErr("pair is not allowed"), if ((getInteger(factoryAddress, kRequestStatus(requestId)) == unit))
337337 then true
338338 else throwErr("account is already exists"), if ((accountsLimit() > userRequestsNumber))
339339 then true
340340 else throwErr(("accounts limit is " + toString(accountsLimit())))]
341341 if ((checks == checks))
342342 then {
343- let $t01171613072 = if ((size(accountsQueue()) == 0))
343+ let $t01171213068 = if ((size(accountsQueue()) == 0))
344344 then $Tuple2([ScriptTransfer(factoryAddress, rewardAmount(), unit)], [invoke(factoryAddress, "integerEntry", [kRequestStatus(requestId), REQUEST_STATUS_EMPTY], nil), invoke(factoryAddress, "binaryEntry", [kRequestsQueue(), (requestsQueue() + requestId)], nil)])
345345 else {
346346 let accountPublicKey = take(accountsQueue(), queueItemSize)
347347 let accountAddress = addressFromPublicKey(accountPublicKey)
348348 let creatorAddress = addressFromPublicKey(valueOrErrorMessage(getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)), wrapErr("invalid creator public key")))
349349 $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)])
350350 }
351- let actions = $t01171613072._1
352- let factoryActions = $t01171613072._2
351+ let actions = $t01171213068._1
352+ let factoryActions = $t01171213068._2
353353 $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)]))
354354 }
355355 else throw("Strict value is not equal to itself.")
356356 }
357357 else throw("Strict value is not equal to itself.")
358358 }
359359
360360
361361
362362 @Callable(i)
363363 func addAccount (callerPublicKey,args) = {
364364 let ckecks = [if (!(shutdown))
365365 then true
366366 else throwErr("not allowed"), mustFactory(i.caller)]
367367 if ((ckecks == ckecks))
368368 then {
369369 let creatorPublicKey = fromBase58String(args[0])
370370 let accountPublicKey = callerPublicKey
371371 let accountAddress = addressFromPublicKey(callerPublicKey)
372372 let creatorAddress = addressFromPublicKey(creatorPublicKey)
373373 let checks = [if ((getBinary(factoryAddress, kAccountCreatorPublicKey(accountAddress)) == unit))
374374 then true
375375 else throwErr("account is already exists"), if ( match scriptHash(accountAddress) {
376376 case b: ByteVector =>
377377 (b == blake2b256_32Kb(accountScript()))
378378 case _ =>
379379 false
380380 })
381381 then true
382382 else throwErr("invalid script")]
383383 if ((checks == checks))
384384 then {
385- let $t01432715329 = if ((size(requestsQueue()) == 0))
385+ let $t01432315325 = if ((size(requestsQueue()) == 0))
386386 then $Tuple2(nil, [invoke(factoryAddress, "binaryEntry", [kAccountsQueue(), (accountsQueue() + accountPublicKey)], nil)])
387387 else {
388388 let requestId = take(requestsQueue(), queueItemSize)
389389 $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)])
390390 }
391- let actions = $t01432715329._1
392- let factoryActions = $t01432715329._2
391+ let actions = $t01432315325._1
392+ let factoryActions = $t01432315325._2
393393 $Tuple2(actions, (factoryActions ++ [invoke(factoryAddress, "binaryEntry", [kAccountCreatorPublicKey(accountAddress), creatorPublicKey], nil)]))
394394 }
395395 else throw("Strict value is not equal to itself.")
396396 }
397397 else throw("Strict value is not equal to itself.")
398398 }
399399
400400
401401
402402 @Callable(i)
403403 func deposit (callerPublicKey,args) = {
404404 let payment = i.payments[0]
405405 let ckecks = [if (!(shutdown))
406406 then true
407407 else throwErr("not allowed"), mustFactory(i.caller), if ((size(i.payments) == 1))
408408 then true
409409 else throwErr("1 payment is required"), if ((payment.assetId == usdtAssetId))
410410 then true
411411 else throwErr("invalid asset")]
412412 if ((ckecks == ckecks))
413413 then {
414414 let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
415415 let actions = [ScriptTransfer(accountAddress, payment.amount, payment.assetId)]
416416 let factoryActions = [invoke(factoryAddress, "integerEntry", [kDeposited(accountAddress), (valueOrElse(depositedOption(accountAddress), 0) + payment.amount)], nil)]
417417 $Tuple2(actions, factoryActions)
418418 }
419419 else throw("Strict value is not equal to itself.")
420420 }
421421
422422
423423
424424 @Callable(i)
425425 func withdraw (callerPublicKey,args) = {
426426 let ckecks = [if (!(shutdown))
427427 then true
428428 else throwErr("not allowed"), mustFactory(i.caller)]
429429 if ((ckecks == ckecks))
430430 then {
431431 let userAddress = addressFromPublicKey(callerPublicKey)
432432 let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
433433 let amount = valueOrErrorMessage(parseInt(args[1]), wrapErr("invalid amount"))
434434 let assetId = parseAssetId(args[2])
435435 let invocations = [invoke(accountAddress, "transferAsset", [userAddress.bytes, amount, assetId], nil)]
436436 $Tuple2(nil, invocations)
437437 }
438438 else throw("Strict value is not equal to itself.")
439439 }
440440
441441
442442
443443 @Callable(i)
444444 func borrow (callerPublicKey,args) = {
445445 let accountAddress = valueOrErrorMessage(addressFromString(args[0]), wrapErr("invalid account address"))
446446 let assetIdRequested = parseAssetId(args[1])
447447 let amountRequested = ensurePositive(valueOrErrorMessage(parseInt(args[2]), wrapErr("invalid requested amount")), "requested amount")
448448 let accountOwnerPublicKey = getAccountOwnerPublicKey(accountAddress)
449449 let userAddress = addressFromPublicKey(callerPublicKey)
450450 let ckecks = [if (!(shutdown))
451451 then true
452452 else throwErr("not allowed"), mustFactory(i.caller), if ((callerPublicKey == accountOwnerPublicKey))
453453 then true
454454 else throwErr("can be called by account owner only")]
455455 if ((ckecks == ckecks))
456456 then {
457457 let amountAssetId = getAccountAssets(accountAddress)._1
458458 let deposited = toX18(valueOrElse(depositedOption(accountAddress), 0), pow10Decimals(usdtAssetId))
459459 let currentPrice = toX18(getCurrentPrice(amountAssetId), pow10Decimals(usdtAssetId))
460460 let creditA = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, amountAssetId)), 0), pow10Decimals(amountAssetId))
461461 let creditB = toX18(valueOrElse(getInteger(factoryAddress, kCredit(accountAddress, usdtAssetId)), 0), pow10Decimals(usdtAssetId))
462462 let totalCredit = calcTotalCredit(creditA, creditB, currentPrice)
463463 let leverageDefault = 3
464464 let leverage = toX18(valueOrElse(getInteger(factoryAddress, kLeverage(accountAddress)), leverageDefault), 1)
465465 let creditAvailableUsdt = calcCreditAvailable(deposited, leverage, totalCredit)
466466 let creditAvailable = if ((assetIdRequested == amountAssetId))
467467 then fromX18(fraction(creditAvailableUsdt, mult18BigInt, currentPrice), pow10Decimals(amountAssetId))
468468 else if ((assetIdRequested == usdtAssetId))
469469 then fromX18(creditAvailableUsdt, pow10Decimals(usdtAssetId))
470470 else throwErr("invalid requested asset id")
471471 let syntheticAssetId = parseAssetId(valueOrErrorMessage(getString(factoryAddress, kSyntheticAssetId(assetIdRequested)), wrapErr("synthetic asset for requested asset is undefined")))
472472 let amountToSend = if ((creditAvailable >= amountRequested))
473473 then amountRequested
474474 else throwErr(("credit available = " + toString(creditAvailable)))
475475 let factoryActions = [invoke(factoryAddress, "integerEntry", [kCredit(accountAddress, assetIdRequested), (valueOrElse(creditOption(accountAddress, assetIdRequested), 0) + amountToSend)], nil), invoke(factoryAddress, "transferAsset", [userAddress.bytes, amountToSend, syntheticAssetId], nil)]
476476 $Tuple2(nil, [factoryActions, creditAvailable])
477477 }
478478 else throw("Strict value is not equal to itself.")
479479 }
480480
481481
482482
483483 @Callable(i)
484484 func repay (callerPublicKey,args) = {
485485 let ckecks = [if (!(shutdown))
486486 then true
487487 else throwErr("not allowed"), mustFactory(i.caller)]
488488 if ((ckecks == ckecks))
489489 then $Tuple2(nil, unit)
490490 else throw("Strict value is not equal to itself.")
491491 }
492492
493493
494494
495495 @Callable(i)
496496 func setPairAllowance (callerPublicKey,args) = {
497497 let ckecks = [if (!(shutdown))
498498 then true
499499 else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey)]
500500 if ((ckecks == ckecks))
501501 then {
502502 let amountAssetIdStr = args[0]
503503 let priceAssetIdStr = args[1]
504504 let allowStr = args[2]
505505 let amountAssetId = parseAssetId(amountAssetIdStr)
506506 let priceAssetId = parseAssetId(priceAssetIdStr)
507507 let allow = (allowStr == "true")
508508 let invocations = [invoke(factoryAddress, "booleanEntry", [kPairAllowed(amountAssetId, priceAssetId), allow], nil)]
509509 $Tuple2(nil, invocations)
510510 }
511511 else throw("Strict value is not equal to itself.")
512512 }
513513
514514
515515
516516 @Callable(i)
517517 func addSyntheticAsset (callerPublicKey,args) = {
518- let baseAssetIdStr = args[0]
519- let baseAssetId = parseAssetId(baseAssetIdStr)
520- let syntheticAssetId = i.payments[0].assetId
518+ let baseAssetId = parseAssetId(args[0])
519+ let syntheticAssetId = parseAssetId(args[1])
521520 let ckecks = [if (!(shutdown))
522521 then true
523522 else throwErr("not allowed"), mustFactory(i.caller), mustAdmin(callerPublicKey), if ((getString(factoryAddress, kSyntheticAssetId(baseAssetId)) == unit))
524523 then true
525- else throwErr("invalid base asset"), if ((size(i.payments) == 1))
526- then true
527- else throwErr("invalid payments"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit))
524+ else throwErr("invalid base asset"), if ((getString(factoryAddress, kBaseAssetId(syntheticAssetId)) == unit))
528525 then true
529526 else throwErr("invalid synthetic asset")]
530527 if ((ckecks == ckecks))
531528 then {
532529 let invocations = [invoke(factoryAddress, "stringEntry", [kSyntheticAssetId(baseAssetId), assetIdToString(syntheticAssetId)], nil), invoke(factoryAddress, "stringEntry", [kBaseAssetId(syntheticAssetId), assetIdToString(baseAssetId)], nil)]
533530 $Tuple2(nil, invocations)
534531 }
535532 else throw("Strict value is not equal to itself.")
536533 }
537534
538535
539536
540537 @Callable(i)
541538 func doShutdown (callerPublicKey,args) = {
542539 let checks = [mustFactory(i.caller), mustAdmin(callerPublicKey)]
543540 if ((checks == checks))
544541 then {
545542 let invocations = [invoke(factoryAddress, "booleanEntry", [kShutdown, true], nil)]
546543 $Tuple2(nil, invocations)
547544 }
548545 else throw("Strict value is not equal to itself.")
549546 }
550547
551548
552549 @Verifier(tx)
553550 func verify () = if (if (isDefined(factoryAddressOption))
554551 then isDefined(getString(factoryAddress, kMultisig))
555552 else false)
556553 then match getString(factoryAddress, kMultisig) {
557554 case multisig: String =>
558555 let statusKey = kStatus(toString(this), toBase58String(tx.id))
559556 let status = valueOrElse(getBoolean(addressFromStringValue(multisig), statusKey), false)
560557 status
561558 case _ =>
562559 false
563560 }
564561 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
565562

github/deemru/w8io/026f985 
65.85 ms