tx · Duo9txVVnFQJBVSx9QubDAYiQF579MJuFCuonS7KnFDB

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01300000 Waves

2023.05.19 10:45 [2584549] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "Duo9txVVnFQJBVSx9QubDAYiQF579MJuFCuonS7KnFDB", "fee": 1300000, "feeAssetId": null, "timestamp": 1684482399801, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "3n7fyU7eB8wkEsULyfun2k3Us1u5We4EQVztMXciG5S21EU1Jp6jrThQrFbSYA6znWtFExJucZPyeUBvyBAkb5s3" ], "script": "base64:BgKnEAgCEgkKBwgICBgBCAESABIAEggKBggICAgICBIDCgEYEgASBAoCCAgiEGNvbnRyYWN0RmlsZW5hbWUiA1NFUCIMd2F2ZXNBc3NldElkIgdWTFRQT09MIghTVEJMUE9PTCIRaW52YWxpZFByaWNlQXNzZXQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiB3Rocm93UEQiFHRocm93Q3JlYXRlTm90Q2FsbGVkIhF0aHJvd1lvdU5vdElzc3VlciIPdGhyb3dQb29sRXhpc3RzIhV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQiFnRocm93SW52YWxpZFByaWNlQXNzZXQiFHRocm93SW52YWxpZEZlZUFzc2V0Ihd0aHJvd0ludmFsaWRBbW91bnRBc3NldCISdGhyb3dJbnZhbGlkU3RhdHVzIh90aHJvd0NhbkFjdGl2YXRlT25seVBlbmRpbmdQb29sIh10aHJvd0ZhY3RvcnlSZXR1cm5lZE5vdFN0cmluZyIcdGhyb3dJbnZhbGlkUHJpY2VBc3NldEFtb3VudCIPdGhyb3dJbnZhbGlkRmVlIhV0aHJvd0ludmFsaWRBc3NldFBhaXIi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IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmFwAQlzZXRBZG1pbnMBAmJ4BAJiawkBAmFyAQUCYXADCQAAAgUCYmsFAmJrCQDMCAIJAQtTdHJpbmdFbnRyeQIJAQF6AAkAuQkCBQJieAUBYgUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmFwARNwcmljZUFzc2V0c1JFQURPTkxZAAkAlAoCBQNuaWwJAQJhZAEJAKIIAQkBAVgAAmFwAQ5zdGF0dXNSRUFET05MWQIBQgFDBAJhQgQBWgkAoggBCQEBQQIFAUIFAUMDCQABAgUBWgIGU3RyaW5nBAJhYQUBWgUCYWEFBHVuaXQJAJQKAgUDbmlsBQJhQgECYnkBAmJ6AAQCYkEEAVoJAQJhbQADCQABAgUBWgIKQnl0ZVZlY3RvcgQCYXEFAVoFAmFxAwkAAQIFAVoCBFVuaXQIBQJieQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCYnkJYm9keUJ5dGVzCQCRAwIIBQJieQZwcm9vZnMAAAUCYkGvmamI", "height": 2584549, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bcqq9bGEuN49RvHfog8bCyPom58HDDuTAGPCW6xYYaGT Next: 7pjDAjxCiUJpaW7vJrDnBfidGpLzYh8A3HC724Vdbr16 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)
218225 func validStatus (status) = containsElement(statuses, status)
219226
220227
221-@Callable(i)
222-func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
223- let checkCaller = mustManager(i)
224- if ((checkCaller == checkCaller))
225- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
226- else throw("Strict value is not equal to itself.")
227- }
228-
229-
230-
231-@Callable(i)
232-func create () = {
228+func _create (i,poolType) = {
233229 let amountAssetPayment = value(i.payments[0])
234230 let priceAssetPayment = value(i.payments[1])
235231 let feeAssetPayment = value(i.payments[2])
236- let $t075407612 = getIdAndInfo(amountAssetPayment)
237- let amountAssetId = $t075407612._1
238- let amountAssetInfo = $t075407612._2
239- let $t076157684 = getIdAndInfo(priceAssetPayment)
240- let priceAssetId = $t076157684._1
241- let priceAssetInfo = $t076157684._2
242- let $t076877750 = getIdAndInfo(feeAssetPayment)
243- let feeAssetId = $t076877750._1
244- let feeAssetInfo = $t076877750._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
245241 let amountAssetAmount = amountAssetPayment.amount
246242 let priceAssetAmount = priceAssetPayment.amount
247243 let feeAssetAmount = feeAssetPayment.amount
307303 then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
308304 else unit
309305 if ((burnEmissionInv == burnEmissionInv))
310- 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)]
306+ 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)]
311307 else throw("Strict value is not equal to itself.")
312308 }
309+ else throw("Strict value is not equal to itself.")
310+ }
311+
312+
313+@Callable(i)
314+func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
315+ let checkCaller = mustManager(i)
316+ if ((checkCaller == checkCaller))
317+ then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
318+ else throw("Strict value is not equal to itself.")
319+ }
320+
321+
322+
323+@Callable(i)
324+func create () = _create(i, VLTPOOL)
325+
326+
327+
328+@Callable(i)
329+func createStable () = {
330+ let checkCaller = mustManager(i)
331+ if ((checkCaller == checkCaller))
332+ then _create(i, STBLPOOL)
313333 else throw("Strict value is not equal to itself.")
314334 }
315335
324344 else throwCanActivateOnlyPendingPool()]
325345 if ((checks == checks))
326346 then {
327- let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
347+ let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId))
348+ let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit))
349+ then "VLTPOOL"
350+ else value(poolTypeOption), logo], nil)
328351 if ((activateNewPoolInv == activateNewPoolInv))
329352 then {
330353 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 keyManagerVaultAddress () = "%s__managerVaultAddress"
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 getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
128135 case s: String =>
129136 addressFromStringValue(s)
130137 case _ =>
131138 this
132139 }
133140
134141
135142 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
136143
137144
138145 func stringOptionToList (stringOrUnit) = match stringOrUnit {
139146 case s: String =>
140147 if ((size(s) == 0))
141148 then nil
142149 else split(s, SEP)
143150 case _: Unit =>
144151 nil
145152 case _ =>
146153 throw("Match error")
147154 }
148155
149156
150157 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
151158
152159 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
153160
154161 let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required")))
155162
156163 let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP)
157164
158165 let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required")))
159166
160167 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
161168
162169
163170 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
164171 then true
165172 else throwCreateNotCalled()
166173
167174
168175 func managerPublicKeyOrUnit () = {
169176 let managerVaultAddress = getManagerVaultAddressOrThis()
170177 match getString(managerVaultAddress, keyManagerPublicKey()) {
171178 case s: String =>
172179 fromBase58String(s)
173180 case _: Unit =>
174181 unit
175182 case _ =>
176183 throw("Match error")
177184 }
178185 }
179186
180187
181188 func isManager (i) = match managerPublicKeyOrUnit() {
182189 case pk: ByteVector =>
183190 (i.callerPublicKey == pk)
184191 case _: Unit =>
185192 (i.caller == this)
186193 case _ =>
187194 throw("Match error")
188195 }
189196
190197
191198 func mustManager (i) = if (isManager(i))
192199 then true
193200 else throwPD()
194201
195202
196203 func mustAdmin (i) = {
197204 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
198205 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
199206 then true
200207 else mustManager(i)
201208 }
202209
203210
204211 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
205212
206213
207214 func getIdAndInfo (payment) = match payment.assetId {
208215 case id: ByteVector =>
209216 let info = value(assetInfo(id))
210217 $Tuple2(toBase58String(id), info)
211218 case _: Unit =>
212219 $Tuple2(wavesAssetId, unit)
213220 case _ =>
214221 throw("Match error")
215222 }
216223
217224
218225 func validStatus (status) = containsElement(statuses, status)
219226
220227
221-@Callable(i)
222-func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
223- let checkCaller = mustManager(i)
224- if ((checkCaller == checkCaller))
225- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
226- else throw("Strict value is not equal to itself.")
227- }
228-
229-
230-
231-@Callable(i)
232-func create () = {
228+func _create (i,poolType) = {
233229 let amountAssetPayment = value(i.payments[0])
234230 let priceAssetPayment = value(i.payments[1])
235231 let feeAssetPayment = value(i.payments[2])
236- let $t075407612 = getIdAndInfo(amountAssetPayment)
237- let amountAssetId = $t075407612._1
238- let amountAssetInfo = $t075407612._2
239- let $t076157684 = getIdAndInfo(priceAssetPayment)
240- let priceAssetId = $t076157684._1
241- let priceAssetInfo = $t076157684._2
242- let $t076877750 = getIdAndInfo(feeAssetPayment)
243- let feeAssetId = $t076877750._1
244- let feeAssetInfo = $t076877750._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
245241 let amountAssetAmount = amountAssetPayment.amount
246242 let priceAssetAmount = priceAssetPayment.amount
247243 let feeAssetAmount = feeAssetPayment.amount
248244 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
249245 let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount())
250246 let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount()))
251247 let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId))
252248 then {
253249 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset)
254250 value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
255251 }
256252 else assetMinAmountDefault
257253 let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId))
258254 then {
259255 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
260256 value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
261257 }
262258 else assetMinAmountDefault
263259 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
264260 let curIndex = (lastIndex + 1)
265261 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
266262 let poolExists = {
267263 let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
268264 if ($isInstanceOf(@, "Boolean"))
269265 then @
270266 else throw(($getType(@) + " couldn't be cast to Boolean"))
271267 }
272268 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
273269 then true
274270 else throwPoolExists(), if (!(poolExists))
275271 then true
276272 else throwPoolExists(), if ((amountAssetId != priceAssetId))
277273 then true
278274 else throwInvalidAssetPair(), if (if (isVerified(amountAssetId))
279275 then isVerified(priceAssetId)
280276 else false)
281277 then true
282278 else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId))
283279 then true
284280 else containsElement(priceAssetsList, priceAssetId))
285281 then true
286282 else throwInvalidAssetPair(), if (if (isManager(i))
287283 then true
288284 else (getString(keyFeeAssetId()) == feeAssetId))
289285 then true
290286 else throwInvalidFeeAsset(), if (if (isManager(i))
291287 then true
292288 else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
293289 then true
294290 else throwInvalidAmountAsset(), if (if (isManager(i))
295291 then true
296292 else (priceAssetAmount >= priceAssetMinAmount))
297293 then true
298294 else throwInvalidPriceAssetAmount(), if (if (isManager(i))
299295 then true
300296 else (feeAssetAmount == getInteger(keyFeeAmount())))
301297 then true
302298 else throwInvalidFee()]
303299 if ((checks == checks))
304300 then {
305301 let paymentsWithFeeSize = 3
306302 let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
307303 then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
308304 else unit
309305 if ((burnEmissionInv == burnEmissionInv))
310- 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)]
306+ 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)]
311307 else throw("Strict value is not equal to itself.")
312308 }
309+ else throw("Strict value is not equal to itself.")
310+ }
311+
312+
313+@Callable(i)
314+func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
315+ let checkCaller = mustManager(i)
316+ if ((checkCaller == checkCaller))
317+ then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
318+ else throw("Strict value is not equal to itself.")
319+ }
320+
321+
322+
323+@Callable(i)
324+func create () = _create(i, VLTPOOL)
325+
326+
327+
328+@Callable(i)
329+func createStable () = {
330+ let checkCaller = mustManager(i)
331+ if ((checkCaller == checkCaller))
332+ then _create(i, STBLPOOL)
313333 else throw("Strict value is not equal to itself.")
314334 }
315335
316336
317337
318338 @Callable(i)
319339 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
320340 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
321341 then true
322342 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
323343 then true
324344 else throwCanActivateOnlyPendingPool()]
325345 if ((checks == checks))
326346 then {
327- let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
347+ let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId))
348+ let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit))
349+ then "VLTPOOL"
350+ else value(poolTypeOption), logo], nil)
328351 if ((activateNewPoolInv == activateNewPoolInv))
329352 then {
330353 let lpAssetId = match activateNewPoolInv {
331354 case id: String =>
332355 id
333356 case _ =>
334357 throwFactoryReturnedNotString()
335358 }
336359 if ((lpAssetId == lpAssetId))
337360 then {
338361 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
339362 if ((beforePut == beforePut))
340363 then {
341364 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
342365 then unit
343366 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
344367 then unit
345368 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
346369 if ((put == put))
347370 then {
348371 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
349372 if ((afterPut == afterPut))
350373 then {
351374 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
352375 let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil)
353376 if ((res == res))
354377 then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
355378 else throw("Strict value is not equal to itself.")
356379 }
357380 else throw("Strict value is not equal to itself.")
358381 }
359382 else throw("Strict value is not equal to itself.")
360383 }
361384 else throw("Strict value is not equal to itself.")
362385 }
363386 else throw("Strict value is not equal to itself.")
364387 }
365388 else throw("Strict value is not equal to itself.")
366389 }
367390 else throw("Strict value is not equal to itself.")
368391 }
369392
370393
371394
372395 @Callable(i)
373396 func setAdmins (adminPubKeys) = {
374397 let checkCaller = mustManager(i)
375398 if ((checkCaller == checkCaller))
376399 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
377400 else throw("Strict value is not equal to itself.")
378401 }
379402
380403
381404
382405 @Callable(i)
383406 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
384407
385408
386409
387410 @Callable(i)
388411 func statusREADONLY (amountAssetId,priceAssetId) = {
389412 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
390413 case s: String =>
391414 s
392415 case _ =>
393416 unit
394417 }
395418 $Tuple2(nil, status)
396419 }
397420
398421
399422 @Verifier(tx)
400423 func verify () = {
401424 let targetPublicKey = match managerPublicKeyOrUnit() {
402425 case pk: ByteVector =>
403426 pk
404427 case _: Unit =>
405428 tx.senderPublicKey
406429 case _ =>
407430 throw("Match error")
408431 }
409432 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
410433 }
411434

github/deemru/w8io/026f985 
64.65 ms