tx · CqMsJXXECJhc8Hry3u8SDb2QiHJsxJVdfDtZdfQqZk6T

3MxPzqFNhXfv22CkzhhrnvdBQRwtYyYJo8d:  -0.01700000 Waves

2023.07.19 14:44 [2672694] smart account 3MxPzqFNhXfv22CkzhhrnvdBQRwtYyYJo8d > SELF 0.00000000 Waves

{ "type": 13, "id": "CqMsJXXECJhc8Hry3u8SDb2QiHJsxJVdfDtZdfQqZk6T", "fee": 1700000, "feeAssetId": null, "timestamp": 1689767082057, "version": 2, "chainId": 84, "sender": "3MxPzqFNhXfv22CkzhhrnvdBQRwtYyYJo8d", "senderPublicKey": "29woGLpVKdVUuqfnN2trGx417VC6TpVxd2gCYBAqh8xP", "proofs": [ "wkNj7h5GioL43iryKyCbf1dVJLSWdhqHb9HxseSvWfaw6pmDbq4TEeRoaEbb9Ta3WuCgZSMo8Ahg2QyEp63ndXb" ], "script": "base64:BgIoCAISCQoHCAgIGAEIARIAEgASCAoGCAgICAgIEgMKARgSABIECgIICEEAEGNvbnRyYWN0RmlsZW5hbWUCD3VzZXJfcG9vbHMucmlkZQADU0VQAgJfXwAMd2F2ZXNBc3NldElkAgVXQVZFUwAHVkxUUE9PTAIHVkxUUE9PTAAIU1RCTFBPT0wCCFNUQkxQT09MABFpbnZhbGlkUHJpY2VBc3NldAITSW52YWxpZCBwcmljZSBhc3NldAEHd3JhcEVycgEDbXNnCQC5CQIJAMwIAgUQY29udHJhY3RGaWxlbmFtZQkAzAgCAgI6IAkAzAgCBQNtc2cFA25pbAIAAQh0aHJvd0VycgEDbXNnCQACAQkBB3dyYXBFcnIBBQNtc2cBB3Rocm93UEQACQEIdGhyb3dFcnIBAhFQZXJtaXNzaW9uIGRlbmllZAEUdGhyb3dDcmVhdGVOb3RDYWxsZWQACQEIdGhyb3dFcnIBAiRDcmVhdGUgaXMgbm90IGNhbGxlZCBmb3IgYXNzZXRzIHBhaXIBEXRocm93WW91Tm90SXNzdWVyAAkBCHRocm93RXJyAQIeWW91IGFyZSBub3QgYW1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QdWJsaWNLZXkf484j", "height": 2672694, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ApMe4NwyrUccmhwNhunZjggVJ6t45xrwj6VF2s43Tz9h Next: none Diff:
OldNewDifferences
6464 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
6565
6666
67-func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
67+func keyManagerVaultAddress () = "%s__managerVaultAddress"
6868
6969
7070 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
131131 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
132132
133133
134+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
135+ case s: String =>
136+ addressFromStringValue(s)
137+ case _ =>
138+ this
139+}
140+
141+
134142 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
135143
136144
164172 else throwCreateNotCalled()
165173
166174
167-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
168- case s: String =>
169- fromBase58String(s)
170- case _: Unit =>
171- unit
172- case _ =>
173- throw("Match error")
174-}
175-
176-
177-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
178- case s: String =>
179- fromBase58String(s)
180- case _: Unit =>
181- unit
182- case _ =>
183- throw("Match error")
184-}
175+func managerPublicKeyOrUnit () = {
176+ let managerVaultAddress = getManagerVaultAddressOrThis()
177+ match getString(managerVaultAddress, keyManagerPublicKey()) {
178+ case s: String =>
179+ fromBase58String(s)
180+ case _: Unit =>
181+ unit
182+ case _ =>
183+ throw("Match error")
184+ }
185+ }
185186
186187
187188 func isManager (i) = match managerPublicKeyOrUnit() {
225226
226227
227228 func _create (i,poolType) = {
228- let asset1Payment = value(i.payments[0])
229- let asset2Payment = value(i.payments[1])
229+ let amountAssetPayment = value(i.payments[0])
230+ let priceAssetPayment = value(i.payments[1])
230231 let feeAssetPayment = value(i.payments[2])
231- let $t064076464 = getIdAndInfo(asset1Payment)
232- let asset1Id = $t064076464._1
233- let asset1Info = $t064076464._2
234- let $t064676524 = getIdAndInfo(asset2Payment)
235- let asset2Id = $t064676524._1
236- let asset2Info = $t064676524._2
237- let $t065276590 = getIdAndInfo(feeAssetPayment)
238- let feeAssetId = $t065276590._1
239- let feeAssetInfo = $t065276590._2
232+ let $t064836555 = getIdAndInfo(amountAssetPayment)
233+ let amountAssetId = $t064836555._1
234+ let amountAssetInfo = $t064836555._2
235+ let $t065586627 = getIdAndInfo(priceAssetPayment)
236+ let priceAssetId = $t065586627._1
237+ let priceAssetInfo = $t065586627._2
238+ let $t066306693 = getIdAndInfo(feeAssetPayment)
239+ let feeAssetId = $t066306693._1
240+ let feeAssetInfo = $t066306693._2
241+ let amountAssetAmount = amountAssetPayment.amount
242+ let priceAssetAmount = priceAssetPayment.amount
243+ let feeAssetAmount = feeAssetPayment.amount
240244 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
241- let checkAssetsNotEqual = if ((asset1Id != asset2Id))
245+ let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount())
246+ let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount()))
247+ let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId))
248+ then {
249+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset)
250+ value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
251+ }
252+ else assetMinAmountDefault
253+ let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId))
254+ then {
255+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
256+ value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
257+ }
258+ else assetMinAmountDefault
259+ let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
260+ let curIndex = (lastIndex + 1)
261+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
262+ let poolExists = {
263+ let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
264+ if ($isInstanceOf(@, "Boolean"))
265+ then @
266+ else throw(($getType(@) + " couldn't be cast to Boolean"))
267+ }
268+ let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
242269 then true
243- else throwInvalidAssetPair()
244- if ((checkAssetsNotEqual == checkAssetsNotEqual))
270+ else throwPoolExists(), if (!(poolExists))
271+ then true
272+ else throwPoolExists(), if ((amountAssetId != priceAssetId))
273+ then true
274+ else throwInvalidAssetPair(), if (if (isManager(i))
275+ then true
276+ else if (isVerified(amountAssetId))
277+ then isVerified(priceAssetId)
278+ else false)
279+ then true
280+ else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId))
281+ then true
282+ else containsElement(priceAssetsList, priceAssetId))
283+ then true
284+ else throwInvalidAssetPair(), if (if (isManager(i))
285+ then true
286+ else (getString(keyFeeAssetId()) == feeAssetId))
287+ then true
288+ else throwInvalidFeeAsset(), if (if (isManager(i))
289+ then true
290+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
291+ then true
292+ else throwInvalidAmountAsset(), if (if (isManager(i))
293+ then true
294+ else (priceAssetAmount >= priceAssetMinAmount))
295+ then true
296+ else throwInvalidPriceAssetAmount(), if (if (isManager(i))
297+ then true
298+ else (feeAssetAmount == getInteger(keyFeeAmount())))
299+ then true
300+ else throwInvalidFee()]
301+ if ((checks == checks))
245302 then {
246- let $t067647225 = if (if (isManager(i))
247- then true
248- else if (containsElement(priceAssetsList, asset2Id))
249- then isVerified(asset1Id)
250- else false)
251- then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
252- else if (if (containsElement(priceAssetsList, asset1Id))
253- then isVerified(asset2Id)
254- else false)
255- then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
256- else throwInvalidAssetPair()
257- let amountAssetId = $t067647225._1
258- let amountAssetAmount = $t067647225._2
259- let priceAssetId = $t067647225._3
260- let priceAssetAmount = $t067647225._4
261- let managerPriceAssetMinAmount = 1
262- let priceAssetMinAmount = if (isManager(i))
263- then managerPriceAssetMinAmount
264- else {
265- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
266- value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
267- }
268- let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
269- let curIndex = (lastIndex + 1)
270- let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
271- let poolExists = {
272- let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
273- if ($isInstanceOf(@, "Boolean"))
274- then @
275- else throw(($getType(@) + " couldn't be cast to Boolean"))
276- }
277- let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
278- then true
279- else throwPoolExists(), if (!(poolExists))
280- then true
281- else throwPoolExists(), if (if (isManager(i))
282- then true
283- else (getString(keyFeeAssetId()) == feeAssetId))
284- then true
285- else throwInvalidFeeAsset(), if (if (isManager(i))
286- then true
287- else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
288- then true
289- else throwInvalidAmountAsset(), if (if (isManager(i))
290- then true
291- else (priceAssetAmount >= priceAssetMinAmount))
292- then true
293- else throwInvalidPriceAssetAmount(), if (if (isManager(i))
294- then true
295- else (feeAssetPayment.amount == getInteger(keyFeeAmount())))
296- then true
297- else throwInvalidFee()]
298- if ((checks == checks))
299- then {
300- let paymentsWithFeeSize = 3
301- let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
302- then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
303- else unit
304- if ((burnEmissionInv == burnEmissionInv))
305- then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount), StringEntry(keyPoolType(amountAssetId, priceAssetId), poolType)]
306- else throw("Strict value is not equal to itself.")
307- }
303+ let paymentsWithFeeSize = 3
304+ let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
305+ then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
306+ else unit
307+ if ((burnEmissionInv == burnEmissionInv))
308+ then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount), StringEntry(keyPoolType(amountAssetId, priceAssetId), poolType)]
308309 else throw("Strict value is not equal to itself.")
309310 }
310311 else throw("Strict value is not equal to itself.")
404405
405406
406407 @Callable(i)
407-func setManager (pendingManagerPublicKey) = {
408- let checkCaller = mustManager(i)
409- if ((checkCaller == checkCaller))
410- then {
411- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
412- if ((checkManagerPublicKey == checkManagerPublicKey))
413- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
414- else throw("Strict value is not equal to itself.")
415- }
416- else throw("Strict value is not equal to itself.")
417- }
418-
419-
420-
421-@Callable(i)
422-func confirmManager () = {
423- let pm = pendingManagerPublicKeyOrUnit()
424- let hasPM = if (isDefined(pm))
425- then true
426- else throw("No pending manager")
427- if ((hasPM == hasPM))
428- then {
429- let checkPM = if ((i.callerPublicKey == value(pm)))
430- then true
431- else throw("You are not pending manager")
432- if ((checkPM == checkPM))
433- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
434- else throw("Strict value is not equal to itself.")
435- }
436- else throw("Strict value is not equal to itself.")
437- }
438-
439-
440-
441-@Callable(i)
442408 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
443409
444410
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFilename = "user_pools.ride"
55
66 let SEP = "__"
77
88 let wavesAssetId = "WAVES"
99
1010 let VLTPOOL = "VLTPOOL"
1111
1212 let STBLPOOL = "STBLPOOL"
1313
1414 let invalidPriceAsset = "Invalid price asset"
1515
1616 func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
1717
1818
1919 func throwErr (msg) = throw(wrapErr(msg))
2020
2121
2222 func throwPD () = throwErr("Permission denied")
2323
2424
2525 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
2626
2727
2828 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2929
3030
3131 func throwPoolExists () = throwErr("Pool with such assets already exists")
3232
3333
3434 func throwAssetNotVerified () = throwErr("Asset is not verified")
3535
3636
3737 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
3838
3939
4040 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
4141
4242
4343 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
4444
4545
4646 func throwInvalidStatus () = throwErr("Invalid status")
4747
4848
4949 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
5050
5151
5252 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
5353
5454
5555 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
5656
5757
5858 func throwInvalidFee () = throwErr("invalid fee")
5959
6060
6161 func throwInvalidAssetPair () = throwErr("invalid asset pair")
6262
6363
6464 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
6565
6666
67-func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
67+func keyManagerVaultAddress () = "%s__managerVaultAddress"
6868
6969
7070 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
7171
7272
7373 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
7474
7575
7676 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
7777
7878
7979 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
8080
8181
8282 func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
8383
8484
8585 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
8686
8787
8888 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
8989
9090
9191 let indexSuffix = "u"
9292
9393 let statusPending = "pending"
9494
9595 let statusDeclined = "declined"
9696
9797 let statusActive = "active"
9898
9999 let statuses = [statusPending, statusDeclined, statusActive]
100100
101101 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
102102
103103
104104 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
105105
106106
107107 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
108108
109109
110110 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
111111
112112
113113 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
114114
115115
116116 func keyPoolType (amountAssetId,priceAssetId) = makeString(["%s%s%s", "poolType", amountAssetId, priceAssetId], SEP)
117117
118118
119119 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
120120
121121
122122 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
123123
124124
125125 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
126126
127127
128128 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
129129
130130
131131 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
132132
133133
134+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
135+ case s: String =>
136+ addressFromStringValue(s)
137+ case _ =>
138+ this
139+}
140+
141+
134142 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
135143
136144
137145 func stringOptionToList (stringOrUnit) = match stringOrUnit {
138146 case s: String =>
139147 if ((size(s) == 0))
140148 then nil
141149 else split(s, SEP)
142150 case _: Unit =>
143151 nil
144152 case _ =>
145153 throw("Match error")
146154 }
147155
148156
149157 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
150158
151159 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
152160
153161 let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required")))
154162
155163 let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP)
156164
157165 let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required")))
158166
159167 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
160168
161169
162170 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
163171 then true
164172 else throwCreateNotCalled()
165173
166174
167-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
168- case s: String =>
169- fromBase58String(s)
170- case _: Unit =>
171- unit
172- case _ =>
173- throw("Match error")
174-}
175-
176-
177-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
178- case s: String =>
179- fromBase58String(s)
180- case _: Unit =>
181- unit
182- case _ =>
183- throw("Match error")
184-}
175+func managerPublicKeyOrUnit () = {
176+ let managerVaultAddress = getManagerVaultAddressOrThis()
177+ match getString(managerVaultAddress, keyManagerPublicKey()) {
178+ case s: String =>
179+ fromBase58String(s)
180+ case _: Unit =>
181+ unit
182+ case _ =>
183+ throw("Match error")
184+ }
185+ }
185186
186187
187188 func isManager (i) = match managerPublicKeyOrUnit() {
188189 case pk: ByteVector =>
189190 (i.callerPublicKey == pk)
190191 case _: Unit =>
191192 (i.caller == this)
192193 case _ =>
193194 throw("Match error")
194195 }
195196
196197
197198 func mustManager (i) = if (isManager(i))
198199 then true
199200 else throwPD()
200201
201202
202203 func mustAdmin (i) = {
203204 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
204205 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
205206 then true
206207 else mustManager(i)
207208 }
208209
209210
210211 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
211212
212213
213214 func getIdAndInfo (payment) = match payment.assetId {
214215 case id: ByteVector =>
215216 let info = value(assetInfo(id))
216217 $Tuple2(toBase58String(id), info)
217218 case _: Unit =>
218219 $Tuple2(wavesAssetId, unit)
219220 case _ =>
220221 throw("Match error")
221222 }
222223
223224
224225 func validStatus (status) = containsElement(statuses, status)
225226
226227
227228 func _create (i,poolType) = {
228- let asset1Payment = value(i.payments[0])
229- let asset2Payment = value(i.payments[1])
229+ let amountAssetPayment = value(i.payments[0])
230+ let priceAssetPayment = value(i.payments[1])
230231 let feeAssetPayment = value(i.payments[2])
231- let $t064076464 = getIdAndInfo(asset1Payment)
232- let asset1Id = $t064076464._1
233- let asset1Info = $t064076464._2
234- let $t064676524 = getIdAndInfo(asset2Payment)
235- let asset2Id = $t064676524._1
236- let asset2Info = $t064676524._2
237- let $t065276590 = getIdAndInfo(feeAssetPayment)
238- let feeAssetId = $t065276590._1
239- let feeAssetInfo = $t065276590._2
232+ let $t064836555 = getIdAndInfo(amountAssetPayment)
233+ let amountAssetId = $t064836555._1
234+ let amountAssetInfo = $t064836555._2
235+ let $t065586627 = getIdAndInfo(priceAssetPayment)
236+ let priceAssetId = $t065586627._1
237+ let priceAssetInfo = $t065586627._2
238+ let $t066306693 = getIdAndInfo(feeAssetPayment)
239+ let feeAssetId = $t066306693._1
240+ let feeAssetInfo = $t066306693._2
241+ let amountAssetAmount = amountAssetPayment.amount
242+ let priceAssetAmount = priceAssetPayment.amount
243+ let feeAssetAmount = feeAssetPayment.amount
240244 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
241- let checkAssetsNotEqual = if ((asset1Id != asset2Id))
245+ let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount())
246+ let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount()))
247+ let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId))
248+ then {
249+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset)
250+ value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
251+ }
252+ else assetMinAmountDefault
253+ let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId))
254+ then {
255+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
256+ value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
257+ }
258+ else assetMinAmountDefault
259+ let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
260+ let curIndex = (lastIndex + 1)
261+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
262+ let poolExists = {
263+ let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
264+ if ($isInstanceOf(@, "Boolean"))
265+ then @
266+ else throw(($getType(@) + " couldn't be cast to Boolean"))
267+ }
268+ let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
242269 then true
243- else throwInvalidAssetPair()
244- if ((checkAssetsNotEqual == checkAssetsNotEqual))
270+ else throwPoolExists(), if (!(poolExists))
271+ then true
272+ else throwPoolExists(), if ((amountAssetId != priceAssetId))
273+ then true
274+ else throwInvalidAssetPair(), if (if (isManager(i))
275+ then true
276+ else if (isVerified(amountAssetId))
277+ then isVerified(priceAssetId)
278+ else false)
279+ then true
280+ else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId))
281+ then true
282+ else containsElement(priceAssetsList, priceAssetId))
283+ then true
284+ else throwInvalidAssetPair(), if (if (isManager(i))
285+ then true
286+ else (getString(keyFeeAssetId()) == feeAssetId))
287+ then true
288+ else throwInvalidFeeAsset(), if (if (isManager(i))
289+ then true
290+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
291+ then true
292+ else throwInvalidAmountAsset(), if (if (isManager(i))
293+ then true
294+ else (priceAssetAmount >= priceAssetMinAmount))
295+ then true
296+ else throwInvalidPriceAssetAmount(), if (if (isManager(i))
297+ then true
298+ else (feeAssetAmount == getInteger(keyFeeAmount())))
299+ then true
300+ else throwInvalidFee()]
301+ if ((checks == checks))
245302 then {
246- let $t067647225 = if (if (isManager(i))
247- then true
248- else if (containsElement(priceAssetsList, asset2Id))
249- then isVerified(asset1Id)
250- else false)
251- then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
252- else if (if (containsElement(priceAssetsList, asset1Id))
253- then isVerified(asset2Id)
254- else false)
255- then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
256- else throwInvalidAssetPair()
257- let amountAssetId = $t067647225._1
258- let amountAssetAmount = $t067647225._2
259- let priceAssetId = $t067647225._3
260- let priceAssetAmount = $t067647225._4
261- let managerPriceAssetMinAmount = 1
262- let priceAssetMinAmount = if (isManager(i))
263- then managerPriceAssetMinAmount
264- else {
265- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
266- value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
267- }
268- let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
269- let curIndex = (lastIndex + 1)
270- let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
271- let poolExists = {
272- let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
273- if ($isInstanceOf(@, "Boolean"))
274- then @
275- else throw(($getType(@) + " couldn't be cast to Boolean"))
276- }
277- let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
278- then true
279- else throwPoolExists(), if (!(poolExists))
280- then true
281- else throwPoolExists(), if (if (isManager(i))
282- then true
283- else (getString(keyFeeAssetId()) == feeAssetId))
284- then true
285- else throwInvalidFeeAsset(), if (if (isManager(i))
286- then true
287- else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
288- then true
289- else throwInvalidAmountAsset(), if (if (isManager(i))
290- then true
291- else (priceAssetAmount >= priceAssetMinAmount))
292- then true
293- else throwInvalidPriceAssetAmount(), if (if (isManager(i))
294- then true
295- else (feeAssetPayment.amount == getInteger(keyFeeAmount())))
296- then true
297- else throwInvalidFee()]
298- if ((checks == checks))
299- then {
300- let paymentsWithFeeSize = 3
301- let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
302- then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
303- else unit
304- if ((burnEmissionInv == burnEmissionInv))
305- then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount), StringEntry(keyPoolType(amountAssetId, priceAssetId), poolType)]
306- else throw("Strict value is not equal to itself.")
307- }
303+ let paymentsWithFeeSize = 3
304+ let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
305+ then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
306+ else unit
307+ if ((burnEmissionInv == burnEmissionInv))
308+ then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), StringEntry(keyCreateCaller(amountAssetId, priceAssetId), toString(i.caller)), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetAmount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetAmount), StringEntry(keyPoolType(amountAssetId, priceAssetId), poolType)]
308309 else throw("Strict value is not equal to itself.")
309310 }
310311 else throw("Strict value is not equal to itself.")
311312 }
312313
313314
314315 @Callable(i)
315316 func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
316317 let checkCaller = mustManager(i)
317318 if ((checkCaller == checkCaller))
318319 then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
319320 else throw("Strict value is not equal to itself.")
320321 }
321322
322323
323324
324325 @Callable(i)
325326 func create () = _create(i, VLTPOOL)
326327
327328
328329
329330 @Callable(i)
330331 func createStable () = {
331332 let checkCaller = mustManager(i)
332333 if ((checkCaller == checkCaller))
333334 then _create(i, STBLPOOL)
334335 else throw("Strict value is not equal to itself.")
335336 }
336337
337338
338339
339340 @Callable(i)
340341 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
341342 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
342343 then true
343344 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
344345 then true
345346 else throwCanActivateOnlyPendingPool()]
346347 if ((checks == checks))
347348 then {
348349 let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId))
349350 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit))
350351 then "VLTPOOL"
351352 else value(poolTypeOption), logo], nil)
352353 if ((activateNewPoolInv == activateNewPoolInv))
353354 then {
354355 let lpAssetId = match activateNewPoolInv {
355356 case id: String =>
356357 id
357358 case _ =>
358359 throwFactoryReturnedNotString()
359360 }
360361 if ((lpAssetId == lpAssetId))
361362 then {
362363 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
363364 if ((beforePut == beforePut))
364365 then {
365366 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
366367 then unit
367368 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
368369 then unit
369370 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
370371 if ((put == put))
371372 then {
372373 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
373374 if ((afterPut == afterPut))
374375 then {
375376 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
376377 let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil)
377378 if ((res == res))
378379 then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
379380 else throw("Strict value is not equal to itself.")
380381 }
381382 else throw("Strict value is not equal to itself.")
382383 }
383384 else throw("Strict value is not equal to itself.")
384385 }
385386 else throw("Strict value is not equal to itself.")
386387 }
387388 else throw("Strict value is not equal to itself.")
388389 }
389390 else throw("Strict value is not equal to itself.")
390391 }
391392 else throw("Strict value is not equal to itself.")
392393 }
393394
394395
395396
396397 @Callable(i)
397398 func setAdmins (adminPubKeys) = {
398399 let checkCaller = mustManager(i)
399400 if ((checkCaller == checkCaller))
400401 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
401402 else throw("Strict value is not equal to itself.")
402403 }
403404
404405
405406
406407 @Callable(i)
407-func setManager (pendingManagerPublicKey) = {
408- let checkCaller = mustManager(i)
409- if ((checkCaller == checkCaller))
410- then {
411- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
412- if ((checkManagerPublicKey == checkManagerPublicKey))
413- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
414- else throw("Strict value is not equal to itself.")
415- }
416- else throw("Strict value is not equal to itself.")
417- }
418-
419-
420-
421-@Callable(i)
422-func confirmManager () = {
423- let pm = pendingManagerPublicKeyOrUnit()
424- let hasPM = if (isDefined(pm))
425- then true
426- else throw("No pending manager")
427- if ((hasPM == hasPM))
428- then {
429- let checkPM = if ((i.callerPublicKey == value(pm)))
430- then true
431- else throw("You are not pending manager")
432- if ((checkPM == checkPM))
433- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
434- else throw("Strict value is not equal to itself.")
435- }
436- else throw("Strict value is not equal to itself.")
437- }
438-
439-
440-
441-@Callable(i)
442408 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
443409
444410
445411
446412 @Callable(i)
447413 func statusREADONLY (amountAssetId,priceAssetId) = {
448414 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
449415 case s: String =>
450416 s
451417 case _ =>
452418 unit
453419 }
454420 $Tuple2(nil, status)
455421 }
456422
457423
458424 @Verifier(tx)
459425 func verify () = {
460426 let targetPublicKey = match managerPublicKeyOrUnit() {
461427 case pk: ByteVector =>
462428 pk
463429 case _: Unit =>
464430 tx.senderPublicKey
465431 case _ =>
466432 throw("Match error")
467433 }
468434 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
469435 }
470436

github/deemru/w8io/169f3d6 
65.70 ms