tx · 4mxuGq5uWxUJ8vLPHGSTLsHrPCnicNcpaTC3oSs7Q1Gy

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01700000 Waves

2023.04.17 12:22 [2538380] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "4mxuGq5uWxUJ8vLPHGSTLsHrPCnicNcpaTC3oSs7Q1Gy", "fee": 1700000, "feeAssetId": null, "timestamp": 1681723392446, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "KAgUAMbZsbkt7qYnuNNybkCmKahvAbahrjH8oEtVHCQoHFHyeRDjSRV4arrRqPSxwBx19YknW7UyY6jpv3a3Vjy" ], "script": "base64:AAIFAAAAAAAAB3AIAhIJCgcICAgYAQgBEgASCAoGCAgICAgIEgMKARgSAwoBCBIAEgASBAoCCAgiA1NFUCIMd2F2ZXNBc3NldElkIhFpbnZhbGlkUHJpY2VBc3NldCIIdGhyb3dFcnIiA21zZyIHdGhyb3dQRCIUdGhyb3dDcmVhdGVOb3RDYWxsZWQiEXRocm93WW91Tm90SXNzdWVyIg90aHJvd1Bvb2xFeGlzdHMiFXRocm93QXNzZXROb3RWZXJpZmllZCIWdGhyb3dJbnZhbGlkUHJpY2VBc3NldCIUdGhyb3dJbnZhbGlkRmVlQXNzZXQiF3Rocm93SW52YWxpZEFtb3VudEFzc2V0IhJ0aHJvd0ludmFsaWRTdGF0dXMiH3Rocm93Q2FuQWN0aXZhdGVPbmx5UGVuZGluZ1Bvb2wiHXRocm93RmFjdG9yeVJldHVybmVkTm90U3RyaW5nIhx0aHJvd0ludmFsaWRQcmljZUFzc2V0QW1vdW50Ig90aHJvd0ludmFsaWRGZWUiFXRocm93SW52YWxpZEFzc2V0UGFpciITa2V5TWFuYWdlclB1YmxpY0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ZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAACYWYBAAAAE3ByaWNlQXNzZXRzUkVBRE9OTFkAAAAACQAFFAAAAAIFAAAAA25pbAkBAAAAAVYAAAABCQAEIgAAAAEJAQAAAAFTAAAAAAAAAAJhZgEAAAAOc3RhdHVzUkVBRE9OTFkAAAACAAAAAXgAAAABeQQAAAACYXIEAAAAAVgJAAQiAAAAAQkBAAAAAXcAAAACBQAAAAF4BQAAAAF5AwkAAAEAAAACBQAAAAFYAgAAAAZTdHJpbmcEAAAAAVkFAAAAAVgFAAAAAVkFAAAABHVuaXQJAAUUAAAAAgUAAAADbmlsBQAAAAJhcgAAAAEAAAACYnEBAAAAAmJyAAAAAAQAAAACYnMEAAAAAVgJAQAAAAJhYwAAAAADCQAAAQAAAAIFAAAAAVgCAAAACkJ5dGVWZWN0b3IEAAAAAmFnBQAAAAFYBQAAAAJhZwMJAAABAAAAAgUAAAABWAIAAAAEVW5pdAgFAAAAAmJxAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACYnEAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJicQAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmJztU0lsA==", "height": 2538380, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: At5ie36JTGMoKjY9yft8zi7aBGFe55GmZy8NV4nTfMJ8 Next: GkjZUyBJNWL3LJGd6TD1hgVXrQVg28kkgqhX5TA2c9g Diff:
OldNewDifferences
4747
4848
4949 func throwInvalidFee () = throwErr("invalid fee")
50+
51+
52+func throwInvalidAssetPair () = throwErr("invalid asset pair")
5053
5154
5255 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
213216
214217 @Callable(i)
215218 func create () = {
216- let amountAssetPayment = value(i.payments[0])
217- let priceAssetPayment = value(i.payments[1])
219+ let asset1Payment = value(i.payments[0])
220+ let asset2Payment = value(i.payments[1])
218221 let feeAssetPayment = value(i.payments[2])
219- let $t066466718 = getIdAndInfo(amountAssetPayment)
220- let amountAssetId = $t066466718._1
221- let amountAssetInfo = $t066466718._2
222- let $t067216790 = getIdAndInfo(priceAssetPayment)
223- let priceAssetId = $t067216790._1
224- let priceAssetInfo = $t067216790._2
225- let $t067936856 = getIdAndInfo(feeAssetPayment)
226- let feeAssetId = $t067936856._1
227- let feeAssetInfo = $t067936856._2
222+ let $t067746831 = getIdAndInfo(asset1Payment)
223+ let asset1Id = $t067746831._1
224+ let asset1Info = $t067746831._2
225+ let $t068346891 = getIdAndInfo(asset2Payment)
226+ let asset2Id = $t068346891._1
227+ let asset2Info = $t068346891._2
228+ let $t068946957 = getIdAndInfo(feeAssetPayment)
229+ let feeAssetId = $t068946957._1
230+ let feeAssetInfo = $t068946957._2
228231 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
229- let managerPriceAssetMinAmount = 1
230- let priceAssetMinAmount = if (isManager(i))
231- then managerPriceAssetMinAmount
232- else {
233- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
234- value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
235- }
236- let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
237- let curIndex = (lastIndex + 1)
238- let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
239- let poolExists = {
240- let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
241- if ($isInstanceOf(@, "Boolean"))
242- then @
243- else throw("Couldn't cast Any to Boolean")
244- }
245- let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
232+ let checkAssetsNotEqual = if ((asset1Id != asset2Id))
246233 then true
247- else throwPoolExists(), if (!(poolExists))
248- then true
249- else throwPoolExists(), if (if (isManager(i))
250- then true
251- else isVerified(amountAssetId))
252- then true
253- else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
254- then true
255- else throwInvalidFeeAsset(), if (if (isManager(i))
256- then true
257- else (amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
258- then true
259- else throwInvalidAmountAsset(), if (if (isManager(i))
260- then true
261- else (priceAssetPayment.amount >= priceAssetMinAmount))
262- then true
263- else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
264- then true
265- else throwInvalidFee()]
266- if ((checks == checks))
234+ else throwInvalidAssetPair()
235+ if ((checkAssetsNotEqual == checkAssetsNotEqual))
267236 then {
268- let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
269- if ((burnEmissionInv == burnEmissionInv))
270- 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), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)]
237+ let $t071317573 = if (if (containsElement(priceAssetsList, asset2Id))
238+ then isVerified(asset1Id)
239+ else false)
240+ then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
241+ else if (if (containsElement(priceAssetsList, asset1Id))
242+ then isVerified(asset2Id)
243+ else false)
244+ then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
245+ else throwInvalidAssetPair()
246+ let amountAssetId = $t071317573._1
247+ let amountAssetAmount = $t071317573._2
248+ let priceAssetId = $t071317573._3
249+ let priceAssetAmount = $t071317573._4
250+ let managerPriceAssetMinAmount = 1
251+ let priceAssetMinAmount = if (isManager(i))
252+ then managerPriceAssetMinAmount
253+ else {
254+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
255+ value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
256+ }
257+ let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
258+ let curIndex = (lastIndex + 1)
259+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
260+ let poolExists = {
261+ let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
262+ if ($isInstanceOf(@, "Boolean"))
263+ then @
264+ else throw("Couldn't cast Any to Boolean")
265+ }
266+ let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
267+ then true
268+ else throwPoolExists(), if (!(poolExists))
269+ then true
270+ else throwPoolExists(), if ((getString(keyFeeAssetId()) == feeAssetId))
271+ then true
272+ else throwInvalidFeeAsset(), if (if (isManager(i))
273+ then true
274+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
275+ then true
276+ else throwInvalidAmountAsset(), if (if (isManager(i))
277+ then true
278+ else (priceAssetAmount >= priceAssetMinAmount))
279+ then true
280+ else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
281+ then true
282+ else throwInvalidFee()]
283+ if ((checks == checks))
284+ then {
285+ let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
286+ if ((burnEmissionInv == burnEmissionInv))
287+ 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)]
288+ else throw("Strict value is not equal to itself.")
289+ }
271290 else throw("Strict value is not equal to itself.")
272291 }
273292 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let wavesAssetId = "WAVES"
77
88 let invalidPriceAsset = "Invalid price asset"
99
1010 func throwErr (msg) = throw(makeString(["user_pools.ride:", msg], " "))
1111
1212
1313 func throwPD () = throwErr("Permission denied")
1414
1515
1616 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
1717
1818
1919 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2020
2121
2222 func throwPoolExists () = throwErr("Pool with such assets already exists")
2323
2424
2525 func throwAssetNotVerified () = throwErr("Asset is not verified")
2626
2727
2828 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
2929
3030
3131 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
3232
3333
3434 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
3535
3636
3737 func throwInvalidStatus () = throwErr("Invalid status")
3838
3939
4040 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
4141
4242
4343 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
4444
4545
4646 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
4747
4848
4949 func throwInvalidFee () = throwErr("invalid fee")
50+
51+
52+func throwInvalidAssetPair () = throwErr("invalid asset pair")
5053
5154
5255 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
5356
5457
5558 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
5659
5760
5861 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
5962
6063
6164 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
6265
6366
6467 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
6568
6669
6770 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
6871
6972
7073 func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
7174
7275
7376 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
7477
7578
7679 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
7780
7881
7982 let indexSuffix = "u"
8083
8184 let statusPending = "pending"
8285
8386 let statusDeclined = "declined"
8487
8588 let statusActive = "active"
8689
8790 let statuses = [statusPending, statusDeclined, statusActive]
8891
8992 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
9093
9194
9295 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
9396
9497
9598 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
9699
97100
98101 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
99102
100103
101104 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
102105
103106
104107 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
105108
106109
107110 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
108111
109112
110113 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
111114
112115
113116 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
114117
115118
116119 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
117120
118121
119122 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
120123
121124
122125 func stringOptionToList (stringOrUnit) = match stringOrUnit {
123126 case s: String =>
124127 if ((size(s) == 0))
125128 then nil
126129 else split(s, SEP)
127130 case _: Unit =>
128131 nil
129132 case _ =>
130133 throw("Match error")
131134 }
132135
133136
134137 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
135138
136139 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
137140
138141
139142 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
140143 then true
141144 else throwCreateNotCalled()
142145
143146
144147 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
145148 case s: String =>
146149 fromBase58String(s)
147150 case _: Unit =>
148151 unit
149152 case _ =>
150153 throw("Match error")
151154 }
152155
153156
154157 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
155158 case s: String =>
156159 fromBase58String(s)
157160 case _: Unit =>
158161 unit
159162 case _ =>
160163 throw("Match error")
161164 }
162165
163166
164167 func isManager (i) = match managerPublicKeyOrUnit() {
165168 case pk: ByteVector =>
166169 (i.callerPublicKey == pk)
167170 case _: Unit =>
168171 (i.caller == this)
169172 case _ =>
170173 throw("Match error")
171174 }
172175
173176
174177 func mustManager (i) = if (isManager(i))
175178 then true
176179 else throwPD()
177180
178181
179182 func mustAdmin (i) = {
180183 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
181184 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
182185 then true
183186 else mustManager(i)
184187 }
185188
186189
187190 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
188191
189192
190193 func getIdAndInfo (payment) = match payment.assetId {
191194 case id: ByteVector =>
192195 let info = value(assetInfo(id))
193196 $Tuple2(toBase58String(id), info)
194197 case _: Unit =>
195198 $Tuple2(wavesAssetId, unit)
196199 case _ =>
197200 throw("Match error")
198201 }
199202
200203
201204 func validStatus (status) = containsElement(statuses, status)
202205
203206
204207 @Callable(i)
205208 func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
206209 let checkCaller = mustManager(i)
207210 if ((checkCaller == checkCaller))
208211 then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
209212 else throw("Strict value is not equal to itself.")
210213 }
211214
212215
213216
214217 @Callable(i)
215218 func create () = {
216- let amountAssetPayment = value(i.payments[0])
217- let priceAssetPayment = value(i.payments[1])
219+ let asset1Payment = value(i.payments[0])
220+ let asset2Payment = value(i.payments[1])
218221 let feeAssetPayment = value(i.payments[2])
219- let $t066466718 = getIdAndInfo(amountAssetPayment)
220- let amountAssetId = $t066466718._1
221- let amountAssetInfo = $t066466718._2
222- let $t067216790 = getIdAndInfo(priceAssetPayment)
223- let priceAssetId = $t067216790._1
224- let priceAssetInfo = $t067216790._2
225- let $t067936856 = getIdAndInfo(feeAssetPayment)
226- let feeAssetId = $t067936856._1
227- let feeAssetInfo = $t067936856._2
222+ let $t067746831 = getIdAndInfo(asset1Payment)
223+ let asset1Id = $t067746831._1
224+ let asset1Info = $t067746831._2
225+ let $t068346891 = getIdAndInfo(asset2Payment)
226+ let asset2Id = $t068346891._1
227+ let asset2Info = $t068346891._2
228+ let $t068946957 = getIdAndInfo(feeAssetPayment)
229+ let feeAssetId = $t068946957._1
230+ let feeAssetInfo = $t068946957._2
228231 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
229- let managerPriceAssetMinAmount = 1
230- let priceAssetMinAmount = if (isManager(i))
231- then managerPriceAssetMinAmount
232- else {
233- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
234- value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
235- }
236- let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
237- let curIndex = (lastIndex + 1)
238- let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
239- let poolExists = {
240- let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
241- if ($isInstanceOf(@, "Boolean"))
242- then @
243- else throw("Couldn't cast Any to Boolean")
244- }
245- let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
232+ let checkAssetsNotEqual = if ((asset1Id != asset2Id))
246233 then true
247- else throwPoolExists(), if (!(poolExists))
248- then true
249- else throwPoolExists(), if (if (isManager(i))
250- then true
251- else isVerified(amountAssetId))
252- then true
253- else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
254- then true
255- else throwInvalidFeeAsset(), if (if (isManager(i))
256- then true
257- else (amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
258- then true
259- else throwInvalidAmountAsset(), if (if (isManager(i))
260- then true
261- else (priceAssetPayment.amount >= priceAssetMinAmount))
262- then true
263- else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
264- then true
265- else throwInvalidFee()]
266- if ((checks == checks))
234+ else throwInvalidAssetPair()
235+ if ((checkAssetsNotEqual == checkAssetsNotEqual))
267236 then {
268- let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
269- if ((burnEmissionInv == burnEmissionInv))
270- 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), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)]
237+ let $t071317573 = if (if (containsElement(priceAssetsList, asset2Id))
238+ then isVerified(asset1Id)
239+ else false)
240+ then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
241+ else if (if (containsElement(priceAssetsList, asset1Id))
242+ then isVerified(asset2Id)
243+ else false)
244+ then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
245+ else throwInvalidAssetPair()
246+ let amountAssetId = $t071317573._1
247+ let amountAssetAmount = $t071317573._2
248+ let priceAssetId = $t071317573._3
249+ let priceAssetAmount = $t071317573._4
250+ let managerPriceAssetMinAmount = 1
251+ let priceAssetMinAmount = if (isManager(i))
252+ then managerPriceAssetMinAmount
253+ else {
254+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
255+ value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
256+ }
257+ let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
258+ let curIndex = (lastIndex + 1)
259+ let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
260+ let poolExists = {
261+ let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
262+ if ($isInstanceOf(@, "Boolean"))
263+ then @
264+ else throw("Couldn't cast Any to Boolean")
265+ }
266+ let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
267+ then true
268+ else throwPoolExists(), if (!(poolExists))
269+ then true
270+ else throwPoolExists(), if ((getString(keyFeeAssetId()) == feeAssetId))
271+ then true
272+ else throwInvalidFeeAsset(), if (if (isManager(i))
273+ then true
274+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
275+ then true
276+ else throwInvalidAmountAsset(), if (if (isManager(i))
277+ then true
278+ else (priceAssetAmount >= priceAssetMinAmount))
279+ then true
280+ else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
281+ then true
282+ else throwInvalidFee()]
283+ if ((checks == checks))
284+ then {
285+ let burnEmissionInv = invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
286+ if ((burnEmissionInv == burnEmissionInv))
287+ 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)]
288+ else throw("Strict value is not equal to itself.")
289+ }
271290 else throw("Strict value is not equal to itself.")
272291 }
273292 else throw("Strict value is not equal to itself.")
274293 }
275294
276295
277296
278297 @Callable(i)
279298 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
280299 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
281300 then true
282301 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
283302 then true
284303 else throwCanActivateOnlyPendingPool()]
285304 if ((checks == checks))
286305 then {
287306 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
288307 if ((activateNewPoolInv == activateNewPoolInv))
289308 then {
290309 let lpAssetId = match activateNewPoolInv {
291310 case id: String =>
292311 id
293312 case _ =>
294313 throwFactoryReturnedNotString()
295314 }
296315 if ((lpAssetId == lpAssetId))
297316 then {
298317 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
299318 if ((beforePut == beforePut))
300319 then {
301320 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
302321 then unit
303322 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
304323 then unit
305324 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
306325 if ((put == put))
307326 then {
308327 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
309328 if ((afterPut == afterPut))
310329 then {
311330 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
312331 [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
313332 }
314333 else throw("Strict value is not equal to itself.")
315334 }
316335 else throw("Strict value is not equal to itself.")
317336 }
318337 else throw("Strict value is not equal to itself.")
319338 }
320339 else throw("Strict value is not equal to itself.")
321340 }
322341 else throw("Strict value is not equal to itself.")
323342 }
324343 else throw("Strict value is not equal to itself.")
325344 }
326345
327346
328347
329348 @Callable(i)
330349 func setAdmins (adminPubKeys) = {
331350 let checkCaller = mustManager(i)
332351 if ((checkCaller == checkCaller))
333352 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
334353 else throw("Strict value is not equal to itself.")
335354 }
336355
337356
338357
339358 @Callable(i)
340359 func setManager (pendingManagerPublicKey) = {
341360 let checkCaller = mustManager(i)
342361 if ((checkCaller == checkCaller))
343362 then {
344363 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
345364 if ((checkManagerPublicKey == checkManagerPublicKey))
346365 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
347366 else throw("Strict value is not equal to itself.")
348367 }
349368 else throw("Strict value is not equal to itself.")
350369 }
351370
352371
353372
354373 @Callable(i)
355374 func confirmManager () = {
356375 let pm = pendingManagerPublicKeyOrUnit()
357376 let hasPM = if (isDefined(pm))
358377 then true
359378 else throw("No pending manager")
360379 if ((hasPM == hasPM))
361380 then {
362381 let checkPM = if ((i.callerPublicKey == value(pm)))
363382 then true
364383 else throw("You are not pending manager")
365384 if ((checkPM == checkPM))
366385 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
367386 else throw("Strict value is not equal to itself.")
368387 }
369388 else throw("Strict value is not equal to itself.")
370389 }
371390
372391
373392
374393 @Callable(i)
375394 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
376395
377396
378397
379398 @Callable(i)
380399 func statusREADONLY (amountAssetId,priceAssetId) = {
381400 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
382401 case s: String =>
383402 s
384403 case _ =>
385404 unit
386405 }
387406 $Tuple2(nil, status)
388407 }
389408
390409
391410 @Verifier(tx)
392411 func verify () = {
393412 let targetPublicKey = match managerPublicKeyOrUnit() {
394413 case pk: ByteVector =>
395414 pk
396415 case _: Unit =>
397416 tx.senderPublicKey
398417 case _ =>
399418 throw("Match error")
400419 }
401420 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
402421 }
403422

github/deemru/w8io/026f985 
63.65 ms