tx · 5LWRgKxspmWRZ5VApBsmk7A3vWPYYNiVPVnfrbFocqcg

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01400000 Waves

2023.05.04 12:23 [2562827] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "5LWRgKxspmWRZ5VApBsmk7A3vWPYYNiVPVnfrbFocqcg", "fee": 1400000, "feeAssetId": null, "timestamp": 1683192278603, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "667g779y62Cz61LkXWvF2GbYF9t5rmZzCHUokaqiUrwMBTkpzAu9krNM6fsZrzdyz2ctWZb54oF3XhDMyfDbT7Y2" ], "script": "base64:BgLiEAgCEgkKBwgICBgBCAESABIAEggKBggICAgICBIDCgEYEgMKAQgSABIAEgQKAggIIhBjb250cmFjdEZpbGVuYW1lIgNTRVAiDHdhdmVzQXNzZXRJZCIHVkxUUE9PTCIIU1RCTFBPT0wiEWludmFsaWRQcmljZUFzc2V0Igd3cmFwRXJyIgNtc2ciCHRocm93RXJyIgd0aHJvd1BEIhR0aHJvd0NyZWF0ZU5vdENhbGxlZCIRdGhyb3dZb3VOb3RJc3N1ZXIiD3Rocm93UG9vbEV4aXN0cyIVdGhyb3dBc3NldE5vdFZlcmlmaWVkIhZ0aHJvd0ludmFsaWRQcmljZUFzc2V0IhR0aHJvd0ludmFsaWRGZWVBc3NldCIXdGhyb3dJbnZhbGlkQW1vdW50QXNzZXQiEnRocm93SW52YWxpZFN0YXR1cyIfdGhyb3dDYW5BY3RpdmF0ZU9ubHlQZW5kaW5nUG9vbCIddGhyb3dGYWN0b3J5UmV0dXJuZWROb3RTdHJpbmciHHRocm93SW52YWxpZFByaWNlQXNzZXRBbW91bnQiD3Rocm93SW52YWxpZEZlZSIVdGhyb3d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uaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4CYW8BE3ByaWNlQXNzZXRzUkVBRE9OTFkACQCUCgIFA25pbAkBAmFhAQkAoggBCQEBWAACYW8BDnN0YXR1c1JFQURPTkxZAgFCAUMEAmFBBAJhYwkAoggBCQEBQQIFAUIFAUMDCQABAgUCYWMCBlN0cmluZwQCYWQFAmFjBQJhZAUEdW5pdAkAlAoCBQNuaWwFAmFBAQJiRQECYkYABAJiRwQCYWMJAQJhbAADCQABAgUCYWMCCkJ5dGVWZWN0b3IEAmFwBQJhYwUCYXADCQABAgUCYWMCBFVuaXQIBQJiRQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCYkUJYm9keUJ5dGVzCQCRAwIIBQJiRQZwcm9vZnMAAAUCYkd7GB8p", "height": 2562827, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ea32eC29rPLKgGsdNAzU1pGQqq6z88yrJ6Sj8AMF8mYZ Next: 5ifMM8dPiZ7dWFGqw4TSnFr2dnkDQrVkRAbNxZVp7YsU Diff:
OldNewDifferences
66 let SEP = "__"
77
88 let wavesAssetId = "WAVES"
9+
10+let VLTPOOL = "VLTPOOL"
11+
12+let STBLPOOL = "STBLPOOL"
913
1014 let invalidPriceAsset = "Invalid price asset"
1115
107111
108112
109113 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)
110117
111118
112119 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
217224 func validStatus (status) = containsElement(statuses, status)
218225
219226
220-@Callable(i)
221-func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
222- let checkCaller = mustManager(i)
223- if ((checkCaller == checkCaller))
224- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
225- else throw("Strict value is not equal to itself.")
226- }
227-
228-
229-
230-@Callable(i)
231-func create () = {
227+func _create (i,poolType) = {
232228 let asset1Payment = value(i.payments[0])
233229 let asset2Payment = value(i.payments[1])
234230 let feeAssetPayment = value(i.payments[2])
235- let $t074647521 = getIdAndInfo(asset1Payment)
236- let asset1Id = $t074647521._1
237- let asset1Info = $t074647521._2
238- let $t075247581 = getIdAndInfo(asset2Payment)
239- let asset2Id = $t075247581._1
240- let asset2Info = $t075247581._2
241- let $t075847647 = getIdAndInfo(feeAssetPayment)
242- let feeAssetId = $t075847647._1
243- let feeAssetInfo = $t075847647._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
244240 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
245241 let checkAssetsNotEqual = if ((asset1Id != asset2Id))
246242 then true
247243 else throwInvalidAssetPair()
248244 if ((checkAssetsNotEqual == checkAssetsNotEqual))
249245 then {
250- let $t078218282 = if (if (isManager(i))
246+ let $t067647225 = if (if (isManager(i))
251247 then true
252248 else if (containsElement(priceAssetsList, asset2Id))
253249 then isVerified(asset1Id)
258254 else false)
259255 then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
260256 else throwInvalidAssetPair()
261- let amountAssetId = $t078218282._1
262- let amountAssetAmount = $t078218282._2
263- let priceAssetId = $t078218282._3
264- let priceAssetAmount = $t078218282._4
257+ let amountAssetId = $t067647225._1
258+ let amountAssetAmount = $t067647225._2
259+ let priceAssetId = $t067647225._3
260+ let priceAssetAmount = $t067647225._4
265261 let managerPriceAssetMinAmount = 1
266262 let priceAssetMinAmount = if (isManager(i))
267263 then managerPriceAssetMinAmount
306302 then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
307303 else unit
308304 if ((burnEmissionInv == burnEmissionInv))
309- 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)]
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)]
310306 else throw("Strict value is not equal to itself.")
311307 }
312308 else throw("Strict value is not equal to itself.")
313309 }
314310 else throw("Strict value is not equal to itself.")
315311 }
312+
313+
314+@Callable(i)
315+func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
316+ let checkCaller = mustManager(i)
317+ if ((checkCaller == checkCaller))
318+ then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
319+ else throw("Strict value is not equal to itself.")
320+ }
321+
322+
323+
324+@Callable(i)
325+func create () = _create(i, VLTPOOL)
326+
327+
328+
329+@Callable(i)
330+func createStable () = _create(i, STBLPOOL)
316331
317332
318333
325340 else throwCanActivateOnlyPendingPool()]
326341 if ((checks == checks))
327342 then {
328- let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
343+ let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId))
344+ let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit))
345+ then "VLTPOOL"
346+ else value(poolTypeOption), logo], nil)
329347 if ((activateNewPoolInv == activateNewPoolInv))
330348 then {
331349 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"
913
1014 let invalidPriceAsset = "Invalid price asset"
1115
1216 func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
1317
1418
1519 func throwErr (msg) = throw(wrapErr(msg))
1620
1721
1822 func throwPD () = throwErr("Permission denied")
1923
2024
2125 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
2226
2327
2428 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2529
2630
2731 func throwPoolExists () = throwErr("Pool with such assets already exists")
2832
2933
3034 func throwAssetNotVerified () = throwErr("Asset is not verified")
3135
3236
3337 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
3438
3539
3640 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
3741
3842
3943 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
4044
4145
4246 func throwInvalidStatus () = throwErr("Invalid status")
4347
4448
4549 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
4650
4751
4852 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
4953
5054
5155 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
5256
5357
5458 func throwInvalidFee () = throwErr("invalid fee")
5559
5660
5761 func throwInvalidAssetPair () = throwErr("invalid asset pair")
5862
5963
6064 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
6165
6266
6367 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
6468
6569
6670 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
6771
6872
6973 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
7074
7175
7276 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
7377
7478
7579 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
7680
7781
7882 func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
7983
8084
8185 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
8286
8387
8488 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
8589
8690
8791 let indexSuffix = "u"
8892
8993 let statusPending = "pending"
9094
9195 let statusDeclined = "declined"
9296
9397 let statusActive = "active"
9498
9599 let statuses = [statusPending, statusDeclined, statusActive]
96100
97101 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
98102
99103
100104 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
101105
102106
103107 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
104108
105109
106110 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
107111
108112
109113 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)
110117
111118
112119 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
113120
114121
115122 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
116123
117124
118125 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
119126
120127
121128 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
122129
123130
124131 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
125132
126133
127134 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
128135
129136
130137 func stringOptionToList (stringOrUnit) = match stringOrUnit {
131138 case s: String =>
132139 if ((size(s) == 0))
133140 then nil
134141 else split(s, SEP)
135142 case _: Unit =>
136143 nil
137144 case _ =>
138145 throw("Match error")
139146 }
140147
141148
142149 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
143150
144151 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
145152
146153 let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required")))
147154
148155 let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP)
149156
150157 let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required")))
151158
152159 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
153160
154161
155162 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
156163 then true
157164 else throwCreateNotCalled()
158165
159166
160167 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
161168 case s: String =>
162169 fromBase58String(s)
163170 case _: Unit =>
164171 unit
165172 case _ =>
166173 throw("Match error")
167174 }
168175
169176
170177 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
171178 case s: String =>
172179 fromBase58String(s)
173180 case _: Unit =>
174181 unit
175182 case _ =>
176183 throw("Match error")
177184 }
178185
179186
180187 func isManager (i) = match managerPublicKeyOrUnit() {
181188 case pk: ByteVector =>
182189 (i.callerPublicKey == pk)
183190 case _: Unit =>
184191 (i.caller == this)
185192 case _ =>
186193 throw("Match error")
187194 }
188195
189196
190197 func mustManager (i) = if (isManager(i))
191198 then true
192199 else throwPD()
193200
194201
195202 func mustAdmin (i) = {
196203 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
197204 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
198205 then true
199206 else mustManager(i)
200207 }
201208
202209
203210 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
204211
205212
206213 func getIdAndInfo (payment) = match payment.assetId {
207214 case id: ByteVector =>
208215 let info = value(assetInfo(id))
209216 $Tuple2(toBase58String(id), info)
210217 case _: Unit =>
211218 $Tuple2(wavesAssetId, unit)
212219 case _ =>
213220 throw("Match error")
214221 }
215222
216223
217224 func validStatus (status) = containsElement(statuses, status)
218225
219226
220-@Callable(i)
221-func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
222- let checkCaller = mustManager(i)
223- if ((checkCaller == checkCaller))
224- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
225- else throw("Strict value is not equal to itself.")
226- }
227-
228-
229-
230-@Callable(i)
231-func create () = {
227+func _create (i,poolType) = {
232228 let asset1Payment = value(i.payments[0])
233229 let asset2Payment = value(i.payments[1])
234230 let feeAssetPayment = value(i.payments[2])
235- let $t074647521 = getIdAndInfo(asset1Payment)
236- let asset1Id = $t074647521._1
237- let asset1Info = $t074647521._2
238- let $t075247581 = getIdAndInfo(asset2Payment)
239- let asset2Id = $t075247581._1
240- let asset2Info = $t075247581._2
241- let $t075847647 = getIdAndInfo(feeAssetPayment)
242- let feeAssetId = $t075847647._1
243- let feeAssetInfo = $t075847647._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
244240 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
245241 let checkAssetsNotEqual = if ((asset1Id != asset2Id))
246242 then true
247243 else throwInvalidAssetPair()
248244 if ((checkAssetsNotEqual == checkAssetsNotEqual))
249245 then {
250- let $t078218282 = if (if (isManager(i))
246+ let $t067647225 = if (if (isManager(i))
251247 then true
252248 else if (containsElement(priceAssetsList, asset2Id))
253249 then isVerified(asset1Id)
254250 else false)
255251 then $Tuple4(asset1Id, asset1Payment.amount, asset2Id, asset2Payment.amount)
256252 else if (if (containsElement(priceAssetsList, asset1Id))
257253 then isVerified(asset2Id)
258254 else false)
259255 then $Tuple4(asset2Id, asset2Payment.amount, asset1Id, asset1Payment.amount)
260256 else throwInvalidAssetPair()
261- let amountAssetId = $t078218282._1
262- let amountAssetAmount = $t078218282._2
263- let priceAssetId = $t078218282._3
264- let priceAssetAmount = $t078218282._4
257+ let amountAssetId = $t067647225._1
258+ let amountAssetAmount = $t067647225._2
259+ let priceAssetId = $t067647225._3
260+ let priceAssetAmount = $t067647225._4
265261 let managerPriceAssetMinAmount = 1
266262 let priceAssetMinAmount = if (isManager(i))
267263 then managerPriceAssetMinAmount
268264 else {
269265 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
270266 value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
271267 }
272268 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
273269 let curIndex = (lastIndex + 1)
274270 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
275271 let poolExists = {
276272 let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
277273 if ($isInstanceOf(@, "Boolean"))
278274 then @
279275 else throw(($getType(@) + " couldn't be cast to Boolean"))
280276 }
281277 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
282278 then true
283279 else throwPoolExists(), if (!(poolExists))
284280 then true
285281 else throwPoolExists(), if (if (isManager(i))
286282 then true
287283 else (getString(keyFeeAssetId()) == feeAssetId))
288284 then true
289285 else throwInvalidFeeAsset(), if (if (isManager(i))
290286 then true
291287 else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
292288 then true
293289 else throwInvalidAmountAsset(), if (if (isManager(i))
294290 then true
295291 else (priceAssetAmount >= priceAssetMinAmount))
296292 then true
297293 else throwInvalidPriceAssetAmount(), if (if (isManager(i))
298294 then true
299295 else (feeAssetPayment.amount == getInteger(keyFeeAmount())))
300296 then true
301297 else throwInvalidFee()]
302298 if ((checks == checks))
303299 then {
304300 let paymentsWithFeeSize = 3
305301 let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
306302 then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetPayment.amount)])
307303 else unit
308304 if ((burnEmissionInv == burnEmissionInv))
309- 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)]
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)]
310306 else throw("Strict value is not equal to itself.")
311307 }
312308 else throw("Strict value is not equal to itself.")
313309 }
314310 else throw("Strict value is not equal to itself.")
315311 }
312+
313+
314+@Callable(i)
315+func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
316+ let checkCaller = mustManager(i)
317+ if ((checkCaller == checkCaller))
318+ then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
319+ else throw("Strict value is not equal to itself.")
320+ }
321+
322+
323+
324+@Callable(i)
325+func create () = _create(i, VLTPOOL)
326+
327+
328+
329+@Callable(i)
330+func createStable () = _create(i, STBLPOOL)
316331
317332
318333
319334 @Callable(i)
320335 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
321336 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
322337 then true
323338 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
324339 then true
325340 else throwCanActivateOnlyPendingPool()]
326341 if ((checks == checks))
327342 then {
328- let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
343+ let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId))
344+ let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit))
345+ then "VLTPOOL"
346+ else value(poolTypeOption), logo], nil)
329347 if ((activateNewPoolInv == activateNewPoolInv))
330348 then {
331349 let lpAssetId = match activateNewPoolInv {
332350 case id: String =>
333351 id
334352 case _ =>
335353 throwFactoryReturnedNotString()
336354 }
337355 if ((lpAssetId == lpAssetId))
338356 then {
339357 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
340358 if ((beforePut == beforePut))
341359 then {
342360 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
343361 then unit
344362 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
345363 then unit
346364 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
347365 if ((put == put))
348366 then {
349367 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
350368 if ((afterPut == afterPut))
351369 then {
352370 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
353371 let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil)
354372 if ((res == res))
355373 then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
356374 else throw("Strict value is not equal to itself.")
357375 }
358376 else throw("Strict value is not equal to itself.")
359377 }
360378 else throw("Strict value is not equal to itself.")
361379 }
362380 else throw("Strict value is not equal to itself.")
363381 }
364382 else throw("Strict value is not equal to itself.")
365383 }
366384 else throw("Strict value is not equal to itself.")
367385 }
368386 else throw("Strict value is not equal to itself.")
369387 }
370388
371389
372390
373391 @Callable(i)
374392 func setAdmins (adminPubKeys) = {
375393 let checkCaller = mustManager(i)
376394 if ((checkCaller == checkCaller))
377395 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
378396 else throw("Strict value is not equal to itself.")
379397 }
380398
381399
382400
383401 @Callable(i)
384402 func setManager (pendingManagerPublicKey) = {
385403 let checkCaller = mustManager(i)
386404 if ((checkCaller == checkCaller))
387405 then {
388406 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
389407 if ((checkManagerPublicKey == checkManagerPublicKey))
390408 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
391409 else throw("Strict value is not equal to itself.")
392410 }
393411 else throw("Strict value is not equal to itself.")
394412 }
395413
396414
397415
398416 @Callable(i)
399417 func confirmManager () = {
400418 let pm = pendingManagerPublicKeyOrUnit()
401419 let hasPM = if (isDefined(pm))
402420 then true
403421 else throw("No pending manager")
404422 if ((hasPM == hasPM))
405423 then {
406424 let checkPM = if ((i.callerPublicKey == value(pm)))
407425 then true
408426 else throw("You are not pending manager")
409427 if ((checkPM == checkPM))
410428 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
411429 else throw("Strict value is not equal to itself.")
412430 }
413431 else throw("Strict value is not equal to itself.")
414432 }
415433
416434
417435
418436 @Callable(i)
419437 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
420438
421439
422440
423441 @Callable(i)
424442 func statusREADONLY (amountAssetId,priceAssetId) = {
425443 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
426444 case s: String =>
427445 s
428446 case _ =>
429447 unit
430448 }
431449 $Tuple2(nil, status)
432450 }
433451
434452
435453 @Verifier(tx)
436454 func verify () = {
437455 let targetPublicKey = match managerPublicKeyOrUnit() {
438456 case pk: ByteVector =>
439457 pk
440458 case _: Unit =>
441459 tx.senderPublicKey
442460 case _ =>
443461 throw("Match error")
444462 }
445463 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
446464 }
447465

github/deemru/w8io/169f3d6 
63.02 ms