tx · 6vriKpo6ksfE7azZKRVG7uXTM3uYKWdXwHffwPfFkLGx

3Mpwh8Q1gGv6gwtzViR9mgruFyy6Jdm4GCG:  -0.01600000 Waves

2023.05.10 13:05 [2571647] smart account 3Mpwh8Q1gGv6gwtzViR9mgruFyy6Jdm4GCG > SELF 0.00000000 Waves

{ "type": 13, "id": "6vriKpo6ksfE7azZKRVG7uXTM3uYKWdXwHffwPfFkLGx", "fee": 1600000, "feeAssetId": null, "timestamp": 1683713244245, "version": 2, "chainId": 84, "sender": "3Mpwh8Q1gGv6gwtzViR9mgruFyy6Jdm4GCG", "senderPublicKey": "FLnBQATnBGWeMDB5MhixoEef8W61cnZUFXeCcwWAWQaR", "proofs": [ "3DSUQt4zMEeN8trAnGQKXfvqA2kEU8JXFE128deWp3X6T58BiFU5x147EjPtLXiMJeRycFfPUAwyrtVe7Xb1L8wV" ], "script": "base64:AAIFAAAAAAAABbsIAhIECgIICBIECgIICBIECgIIGBIDCgEIEgUKAwgICBIDCgEIEgMKAQgSAwoBCBIECgIICBIECgIICBIECgIICBIDCgEIEgUKAwgIBBIECgIICBIECgIIBBIDCgEIEgMKARgSAwoBCCIDU0VQIgVFTVBUWSIOc3RhdHVzVmVyaWZpZWQiEHN0YXR1c1VudmVyaWZpZWQiFmxhYmVsQ29tbXVuaXR5VmVyaWZpZWQiDGxhYmVsUG9vbHNMcCINZGVmYXVsdExhYmVscyIHdGhyb3dQRCIMdGhyb3dOb0Fzc2V0IhJ0aHJvd0ludmFsaWRUaWNrZXIiD2tleUFkbWluUHViS2V5cyIUa2V5VXNlclBvb2xzQ29udHJhY3QiEmtleUZhY3RvcnlDb250cmFjdCIKa2V5Q3JlYXRlZCIHYXNzZXRJZCIHa2V5TG9nbyIJa2V5VGlja2VyIglrZXlTdGF0dXMiE2tleUFzc2V0UG9vbHNOdW1iZXIiEmtleVRpY2tlclRvQXNzZXRJZCIGdGlja2VyIhJrZXlBc3NldElkVG9UaWNrZXIiIGtleUFtb3VudEFuZFBy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IBQAAAAJhUgAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmFUaNIhdg==", "height": 2571647, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8rH4UP8YH7tnJ8YmdiWzFHx1AuPEasZQCe5334mKxF67 Next: Hoxib9WVnTye26KN7cMcvnwVZFVBBkXpFyvE7gnHak1E Diff:
OldNewDifferences
130130 }
131131
132132
133-func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
133+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
134+ case s: String =>
135+ addressFromStringValue(s)
136+ case _ =>
137+ this
138+}
134139
135140
136141 func managerPublicKeyOrUnit () = {
137- let managerVaultAddress = getManagerAddressOrFail()
142+ let managerVaultAddress = getManagerVaultAddressOrThis()
138143 match getString(managerVaultAddress, keyManagerPublicKey()) {
139144 case s: String =>
140145 fromBase58String(s)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let statusVerified = 2
99
1010 let statusUnverified = 0
1111
1212 let labelCommunityVerified = "COMMUNITY_VERIFIED"
1313
1414 let labelPoolsLp = "POOLS_LP"
1515
1616 let defaultLabels = [labelCommunityVerified, labelPoolsLp]
1717
1818 func throwPD () = throw("Permission denied")
1919
2020
2121 func throwNoAsset () = throw("Asset doesn't exists")
2222
2323
2424 func throwInvalidTicker () = throw("Invalid ticker")
2525
2626
2727 func keyAdminPubKeys () = "%s__adminPubKeys"
2828
2929
3030 func keyUserPoolsContract () = "%s__userPoolsContract"
3131
3232
3333 func keyFactoryContract () = "%s__factoryContract"
3434
3535
3636 func keyCreated (assetId) = (("created_<" + assetId) + ">")
3737
3838
3939 func keyLogo (assetId) = (("logo_<" + assetId) + ">")
4040
4141
4242 func keyTicker (assetId) = (("ticker_<" + assetId) + ">")
4343
4444
4545 func keyStatus (assetId) = (("status_<" + assetId) + ">")
4646
4747
4848 func keyAssetPoolsNumber (assetId) = makeString(["%s%s", "pools", assetId], SEP)
4949
5050
5151 func keyTickerToAssetId (ticker) = makeString(["%s%s", "ticker2assetId", ticker], SEP)
5252
5353
5454 func keyAssetIdToTicker (assetId) = makeString(["%s%s", "assetId2ticker", assetId], SEP)
5555
5656
5757 func keyAmountAndPriceAssetsToLpAsset (amountAsset,priceAsset) = makeString(["%s%s%s", "amountAndPriceAssetsToLpAsset", amountAsset, priceAsset], SEP)
5858
5959
6060 func keyLpAssetToAmountAndPriceAssets (lpAsset) = makeString(["%s%s", "lpAssetToAmountAndPriceAssets", lpAsset], SEP)
6161
6262
6363 func keyAssetLabels (assetId) = makeString(["%s%s", "labels", assetId], SEP)
6464
6565
6666 func keyLabels () = makeString(["%s", "labels"], SEP)
6767
6868
6969 func keyAssetName (assetId) = makeString(["%s%s", "assetName", assetId], SEP)
7070
7171
7272 func keyManagerVaultAddress () = "%s__managerVaultAddress"
7373
7474
7575 func keyManagerPublicKey () = "%s__managerPublicKey"
7676
7777
7878 func keyAssetDescription (assetId) = makeString(["%s%s", "assetDescription", assetId], SEP)
7979
8080
8181 func getValueOrFail (address,key,type) = {
8282 let error = makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")
8383 valueOrErrorMessage( match type {
8484 case str: String =>
8585 getString(address, key)
8686 case int: Int =>
8787 getInteger(address, key)
8888 case _ =>
8989 throw("invalid entry type")
9090 }, error)
9191 }
9292
9393
9494 func getStrOrFail (address,key) = {
9595 let @ = getValueOrFail(address, key, "")
9696 if ($isInstanceOf(@, "String"))
9797 then @
9898 else throw("Couldn't cast Int|String to String")
9999 }
100100
101101
102102 func getIntOrFail (address,key) = {
103103 let @ = getValueOrFail(address, key, 0)
104104 if ($isInstanceOf(@, "Int"))
105105 then @
106106 else throw("Couldn't cast Int|String to Int")
107107 }
108108
109109
110110 func isVerified (assetId) = (valueOrElse(getInteger(keyStatus(assetId)), statusUnverified) == statusVerified)
111111
112112
113113 func getLabels () = match getString(keyLabels()) {
114114 case s: String =>
115115 if ((size(s) == 0))
116116 then nil
117117 else split(s, SEP)
118118 case _ =>
119119 nil
120120 }
121121
122122
123123 func getAssetLabels (assetId) = match getString(keyAssetLabels(assetId)) {
124124 case s: String =>
125125 if ((size(s) == 0))
126126 then nil
127127 else split(s, SEP)
128128 case _ =>
129129 nil
130130 }
131131
132132
133-func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
133+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
134+ case s: String =>
135+ addressFromStringValue(s)
136+ case _ =>
137+ this
138+}
134139
135140
136141 func managerPublicKeyOrUnit () = {
137- let managerVaultAddress = getManagerAddressOrFail()
142+ let managerVaultAddress = getManagerVaultAddressOrThis()
138143 match getString(managerVaultAddress, keyManagerPublicKey()) {
139144 case s: String =>
140145 fromBase58String(s)
141146 case _: Unit =>
142147 unit
143148 case _ =>
144149 throw("Match error")
145150 }
146151 }
147152
148153
149154 func isManager (i) = match managerPublicKeyOrUnit() {
150155 case pk: ByteVector =>
151156 (i.callerPublicKey == pk)
152157 case _: Unit =>
153158 (i.caller == this)
154159 case _ =>
155160 throw("Match error")
156161 }
157162
158163
159164 func mustManager (i) = if (isManager(i))
160165 then true
161166 else throw("permission denied")
162167
163168
164169 func mustAdmin (i) = {
165170 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
166171 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
167172 then true
168173 else mustManager(i)
169174 }
170175
171176
172177 func isCreated (assetId) = valueOrElse(getBoolean(keyCreated(assetId)), false)
173178
174179
175180 func verifiedToStatus (verified) = if (verified)
176181 then statusVerified
177182 else statusUnverified
178183
179184
180185 func addLabelActions (assetId,label,throwOnError) = {
181186 let labels = getLabels()
182187 let assetLabels = getAssetLabels(assetId)
183188 let checkLabel = if (containsElement(labels, label))
184189 then true
185190 else throw("Label doesn't exist")
186191 if ((checkLabel == checkLabel))
187192 then {
188193 let newAssetLabels = if (containsElement(assetLabels, label))
189194 then if (throwOnError)
190195 then throw("Label has already been added")
191196 else assetLabels
192197 else (assetLabels :+ label)
193198 [StringEntry(keyAssetLabels(assetId), makeString(newAssetLabels, SEP))]
194199 }
195200 else throw("Strict value is not equal to itself.")
196201 }
197202
198203
199204 func deleteLabelActions (assetId,label,throwOnError) = {
200205 let assetLabels = getAssetLabels(assetId)
201206 let newAssetLabels = if (containsElement(assetLabels, label))
202207 then removeByIndex(assetLabels, value(indexOf(assetLabels, label)))
203208 else if (throwOnError)
204209 then throw("Label wasn't added")
205210 else assetLabels
206211 [StringEntry(keyAssetLabels(assetId), makeString(newAssetLabels, SEP))]
207212 }
208213
209214
210215 func setVerifiedActions (assetId,verified) = {
211216 let labelCommunityVerifiedActions = if (verified)
212217 then addLabelActions(assetId, labelCommunityVerified, false)
213218 else deleteLabelActions(assetId, labelCommunityVerified, false)
214219 ([IntegerEntry(keyStatus(assetId), verifiedToStatus(verified))] ++ labelCommunityVerifiedActions)
215220 }
216221
217222
218223 @Callable(i)
219224 func setAssetName (assetID,assetName) = {
220225 let checkCaller = mustAdmin(i)
221226 if ((checkCaller == checkCaller))
222227 then [StringEntry(keyAssetName(assetID), assetName)]
223228 else throw("Strict value is not equal to itself.")
224229 }
225230
226231
227232
228233 @Callable(i)
229234 func setAssetDescription (assetID,assetDescription) = {
230235 let checkCaller = mustAdmin(i)
231236 if ((checkCaller == checkCaller))
232237 then [StringEntry(keyAssetDescription(assetID), assetDescription)]
233238 else throw("Strict value is not equal to itself.")
234239 }
235240
236241
237242
238243 @Callable(i)
239244 func constructor (userPoolsContract,labels) = {
240245 let checkCaller = mustManager(i)
241246 if ((checkCaller == checkCaller))
242247 then {
243248 let checksAddress = valueOrErrorMessage(addressFromString(userPoolsContract), "Invalid address")
244249 if ((checksAddress == checksAddress))
245250 then [StringEntry(keyUserPoolsContract(), userPoolsContract), StringEntry(keyLabels(), makeString((defaultLabels ++ labels), SEP))]
246251 else throw("Strict value is not equal to itself.")
247252 }
248253 else throw("Strict value is not equal to itself.")
249254 }
250255
251256
252257
253258 @Callable(i)
254259 func constructorV2 (factoryContract) = {
255260 let checkCaller = mustManager(i)
256261 if ((checkCaller == checkCaller))
257262 then {
258263 let checkAddress = valueOrErrorMessage(addressFromString(factoryContract), "invalid factory contract address")
259264 if ((checkAddress == checkAddress))
260265 then [StringEntry(keyFactoryContract(), factoryContract)]
261266 else throw("Strict value is not equal to itself.")
262267 }
263268 else throw("Strict value is not equal to itself.")
264269 }
265270
266271
267272
268273 @Callable(i)
269274 func addAssetsLink (amountAsset,priceAsset,lpAsset) = {
270275 let checkCaller = mustAdmin(i)
271276 if ((checkCaller == checkCaller))
272277 then [StringEntry(keyAmountAndPriceAssetsToLpAsset(amountAsset, priceAsset), lpAsset), StringEntry(keyLpAssetToAmountAndPriceAssets(lpAsset), makeString([amountAsset, priceAsset], SEP))]
273278 else throw("Strict value is not equal to itself.")
274279 }
275280
276281
277282
278283 @Callable(i)
279284 func increaseAssetPoolsNumber (assetId) = {
280285 let checkCaller = mustAdmin(i)
281286 if ((checkCaller == checkCaller))
282287 then {
283288 let assetPoolsNumberKey = keyAssetPoolsNumber(assetId)
284289 let assetPoolsNumber = valueOrElse(getInteger(assetPoolsNumberKey), 0)
285290 [IntegerEntry(assetPoolsNumberKey, (assetPoolsNumber + 1))]
286291 }
287292 else throw("Strict value is not equal to itself.")
288293 }
289294
290295
291296
292297 @Callable(i)
293298 func createLabel (label) = {
294299 let labels = getLabels()
295300 let checkCaller = mustAdmin(i)
296301 if ((checkCaller == checkCaller))
297302 then {
298303 let checkLabel = [if (!(contains(label, SEP)))
299304 then true
300305 else throw("Invalid label name"), if (!(containsElement(labels, label)))
301306 then true
302307 else throw("Label exists")]
303308 if ((checkLabel == checkLabel))
304309 then [StringEntry(keyLabels(), makeString((labels :+ label), SEP))]
305310 else throw("Strict value is not equal to itself.")
306311 }
307312 else throw("Strict value is not equal to itself.")
308313 }
309314
310315
311316
312317 @Callable(i)
313318 func dropLabel (label) = {
314319 let labels = getLabels()
315320 let checkCaller = mustManager(i)
316321 if ((checkCaller == checkCaller))
317322 then {
318323 let checkLabel = if (containsElement(labels, label))
319324 then true
320325 else throw("Label doesn't exist")
321326 if ((checkLabel == checkLabel))
322327 then [StringEntry(keyLabels(), makeString(removeByIndex(labels, value(indexOf(labels, label))), SEP))]
323328 else throw("Strict value is not equal to itself.")
324329 }
325330 else throw("Strict value is not equal to itself.")
326331 }
327332
328333
329334
330335 @Callable(i)
331336 func addLabel (assetId,label) = {
332337 let checkCaller = mustAdmin(i)
333338 if ((checkCaller == checkCaller))
334339 then addLabelActions(assetId, label, true)
335340 else throw("Strict value is not equal to itself.")
336341 }
337342
338343
339344
340345 @Callable(i)
341346 func deleteLabel (assetId,label) = {
342347 let checkCaller = mustAdmin(i)
343348 if ((checkCaller == checkCaller))
344349 then deleteLabelActions(assetId, label, true)
345350 else throw("Strict value is not equal to itself.")
346351 }
347352
348353
349354
350355 @Callable(i)
351356 func updateTicker (assetId,ticker) = {
352357 let checkCaller = mustAdmin(i)
353358 if ((checkCaller == checkCaller))
354359 then {
355360 let checkAsset = if (isCreated(assetId))
356361 then true
357362 else throwNoAsset()
358363 if ((checkAsset == checkAsset))
359364 then {
360365 let checkTicker = if ((ticker != ""))
361366 then true
362367 else throwInvalidTicker()
363368 if ((checkTicker == checkTicker))
364369 then {
365370 let deleteActions = ( match getString(keyTickerToAssetId(ticker)) {
366371 case assetIdOld: String =>
367372 [DeleteEntry(keyAssetIdToTicker(assetIdOld))]
368373 case _: Unit =>
369374 nil
370375 case _ =>
371376 throw("Match error")
372377 } ++ match getString(keyAssetIdToTicker(assetId)) {
373378 case tickerOld: String =>
374379 [DeleteEntry(keyTickerToAssetId(tickerOld))]
375380 case _: Unit =>
376381 nil
377382 case _ =>
378383 throw("Match error")
379384 })
380385 let updateActions = [StringEntry(keyAssetIdToTicker(assetId), ticker), StringEntry(keyTickerToAssetId(ticker), assetId)]
381386 (deleteActions ++ updateActions)
382387 }
383388 else throw("Strict value is not equal to itself.")
384389 }
385390 else throw("Strict value is not equal to itself.")
386391 }
387392 else throw("Strict value is not equal to itself.")
388393 }
389394
390395
391396
392397 @Callable(i)
393398 func deleteTicker (assetId) = {
394399 let checkCaller = mustAdmin(i)
395400 if ((checkCaller == checkCaller))
396401 then {
397402 let ticker = valueOrErrorMessage(getString(keyAssetIdToTicker(assetId)), "Invalid asset")
398403 [DeleteEntry(keyAssetIdToTicker(assetId)), DeleteEntry(keyTickerToAssetId(ticker))]
399404 }
400405 else throw("Strict value is not equal to itself.")
401406 }
402407
403408
404409
405410 @Callable(i)
406411 func createOrUpdate (assetId,logo,verified) = {
407412 let checkCaller = mustAdmin(i)
408413 if ((checkCaller == checkCaller))
409414 then {
410415 let isCreatedNow = !(isCreated(assetId))
411416 if ((isCreatedNow == isCreatedNow))
412417 then {
413418 let setLogoActions = if ((logo == ""))
414419 then nil
415420 else [StringEntry(keyLogo(assetId), logo)]
416421 $Tuple2((([BooleanEntry(keyCreated(assetId), true)] ++ setLogoActions) ++ setVerifiedActions(assetId, verified)), isCreatedNow)
417422 }
418423 else throw("Strict value is not equal to itself.")
419424 }
420425 else throw("Strict value is not equal to itself.")
421426 }
422427
423428
424429
425430 @Callable(i)
426431 func setLogo (assetId,logo) = {
427432 let checks = [mustAdmin(i), if (isCreated(assetId))
428433 then true
429434 else throwNoAsset()]
430435 if ((checks == checks))
431436 then {
432437 let action = if ((logo == ""))
433438 then DeleteEntry(keyLogo(assetId))
434439 else StringEntry(keyLogo(assetId), logo)
435440 [action]
436441 }
437442 else throw("Strict value is not equal to itself.")
438443 }
439444
440445
441446
442447 @Callable(i)
443448 func setVerified (assetId,verified) = {
444449 let checks = [mustAdmin(i), if (isCreated(assetId))
445450 then true
446451 else throwNoAsset()]
447452 if ((checks == checks))
448453 then {
449454 let onVerificationLossInv = if (!(verified))
450455 then {
451456 let factoryContract = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyFactoryContract())), "invalid factory contract address")
452457 invoke(factoryContract, "onVerificationLoss", [assetId], nil)
453458 }
454459 else unit
455460 if ((onVerificationLossInv == onVerificationLossInv))
456461 then $Tuple2(setVerifiedActions(assetId, verified), unit)
457462 else throw("Strict value is not equal to itself.")
458463 }
459464 else throw("Strict value is not equal to itself.")
460465 }
461466
462467
463468
464469 @Callable(i)
465470 func onEliminate (assetId) = {
466471 let poolsNumber = valueOrElse(getInteger(keyAssetPoolsNumber(assetId)), 0)
467472 let actions = if ((poolsNumber > 0))
468473 then nil
469474 else [DeleteEntry(keyLogo(assetId))]
470475 $Tuple2(actions, unit)
471476 }
472477
473478
474479
475480 @Callable(i)
476481 func setAdmins (adminPubKeys) = {
477482 let checkCaller = mustManager(i)
478483 if ((checkCaller == checkCaller))
479484 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
480485 else throw("Strict value is not equal to itself.")
481486 }
482487
483488
484489
485490 @Callable(i)
486491 func isVerifiedREADONLY (assetId) = $Tuple2(nil, isVerified(assetId))
487492
488493
489494 @Verifier(tx)
490495 func verify () = {
491496 let targetPublicKey = match managerPublicKeyOrUnit() {
492497 case pk: ByteVector =>
493498 pk
494499 case _: Unit =>
495500 tx.senderPublicKey
496501 case _ =>
497502 throw("Match error")
498503 }
499504 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
500505 }
501506

github/deemru/w8io/026f985 
49.16 ms