tx · 2yzv1Ze1fbmVyZCxELmf47j6hYnJfZ8yjs4MW5oetoVv

3N5BB6iE58rujeTEkymeLNcdsYF4f6iKoxr:  -0.01600000 Waves

2023.05.02 09:51 [2559807] smart account 3N5BB6iE58rujeTEkymeLNcdsYF4f6iKoxr > SELF 0.00000000 Waves

{ "type": 13, "id": "2yzv1Ze1fbmVyZCxELmf47j6hYnJfZ8yjs4MW5oetoVv", "fee": 1600000, "feeAssetId": null, "timestamp": 1683010310602, "version": 2, "chainId": 84, "sender": "3N5BB6iE58rujeTEkymeLNcdsYF4f6iKoxr", "senderPublicKey": "EtZZHS4uqNXY5WPneZ8jY2aA95peXwthJVLzAMxMp379", "proofs": [ "4Xe1oZiFXHFtM3eqFc3LitmXf6shMBSBTXfEDEEQTXQ9FeWJ5CTSy9ubJceutikueX6VvA5wG58keicJFrjt8RDk" ], "script": "base64:AAIFAAAAAAAABbYIAhIECgIICBIECgIICBIECgIIGBIDCgEIEgUKAwgICBIDCgEIEgMKAQgSAwoBCBIECgIICBIECgIICBIECgIICBIDCgEIEgUKAwgIBBIECgIICBIECgIIBBIDCgEIEgMKARgSAwoBCCIDU0VQIgVFTVBUWSIOc3RhdHVzVmVyaWZpZWQiEHN0YXR1c1VudmVyaWZpZWQiFmxhYmVsQ29tbXVuaXR5VmVyaWZpZWQiDGxhYmVsUG9vbHNMcCINZGVmYXVsdExhYmVscyIHdGhyb3dQRCIMdGhyb3dOb0Fzc2V0IhJ0aHJvd0ludmFsaWRUaWNrZXIiD2tleUFkbWluUHViS2V5cyIUa2V5VXNlclBvb2xzQ29udHJhY3QiEmtleUZhY3RvcnlDb250cmFjdCIKa2V5Q3JlYXRlZCIHYXNzZXRJZCIHa2V5TG9nbyIJa2V5VGlja2VyIglrZXlTdGF0dXMiE2tleUFzc2V0UG9vbHNOdW1iZXIiEmtleVRpY2tlclRvQXNzZXRJZCIGdGlja2VyIhJrZXlBc3NldElkVG9UaWNrZXIiIGtleUFtb3VudEFuZFByaWNlQXNz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AAAAAAAAAAFAAAAAmFUrPj5WA==", "height": 2559807, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 881rjhL5QAtMYSxpD9DXoLgQmoSXiDwLw7N2VAMacNZS Next: none Diff:
OldNewDifferences
2222
2323
2424 func throwInvalidTicker () = throw("Invalid ticker")
25-
26-
27-func keyManagerPublicKey () = "%s__managerPublicKey"
28-
29-
30-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
3125
3226
3327 func keyAdminPubKeys () = "%s__adminPubKeys"
7367
7468
7569 func keyAssetName (assetId) = makeString(["%s%s", "assetName", assetId], SEP)
70+
71+
72+func keyManagerVaultAddress () = "%s__managerVaultAddress"
73+
74+
75+func keyManagerPublicKey () = "%s__managerPublicKey"
7676
7777
7878 func keyAssetDescription (assetId) = makeString(["%s%s", "assetDescription", assetId], SEP)
130130 }
131131
132132
133-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
134- case s: String =>
135- fromBase58String(s)
133+func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
134+
135+
136+func managerPublicKeyOrUnit () = {
137+ let managerVaultAddress = getManagerAddressOrFail()
138+ match getString(managerVaultAddress, keyManagerPublicKey()) {
139+ case s: String =>
140+ fromBase58String(s)
141+ case _: Unit =>
142+ unit
143+ case _ =>
144+ throw("Match error")
145+ }
146+ }
147+
148+
149+func isManager (i) = match managerPublicKeyOrUnit() {
150+ case pk: ByteVector =>
151+ (i.callerPublicKey == pk)
136152 case _: Unit =>
137- unit
153+ (i.caller == this)
138154 case _ =>
139155 throw("Match error")
140156 }
141157
142158
143-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
144- case s: String =>
145- fromBase58String(s)
146- case _: Unit =>
147- unit
148- case _ =>
149- throw("Match error")
150-}
151-
152-
153-func mustManager (i) = match managerPublicKeyOrUnit() {
154- case pk: ByteVector =>
155- if ((i.callerPublicKey == pk))
156- then true
157- else throwPD()
158- case _: Unit =>
159- if ((i.caller == this))
160- then true
161- else throwPD()
162- case _ =>
163- throw("Match error")
164-}
159+func mustManager (i) = if (isManager(i))
160+ then true
161+ else throw("permission denied")
165162
166163
167164 func mustAdmin (i) = {
168165 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
169166 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
170167 then true
171- else {
172- let isManager = mustManager(i)
173- if ((isManager == isManager))
174- then true
175- else throw("Strict value is not equal to itself.")
176- }
168+ else mustManager(i)
177169 }
178170
179171
491483
492484
493485 @Callable(i)
494-func setManager (pendingManagerPublicKey) = {
495- let checkCaller = mustManager(i)
496- if ((checkCaller == checkCaller))
497- then {
498- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
499- if ((checkManagerPublicKey == checkManagerPublicKey))
500- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
501- else throw("Strict value is not equal to itself.")
502- }
503- else throw("Strict value is not equal to itself.")
504- }
505-
506-
507-
508-@Callable(i)
509-func confirmManager () = {
510- let pm = pendingManagerPublicKeyOrUnit()
511- let hasPM = if (isDefined(pm))
512- then true
513- else throw("No pending manager")
514- if ((hasPM == hasPM))
515- then {
516- let checkPM = if ((i.callerPublicKey == value(pm)))
517- then true
518- else throw("You are not pending manager")
519- if ((checkPM == checkPM))
520- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
521- else throw("Strict value is not equal to itself.")
522- }
523- else throw("Strict value is not equal to itself.")
524- }
525-
526-
527-
528-@Callable(i)
529486 func isVerifiedREADONLY (assetId) = $Tuple2(nil, isVerified(assetId))
530487
531488
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")
25-
26-
27-func keyManagerPublicKey () = "%s__managerPublicKey"
28-
29-
30-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
3125
3226
3327 func keyAdminPubKeys () = "%s__adminPubKeys"
3428
3529
3630 func keyUserPoolsContract () = "%s__userPoolsContract"
3731
3832
3933 func keyFactoryContract () = "%s__factoryContract"
4034
4135
4236 func keyCreated (assetId) = (("created_<" + assetId) + ">")
4337
4438
4539 func keyLogo (assetId) = (("logo_<" + assetId) + ">")
4640
4741
4842 func keyTicker (assetId) = (("ticker_<" + assetId) + ">")
4943
5044
5145 func keyStatus (assetId) = (("status_<" + assetId) + ">")
5246
5347
5448 func keyAssetPoolsNumber (assetId) = makeString(["%s%s", "pools", assetId], SEP)
5549
5650
5751 func keyTickerToAssetId (ticker) = makeString(["%s%s", "ticker2assetId", ticker], SEP)
5852
5953
6054 func keyAssetIdToTicker (assetId) = makeString(["%s%s", "assetId2ticker", assetId], SEP)
6155
6256
6357 func keyAmountAndPriceAssetsToLpAsset (amountAsset,priceAsset) = makeString(["%s%s%s", "amountAndPriceAssetsToLpAsset", amountAsset, priceAsset], SEP)
6458
6559
6660 func keyLpAssetToAmountAndPriceAssets (lpAsset) = makeString(["%s%s", "lpAssetToAmountAndPriceAssets", lpAsset], SEP)
6761
6862
6963 func keyAssetLabels (assetId) = makeString(["%s%s", "labels", assetId], SEP)
7064
7165
7266 func keyLabels () = makeString(["%s", "labels"], SEP)
7367
7468
7569 func keyAssetName (assetId) = makeString(["%s%s", "assetName", assetId], SEP)
70+
71+
72+func keyManagerVaultAddress () = "%s__managerVaultAddress"
73+
74+
75+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 managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
134- case s: String =>
135- fromBase58String(s)
133+func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
134+
135+
136+func managerPublicKeyOrUnit () = {
137+ let managerVaultAddress = getManagerAddressOrFail()
138+ match getString(managerVaultAddress, keyManagerPublicKey()) {
139+ case s: String =>
140+ fromBase58String(s)
141+ case _: Unit =>
142+ unit
143+ case _ =>
144+ throw("Match error")
145+ }
146+ }
147+
148+
149+func isManager (i) = match managerPublicKeyOrUnit() {
150+ case pk: ByteVector =>
151+ (i.callerPublicKey == pk)
136152 case _: Unit =>
137- unit
153+ (i.caller == this)
138154 case _ =>
139155 throw("Match error")
140156 }
141157
142158
143-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
144- case s: String =>
145- fromBase58String(s)
146- case _: Unit =>
147- unit
148- case _ =>
149- throw("Match error")
150-}
151-
152-
153-func mustManager (i) = match managerPublicKeyOrUnit() {
154- case pk: ByteVector =>
155- if ((i.callerPublicKey == pk))
156- then true
157- else throwPD()
158- case _: Unit =>
159- if ((i.caller == this))
160- then true
161- else throwPD()
162- case _ =>
163- throw("Match error")
164-}
159+func mustManager (i) = if (isManager(i))
160+ then true
161+ else throw("permission denied")
165162
166163
167164 func mustAdmin (i) = {
168165 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
169166 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
170167 then true
171- else {
172- let isManager = mustManager(i)
173- if ((isManager == isManager))
174- then true
175- else throw("Strict value is not equal to itself.")
176- }
168+ else mustManager(i)
177169 }
178170
179171
180172 func isCreated (assetId) = valueOrElse(getBoolean(keyCreated(assetId)), false)
181173
182174
183175 func verifiedToStatus (verified) = if (verified)
184176 then statusVerified
185177 else statusUnverified
186178
187179
188180 func addLabelActions (assetId,label,throwOnError) = {
189181 let labels = getLabels()
190182 let assetLabels = getAssetLabels(assetId)
191183 let checkLabel = if (containsElement(labels, label))
192184 then true
193185 else throw("Label doesn't exist")
194186 if ((checkLabel == checkLabel))
195187 then {
196188 let newAssetLabels = if (containsElement(assetLabels, label))
197189 then if (throwOnError)
198190 then throw("Label has already been added")
199191 else assetLabels
200192 else (assetLabels :+ label)
201193 [StringEntry(keyAssetLabels(assetId), makeString(newAssetLabels, SEP))]
202194 }
203195 else throw("Strict value is not equal to itself.")
204196 }
205197
206198
207199 func deleteLabelActions (assetId,label,throwOnError) = {
208200 let assetLabels = getAssetLabels(assetId)
209201 let newAssetLabels = if (containsElement(assetLabels, label))
210202 then removeByIndex(assetLabels, value(indexOf(assetLabels, label)))
211203 else if (throwOnError)
212204 then throw("Label wasn't added")
213205 else assetLabels
214206 [StringEntry(keyAssetLabels(assetId), makeString(newAssetLabels, SEP))]
215207 }
216208
217209
218210 func setVerifiedActions (assetId,verified) = {
219211 let labelCommunityVerifiedActions = if (verified)
220212 then addLabelActions(assetId, labelCommunityVerified, false)
221213 else deleteLabelActions(assetId, labelCommunityVerified, false)
222214 ([IntegerEntry(keyStatus(assetId), verifiedToStatus(verified))] ++ labelCommunityVerifiedActions)
223215 }
224216
225217
226218 @Callable(i)
227219 func setAssetName (assetID,assetName) = {
228220 let checkCaller = mustAdmin(i)
229221 if ((checkCaller == checkCaller))
230222 then [StringEntry(keyAssetName(assetID), assetName)]
231223 else throw("Strict value is not equal to itself.")
232224 }
233225
234226
235227
236228 @Callable(i)
237229 func setAssetDescription (assetID,assetDescription) = {
238230 let checkCaller = mustAdmin(i)
239231 if ((checkCaller == checkCaller))
240232 then [StringEntry(keyAssetDescription(assetID), assetDescription)]
241233 else throw("Strict value is not equal to itself.")
242234 }
243235
244236
245237
246238 @Callable(i)
247239 func constructor (userPoolsContract,labels) = {
248240 let checkCaller = mustManager(i)
249241 if ((checkCaller == checkCaller))
250242 then {
251243 let checksAddress = valueOrErrorMessage(addressFromString(userPoolsContract), "Invalid address")
252244 if ((checksAddress == checksAddress))
253245 then [StringEntry(keyUserPoolsContract(), userPoolsContract), StringEntry(keyLabels(), makeString((defaultLabels ++ labels), SEP))]
254246 else throw("Strict value is not equal to itself.")
255247 }
256248 else throw("Strict value is not equal to itself.")
257249 }
258250
259251
260252
261253 @Callable(i)
262254 func constructorV2 (factoryContract) = {
263255 let checkCaller = mustManager(i)
264256 if ((checkCaller == checkCaller))
265257 then {
266258 let checkAddress = valueOrErrorMessage(addressFromString(factoryContract), "invalid factory contract address")
267259 if ((checkAddress == checkAddress))
268260 then [StringEntry(keyFactoryContract(), factoryContract)]
269261 else throw("Strict value is not equal to itself.")
270262 }
271263 else throw("Strict value is not equal to itself.")
272264 }
273265
274266
275267
276268 @Callable(i)
277269 func addAssetsLink (amountAsset,priceAsset,lpAsset) = {
278270 let checkCaller = mustAdmin(i)
279271 if ((checkCaller == checkCaller))
280272 then [StringEntry(keyAmountAndPriceAssetsToLpAsset(amountAsset, priceAsset), lpAsset), StringEntry(keyLpAssetToAmountAndPriceAssets(lpAsset), makeString([amountAsset, priceAsset], SEP))]
281273 else throw("Strict value is not equal to itself.")
282274 }
283275
284276
285277
286278 @Callable(i)
287279 func increaseAssetPoolsNumber (assetId) = {
288280 let checkCaller = mustAdmin(i)
289281 if ((checkCaller == checkCaller))
290282 then {
291283 let assetPoolsNumberKey = keyAssetPoolsNumber(assetId)
292284 let assetPoolsNumber = valueOrElse(getInteger(assetPoolsNumberKey), 0)
293285 [IntegerEntry(assetPoolsNumberKey, (assetPoolsNumber + 1))]
294286 }
295287 else throw("Strict value is not equal to itself.")
296288 }
297289
298290
299291
300292 @Callable(i)
301293 func createLabel (label) = {
302294 let labels = getLabels()
303295 let checkCaller = mustAdmin(i)
304296 if ((checkCaller == checkCaller))
305297 then {
306298 let checkLabel = [if (!(contains(label, SEP)))
307299 then true
308300 else throw("Invalid label name"), if (!(containsElement(labels, label)))
309301 then true
310302 else throw("Label exists")]
311303 if ((checkLabel == checkLabel))
312304 then [StringEntry(keyLabels(), makeString((labels :+ label), SEP))]
313305 else throw("Strict value is not equal to itself.")
314306 }
315307 else throw("Strict value is not equal to itself.")
316308 }
317309
318310
319311
320312 @Callable(i)
321313 func dropLabel (label) = {
322314 let labels = getLabels()
323315 let checkCaller = mustManager(i)
324316 if ((checkCaller == checkCaller))
325317 then {
326318 let checkLabel = if (containsElement(labels, label))
327319 then true
328320 else throw("Label doesn't exist")
329321 if ((checkLabel == checkLabel))
330322 then [StringEntry(keyLabels(), makeString(removeByIndex(labels, value(indexOf(labels, label))), SEP))]
331323 else throw("Strict value is not equal to itself.")
332324 }
333325 else throw("Strict value is not equal to itself.")
334326 }
335327
336328
337329
338330 @Callable(i)
339331 func addLabel (assetId,label) = {
340332 let checkCaller = mustAdmin(i)
341333 if ((checkCaller == checkCaller))
342334 then addLabelActions(assetId, label, true)
343335 else throw("Strict value is not equal to itself.")
344336 }
345337
346338
347339
348340 @Callable(i)
349341 func deleteLabel (assetId,label) = {
350342 let checkCaller = mustAdmin(i)
351343 if ((checkCaller == checkCaller))
352344 then deleteLabelActions(assetId, label, true)
353345 else throw("Strict value is not equal to itself.")
354346 }
355347
356348
357349
358350 @Callable(i)
359351 func updateTicker (assetId,ticker) = {
360352 let checkCaller = mustAdmin(i)
361353 if ((checkCaller == checkCaller))
362354 then {
363355 let checkAsset = if (isCreated(assetId))
364356 then true
365357 else throwNoAsset()
366358 if ((checkAsset == checkAsset))
367359 then {
368360 let checkTicker = if ((ticker != ""))
369361 then true
370362 else throwInvalidTicker()
371363 if ((checkTicker == checkTicker))
372364 then {
373365 let deleteActions = ( match getString(keyTickerToAssetId(ticker)) {
374366 case assetIdOld: String =>
375367 [DeleteEntry(keyAssetIdToTicker(assetIdOld))]
376368 case _: Unit =>
377369 nil
378370 case _ =>
379371 throw("Match error")
380372 } ++ match getString(keyAssetIdToTicker(assetId)) {
381373 case tickerOld: String =>
382374 [DeleteEntry(keyTickerToAssetId(tickerOld))]
383375 case _: Unit =>
384376 nil
385377 case _ =>
386378 throw("Match error")
387379 })
388380 let updateActions = [StringEntry(keyAssetIdToTicker(assetId), ticker), StringEntry(keyTickerToAssetId(ticker), assetId)]
389381 (deleteActions ++ updateActions)
390382 }
391383 else throw("Strict value is not equal to itself.")
392384 }
393385 else throw("Strict value is not equal to itself.")
394386 }
395387 else throw("Strict value is not equal to itself.")
396388 }
397389
398390
399391
400392 @Callable(i)
401393 func deleteTicker (assetId) = {
402394 let checkCaller = mustAdmin(i)
403395 if ((checkCaller == checkCaller))
404396 then {
405397 let ticker = valueOrErrorMessage(getString(keyAssetIdToTicker(assetId)), "Invalid asset")
406398 [DeleteEntry(keyAssetIdToTicker(assetId)), DeleteEntry(keyTickerToAssetId(ticker))]
407399 }
408400 else throw("Strict value is not equal to itself.")
409401 }
410402
411403
412404
413405 @Callable(i)
414406 func createOrUpdate (assetId,logo,verified) = {
415407 let checkCaller = mustAdmin(i)
416408 if ((checkCaller == checkCaller))
417409 then {
418410 let isCreatedNow = !(isCreated(assetId))
419411 if ((isCreatedNow == isCreatedNow))
420412 then {
421413 let setLogoActions = if ((logo == ""))
422414 then nil
423415 else [StringEntry(keyLogo(assetId), logo)]
424416 $Tuple2((([BooleanEntry(keyCreated(assetId), true)] ++ setLogoActions) ++ setVerifiedActions(assetId, verified)), isCreatedNow)
425417 }
426418 else throw("Strict value is not equal to itself.")
427419 }
428420 else throw("Strict value is not equal to itself.")
429421 }
430422
431423
432424
433425 @Callable(i)
434426 func setLogo (assetId,logo) = {
435427 let checks = [mustAdmin(i), if (isCreated(assetId))
436428 then true
437429 else throwNoAsset()]
438430 if ((checks == checks))
439431 then {
440432 let action = if ((logo == ""))
441433 then DeleteEntry(keyLogo(assetId))
442434 else StringEntry(keyLogo(assetId), logo)
443435 [action]
444436 }
445437 else throw("Strict value is not equal to itself.")
446438 }
447439
448440
449441
450442 @Callable(i)
451443 func setVerified (assetId,verified) = {
452444 let checks = [mustAdmin(i), if (isCreated(assetId))
453445 then true
454446 else throwNoAsset()]
455447 if ((checks == checks))
456448 then {
457449 let onVerificationLossInv = if (!(verified))
458450 then {
459451 let factoryContract = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyFactoryContract())), "invalid factory contract address")
460452 invoke(factoryContract, "onVerificationLoss", [assetId], nil)
461453 }
462454 else unit
463455 if ((onVerificationLossInv == onVerificationLossInv))
464456 then $Tuple2(setVerifiedActions(assetId, verified), unit)
465457 else throw("Strict value is not equal to itself.")
466458 }
467459 else throw("Strict value is not equal to itself.")
468460 }
469461
470462
471463
472464 @Callable(i)
473465 func onEliminate (assetId) = {
474466 let poolsNumber = valueOrElse(getInteger(keyAssetPoolsNumber(assetId)), 0)
475467 let actions = if ((poolsNumber > 0))
476468 then nil
477469 else [DeleteEntry(keyLogo(assetId))]
478470 $Tuple2(actions, unit)
479471 }
480472
481473
482474
483475 @Callable(i)
484476 func setAdmins (adminPubKeys) = {
485477 let checkCaller = mustManager(i)
486478 if ((checkCaller == checkCaller))
487479 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
488480 else throw("Strict value is not equal to itself.")
489481 }
490482
491483
492484
493485 @Callable(i)
494-func setManager (pendingManagerPublicKey) = {
495- let checkCaller = mustManager(i)
496- if ((checkCaller == checkCaller))
497- then {
498- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
499- if ((checkManagerPublicKey == checkManagerPublicKey))
500- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
501- else throw("Strict value is not equal to itself.")
502- }
503- else throw("Strict value is not equal to itself.")
504- }
505-
506-
507-
508-@Callable(i)
509-func confirmManager () = {
510- let pm = pendingManagerPublicKeyOrUnit()
511- let hasPM = if (isDefined(pm))
512- then true
513- else throw("No pending manager")
514- if ((hasPM == hasPM))
515- then {
516- let checkPM = if ((i.callerPublicKey == value(pm)))
517- then true
518- else throw("You are not pending manager")
519- if ((checkPM == checkPM))
520- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
521- else throw("Strict value is not equal to itself.")
522- }
523- else throw("Strict value is not equal to itself.")
524- }
525-
526-
527-
528-@Callable(i)
529486 func isVerifiedREADONLY (assetId) = $Tuple2(nil, isVerified(assetId))
530487
531488
532489 @Verifier(tx)
533490 func verify () = {
534491 let targetPublicKey = match managerPublicKeyOrUnit() {
535492 case pk: ByteVector =>
536493 pk
537494 case _: Unit =>
538495 tx.senderPublicKey
539496 case _ =>
540497 throw("Match error")
541498 }
542499 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
543500 }
544501

github/deemru/w8io/026f985 
62.33 ms