tx · EJLspSb7yyEbxUC9rjtAW6t767SsgtqZUCxaEKhJrV3e

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01400000 Waves

2023.05.05 11:41 [2564285] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "EJLspSb7yyEbxUC9rjtAW6t767SsgtqZUCxaEKhJrV3e", "fee": 1400000, "feeAssetId": null, "timestamp": 1683276074102, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "5kA218dCjB5Y2dLhFZTCxSv7JU3cVCjX4XmxGz2fjoQoeR5z2TkCB5ocSLx12DGaijMwQ4rYurm124cNQfuzFsDB" ], "script": "base64:BgKJEAgCEgkKBwgICBgBCAESABIICgYICAgICAgSAwoBGBIDCgEIEgASABIECgIICCIQY29udHJhY3RGaWxlbmFtZSIDU0VQIgx3YXZlc0Fzc2V0SWQiEWludmFsaWRQcmljZUFzc2V0Igd3cmFwRXJyIgNtc2ciCHRocm93RXJyIgd0aHJvd1BEIhR0aHJvd0NyZWF0ZU5vdENhbGxlZCIRdGhyb3dZb3VOb3RJc3N1ZXIiD3Rocm93UG9vbEV4aXN0cyIVdGhyb3dBc3NldE5vdFZlcmlmaWVkIhZ0aHJvd0ludmFsaWRQcmljZUFzc2V0IhR0aHJvd0ludmFsaWRGZWVBc3NldCIXdGhyb3dJbnZhbGlkQW1vdW50QXNzZXQiEnRocm93SW52YWxpZFN0YXR1cyIfdGhyb3dDYW5BY3RpdmF0ZU9ubHlQZW5kaW5nUG9vbCIddGhyb3dGYWN0b3J5UmV0dXJuZWROb3RTdHJpbmciHHRocm93SW52YWxpZFByaWNlQXNzZXRBbW91bnQiD3Rocm93SW52YWxpZEZlZSIVdGhyb3dJbnZhbGlkQXNzZXRQYWlyIhNrZXlN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AAQCYnQDCQEJaXNEZWZpbmVkAQUCYnMGCQACAQISTm8gcGVuZGluZyBtYW5hZ2VyAwkAAAIFAmJ0BQJidAQCYnUDCQAAAggFAmFsD2NhbGxlclB1YmxpY0tleQkBBXZhbHVlAQUCYnMGCQACAQIbWW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAIFAmJ1BQJidQkAzAgCCQELU3RyaW5nRW50cnkCCQEBdgAJANgEAQkBBXZhbHVlAQUCYnMJAMwIAgkBC0RlbGV0ZUVudHJ5AQkBAXcABQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4CYWwBE3ByaWNlQXNzZXRzUkVBRE9OTFkACQCUCgIFA25pbAkBAVgBCQCiCAEJAQFVAAJhbAEOc3RhdHVzUkVBRE9OTFkCAXoBQQQCYXgEAVoJAKIIAQkBAXkCBQF6BQFBAwkAAQIFAVoCBlN0cmluZwQCYWEFAVoFAmFhBQR1bml0CQCUCgIFA25pbAUCYXgBAmJ2AQJidwAEAmJ4BAFaCQECYWkAAwkAAQIFAVoCCkJ5dGVWZWN0b3IEAmFtBQFaBQJhbQMJAAECBQFaAgRVbml0CAUCYnYPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmJ2CWJvZHlCeXRlcwkAkQMCCAUCYnYGcHJvb2ZzAAAFAmJ4F+bv1g==", "height": 2564285, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5ifMM8dPiZ7dWFGqw4TSnFr2dnkDQrVkRAbNxZVp7YsU Next: 4pAh3mrJUeHMi8nxU6tiKTbUTDVovY6CR5E5STvVv8sc Diff:
OldNewDifferences
66 let SEP = "__"
77
88 let wavesAssetId = "WAVES"
9-
10-let VLTPOOL = "VLTPOOL"
11-
12-let STBLPOOL = "STBLPOOL"
139
1410 let invalidPriceAsset = "Invalid price asset"
1511
111107
112108
113109 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
114-
115-
116-func keyPoolType (amountAssetId,priceAssetId) = makeString(["%s%s%s", "poolType", amountAssetId, priceAssetId], SEP)
117110
118111
119112 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
224217 func validStatus (status) = containsElement(statuses, status)
225218
226219
227-func _create (i,poolType) = {
228- let asset1Payment = value(i.payments[0])
229- let asset2Payment = value(i.payments[1])
230- 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
240- let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
241- let checkAssetsNotEqual = if ((asset1Id != asset2Id))
242- then true
243- else throwInvalidAssetPair()
244- if ((checkAssetsNotEqual == checkAssetsNotEqual))
245- 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- }
308- else throw("Strict value is not equal to itself.")
309- }
310- else throw("Strict value is not equal to itself.")
311- }
312-
313-
314220 @Callable(i)
315221 func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
316222 let checkCaller = mustManager(i)
322228
323229
324230 @Callable(i)
325-func create () = _create(i, VLTPOOL)
326-
327-
328-
329-@Callable(i)
330-func createStable () = {
331- let checkCaller = mustManager(i)
332- if ((checkCaller == checkCaller))
333- then _create(i, STBLPOOL)
231+func create () = {
232+ let amountAssetPayment = value(i.payments[0])
233+ let priceAssetPayment = value(i.payments[1])
234+ let feeAssetPayment = value(i.payments[2])
235+ let $t074737545 = getIdAndInfo(amountAssetPayment)
236+ let amountAssetId = $t074737545._1
237+ let amountAssetInfo = $t074737545._2
238+ let $t075487617 = getIdAndInfo(priceAssetPayment)
239+ let priceAssetId = $t075487617._1
240+ let priceAssetInfo = $t075487617._2
241+ let $t076207683 = getIdAndInfo(feeAssetPayment)
242+ let feeAssetId = $t076207683._1
243+ let feeAssetInfo = $t076207683._2
244+ let amountAssetAmount = amountAssetPayment.amount
245+ let priceAssetAmount = priceAssetPayment.amount
246+ let feeAssetAmount = feeAssetPayment.amount
247+ let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
248+ let managerPriceAssetMinAmount = 1
249+ let priceAssetMinAmount = if (isManager(i))
250+ then managerPriceAssetMinAmount
251+ else {
252+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
253+ value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
254+ }
255+ let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
256+ let curIndex = (lastIndex + 1)
257+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
258+ let poolExists = {
259+ let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
260+ if ($isInstanceOf(@, "Boolean"))
261+ then @
262+ else throw(($getType(@) + " couldn't be cast to Boolean"))
263+ }
264+ let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
265+ then true
266+ else throwPoolExists(), if (!(poolExists))
267+ then true
268+ else throwPoolExists(), if ((amountAssetId != priceAssetId))
269+ then true
270+ else throwInvalidAssetPair(), if (if (isVerified(amountAssetId))
271+ then isVerified(priceAssetId)
272+ else false)
273+ then true
274+ else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId))
275+ then true
276+ else containsElement(priceAssetsList, priceAssetId))
277+ then true
278+ else throwInvalidAssetPair(), if (if (isManager(i))
279+ then true
280+ else (getString(keyFeeAssetId()) == feeAssetId))
281+ then true
282+ else throwInvalidFeeAsset(), if (if (isManager(i))
283+ then true
284+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
285+ then true
286+ else throwInvalidAmountAsset(), if (if (isManager(i))
287+ then true
288+ else (priceAssetAmount >= priceAssetMinAmount))
289+ then true
290+ else throwInvalidPriceAssetAmount(), if (if (isManager(i))
291+ then true
292+ else (feeAssetAmount == getInteger(keyFeeAmount())))
293+ then true
294+ else throwInvalidFee()]
295+ if ((checks == checks))
296+ then {
297+ let paymentsWithFeeSize = 3
298+ let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
299+ then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
300+ else unit
301+ if ((burnEmissionInv == burnEmissionInv))
302+ 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)]
303+ else throw("Strict value is not equal to itself.")
304+ }
334305 else throw("Strict value is not equal to itself.")
335306 }
336307
345316 else throwCanActivateOnlyPendingPool()]
346317 if ((checks == checks))
347318 then {
348- let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId))
349- let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit))
350- then "VLTPOOL"
351- else value(poolTypeOption), logo], nil)
319+ let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
352320 if ((activateNewPoolInv == activateNewPoolInv))
353321 then {
354322 let lpAssetId = match activateNewPoolInv {
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"
9-
10-let VLTPOOL = "VLTPOOL"
11-
12-let STBLPOOL = "STBLPOOL"
139
1410 let invalidPriceAsset = "Invalid price asset"
1511
1612 func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
1713
1814
1915 func throwErr (msg) = throw(wrapErr(msg))
2016
2117
2218 func throwPD () = throwErr("Permission denied")
2319
2420
2521 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
2622
2723
2824 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2925
3026
3127 func throwPoolExists () = throwErr("Pool with such assets already exists")
3228
3329
3430 func throwAssetNotVerified () = throwErr("Asset is not verified")
3531
3632
3733 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
3834
3935
4036 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
4137
4238
4339 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
4440
4541
4642 func throwInvalidStatus () = throwErr("Invalid status")
4743
4844
4945 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
5046
5147
5248 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
5349
5450
5551 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
5652
5753
5854 func throwInvalidFee () = throwErr("invalid fee")
5955
6056
6157 func throwInvalidAssetPair () = throwErr("invalid asset pair")
6258
6359
6460 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
6561
6662
6763 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
6864
6965
7066 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
7167
7268
7369 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
7470
7571
7672 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
7773
7874
7975 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
8076
8177
8278 func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
8379
8480
8581 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
8682
8783
8884 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
8985
9086
9187 let indexSuffix = "u"
9288
9389 let statusPending = "pending"
9490
9591 let statusDeclined = "declined"
9692
9793 let statusActive = "active"
9894
9995 let statuses = [statusPending, statusDeclined, statusActive]
10096
10197 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
10298
10399
104100 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
105101
106102
107103 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
108104
109105
110106 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
111107
112108
113109 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
114-
115-
116-func keyPoolType (amountAssetId,priceAssetId) = makeString(["%s%s%s", "poolType", amountAssetId, priceAssetId], SEP)
117110
118111
119112 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
120113
121114
122115 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
123116
124117
125118 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
126119
127120
128121 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
129122
130123
131124 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
132125
133126
134127 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
135128
136129
137130 func stringOptionToList (stringOrUnit) = match stringOrUnit {
138131 case s: String =>
139132 if ((size(s) == 0))
140133 then nil
141134 else split(s, SEP)
142135 case _: Unit =>
143136 nil
144137 case _ =>
145138 throw("Match error")
146139 }
147140
148141
149142 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
150143
151144 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
152145
153146 let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required")))
154147
155148 let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP)
156149
157150 let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required")))
158151
159152 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
160153
161154
162155 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
163156 then true
164157 else throwCreateNotCalled()
165158
166159
167160 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
168161 case s: String =>
169162 fromBase58String(s)
170163 case _: Unit =>
171164 unit
172165 case _ =>
173166 throw("Match error")
174167 }
175168
176169
177170 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
178171 case s: String =>
179172 fromBase58String(s)
180173 case _: Unit =>
181174 unit
182175 case _ =>
183176 throw("Match error")
184177 }
185178
186179
187180 func isManager (i) = match managerPublicKeyOrUnit() {
188181 case pk: ByteVector =>
189182 (i.callerPublicKey == pk)
190183 case _: Unit =>
191184 (i.caller == this)
192185 case _ =>
193186 throw("Match error")
194187 }
195188
196189
197190 func mustManager (i) = if (isManager(i))
198191 then true
199192 else throwPD()
200193
201194
202195 func mustAdmin (i) = {
203196 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
204197 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
205198 then true
206199 else mustManager(i)
207200 }
208201
209202
210203 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
211204
212205
213206 func getIdAndInfo (payment) = match payment.assetId {
214207 case id: ByteVector =>
215208 let info = value(assetInfo(id))
216209 $Tuple2(toBase58String(id), info)
217210 case _: Unit =>
218211 $Tuple2(wavesAssetId, unit)
219212 case _ =>
220213 throw("Match error")
221214 }
222215
223216
224217 func validStatus (status) = containsElement(statuses, status)
225218
226219
227-func _create (i,poolType) = {
228- let asset1Payment = value(i.payments[0])
229- let asset2Payment = value(i.payments[1])
230- 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
240- let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
241- let checkAssetsNotEqual = if ((asset1Id != asset2Id))
242- then true
243- else throwInvalidAssetPair()
244- if ((checkAssetsNotEqual == checkAssetsNotEqual))
245- 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- }
308- else throw("Strict value is not equal to itself.")
309- }
310- else throw("Strict value is not equal to itself.")
311- }
312-
313-
314220 @Callable(i)
315221 func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
316222 let checkCaller = mustManager(i)
317223 if ((checkCaller == checkCaller))
318224 then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
319225 else throw("Strict value is not equal to itself.")
320226 }
321227
322228
323229
324230 @Callable(i)
325-func create () = _create(i, VLTPOOL)
326-
327-
328-
329-@Callable(i)
330-func createStable () = {
331- let checkCaller = mustManager(i)
332- if ((checkCaller == checkCaller))
333- then _create(i, STBLPOOL)
231+func create () = {
232+ let amountAssetPayment = value(i.payments[0])
233+ let priceAssetPayment = value(i.payments[1])
234+ let feeAssetPayment = value(i.payments[2])
235+ let $t074737545 = getIdAndInfo(amountAssetPayment)
236+ let amountAssetId = $t074737545._1
237+ let amountAssetInfo = $t074737545._2
238+ let $t075487617 = getIdAndInfo(priceAssetPayment)
239+ let priceAssetId = $t075487617._1
240+ let priceAssetInfo = $t075487617._2
241+ let $t076207683 = getIdAndInfo(feeAssetPayment)
242+ let feeAssetId = $t076207683._1
243+ let feeAssetInfo = $t076207683._2
244+ let amountAssetAmount = amountAssetPayment.amount
245+ let priceAssetAmount = priceAssetPayment.amount
246+ let feeAssetAmount = feeAssetPayment.amount
247+ let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
248+ let managerPriceAssetMinAmount = 1
249+ let priceAssetMinAmount = if (isManager(i))
250+ then managerPriceAssetMinAmount
251+ else {
252+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
253+ value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
254+ }
255+ let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
256+ let curIndex = (lastIndex + 1)
257+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
258+ let poolExists = {
259+ let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
260+ if ($isInstanceOf(@, "Boolean"))
261+ then @
262+ else throw(($getType(@) + " couldn't be cast to Boolean"))
263+ }
264+ let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
265+ then true
266+ else throwPoolExists(), if (!(poolExists))
267+ then true
268+ else throwPoolExists(), if ((amountAssetId != priceAssetId))
269+ then true
270+ else throwInvalidAssetPair(), if (if (isVerified(amountAssetId))
271+ then isVerified(priceAssetId)
272+ else false)
273+ then true
274+ else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId))
275+ then true
276+ else containsElement(priceAssetsList, priceAssetId))
277+ then true
278+ else throwInvalidAssetPair(), if (if (isManager(i))
279+ then true
280+ else (getString(keyFeeAssetId()) == feeAssetId))
281+ then true
282+ else throwInvalidFeeAsset(), if (if (isManager(i))
283+ then true
284+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
285+ then true
286+ else throwInvalidAmountAsset(), if (if (isManager(i))
287+ then true
288+ else (priceAssetAmount >= priceAssetMinAmount))
289+ then true
290+ else throwInvalidPriceAssetAmount(), if (if (isManager(i))
291+ then true
292+ else (feeAssetAmount == getInteger(keyFeeAmount())))
293+ then true
294+ else throwInvalidFee()]
295+ if ((checks == checks))
296+ then {
297+ let paymentsWithFeeSize = 3
298+ let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
299+ then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
300+ else unit
301+ if ((burnEmissionInv == burnEmissionInv))
302+ 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)]
303+ else throw("Strict value is not equal to itself.")
304+ }
334305 else throw("Strict value is not equal to itself.")
335306 }
336307
337308
338309
339310 @Callable(i)
340311 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
341312 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
342313 then true
343314 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
344315 then true
345316 else throwCanActivateOnlyPendingPool()]
346317 if ((checks == checks))
347318 then {
348- let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId))
349- let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit))
350- then "VLTPOOL"
351- else value(poolTypeOption), logo], nil)
319+ let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
352320 if ((activateNewPoolInv == activateNewPoolInv))
353321 then {
354322 let lpAssetId = match activateNewPoolInv {
355323 case id: String =>
356324 id
357325 case _ =>
358326 throwFactoryReturnedNotString()
359327 }
360328 if ((lpAssetId == lpAssetId))
361329 then {
362330 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
363331 if ((beforePut == beforePut))
364332 then {
365333 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
366334 then unit
367335 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
368336 then unit
369337 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
370338 if ((put == put))
371339 then {
372340 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
373341 if ((afterPut == afterPut))
374342 then {
375343 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
376344 let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil)
377345 if ((res == res))
378346 then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
379347 else throw("Strict value is not equal to itself.")
380348 }
381349 else throw("Strict value is not equal to itself.")
382350 }
383351 else throw("Strict value is not equal to itself.")
384352 }
385353 else throw("Strict value is not equal to itself.")
386354 }
387355 else throw("Strict value is not equal to itself.")
388356 }
389357 else throw("Strict value is not equal to itself.")
390358 }
391359 else throw("Strict value is not equal to itself.")
392360 }
393361
394362
395363
396364 @Callable(i)
397365 func setAdmins (adminPubKeys) = {
398366 let checkCaller = mustManager(i)
399367 if ((checkCaller == checkCaller))
400368 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
401369 else throw("Strict value is not equal to itself.")
402370 }
403371
404372
405373
406374 @Callable(i)
407375 func setManager (pendingManagerPublicKey) = {
408376 let checkCaller = mustManager(i)
409377 if ((checkCaller == checkCaller))
410378 then {
411379 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
412380 if ((checkManagerPublicKey == checkManagerPublicKey))
413381 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
414382 else throw("Strict value is not equal to itself.")
415383 }
416384 else throw("Strict value is not equal to itself.")
417385 }
418386
419387
420388
421389 @Callable(i)
422390 func confirmManager () = {
423391 let pm = pendingManagerPublicKeyOrUnit()
424392 let hasPM = if (isDefined(pm))
425393 then true
426394 else throw("No pending manager")
427395 if ((hasPM == hasPM))
428396 then {
429397 let checkPM = if ((i.callerPublicKey == value(pm)))
430398 then true
431399 else throw("You are not pending manager")
432400 if ((checkPM == checkPM))
433401 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
434402 else throw("Strict value is not equal to itself.")
435403 }
436404 else throw("Strict value is not equal to itself.")
437405 }
438406
439407
440408
441409 @Callable(i)
442410 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
443411
444412
445413
446414 @Callable(i)
447415 func statusREADONLY (amountAssetId,priceAssetId) = {
448416 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
449417 case s: String =>
450418 s
451419 case _ =>
452420 unit
453421 }
454422 $Tuple2(nil, status)
455423 }
456424
457425
458426 @Verifier(tx)
459427 func verify () = {
460428 let targetPublicKey = match managerPublicKeyOrUnit() {
461429 case pk: ByteVector =>
462430 pk
463431 case _: Unit =>
464432 tx.senderPublicKey
465433 case _ =>
466434 throw("Match error")
467435 }
468436 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
469437 }
470438

github/deemru/w8io/026f985 
59.61 ms