tx · EyaCuH3qBuzELXSdNZ4cccKJb2hmznJknsrLmrSByGCu

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01400000 Waves

2023.09.25 14:00 [2770844] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "EyaCuH3qBuzELXSdNZ4cccKJb2hmznJknsrLmrSByGCu", "fee": 1400000, "feeAssetId": null, "timestamp": 1695639623195, "version": 2, "chainId": 84, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "2CSQVVoxigtfPcDH5YSzyP9PtcXcfRsRHPSREBrNx948LarQY6XPbsxeYNcWG8T3QQxhCiZSvccDVekDPdQ2VQJT" ], "script": "base64:BgK8EAgCEgkKBwgICBgBCAESABIAEggKBggICAgICBIDCgEYEgASBAoCCAgSBAoCCAgSBAoCCAgiEGNvbnRyYWN0RmlsZW5hbWUiA1NFUCIMd2F2ZXNBc3NldElkIgdWTFRQT09MIghTVEJMUE9PTCIRaW52YWxpZFByaWNlQXNzZXQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiB3Rocm93UEQiFHRocm93Q3JlYXRlTm90Q2FsbGVkIhF0aHJvd1lvdU5vdElzc3VlciIPdGhyb3dQb29sRXhpc3RzIhV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQiFnRocm93SW52YWxpZFByaWNlQXNzZXQiFHRocm93SW52YWxpZEZlZUFzc2V0Ihd0aHJvd0ludmFsaWRBbW91bnRBc3NldCISdGhyb3dJbnZhbGlkU3RhdHVzIh90aHJvd0NhbkFjdGl2YXRlT25seVBlbmRpbmdQb29sIh10aHJvd0ZhY3RvcnlSZXR1cm5lZE5vdFN0cmluZyIcdGhyb3dJbnZhbGlkUHJpY2VBc3NldEFtb3VudCIPdGhyb3dJbnZhbGlkRmVlIhV0aHJvd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QFBAgUBQgUBQwkAzAgCCQELRGVsZXRlRW50cnkBCQEBUAIFAUIFAUMJAMwIAgkBC0RlbGV0ZUVudHJ5AQkBAVECBQFCBQFDCQDMCAIJAQtEZWxldGVFbnRyeQEJAQFTAgUBQgUBQwUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJiegECYkEABAJiQgQBWgkBAmFtAAMJAAECBQFaAgpCeXRlVmVjdG9yBAJhcQUBWgUCYXEDCQABAgUBWgIEVW5pdAgFAmJ6D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJieglib2R5Qnl0ZXMJAJEDAggFAmJ6BnByb29mcwAABQJiQrNxask=", "height": 2770844, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4E2ZGZuAwiDitm8oKXkoQtuMSfoAKW2mxQxZYSKzjyvu Next: C1WDv6ANK9MfpBf6GG3xXmP7H2tEPibczdoYiuDT8Am2 Diff:
OldNewDifferences
122122 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
123123
124124
125-func keyPoolAssetDefaultMinAmount () = makeString(["%s", "poolAssetDefaultMinAmount"], SEP)
125+func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
126126
127127
128-func keyPoolAssetsMinAmount (assetId) = makeString(["%s%s", "poolAssetMinAmount", assetId], SEP)
128+func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
129129
130130
131131 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
229229 let amountAssetPayment = value(i.payments[0])
230230 let priceAssetPayment = value(i.payments[1])
231231 let feeAssetPayment = value(i.payments[2])
232- let $t065196591 = getIdAndInfo(amountAssetPayment)
233- let amountAssetId = $t065196591._1
234- let amountAssetInfo = $t065196591._2
235- let $t065946663 = getIdAndInfo(priceAssetPayment)
236- let priceAssetId = $t065946663._1
237- let priceAssetInfo = $t065946663._2
238- let $t066666729 = getIdAndInfo(feeAssetPayment)
239- let feeAssetId = $t066666729._1
240- let feeAssetInfo = $t066666729._2
232+ let $t064866558 = getIdAndInfo(amountAssetPayment)
233+ let amountAssetId = $t064866558._1
234+ let amountAssetInfo = $t064866558._2
235+ let $t065616630 = getIdAndInfo(priceAssetPayment)
236+ let priceAssetId = $t065616630._1
237+ let priceAssetInfo = $t065616630._2
238+ let $t066336696 = getIdAndInfo(feeAssetPayment)
239+ let feeAssetId = $t066336696._1
240+ let feeAssetInfo = $t066336696._2
241241 let amountAssetAmount = amountAssetPayment.amount
242242 let priceAssetAmount = priceAssetPayment.amount
243243 let feeAssetAmount = feeAssetPayment.amount
244244 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
245- let assetMinAmountDefault = getIntegerValue(factoryContract, keyPoolAssetDefaultMinAmount())
246- let amountAssetMinAmount = valueOrElse(getInteger(factoryContract, keyPoolAssetsMinAmount(amountAssetId)), assetMinAmountDefault)
247- let priceAssetMinAmount = valueOrElse(getInteger(factoryContract, keyPoolAssetsMinAmount(priceAssetId)), assetMinAmountDefault)
245+ let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount())
246+ let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount()))
247+ let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId))
248+ then {
249+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset)
250+ value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
251+ }
252+ else assetMinAmountDefault
253+ let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId))
254+ then {
255+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
256+ value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
257+ }
258+ else assetMinAmountDefault
248259 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
249260 let curIndex = (lastIndex + 1)
250261 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
276287 then true
277288 else throwInvalidFeeAsset(), if (if (isManager(i))
278289 then true
279- else (amountAssetAmount >= amountAssetMinAmount))
290+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
280291 then true
281292 else throwInvalidAmountAsset(), if (if (isManager(i))
282293 then true
302313
303314
304315 @Callable(i)
305-func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,feeAssetId,feeAmount) = {
316+func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
306317 let checkCaller = mustManager(i)
307318 if ((checkCaller == checkCaller))
308- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
319+ then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
309320 else throw("Strict value is not equal to itself.")
310321 }
311322
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFilename = "user_pools.ride"
55
66 let SEP = "__"
77
88 let wavesAssetId = "WAVES"
99
1010 let VLTPOOL = "VLTPOOL"
1111
1212 let STBLPOOL = "STBLPOOL"
1313
1414 let invalidPriceAsset = "Invalid price asset"
1515
1616 func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
1717
1818
1919 func throwErr (msg) = throw(wrapErr(msg))
2020
2121
2222 func throwPD () = throwErr("Permission denied")
2323
2424
2525 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
2626
2727
2828 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2929
3030
3131 func throwPoolExists () = throwErr("Pool with such assets already exists")
3232
3333
3434 func throwAssetNotVerified () = throwErr("Asset is not verified")
3535
3636
3737 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
3838
3939
4040 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
4141
4242
4343 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
4444
4545
4646 func throwInvalidStatus () = throwErr("Invalid status")
4747
4848
4949 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
5050
5151
5252 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
5353
5454
5555 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
5656
5757
5858 func throwInvalidFee () = throwErr("invalid fee")
5959
6060
6161 func throwInvalidAssetPair () = throwErr("invalid asset pair")
6262
6363
6464 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
6565
6666
6767 func keyManagerVaultAddress () = "%s__managerVaultAddress"
6868
6969
7070 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
7171
7272
7373 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
7474
7575
7676 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
7777
7878
7979 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
8080
8181
8282 func keyEmissionContract () = makeString(["%s", "emissionContract"], SEP)
8383
8484
8585 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
8686
8787
8888 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
8989
9090
9191 let indexSuffix = "u"
9292
9393 let statusPending = "pending"
9494
9595 let statusDeclined = "declined"
9696
9797 let statusActive = "active"
9898
9999 let statuses = [statusPending, statusDeclined, statusActive]
100100
101101 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
102102
103103
104104 func keyCreateCaller (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCaller", amountAssetId, priceAssetId], SEP)
105105
106106
107107 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
108108
109109
110110 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
111111
112112
113113 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
114114
115115
116116 func keyPoolType (amountAssetId,priceAssetId) = makeString(["%s%s%s", "poolType", amountAssetId, priceAssetId], SEP)
117117
118118
119119 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
120120
121121
122122 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
123123
124124
125-func keyPoolAssetDefaultMinAmount () = makeString(["%s", "poolAssetDefaultMinAmount"], SEP)
125+func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
126126
127127
128-func keyPoolAssetsMinAmount (assetId) = makeString(["%s%s", "poolAssetMinAmount", assetId], SEP)
128+func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
129129
130130
131131 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
132132
133133
134134 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
135135 case s: String =>
136136 addressFromStringValue(s)
137137 case _ =>
138138 this
139139 }
140140
141141
142142 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
143143
144144
145145 func stringOptionToList (stringOrUnit) = match stringOrUnit {
146146 case s: String =>
147147 if ((size(s) == 0))
148148 then nil
149149 else split_4C(s, SEP)
150150 case _: Unit =>
151151 nil
152152 case _ =>
153153 throw("Match error")
154154 }
155155
156156
157157 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
158158
159159 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
160160
161161 let votingEmissionContract = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyVotingEmissionContract), wrapErr("voting emission contract address is required")))
162162
163163 let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], SEP)
164164
165165 let votingEmissionCandidateContract = addressFromStringValue(valueOrErrorMessage(getString(votingEmissionContract, keyVotingEmissionCandidateContract), wrapErr("voting emission candidate contract address is required")))
166166
167167 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
168168
169169
170170 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
171171 then true
172172 else throwCreateNotCalled()
173173
174174
175175 func managerPublicKeyOrUnit () = {
176176 let managerVaultAddress = getManagerVaultAddressOrThis()
177177 match getString(managerVaultAddress, keyManagerPublicKey()) {
178178 case s: String =>
179179 fromBase58String(s)
180180 case _: Unit =>
181181 unit
182182 case _ =>
183183 throw("Match error")
184184 }
185185 }
186186
187187
188188 func isManager (i) = match managerPublicKeyOrUnit() {
189189 case pk: ByteVector =>
190190 (i.callerPublicKey == pk)
191191 case _: Unit =>
192192 (i.caller == this)
193193 case _ =>
194194 throw("Match error")
195195 }
196196
197197
198198 func mustManager (i) = if (isManager(i))
199199 then true
200200 else throwPD()
201201
202202
203203 func mustAdmin (i) = {
204204 let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
205205 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
206206 then true
207207 else mustManager(i)
208208 }
209209
210210
211211 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
212212
213213
214214 func getIdAndInfo (payment) = match payment.assetId {
215215 case id: ByteVector =>
216216 let info = value(assetInfo(id))
217217 $Tuple2(toBase58String(id), info)
218218 case _: Unit =>
219219 $Tuple2(wavesAssetId, unit)
220220 case _ =>
221221 throw("Match error")
222222 }
223223
224224
225225 func validStatus (status) = containsElement(statuses, status)
226226
227227
228228 func _create (i,poolType) = {
229229 let amountAssetPayment = value(i.payments[0])
230230 let priceAssetPayment = value(i.payments[1])
231231 let feeAssetPayment = value(i.payments[2])
232- let $t065196591 = getIdAndInfo(amountAssetPayment)
233- let amountAssetId = $t065196591._1
234- let amountAssetInfo = $t065196591._2
235- let $t065946663 = getIdAndInfo(priceAssetPayment)
236- let priceAssetId = $t065946663._1
237- let priceAssetInfo = $t065946663._2
238- let $t066666729 = getIdAndInfo(feeAssetPayment)
239- let feeAssetId = $t066666729._1
240- let feeAssetInfo = $t066666729._2
232+ let $t064866558 = getIdAndInfo(amountAssetPayment)
233+ let amountAssetId = $t064866558._1
234+ let amountAssetInfo = $t064866558._2
235+ let $t065616630 = getIdAndInfo(priceAssetPayment)
236+ let priceAssetId = $t065616630._1
237+ let priceAssetInfo = $t065616630._2
238+ let $t066336696 = getIdAndInfo(feeAssetPayment)
239+ let feeAssetId = $t066336696._1
240+ let feeAssetInfo = $t066336696._2
241241 let amountAssetAmount = amountAssetPayment.amount
242242 let priceAssetAmount = priceAssetPayment.amount
243243 let feeAssetAmount = feeAssetPayment.amount
244244 let priceAssetsList = stringOptionToList(getString(factoryContract, keyPriceAssets()))
245- let assetMinAmountDefault = getIntegerValue(factoryContract, keyPoolAssetDefaultMinAmount())
246- let amountAssetMinAmount = valueOrElse(getInteger(factoryContract, keyPoolAssetsMinAmount(amountAssetId)), assetMinAmountDefault)
247- let priceAssetMinAmount = valueOrElse(getInteger(factoryContract, keyPoolAssetsMinAmount(priceAssetId)), assetMinAmountDefault)
245+ let assetMinAmountDefault = getIntegerValue(keyAmountAssetMinAmount())
246+ let allowedAssetsMinAmounts = stringOptionToList(getString(keyPriceAssetsMinAmount()))
247+ let amountAssetMinAmount = if (containsElement(priceAssetsList, amountAssetId))
248+ then {
249+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, amountAssetId), invalidPriceAsset)
250+ value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
251+ }
252+ else assetMinAmountDefault
253+ let priceAssetMinAmount = if (containsElement(priceAssetsList, priceAssetId))
254+ then {
255+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
256+ value(parseInt(allowedAssetsMinAmounts[priceAssetsIndex]))
257+ }
258+ else assetMinAmountDefault
248259 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
249260 let curIndex = (lastIndex + 1)
250261 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract()))
251262 let poolExists = {
252263 let @ = invoke(factoryContract, "poolExistsREADONLY", [amountAssetId, priceAssetId], nil)
253264 if ($isInstanceOf(@, "Boolean"))
254265 then @
255266 else throw(($getType(@) + " couldn't be cast to Boolean"))
256267 }
257268 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
258269 then true
259270 else throwPoolExists(), if (!(poolExists))
260271 then true
261272 else throwPoolExists(), if ((amountAssetId != priceAssetId))
262273 then true
263274 else throwInvalidAssetPair(), if (if (isManager(i))
264275 then true
265276 else if (isVerified(amountAssetId))
266277 then isVerified(priceAssetId)
267278 else false)
268279 then true
269280 else throwInvalidAssetPair(), if (if (containsElement(priceAssetsList, amountAssetId))
270281 then true
271282 else containsElement(priceAssetsList, priceAssetId))
272283 then true
273284 else throwInvalidAssetPair(), if (if (isManager(i))
274285 then true
275286 else (getString(keyFeeAssetId()) == feeAssetId))
276287 then true
277288 else throwInvalidFeeAsset(), if (if (isManager(i))
278289 then true
279- else (amountAssetAmount >= amountAssetMinAmount))
290+ else (amountAssetAmount >= getIntegerValue(keyAmountAssetMinAmount())))
280291 then true
281292 else throwInvalidAmountAsset(), if (if (isManager(i))
282293 then true
283294 else (priceAssetAmount >= priceAssetMinAmount))
284295 then true
285296 else throwInvalidPriceAssetAmount(), if (if (isManager(i))
286297 then true
287298 else (feeAssetAmount == getInteger(keyFeeAmount())))
288299 then true
289300 else throwInvalidFee()]
290301 if ((checks == checks))
291302 then {
292303 let paymentsWithFeeSize = 3
293304 let burnEmissionInv = if ((size(i.payments) >= paymentsWithFeeSize))
294305 then invoke(emissionContract, "burn", nil, [AttachedPayment(fromBase58String(feeAssetId), feeAssetAmount)])
295306 else unit
296307 if ((burnEmissionInv == burnEmissionInv))
297308 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)]
298309 else throw("Strict value is not equal to itself.")
299310 }
300311 else throw("Strict value is not equal to itself.")
301312 }
302313
303314
304315 @Callable(i)
305-func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,feeAssetId,feeAmount) = {
316+func constructor (factoryV2Address,assetsStoreAddress,emissionAddress,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
306317 let checkCaller = mustManager(i)
307318 if ((checkCaller == checkCaller))
308- then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
319+ then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyEmissionContract(), emissionAddress), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)]
309320 else throw("Strict value is not equal to itself.")
310321 }
311322
312323
313324
314325 @Callable(i)
315326 func create () = _create(i, VLTPOOL)
316327
317328
318329
319330 @Callable(i)
320331 func createStable () = {
321332 let checkCaller = mustManager(i)
322333 if ((checkCaller == checkCaller))
323334 then _create(i, STBLPOOL)
324335 else throw("Strict value is not equal to itself.")
325336 }
326337
327338
328339
329340 @Callable(i)
330341 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
331342 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
332343 then true
333344 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
334345 then true
335346 else throwCanActivateOnlyPendingPool()]
336347 if ((checks == checks))
337348 then {
338349 let poolTypeOption = getString(this, keyPoolType(amountAssetId, priceAssetId))
339350 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, if ((poolTypeOption == unit))
340351 then "VLTPOOL"
341352 else value(poolTypeOption), logo], nil)
342353 if ((activateNewPoolInv == activateNewPoolInv))
343354 then {
344355 let lpAssetId = match activateNewPoolInv {
345356 case id: String =>
346357 id
347358 case _ =>
348359 throwFactoryReturnedNotString()
349360 }
350361 if ((lpAssetId == lpAssetId))
351362 then {
352363 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
353364 if ((beforePut == beforePut))
354365 then {
355366 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(if ((amountAssetId == "WAVES"))
356367 then unit
357368 else fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
358369 then unit
359370 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
360371 if ((put == put))
361372 then {
362373 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
363374 if ((afterPut == afterPut))
364375 then {
365376 let user = value(addressFromString(value(getString(keyCreateCaller(amountAssetId, priceAssetId)))))
366377 let res = invoke(votingEmissionCandidateContract, "approve", [amountAssetId, priceAssetId], nil)
367378 if ((res == res))
368379 then [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
369380 else throw("Strict value is not equal to itself.")
370381 }
371382 else throw("Strict value is not equal to itself.")
372383 }
373384 else throw("Strict value is not equal to itself.")
374385 }
375386 else throw("Strict value is not equal to itself.")
376387 }
377388 else throw("Strict value is not equal to itself.")
378389 }
379390 else throw("Strict value is not equal to itself.")
380391 }
381392 else throw("Strict value is not equal to itself.")
382393 }
383394
384395
385396
386397 @Callable(i)
387398 func setAdmins (adminPubKeys) = {
388399 let checkCaller = mustManager(i)
389400 if ((checkCaller == checkCaller))
390401 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
391402 else throw("Strict value is not equal to itself.")
392403 }
393404
394405
395406
396407 @Callable(i)
397408 func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssets())))
398409
399410
400411
401412 @Callable(i)
402413 func statusREADONLY (amountAssetId,priceAssetId) = {
403414 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
404415 case s: String =>
405416 s
406417 case _ =>
407418 unit
408419 }
409420 $Tuple2(nil, status)
410421 }
411422
412423
413424
414425 @Callable(i)
415426 func getPoolCreatorREADONLY (amountAssetId,priceAssetId) = {
416427 let creator = valueOrElse(getString(keyCreateCaller(amountAssetId, priceAssetId)), "")
417428 $Tuple2(nil, creator)
418429 }
419430
420431
421432
422433 @Callable(i)
423434 func deletePool (amountAssetId,priceAssetId) = {
424435 let checkCaller = if (if ((i.caller == factoryContract))
425436 then true
426437 else mustManager(i))
427438 then true
428439 else throwErr("Permission denied")
429440 if ((checkCaller == checkCaller))
430441 then [DeleteEntry(keyCreateCalled(amountAssetId, priceAssetId)), DeleteEntry(keyCreateCaller(amountAssetId, priceAssetId)), DeleteEntry(keySuffix(amountAssetId, priceAssetId)), DeleteEntry(keyHeight(amountAssetId, priceAssetId)), DeleteEntry(keyStatus(amountAssetId, priceAssetId)), DeleteEntry(keyAmountAssetAmount(amountAssetId, priceAssetId)), DeleteEntry(keyPriceAssetAmount(amountAssetId, priceAssetId)), DeleteEntry(keyPoolType(amountAssetId, priceAssetId))]
431442 else throw("Strict value is not equal to itself.")
432443 }
433444
434445
435446 @Verifier(tx)
436447 func verify () = {
437448 let targetPublicKey = match managerPublicKeyOrUnit() {
438449 case pk: ByteVector =>
439450 pk
440451 case _: Unit =>
441452 tx.senderPublicKey
442453 case _ =>
443454 throw("Match error")
444455 }
445456 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
446457 }
447458

github/deemru/w8io/026f985 
72.64 ms