tx · dS81iW1YZzryaVzWB129AqS8veufvhm6vKGgk5KpFaT

3N45khsjRq7bYfsvbxX1YBURhNRBBDRFNYV:  -0.03500000 Waves

2022.10.12 17:09 [2269238] smart account 3N45khsjRq7bYfsvbxX1YBURhNRBBDRFNYV > SELF 0.00000000 Waves

{ "type": 13, "id": "dS81iW1YZzryaVzWB129AqS8veufvhm6vKGgk5KpFaT", "fee": 3500000, "feeAssetId": null, "timestamp": 1665583723431, "version": 1, "sender": "3N45khsjRq7bYfsvbxX1YBURhNRBBDRFNYV", "senderPublicKey": "9QeKzbcXevL66Vm5v2GCmySfZ86o8jcD5y7pPmfRcRYE", "proofs": [ "sCrWfieZrmpa7xSCZfE1nE6W1SQUCccbd1f25FiHDPz16C64bHLXAcwN7xjqX8VquyQpBX56yAtmJnrdDZ3Zk99" ], "script": "base64:BgJ7CAISAwoBCBIAEgQKAgEEEgMKAQESBAoCAQQSBQoDCAEBEgASBAoCAQESAwoBARIECgIICBIAEgMKAQgSBQoDAQEBEgQKAgEBEgQKAggBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgASAwoBARIDCgEBEgQKAggBUgAKbFBkZWNpbWFscwAIAAZzY2FsZTgAgMLXLwAMc2NhbGU4QmlnSW50CQC2AgEAgMLXLwAHc2NhbGUxOAkAtgIBAICAkLu61q3wDQAKemVyb0JpZ0ludAkAtgIBAAAABGJpZzAJALYCAQAAAARiaWcxCQC2AgEAAQAEYmlnMgkAtgIBAAEAC3dhdmVzU3RyaW5nAgVXQVZFUwADU0VQAgJfXwAKUG9vbEFjdGl2ZQABAA9Qb29sUHV0RGlzYWJsZWQAAgATUG9vbE1hdGNoZXJEaXNhYmxlZAADAAxQb29sU2h1dGRvd24ABAAOaWR4UG9vbEFkZHJlc3MAAQANaWR4UG9vbFN0YXR1cwACABBpZHhQb29sTFBBc3NldElkAAMADWlkeEFtdEFzc2V0SWQABAAPaWR4UHJpY2VBc3NldElkAAUADmlkeEFtdEFzc2V0RGNtAAYAEG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ZXlBbGxvd2VkTHBTY3JpcHRIYXNoAAQLY3VycmVudEhhc2gJAPEHAQUEdGhpcwMDCQAAAgULYWxsb3dlZEhhc2gFB25ld0hhc2gJAQIhPQIFC2N1cnJlbnRIYXNoBQduZXdIYXNoBwYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleQkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5KU/DiA==", "chainId": 84, "height": 2269238, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4QwzqdBL2bftvFentQsxqYcU3eKEw3sDDiZxnRWQhUdy Next: J3qKAXU7RiQVGycHMnUQmKuCzwvMEpUaBNxbEmpfthV1 Diff:
OldNewDifferences
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
13+
14+let big0 = toBigInt(0)
15+
16+let big1 = toBigInt(1)
17+
18+let big2 = toBigInt(1)
19+
20+let wavesString = "WAVES"
1321
1422 let SEP = "__"
1523
125133 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
126134
127135
136+func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
137+
138+
128139 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
129140
130141 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
142153 }
143154
144155
156+func parseAssetId (input) = if ((input == wavesString))
157+ then unit
158+ else fromBase58String(input)
159+
160+
161+func assetIdToString (input) = if ((input == unit))
162+ then wavesString
163+ else toBase58String(value(input))
164+
165+
166+func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
167+
168+
145169 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
146170
171+
172+let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
173+
174+let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
147175
148176 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
149177
380408 }
381409
382410
411+func emit (amount) = {
412+ let emitInv = invoke(factoryContract, "emit", [amount], nil)
413+ if ((emitInv == emitInv))
414+ then {
415+ let emitInvLegacy = match emitInv {
416+ case legacyFactoryContract: Address =>
417+ invoke(legacyFactoryContract, "emit", [amount], nil)
418+ case _ =>
419+ unit
420+ }
421+ if ((emitInvLegacy == emitInvLegacy))
422+ then amount
423+ else throw("Strict value is not equal to itself.")
424+ }
425+ else throw("Strict value is not equal to itself.")
426+ }
427+
428+
429+func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
430+ let isEval = (txId == unit)
431+ let $t02148521663 = parsePoolConfig(getPoolConfig())
432+ let poolAddress = $t02148521663._1
433+ let poolStatus = $t02148521663._2
434+ let lpAssetId = $t02148521663._3
435+ let amountAssetId = $t02148521663._4
436+ let priceAssetId = $t02148521663._5
437+ let amountAssetDecimals = $t02148521663._6
438+ let priceAssetDecimals = $t02148521663._7
439+ let paymentAmount = paymentAmountRaw
440+ let balanceRaw = if ((paymentAssetId == amountAssetId))
441+ then getAccBalance(assetIdToString(amountAssetId))
442+ else if ((paymentAssetId == priceAssetId))
443+ then getAccBalance(assetIdToString(priceAssetId))
444+ else throwErr("invalid asset")
445+ let amountToSubtract = if (isEval)
446+ then 0
447+ else paymentAmount
448+ let balance = (balanceRaw - amountToSubtract)
449+ let balanceBigInt = toBigInt(balance)
450+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
451+ let depositBigInt = toBigInt(paymentAmount)
452+ let issueAmount = ((supplyBigInt * (sqrtBigInt((scale8BigInt + ((depositBigInt * scale8BigInt) / balanceBigInt)), 8, 8, DOWN) - scale8BigInt)) / scale8BigInt)
453+ toInt(issueAmount)
454+ }
455+
456+
457+func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
458+ let isEval = (txId == unit)
459+ let $t02267122849 = parsePoolConfig(getPoolConfig())
460+ let poolAddress = $t02267122849._1
461+ let poolStatus = $t02267122849._2
462+ let lpAssetId = $t02267122849._3
463+ let amountAssetId = $t02267122849._4
464+ let priceAssetId = $t02267122849._5
465+ let amountAssetDecimals = $t02267122849._6
466+ let priceAssetDecimals = $t02267122849._7
467+ let checks = [if ((paymentAssetId == lpAssetId))
468+ then true
469+ else throw("invalid lp asset")]
470+ if ((checks == checks))
471+ then {
472+ let balanceBigInt = if ((outAssetId == amountAssetId))
473+ then toBigInt(getAccBalance(assetIdToString(amountAssetId)))
474+ else if ((outAssetId == priceAssetId))
475+ then toBigInt(getAccBalance(assetIdToString(priceAssetId)))
476+ else throwErr("invalid asset")
477+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
478+ let redeemedBigInt = toBigInt(paymentAmount)
479+ let amount = ((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt)
480+ toInt(amount)
481+ }
482+ else throw("Strict value is not equal to itself.")
483+ }
484+
485+
383486 func managerPublicKeyOrUnit () = match getString(mpk()) {
384487 case s: String =>
385488 fromBase58String(s)
418521
419522
420523 @Callable(i)
421-func constructor (factoryContract) = {
422- let checkCaller = mustManager(i)
423- if ((checkCaller == checkCaller))
424- then [StringEntry(fc(), factoryContract)]
425- else throw("Strict value is not equal to itself.")
426- }
427-
428-
429-
430-@Callable(i)
431524 func setManager (pendingManagerPublicKey) = {
432525 let checkCaller = mustManager(i)
433526 if ((checkCaller == checkCaller))
463556
464557
465558 @Callable(i)
466-func put (slippageTolerance,shouldAutoStake) = {
467- let factoryCfg = getFactoryConfig()
468- let stakingContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactoryStakingContract]), "Error. Incorrect staking address.")
469- let slippageContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactorySlippageContract]), "Error. Incorrect slippage contract address.")
470- if ((0 > slippageTolerance))
471- then throw("Invalid slippageTolerance passed")
472- else {
473- let estPut = commonPut(i, slippageTolerance, true)
474- let emitLpAmt = estPut._2
475- let lpAssetId = estPut._7
476- let state = estPut._9
477- let amDiff = estPut._10
478- let prDiff = estPut._11
479- let amId = estPut._12
480- let prId = estPut._13
481- let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
482- if ((emitInv == emitInv))
483- then {
484- let emitInvLegacy = match emitInv {
485- case legacyFactoryContract: Address =>
486- invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
487- case _ =>
488- unit
489- }
490- if ((emitInvLegacy == emitInvLegacy))
491- then {
492- let slippageAInv = if ((amDiff > 0))
493- then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
494- else nil
495- if ((slippageAInv == slippageAInv))
496- then {
497- let slippagePInv = if ((prDiff > 0))
498- then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
499- else nil
500- if ((slippagePInv == slippagePInv))
501- then {
502- let lpTransfer = if (shouldAutoStake)
503- then {
504- let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
505- if ((slpStakeInv == slpStakeInv))
506- then nil
507- else throw("Strict value is not equal to itself.")
508- }
509- else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
510- (state ++ lpTransfer)
511- }
512- else throw("Strict value is not equal to itself.")
513- }
514- else throw("Strict value is not equal to itself.")
515- }
516- else throw("Strict value is not equal to itself.")
517- }
518- else throw("Strict value is not equal to itself.")
519- }
520- }
559+func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
560+ then throw("Invalid slippageTolerance passed")
561+ else {
562+ let estPut = commonPut(i, slippageTolerance, true)
563+ let emitLpAmt = estPut._2
564+ let lpAssetId = estPut._7
565+ let state = estPut._9
566+ let amDiff = estPut._10
567+ let prDiff = estPut._11
568+ let amId = estPut._12
569+ let prId = estPut._13
570+ let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
571+ if ((emitInv == emitInv))
572+ then {
573+ let emitInvLegacy = match emitInv {
574+ case legacyFactoryContract: Address =>
575+ invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
576+ case _ =>
577+ unit
578+ }
579+ if ((emitInvLegacy == emitInvLegacy))
580+ then {
581+ let slippageAInv = if ((amDiff > 0))
582+ then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
583+ else nil
584+ if ((slippageAInv == slippageAInv))
585+ then {
586+ let slippagePInv = if ((prDiff > 0))
587+ then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
588+ else nil
589+ if ((slippagePInv == slippagePInv))
590+ then {
591+ let lpTransfer = if (shouldAutoStake)
592+ then {
593+ let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
594+ if ((slpStakeInv == slpStakeInv))
595+ then nil
596+ else throw("Strict value is not equal to itself.")
597+ }
598+ else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
599+ (state ++ lpTransfer)
600+ }
601+ else throw("Strict value is not equal to itself.")
602+ }
603+ else throw("Strict value is not equal to itself.")
604+ }
605+ else throw("Strict value is not equal to itself.")
606+ }
607+ else throw("Strict value is not equal to itself.")
608+ }
521609
522610
523611
528616 let estPut = commonPut(i, maxSlippage, false)
529617 estPut._9
530618 }
619+
620+
621+
622+@Callable(i)
623+func putOneTkn (minOutAmount,autoStake) = {
624+ let $t02675626934 = parsePoolConfig(getPoolConfig())
625+ let poolAddress = $t02675626934._1
626+ let poolStatus = $t02675626934._2
627+ let lpAssetId = $t02675626934._3
628+ let amountAssetId = $t02675626934._4
629+ let priceAssetId = $t02675626934._5
630+ let amountAssetDecimals = $t02675626934._6
631+ let priceAssetDecimals = $t02675626934._7
632+ let isPutDisabled = if (if (isGlobalShutdown())
633+ then true
634+ else (poolStatus == PoolPutDisabled))
635+ then true
636+ else (poolStatus == PoolShutdown)
637+ let checks = [if (!(isPutDisabled))
638+ then true
639+ else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
640+ then true
641+ else throwErr("exactly 1 payment are expected")]
642+ if ((checks == checks))
643+ then {
644+ let payment = i.payments[0]
645+ let paymentAssetId = payment.assetId
646+ let paymentAmountRaw = payment.amount
647+ let paymentAmount = paymentAmountRaw
648+ let userAddress = i.caller
649+ let txId = i.transactionId
650+ let emitAmount = {
651+ let emitAmountEstimated = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
652+ if (if ((minOutAmount > 0))
653+ then (minOutAmount > emitAmountEstimated)
654+ else false)
655+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
656+ else emitAmountEstimated
657+ }
658+ let emitInv = emit(emitAmount)
659+ if ((emitInv == emitInv))
660+ then {
661+ let lpTransfer = if (autoStake)
662+ then {
663+ let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitAmount)])
664+ if ((stakeInv == stakeInv))
665+ then nil
666+ else throw("Strict value is not equal to itself.")
667+ }
668+ else [ScriptTransfer(i.caller, emitAmount, lpAssetId)]
669+ $Tuple2(lpTransfer, emitAmount)
670+ }
671+ else throw("Strict value is not equal to itself.")
672+ }
673+ else throw("Strict value is not equal to itself.")
674+ }
675+
676+
677+
678+@Callable(i)
679+func getOneTkn (outAssetId,minOutAmount,unstakeAmount) = {
680+ let $t02816728345 = parsePoolConfig(getPoolConfig())
681+ let poolAddress = $t02816728345._1
682+ let poolStatus = $t02816728345._2
683+ let lpAssetId = $t02816728345._3
684+ let amountAssetId = $t02816728345._4
685+ let priceAssetId = $t02816728345._5
686+ let amountAssetDecimals = $t02816728345._6
687+ let priceAssetDecimals = $t02816728345._7
688+ let isGetDisabled = if (isGlobalShutdown())
689+ then true
690+ else (poolStatus == PoolShutdown)
691+ let checks = [if (!(isGetDisabled))
692+ then true
693+ else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
694+ then true
695+ else throwErr("exactly 1 payment are expected")]
696+ if ((checks == checks))
697+ then {
698+ let payment = i.payments[0]
699+ let paymentAssetId = payment.assetId
700+ let paymentAmount = payment.amount
701+ let userAddress = i.caller
702+ let txId = i.transactionId
703+ let amount = {
704+ let amountEstimated = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId)
705+ if (if ((minOutAmount > 0))
706+ then (minOutAmount > amountEstimated)
707+ else false)
708+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
709+ else amountEstimated
710+ }
711+ let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
712+ if ((burnInv == burnInv))
713+ then {
714+ let assetTransfer = [ScriptTransfer(userAddress, amount, parseAssetId(outAssetId))]
715+ $Tuple2(assetTransfer, amount)
716+ }
717+ else throw("Strict value is not equal to itself.")
718+ }
719+ else throw("Strict value is not equal to itself.")
720+ }
531721
532722
533723
577767 if ((checkPayments == checkPayments))
578768 then {
579769 let cfg = getPoolConfig()
580- let factoryCfg = getFactoryConfig()
581770 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
582- let stakingContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactoryStakingContract]), "Error. Incorrect staking address.")
583771 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
584772 if ((unstakeInv == unstakeInv))
585773 then {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
13+
14+let big0 = toBigInt(0)
15+
16+let big1 = toBigInt(1)
17+
18+let big2 = toBigInt(1)
19+
20+let wavesString = "WAVES"
1321
1422 let SEP = "__"
1523
1624 let PoolActive = 1
1725
1826 let PoolPutDisabled = 2
1927
2028 let PoolMatcherDisabled = 3
2129
2230 let PoolShutdown = 4
2331
2432 let idxPoolAddress = 1
2533
2634 let idxPoolStatus = 2
2735
2836 let idxPoolLPAssetId = 3
2937
3038 let idxAmtAssetId = 4
3139
3240 let idxPriceAssetId = 5
3341
3442 let idxAmtAssetDcm = 6
3543
3644 let idxPriceAssetDcm = 7
3745
3846 let idxIAmtAssetId = 8
3947
4048 let idxIPriceAssetId = 9
4149
4250 let idxLPAssetDcm = 10
4351
4452 let idxPoolAmtAssetAmt = 1
4553
4654 let idxPoolPriceAssetAmt = 2
4755
4856 let idxPoolLPAssetAmt = 3
4957
5058 let idxFactoryStakingContract = 1
5159
5260 let idxFactorySlippageContract = 7
5361
5462 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
5563
5664
5765 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
5866
5967
6068 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6169
6270
6371 func abs (val) = if ((zeroBigInt > val))
6472 then -(val)
6573 else val
6674
6775
6876 func fc () = "%s__factoryContract"
6977
7078
7179 func mpk () = "%s__managerPublicKey"
7280
7381
7482 func pmpk () = "%s__pendingManagerPublicKey"
7583
7684
7785 func pl () = "%s%s__price__last"
7886
7987
8088 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
8189
8290
8391 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
8492
8593
8694 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
8795
8896
8997 func aa () = "%s__amountAsset"
9098
9199
92100 func pa () = "%s__priceAsset"
93101
94102
95103 func keyFactoryConfig () = "%s__factoryConfig"
96104
97105
98106 func keyMatcherPub () = "%s%s__matcher__publicKey"
99107
100108
101109 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
102110
103111
104112 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
105113
106114
107115 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
108116
109117
110118 func keyAllPoolsShutdown () = "%s__shutdown"
111119
112120
113121 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
114122
115123
116124 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
117125
118126
119127 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
120128
121129
122130 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
123131
124132
125133 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
126134
127135
136+func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
137+
138+
128139 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
129140
130141 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
131142
132143
133144 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
134145
135146
136147 func getPoolConfig () = {
137148 let amtAsset = getStringOrFail(this, aa())
138149 let priceAsset = getStringOrFail(this, pa())
139150 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
140151 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
141152 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
142153 }
143154
144155
156+func parseAssetId (input) = if ((input == wavesString))
157+ then unit
158+ else fromBase58String(input)
159+
160+
161+func assetIdToString (input) = if ((input == unit))
162+ then wavesString
163+ else toBase58String(value(input))
164+
165+
166+func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
167+
168+
145169 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
146170
171+
172+let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
173+
174+let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
147175
148176 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
149177
150178
151179 func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP)
152180
153181
154182 func getAccBalance (assetId) = if ((assetId == "WAVES"))
155183 then wavesBalance(this).available
156184 else assetBalance(this, fromBase58String(assetId))
157185
158186
159187 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
160188
161189
162190 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
163191 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
164192 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
165193 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
166194 }
167195
168196
169197 func calcPrices (amAmt,prAmt,lpAmt) = {
170198 let cfg = getPoolConfig()
171199 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
172200 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
173201 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
174202 let amAmtX18 = toX18(amAmt, amtAssetDcm)
175203 let prAmtX18 = toX18(prAmt, priceAssetDcm)
176204 let lpAmtX18 = toX18(lpAmt, scale8)
177205 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
178206 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
179207 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
180208 }
181209
182210
183211 func calculatePrices (amAmt,prAmt,lpAmt) = {
184212 let prices = calcPrices(amAmt, prAmt, lpAmt)
185213 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
186214 }
187215
188216
189217 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
190218 let cfg = getPoolConfig()
191219 let lpAssetId = cfg[idxPoolLPAssetId]
192220 let amAssetId = cfg[idxAmtAssetId]
193221 let prAssetId = cfg[idxPriceAssetId]
194222 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
195223 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
196224 let poolStatus = cfg[idxPoolStatus]
197225 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
198226 if ((lpAssetId != pmtAssetId))
199227 then throw("Invalid asset passed.")
200228 else {
201229 let amBalance = getAccBalance(amAssetId)
202230 let amBalanceX18 = toX18(amBalance, amAssetDcm)
203231 let prBalance = getAccBalance(prAssetId)
204232 let prBalanceX18 = toX18(prBalance, prAssetDcm)
205233 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
206234 let curPrice = fromX18(curPriceX18, scale8)
207235 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
208236 let lpEmissionX18 = toX18(lpEmission, scale8)
209237 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
210238 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
211239 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
212240 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
213241 let state = if ((txId58 == ""))
214242 then nil
215243 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
216244 then unit
217245 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
218246 then unit
219247 else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
220248 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
221249 }
222250 }
223251
224252
225253 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
226254 let cfg = getPoolConfig()
227255 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
228256 let amAssetIdStr = cfg[idxAmtAssetId]
229257 let prAssetIdStr = cfg[idxPriceAssetId]
230258 let iAmtAssetId = cfg[idxIAmtAssetId]
231259 let iPriceAssetId = cfg[idxIPriceAssetId]
232260 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
233261 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
234262 let poolStatus = cfg[idxPoolStatus]
235263 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
236264 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
237265 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
238266 if (if ((amAssetIdStr != inAmAssetIdStr))
239267 then true
240268 else (prAssetIdStr != inPrAssetIdStr))
241269 then throw("Invalid amt or price asset passed.")
242270 else {
243271 let amBalance = if (isEvaluate)
244272 then getAccBalance(amAssetIdStr)
245273 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
246274 let prBalance = if (isEvaluate)
247275 then getAccBalance(prAssetIdStr)
248276 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
249277 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
250278 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
251279 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
252280 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
253281 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
254282 let res = if ((lpEmission == 0))
255283 then {
256284 let curPriceX18 = zeroBigInt
257285 let slippageX18 = zeroBigInt
258286 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
259287 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
260288 }
261289 else {
262290 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
263291 let slippageX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
264292 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
265293 if (if ((curPriceX18 != zeroBigInt))
266294 then (slippageX18 > slippageToleranceX18)
267295 else false)
268296 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
269297 else {
270298 let lpEmissionX18 = toX18(lpEmission, scale8)
271299 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
272300 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
273301 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
274302 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
275303 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
276304 let expAmtAssetAmtX18 = expectedAmts._1
277305 let expPriceAssetAmtX18 = expectedAmts._2
278306 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
279307 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
280308 }
281309 }
282310 let calcLpAmt = res._1
283311 let calcAmAssetPmt = res._2
284312 let calcPrAssetPmt = res._3
285313 let curPrice = fromX18(res._4, scale8)
286314 let slippageCalc = fromX18(res._5, scale8)
287315 if ((0 >= calcLpAmt))
288316 then throw("Invalid calculations. LP calculated is less than zero.")
289317 else {
290318 let emitLpAmt = if (!(emitLp))
291319 then 0
292320 else calcLpAmt
293321 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
294322 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
295323 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
296324 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
297325 }
298326 }
299327 }
300328
301329
302330 func validateMatcherOrderAllowed (order) = {
303331 let cfg = getPoolConfig()
304332 let amtAssetId = cfg[idxAmtAssetId]
305333 let priceAssetId = cfg[idxPriceAssetId]
306334 let poolStatus = parseIntValue(cfg[idxPoolStatus])
307335 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
308336 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
309337 let accAmtAssetBalance = getAccBalance(amtAssetId)
310338 let accPriceAssetBalance = getAccBalance(priceAssetId)
311339 let curPriceX18 = if ((order.orderType == Buy))
312340 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
313341 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
314342 let curPrice = fromX18(curPriceX18, scale8)
315343 if (if (if (isGlobalShutdown())
316344 then true
317345 else (poolStatus == PoolMatcherDisabled))
318346 then true
319347 else (poolStatus == PoolShutdown))
320348 then throw("Exchange operations disabled")
321349 else {
322350 let orderAmtAsset = order.assetPair.amountAsset
323351 let orderAmtAssetStr = if ((orderAmtAsset == unit))
324352 then "WAVES"
325353 else toBase58String(value(orderAmtAsset))
326354 let orderPriceAsset = order.assetPair.priceAsset
327355 let orderPriceAssetStr = if ((orderPriceAsset == unit))
328356 then "WAVES"
329357 else toBase58String(value(orderPriceAsset))
330358 if (if ((orderAmtAssetStr != amtAssetId))
331359 then true
332360 else (orderPriceAssetStr != priceAssetId))
333361 then throw("Wrong order assets.")
334362 else {
335363 let orderPrice = order.price
336364 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
337365 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
338366 let isOrderPriceValid = if ((order.orderType == Buy))
339367 then (curPrice >= castedOrderPrice)
340368 else (castedOrderPrice >= curPrice)
341369 true
342370 }
343371 }
344372 }
345373
346374
347375 func commonGet (i) = if ((size(i.payments) != 1))
348376 then throw("exactly 1 payment is expected")
349377 else {
350378 let pmt = value(i.payments[0])
351379 let pmtAssetId = value(pmt.assetId)
352380 let pmtAmt = pmt.amount
353381 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
354382 let outAmAmt = res._1
355383 let outPrAmt = res._2
356384 let poolStatus = parseIntValue(res._9)
357385 let state = res._10
358386 if (if (isGlobalShutdown())
359387 then true
360388 else (poolStatus == PoolShutdown))
361389 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
362390 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
363391 }
364392
365393
366394 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
367395 then throw("exactly 2 payments are expected")
368396 else {
369397 let amAssetPmt = value(i.payments[0])
370398 let prAssetPmt = value(i.payments[1])
371399 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
372400 let poolStatus = parseIntValue(estPut._8)
373401 if (if (if (isGlobalShutdown())
374402 then true
375403 else (poolStatus == PoolPutDisabled))
376404 then true
377405 else (poolStatus == PoolShutdown))
378406 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
379407 else estPut
380408 }
381409
382410
411+func emit (amount) = {
412+ let emitInv = invoke(factoryContract, "emit", [amount], nil)
413+ if ((emitInv == emitInv))
414+ then {
415+ let emitInvLegacy = match emitInv {
416+ case legacyFactoryContract: Address =>
417+ invoke(legacyFactoryContract, "emit", [amount], nil)
418+ case _ =>
419+ unit
420+ }
421+ if ((emitInvLegacy == emitInvLegacy))
422+ then amount
423+ else throw("Strict value is not equal to itself.")
424+ }
425+ else throw("Strict value is not equal to itself.")
426+ }
427+
428+
429+func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
430+ let isEval = (txId == unit)
431+ let $t02148521663 = parsePoolConfig(getPoolConfig())
432+ let poolAddress = $t02148521663._1
433+ let poolStatus = $t02148521663._2
434+ let lpAssetId = $t02148521663._3
435+ let amountAssetId = $t02148521663._4
436+ let priceAssetId = $t02148521663._5
437+ let amountAssetDecimals = $t02148521663._6
438+ let priceAssetDecimals = $t02148521663._7
439+ let paymentAmount = paymentAmountRaw
440+ let balanceRaw = if ((paymentAssetId == amountAssetId))
441+ then getAccBalance(assetIdToString(amountAssetId))
442+ else if ((paymentAssetId == priceAssetId))
443+ then getAccBalance(assetIdToString(priceAssetId))
444+ else throwErr("invalid asset")
445+ let amountToSubtract = if (isEval)
446+ then 0
447+ else paymentAmount
448+ let balance = (balanceRaw - amountToSubtract)
449+ let balanceBigInt = toBigInt(balance)
450+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
451+ let depositBigInt = toBigInt(paymentAmount)
452+ let issueAmount = ((supplyBigInt * (sqrtBigInt((scale8BigInt + ((depositBigInt * scale8BigInt) / balanceBigInt)), 8, 8, DOWN) - scale8BigInt)) / scale8BigInt)
453+ toInt(issueAmount)
454+ }
455+
456+
457+func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
458+ let isEval = (txId == unit)
459+ let $t02267122849 = parsePoolConfig(getPoolConfig())
460+ let poolAddress = $t02267122849._1
461+ let poolStatus = $t02267122849._2
462+ let lpAssetId = $t02267122849._3
463+ let amountAssetId = $t02267122849._4
464+ let priceAssetId = $t02267122849._5
465+ let amountAssetDecimals = $t02267122849._6
466+ let priceAssetDecimals = $t02267122849._7
467+ let checks = [if ((paymentAssetId == lpAssetId))
468+ then true
469+ else throw("invalid lp asset")]
470+ if ((checks == checks))
471+ then {
472+ let balanceBigInt = if ((outAssetId == amountAssetId))
473+ then toBigInt(getAccBalance(assetIdToString(amountAssetId)))
474+ else if ((outAssetId == priceAssetId))
475+ then toBigInt(getAccBalance(assetIdToString(priceAssetId)))
476+ else throwErr("invalid asset")
477+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
478+ let redeemedBigInt = toBigInt(paymentAmount)
479+ let amount = ((balanceBigInt * (scale8BigInt - pow((scale8BigInt - ((redeemedBigInt * scale8BigInt) / supplyBigInt)), 8, big2, 0, 8, DOWN))) / scale8BigInt)
480+ toInt(amount)
481+ }
482+ else throw("Strict value is not equal to itself.")
483+ }
484+
485+
383486 func managerPublicKeyOrUnit () = match getString(mpk()) {
384487 case s: String =>
385488 fromBase58String(s)
386489 case _: Unit =>
387490 unit
388491 case _ =>
389492 throw("Match error")
390493 }
391494
392495
393496 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
394497 case s: String =>
395498 fromBase58String(s)
396499 case _: Unit =>
397500 unit
398501 case _ =>
399502 throw("Match error")
400503 }
401504
402505
403506 func mustManager (i) = {
404507 let pd = throw("Permission denied")
405508 match managerPublicKeyOrUnit() {
406509 case pk: ByteVector =>
407510 if ((i.callerPublicKey == pk))
408511 then true
409512 else pd
410513 case _: Unit =>
411514 if ((i.caller == this))
412515 then true
413516 else pd
414517 case _ =>
415518 throw("Match error")
416519 }
417520 }
418521
419522
420523 @Callable(i)
421-func constructor (factoryContract) = {
422- let checkCaller = mustManager(i)
423- if ((checkCaller == checkCaller))
424- then [StringEntry(fc(), factoryContract)]
425- else throw("Strict value is not equal to itself.")
426- }
427-
428-
429-
430-@Callable(i)
431524 func setManager (pendingManagerPublicKey) = {
432525 let checkCaller = mustManager(i)
433526 if ((checkCaller == checkCaller))
434527 then {
435528 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
436529 if ((checkManagerPublicKey == checkManagerPublicKey))
437530 then [StringEntry(pmpk(), pendingManagerPublicKey)]
438531 else throw("Strict value is not equal to itself.")
439532 }
440533 else throw("Strict value is not equal to itself.")
441534 }
442535
443536
444537
445538 @Callable(i)
446539 func confirmManager () = {
447540 let pm = pendingManagerPublicKeyOrUnit()
448541 let hasPM = if (isDefined(pm))
449542 then true
450543 else throw("No pending manager")
451544 if ((hasPM == hasPM))
452545 then {
453546 let checkPM = if ((i.callerPublicKey == value(pm)))
454547 then true
455548 else throw("You are not pending manager")
456549 if ((checkPM == checkPM))
457550 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
458551 else throw("Strict value is not equal to itself.")
459552 }
460553 else throw("Strict value is not equal to itself.")
461554 }
462555
463556
464557
465558 @Callable(i)
466-func put (slippageTolerance,shouldAutoStake) = {
467- let factoryCfg = getFactoryConfig()
468- let stakingContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactoryStakingContract]), "Error. Incorrect staking address.")
469- let slippageContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactorySlippageContract]), "Error. Incorrect slippage contract address.")
470- if ((0 > slippageTolerance))
471- then throw("Invalid slippageTolerance passed")
472- else {
473- let estPut = commonPut(i, slippageTolerance, true)
474- let emitLpAmt = estPut._2
475- let lpAssetId = estPut._7
476- let state = estPut._9
477- let amDiff = estPut._10
478- let prDiff = estPut._11
479- let amId = estPut._12
480- let prId = estPut._13
481- let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
482- if ((emitInv == emitInv))
483- then {
484- let emitInvLegacy = match emitInv {
485- case legacyFactoryContract: Address =>
486- invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
487- case _ =>
488- unit
489- }
490- if ((emitInvLegacy == emitInvLegacy))
491- then {
492- let slippageAInv = if ((amDiff > 0))
493- then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
494- else nil
495- if ((slippageAInv == slippageAInv))
496- then {
497- let slippagePInv = if ((prDiff > 0))
498- then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
499- else nil
500- if ((slippagePInv == slippagePInv))
501- then {
502- let lpTransfer = if (shouldAutoStake)
503- then {
504- let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
505- if ((slpStakeInv == slpStakeInv))
506- then nil
507- else throw("Strict value is not equal to itself.")
508- }
509- else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
510- (state ++ lpTransfer)
511- }
512- else throw("Strict value is not equal to itself.")
513- }
514- else throw("Strict value is not equal to itself.")
515- }
516- else throw("Strict value is not equal to itself.")
517- }
518- else throw("Strict value is not equal to itself.")
519- }
520- }
559+func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
560+ then throw("Invalid slippageTolerance passed")
561+ else {
562+ let estPut = commonPut(i, slippageTolerance, true)
563+ let emitLpAmt = estPut._2
564+ let lpAssetId = estPut._7
565+ let state = estPut._9
566+ let amDiff = estPut._10
567+ let prDiff = estPut._11
568+ let amId = estPut._12
569+ let prId = estPut._13
570+ let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
571+ if ((emitInv == emitInv))
572+ then {
573+ let emitInvLegacy = match emitInv {
574+ case legacyFactoryContract: Address =>
575+ invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
576+ case _ =>
577+ unit
578+ }
579+ if ((emitInvLegacy == emitInvLegacy))
580+ then {
581+ let slippageAInv = if ((amDiff > 0))
582+ then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
583+ else nil
584+ if ((slippageAInv == slippageAInv))
585+ then {
586+ let slippagePInv = if ((prDiff > 0))
587+ then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
588+ else nil
589+ if ((slippagePInv == slippagePInv))
590+ then {
591+ let lpTransfer = if (shouldAutoStake)
592+ then {
593+ let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
594+ if ((slpStakeInv == slpStakeInv))
595+ then nil
596+ else throw("Strict value is not equal to itself.")
597+ }
598+ else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
599+ (state ++ lpTransfer)
600+ }
601+ else throw("Strict value is not equal to itself.")
602+ }
603+ else throw("Strict value is not equal to itself.")
604+ }
605+ else throw("Strict value is not equal to itself.")
606+ }
607+ else throw("Strict value is not equal to itself.")
608+ }
521609
522610
523611
524612 @Callable(i)
525613 func putForFree (maxSlippage) = if ((0 > maxSlippage))
526614 then throw("Invalid value passed")
527615 else {
528616 let estPut = commonPut(i, maxSlippage, false)
529617 estPut._9
530618 }
619+
620+
621+
622+@Callable(i)
623+func putOneTkn (minOutAmount,autoStake) = {
624+ let $t02675626934 = parsePoolConfig(getPoolConfig())
625+ let poolAddress = $t02675626934._1
626+ let poolStatus = $t02675626934._2
627+ let lpAssetId = $t02675626934._3
628+ let amountAssetId = $t02675626934._4
629+ let priceAssetId = $t02675626934._5
630+ let amountAssetDecimals = $t02675626934._6
631+ let priceAssetDecimals = $t02675626934._7
632+ let isPutDisabled = if (if (isGlobalShutdown())
633+ then true
634+ else (poolStatus == PoolPutDisabled))
635+ then true
636+ else (poolStatus == PoolShutdown)
637+ let checks = [if (!(isPutDisabled))
638+ then true
639+ else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
640+ then true
641+ else throwErr("exactly 1 payment are expected")]
642+ if ((checks == checks))
643+ then {
644+ let payment = i.payments[0]
645+ let paymentAssetId = payment.assetId
646+ let paymentAmountRaw = payment.amount
647+ let paymentAmount = paymentAmountRaw
648+ let userAddress = i.caller
649+ let txId = i.transactionId
650+ let emitAmount = {
651+ let emitAmountEstimated = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
652+ if (if ((minOutAmount > 0))
653+ then (minOutAmount > emitAmountEstimated)
654+ else false)
655+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
656+ else emitAmountEstimated
657+ }
658+ let emitInv = emit(emitAmount)
659+ if ((emitInv == emitInv))
660+ then {
661+ let lpTransfer = if (autoStake)
662+ then {
663+ let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitAmount)])
664+ if ((stakeInv == stakeInv))
665+ then nil
666+ else throw("Strict value is not equal to itself.")
667+ }
668+ else [ScriptTransfer(i.caller, emitAmount, lpAssetId)]
669+ $Tuple2(lpTransfer, emitAmount)
670+ }
671+ else throw("Strict value is not equal to itself.")
672+ }
673+ else throw("Strict value is not equal to itself.")
674+ }
675+
676+
677+
678+@Callable(i)
679+func getOneTkn (outAssetId,minOutAmount,unstakeAmount) = {
680+ let $t02816728345 = parsePoolConfig(getPoolConfig())
681+ let poolAddress = $t02816728345._1
682+ let poolStatus = $t02816728345._2
683+ let lpAssetId = $t02816728345._3
684+ let amountAssetId = $t02816728345._4
685+ let priceAssetId = $t02816728345._5
686+ let amountAssetDecimals = $t02816728345._6
687+ let priceAssetDecimals = $t02816728345._7
688+ let isGetDisabled = if (isGlobalShutdown())
689+ then true
690+ else (poolStatus == PoolShutdown)
691+ let checks = [if (!(isGetDisabled))
692+ then true
693+ else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
694+ then true
695+ else throwErr("exactly 1 payment are expected")]
696+ if ((checks == checks))
697+ then {
698+ let payment = i.payments[0]
699+ let paymentAssetId = payment.assetId
700+ let paymentAmount = payment.amount
701+ let userAddress = i.caller
702+ let txId = i.transactionId
703+ let amount = {
704+ let amountEstimated = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, paymentAssetId, userAddress, txId)
705+ if (if ((minOutAmount > 0))
706+ then (minOutAmount > amountEstimated)
707+ else false)
708+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
709+ else amountEstimated
710+ }
711+ let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
712+ if ((burnInv == burnInv))
713+ then {
714+ let assetTransfer = [ScriptTransfer(userAddress, amount, parseAssetId(outAssetId))]
715+ $Tuple2(assetTransfer, amount)
716+ }
717+ else throw("Strict value is not equal to itself.")
718+ }
719+ else throw("Strict value is not equal to itself.")
720+ }
531721
532722
533723
534724 @Callable(i)
535725 func get () = {
536726 let res = commonGet(i)
537727 let outAmtAmt = res._1
538728 let outPrAmt = res._2
539729 let pmtAmt = res._3
540730 let pmtAssetId = res._4
541731 let state = res._5
542732 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
543733 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
544734 then state
545735 else throw("Strict value is not equal to itself.")
546736 }
547737
548738
549739
550740 @Callable(i)
551741 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
552742 let res = commonGet(i)
553743 let outAmAmt = res._1
554744 let outPrAmt = res._2
555745 let pmtAmt = res._3
556746 let pmtAssetId = res._4
557747 let state = res._5
558748 if ((noLessThenAmtAsset > outAmAmt))
559749 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
560750 else if ((noLessThenPriceAsset > outPrAmt))
561751 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
562752 else {
563753 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
564754 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
565755 then state
566756 else throw("Strict value is not equal to itself.")
567757 }
568758 }
569759
570760
571761
572762 @Callable(i)
573763 func unstakeAndGet (amount) = {
574764 let checkPayments = if ((size(i.payments) != 0))
575765 then throw("No payments are expected")
576766 else true
577767 if ((checkPayments == checkPayments))
578768 then {
579769 let cfg = getPoolConfig()
580- let factoryCfg = getFactoryConfig()
581770 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
582- let stakingContract = valueOrErrorMessage(addressFromString(factoryCfg[idxFactoryStakingContract]), "Error. Incorrect staking address.")
583771 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
584772 if ((unstakeInv == unstakeInv))
585773 then {
586774 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
587775 let poolStatus = parseIntValue(res._9)
588776 let state = res._10
589777 let checkPoolStatus = if (if (isGlobalShutdown())
590778 then true
591779 else (poolStatus == PoolShutdown))
592780 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
593781 else true
594782 if ((checkPoolStatus == checkPoolStatus))
595783 then {
596784 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
597785 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
598786 then state
599787 else throw("Strict value is not equal to itself.")
600788 }
601789 else throw("Strict value is not equal to itself.")
602790 }
603791 else throw("Strict value is not equal to itself.")
604792 }
605793 else throw("Strict value is not equal to itself.")
606794 }
607795
608796
609797
610798 @Callable(i)
611799 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
612800 then throw("permissions denied")
613801 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
614802
615803
616804
617805 @Callable(i)
618806 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
619807
620808
621809
622810 @Callable(i)
623811 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
624812
625813
626814
627815 @Callable(i)
628816 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
629817 let prices = calcPrices(amAmt, prAmt, lpAmt)
630818 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
631819 }
632820
633821
634822
635823 @Callable(i)
636824 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
637825
638826
639827
640828 @Callable(i)
641829 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
642830
643831
644832
645833 @Callable(i)
646834 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
647835
648836
649837
650838 @Callable(i)
651839 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
652840
653841
654842
655843 @Callable(i)
656844 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
657845 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
658846 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
659847 }
660848
661849
662850
663851 @Callable(i)
664852 func statsREADONLY () = {
665853 let cfg = getPoolConfig()
666854 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
667855 let amtAssetId = cfg[idxAmtAssetId]
668856 let priceAssetId = cfg[idxPriceAssetId]
669857 let iAmtAssetId = cfg[idxIAmtAssetId]
670858 let iPriceAssetId = cfg[idxIPriceAssetId]
671859 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
672860 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
673861 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
674862 let accAmtAssetBalance = getAccBalance(amtAssetId)
675863 let accPriceAssetBalance = getAccBalance(priceAssetId)
676864 let pricesList = if ((poolLPBalance == 0))
677865 then [zeroBigInt, zeroBigInt, zeroBigInt]
678866 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
679867 let curPrice = 0
680868 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
681869 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
682870 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
683871 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight)], SEP))
684872 }
685873
686874
687875
688876 @Callable(i)
689877 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
690878 let cfg = getPoolConfig()
691879 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
692880 let amAssetIdStr = cfg[idxAmtAssetId]
693881 let amAssetId = fromBase58String(amAssetIdStr)
694882 let prAssetIdStr = cfg[idxPriceAssetId]
695883 let prAssetId = fromBase58String(prAssetIdStr)
696884 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
697885 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
698886 let poolStatus = cfg[idxPoolStatus]
699887 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
700888 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
701889 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
702890 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
703891 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
704892 let curPriceX18 = if ((poolLPBalance == 0))
705893 then zeroBigInt
706894 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
707895 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
708896 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
709897 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
710898 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
711899 let calcLpAmt = estPut._1
712900 let curPriceCalc = estPut._3
713901 let amBalance = estPut._4
714902 let prBalance = estPut._5
715903 let lpEmission = estPut._6
716904 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP))
717905 }
718906
719907
720908
721909 @Callable(i)
722910 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
723911 let cfg = getPoolConfig()
724912 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
725913 let amAssetIdStr = cfg[idxAmtAssetId]
726914 let amAssetId = fromBase58String(amAssetIdStr)
727915 let prAssetIdStr = cfg[idxPriceAssetId]
728916 let prAssetId = fromBase58String(prAssetIdStr)
729917 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
730918 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
731919 let poolStatus = cfg[idxPoolStatus]
732920 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
733921 let amBalanceRaw = getAccBalance(amAssetIdStr)
734922 let prBalanceRaw = getAccBalance(prAssetIdStr)
735923 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
736924 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
737925 let curPriceX18 = if ((poolLPBalance == 0))
738926 then zeroBigInt
739927 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
740928 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
741929 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
742930 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
743931 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
744932 let calcLpAmt = estPut._1
745933 let curPriceCalc = estPut._3
746934 let amBalance = estPut._4
747935 let prBalance = estPut._5
748936 let lpEmission = estPut._6
749937 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP))
750938 }
751939
752940
753941
754942 @Callable(i)
755943 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
756944 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
757945 let outAmAmt = res._1
758946 let outPrAmt = res._2
759947 let amBalance = res._5
760948 let prBalance = res._6
761949 let lpEmission = res._7
762950 let curPrice = res._8
763951 let poolStatus = parseIntValue(res._9)
764952 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), toString(curPrice), toString(poolStatus)], SEP))
765953 }
766954
767955
768956 @Verifier(tx)
769957 func verify () = {
770958 let targetPublicKey = match managerPublicKeyOrUnit() {
771959 case pk: ByteVector =>
772960 pk
773961 case _: Unit =>
774962 tx.senderPublicKey
775963 case _ =>
776964 throw("Match error")
777965 }
778966 match tx {
779967 case order: Order =>
780968 let matcherPub = getMatcherPubOrFail()
781969 let orderValid = validateMatcherOrderAllowed(order)
782970 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
783971 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
784972 if (if (if (orderValid)
785973 then senderValid
786974 else false)
787975 then matcherValid
788976 else false)
789977 then true
790978 else throwOrderError(orderValid, senderValid, matcherValid)
791979 case s: SetScriptTransaction =>
792980 let newHash = blake2b256(value(s.script))
793981 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
794982 let currentHash = scriptHash(this)
795983 if (if ((allowedHash == newHash))
796984 then (currentHash != newHash)
797985 else false)
798986 then true
799987 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
800988 case _ =>
801989 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
802990 }
803991 }
804992

github/deemru/w8io/169f3d6 
118.91 ms