tx · 8RSGP9VENZ9F6H8saRG7CSPx4EqsdmHCr53Svmx1s3JZ 3Mr8pwBp54HbQ37tV6277cRkeJs9h6VtpX7: -0.01900000 Waves 2023.03.02 11:16 [2472185] smart account 3Mr8pwBp54HbQ37tV6277cRkeJs9h6VtpX7 > SELF 0.00000000 Waves
{ "type": 13, "id": "8RSGP9VENZ9F6H8saRG7CSPx4EqsdmHCr53Svmx1s3JZ", "fee": 1900000, "feeAssetId": null, "timestamp": 1677744981631, "version": 1, "sender": "3Mr8pwBp54HbQ37tV6277cRkeJs9h6VtpX7", "senderPublicKey": "BipwwNm1AXatVUXJb8S5UC7SSQhG4JdhYwQN1wJ6LPMj", "proofs": [ "dQKdciba475NWiDFCnZTQxAQo6gLRX8w6B5obqKfwfvBqCgB15zjZ62muvinXZsZ7WTVdUuH3TERKKPFtfWWJHo" ], "script": "base64:AAIFAAAAAAAAAGMIAhIECgIIGBIDCgEIEgUKAwgICBIDCgEIEgMKAQgSAwoBCBIECgIICBIECgIICBIECgIICBIDCgEIEgUKAwgIBBIECgIICBIECgIIBBIDCgEIEgMKARgSAwoBCBIAEgMKAQgAAAApAAAAAANTRVACAAAAAl9fAAAAAAVFTVBUWQIAAAAAAAAAAA5zdGF0dXNWZXJpZmllZAAAAAAAAAAAAgAAAAAQc3RhdHVzVW52ZXJpZmllZAAAAAAAAAAAAAAAAAAWbGFiZWxDb21tdW5pdHlWZXJpZmllZAIAAAASQ09NTVVOSVRZX1ZFUklGSUVEAAAAAAxsYWJlbFBvb2xzTHACAAAACFBPT0xTX0xQAAAAAA1kZWZhdWx0TGFiZWxzCQAETAAAAAIFAAAAFmxhYmVsQ29tbXVuaXR5VmVyaWZpZWQJAARMAAAAAgUAAAAMbGFiZWxQb29sc0xwBQAAAANuaWwBAAAAB3Rocm93UEQAAAAACQAAAgAAAAECAAAAEVBlcm1pc3Npb24gZGVuaWVkAQAAAAx0aHJvd05vQXNzZXQAAAAACQAAAgAAAAECAAAAFEFzc2V0IGRvZXN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UFET05MWQAAAAEAAAAHYXNzZXRJZAkABRQAAAACBQAAAANuaWwJAQAAAAppc1ZlcmlmaWVkAAAAAQUAAAAHYXNzZXRJZAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAD3RhcmdldFB1YmxpY0tleQQAAAAHJG1hdGNoMAkBAAAAFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAJwawUAAAAHJG1hdGNoMAUAAAACcGsDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXn97ltr", "chainId": 84, "height": 2472185, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEP = "__" | |
5 | + | ||
6 | + | let EMPTY = "" | |
7 | + | ||
8 | + | let statusVerified = 2 | |
9 | + | ||
10 | + | let statusUnverified = 0 | |
11 | + | ||
12 | + | let labelCommunityVerified = "COMMUNITY_VERIFIED" | |
13 | + | ||
14 | + | let labelPoolsLp = "POOLS_LP" | |
15 | + | ||
16 | + | let defaultLabels = [labelCommunityVerified, labelPoolsLp] | |
17 | + | ||
18 | + | func throwPD () = throw("Permission denied") | |
19 | + | ||
20 | + | ||
21 | + | func throwNoAsset () = throw("Asset doesn't exists") | |
22 | + | ||
23 | + | ||
24 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
25 | + | ||
26 | + | ||
27 | + | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
28 | + | ||
29 | + | ||
30 | + | func keyAdminPubKeys () = "%s__adminPubKeys" | |
31 | + | ||
32 | + | ||
33 | + | func keyUserPoolsContract () = "%s__userPoolsContract" | |
34 | + | ||
35 | + | ||
36 | + | func keyFactoryContract () = "%s__factoryContract" | |
37 | + | ||
38 | + | ||
39 | + | func keyCreated (assetId) = (("created_<" + assetId) + ">") | |
40 | + | ||
41 | + | ||
42 | + | func keyLogo (assetId) = (("logo_<" + assetId) + ">") | |
43 | + | ||
44 | + | ||
45 | + | func keyTicker (assetId) = (("ticker_<" + assetId) + ">") | |
46 | + | ||
47 | + | ||
48 | + | func keyStatus (assetId) = (("status_<" + assetId) + ">") | |
49 | + | ||
50 | + | ||
51 | + | func keyAssetPoolsNumber (assetId) = makeString(["%s%s", "pools", assetId], SEP) | |
52 | + | ||
53 | + | ||
54 | + | func keyTickerToAssetId (ticker) = makeString(["%s%s", "ticker2assetId", ticker], SEP) | |
55 | + | ||
56 | + | ||
57 | + | func keyAssetIdToTicker (assetId) = makeString(["%s%s", "assetId2ticker", assetId], SEP) | |
58 | + | ||
59 | + | ||
60 | + | func keyAmountAndPriceAssetsToLpAsset (amountAsset,priceAsset) = makeString(["%s%s%s", "amountAndPriceAssetsToLpAsset", amountAsset, priceAsset], SEP) | |
61 | + | ||
62 | + | ||
63 | + | func keyLpAssetToAmountAndPriceAssets (lpAsset) = makeString(["%s%s", "lpAssetToAmountAndPriceAssets", lpAsset], SEP) | |
64 | + | ||
65 | + | ||
66 | + | func keyAssetLabels (assetId) = makeString(["%s%s", "labels", assetId], SEP) | |
67 | + | ||
68 | + | ||
69 | + | func keyLabels () = makeString(["%s", "labels"], SEP) | |
70 | + | ||
71 | + | ||
72 | + | func getValueOrFail (address,key,type) = { | |
73 | + | let error = makeString(["mandatory ", toString(address), ".", key, " is not defined"], "") | |
74 | + | valueOrErrorMessage( match type { | |
75 | + | case str: String => | |
76 | + | getString(address, key) | |
77 | + | case int: Int => | |
78 | + | getInteger(address, key) | |
79 | + | case _ => | |
80 | + | throw("invalid entry type") | |
81 | + | }, error) | |
82 | + | } | |
83 | + | ||
84 | + | ||
85 | + | func getStrOrFail (address,key) = { | |
86 | + | let @ = getValueOrFail(address, key, "") | |
87 | + | if ($isInstanceOf(@, "String")) | |
88 | + | then @ | |
89 | + | else throw("Couldn't cast Int|String to String") | |
90 | + | } | |
91 | + | ||
92 | + | ||
93 | + | func getIntOrFail (address,key) = { | |
94 | + | let @ = getValueOrFail(address, key, 0) | |
95 | + | if ($isInstanceOf(@, "Int")) | |
96 | + | then @ | |
97 | + | else throw("Couldn't cast Int|String to Int") | |
98 | + | } | |
99 | + | ||
100 | + | ||
101 | + | func isVerified (assetId) = (valueOrElse(getInteger(keyStatus(assetId)), statusUnverified) == statusVerified) | |
102 | + | ||
103 | + | ||
104 | + | func getLabels () = match getString(keyLabels()) { | |
105 | + | case s: String => | |
106 | + | if ((size(s) == 0)) | |
107 | + | then nil | |
108 | + | else split(s, SEP) | |
109 | + | case _ => | |
110 | + | nil | |
111 | + | } | |
112 | + | ||
113 | + | ||
114 | + | func getAssetLabels (assetId) = match getString(keyAssetLabels(assetId)) { | |
115 | + | case s: String => | |
116 | + | if ((size(s) == 0)) | |
117 | + | then nil | |
118 | + | else split(s, SEP) | |
119 | + | case _ => | |
120 | + | nil | |
121 | + | } | |
122 | + | ||
123 | + | ||
124 | + | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
125 | + | case s: String => | |
126 | + | fromBase58String(s) | |
127 | + | case _: Unit => | |
128 | + | unit | |
129 | + | case _ => | |
130 | + | throw("Match error") | |
131 | + | } | |
132 | + | ||
133 | + | ||
134 | + | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
135 | + | case s: String => | |
136 | + | fromBase58String(s) | |
137 | + | case _: Unit => | |
138 | + | unit | |
139 | + | case _ => | |
140 | + | throw("Match error") | |
141 | + | } | |
142 | + | ||
143 | + | ||
144 | + | func mustManager (i) = match managerPublicKeyOrUnit() { | |
145 | + | case pk: ByteVector => | |
146 | + | if ((i.callerPublicKey == pk)) | |
147 | + | then true | |
148 | + | else throwPD() | |
149 | + | case _: Unit => | |
150 | + | if ((i.caller == this)) | |
151 | + | then true | |
152 | + | else throwPD() | |
153 | + | case _ => | |
154 | + | throw("Match error") | |
155 | + | } | |
156 | + | ||
157 | + | ||
158 | + | func mustAdmin (i) = { | |
159 | + | let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP) | |
160 | + | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
161 | + | then true | |
162 | + | else { | |
163 | + | let isManager = mustManager(i) | |
164 | + | if ((isManager == isManager)) | |
165 | + | then true | |
166 | + | else throw("Strict value is not equal to itself.") | |
167 | + | } | |
168 | + | } | |
169 | + | ||
170 | + | ||
171 | + | func isCreated (assetId) = valueOrElse(getBoolean(keyCreated(assetId)), false) | |
172 | + | ||
173 | + | ||
174 | + | func verifiedToStatus (verified) = if (verified) | |
175 | + | then statusVerified | |
176 | + | else statusUnverified | |
177 | + | ||
178 | + | ||
179 | + | func addLabelActions (assetId,label,throwOnError) = { | |
180 | + | let labels = getLabels() | |
181 | + | let assetLabels = getAssetLabels(assetId) | |
182 | + | let checkLabel = if (containsElement(labels, label)) | |
183 | + | then true | |
184 | + | else throw("Label doesn't exist") | |
185 | + | if ((checkLabel == checkLabel)) | |
186 | + | then { | |
187 | + | let newAssetLabels = if (containsElement(assetLabels, label)) | |
188 | + | then if (throwOnError) | |
189 | + | then throw("Label has already been added") | |
190 | + | else assetLabels | |
191 | + | else (assetLabels :+ label) | |
192 | + | [StringEntry(keyAssetLabels(assetId), makeString(newAssetLabels, SEP))] | |
193 | + | } | |
194 | + | else throw("Strict value is not equal to itself.") | |
195 | + | } | |
196 | + | ||
197 | + | ||
198 | + | func deleteLabelActions (assetId,label,throwOnError) = { | |
199 | + | let assetLabels = getAssetLabels(assetId) | |
200 | + | let newAssetLabels = if (containsElement(assetLabels, label)) | |
201 | + | then removeByIndex(assetLabels, value(indexOf(assetLabels, label))) | |
202 | + | else if (throwOnError) | |
203 | + | then throw("Label wasn't added") | |
204 | + | else assetLabels | |
205 | + | [StringEntry(keyAssetLabels(assetId), makeString(newAssetLabels, SEP))] | |
206 | + | } | |
207 | + | ||
208 | + | ||
209 | + | func setVerifiedActions (assetId,verified) = { | |
210 | + | let labelCommunityVerifiedActions = if (verified) | |
211 | + | then addLabelActions(assetId, labelCommunityVerified, false) | |
212 | + | else deleteLabelActions(assetId, labelCommunityVerified, false) | |
213 | + | ([IntegerEntry(keyStatus(assetId), verifiedToStatus(verified))] ++ labelCommunityVerifiedActions) | |
214 | + | } | |
215 | + | ||
216 | + | ||
217 | + | func updateTickerActions (assetId,ticker) = { | |
218 | + | let checkTicker = { | |
219 | + | let linkedAssetIdOrUnit = getString(keyTickerToAssetId(ticker)) | |
220 | + | let tickerIsValid = if ((ticker != "")) | |
221 | + | then if ((linkedAssetIdOrUnit == unit)) | |
222 | + | then true | |
223 | + | else (value(linkedAssetIdOrUnit) == assetId) | |
224 | + | else false | |
225 | + | if (tickerIsValid) | |
226 | + | then true | |
227 | + | else throw("Invalid ticker") | |
228 | + | } | |
229 | + | if ((checkTicker == checkTicker)) | |
230 | + | then [StringEntry(keyAssetIdToTicker(assetId), ticker), StringEntry(keyTickerToAssetId(ticker), assetId)] | |
231 | + | else throw("Strict value is not equal to itself.") | |
232 | + | } | |
233 | + | ||
234 | + | ||
235 | + | @Callable(i) | |
236 | + | func constructor (userPoolsContract,labels) = { | |
237 | + | let checkCaller = mustManager(i) | |
238 | + | if ((checkCaller == checkCaller)) | |
239 | + | then { | |
240 | + | let checksAddress = valueOrErrorMessage(addressFromString(userPoolsContract), "Invalid address") | |
241 | + | if ((checksAddress == checksAddress)) | |
242 | + | then [StringEntry(keyUserPoolsContract(), userPoolsContract), StringEntry(keyLabels(), makeString((defaultLabels ++ labels), SEP))] | |
243 | + | else throw("Strict value is not equal to itself.") | |
244 | + | } | |
245 | + | else throw("Strict value is not equal to itself.") | |
246 | + | } | |
247 | + | ||
248 | + | ||
249 | + | ||
250 | + | @Callable(i) | |
251 | + | func constructorV2 (factoryContract) = { | |
252 | + | let checkCaller = mustManager(i) | |
253 | + | if ((checkCaller == checkCaller)) | |
254 | + | then { | |
255 | + | let checkAddress = valueOrErrorMessage(addressFromString(factoryContract), "invalid factory contract address") | |
256 | + | if ((checkAddress == checkAddress)) | |
257 | + | then [StringEntry(keyFactoryContract(), factoryContract)] | |
258 | + | else throw("Strict value is not equal to itself.") | |
259 | + | } | |
260 | + | else throw("Strict value is not equal to itself.") | |
261 | + | } | |
262 | + | ||
263 | + | ||
264 | + | ||
265 | + | @Callable(i) | |
266 | + | func addAssetsLink (amountAsset,priceAsset,lpAsset) = { | |
267 | + | let checkCaller = mustAdmin(i) | |
268 | + | if ((checkCaller == checkCaller)) | |
269 | + | then [StringEntry(keyAmountAndPriceAssetsToLpAsset(amountAsset, priceAsset), lpAsset), StringEntry(keyLpAssetToAmountAndPriceAssets(lpAsset), makeString([amountAsset, priceAsset], SEP))] | |
270 | + | else throw("Strict value is not equal to itself.") | |
271 | + | } | |
272 | + | ||
273 | + | ||
274 | + | ||
275 | + | @Callable(i) | |
276 | + | func increaseAssetPoolsNumber (assetId) = { | |
277 | + | let checkCaller = mustAdmin(i) | |
278 | + | if ((checkCaller == checkCaller)) | |
279 | + | then { | |
280 | + | let assetPoolsNumberKey = keyAssetPoolsNumber(assetId) | |
281 | + | let assetPoolsNumber = valueOrElse(getInteger(assetPoolsNumberKey), 0) | |
282 | + | [IntegerEntry(assetPoolsNumberKey, (assetPoolsNumber + 1))] | |
283 | + | } | |
284 | + | else throw("Strict value is not equal to itself.") | |
285 | + | } | |
286 | + | ||
287 | + | ||
288 | + | ||
289 | + | @Callable(i) | |
290 | + | func createLabel (label) = { | |
291 | + | let labels = getLabels() | |
292 | + | let checkCaller = mustAdmin(i) | |
293 | + | if ((checkCaller == checkCaller)) | |
294 | + | then { | |
295 | + | let checkLabel = [if (!(contains(label, SEP))) | |
296 | + | then true | |
297 | + | else throw("Invalid label name"), if (!(containsElement(labels, label))) | |
298 | + | then true | |
299 | + | else throw("Label exists")] | |
300 | + | if ((checkLabel == checkLabel)) | |
301 | + | then [StringEntry(keyLabels(), makeString((labels :+ label), SEP))] | |
302 | + | else throw("Strict value is not equal to itself.") | |
303 | + | } | |
304 | + | else throw("Strict value is not equal to itself.") | |
305 | + | } | |
306 | + | ||
307 | + | ||
308 | + | ||
309 | + | @Callable(i) | |
310 | + | func dropLabel (label) = { | |
311 | + | let labels = getLabels() | |
312 | + | let checkCaller = mustManager(i) | |
313 | + | if ((checkCaller == checkCaller)) | |
314 | + | then { | |
315 | + | let checkLabel = if (containsElement(labels, label)) | |
316 | + | then true | |
317 | + | else throw("Label doesn't exist") | |
318 | + | if ((checkLabel == checkLabel)) | |
319 | + | then [StringEntry(keyLabels(), makeString(removeByIndex(labels, value(indexOf(labels, label))), SEP))] | |
320 | + | else throw("Strict value is not equal to itself.") | |
321 | + | } | |
322 | + | else throw("Strict value is not equal to itself.") | |
323 | + | } | |
324 | + | ||
325 | + | ||
326 | + | ||
327 | + | @Callable(i) | |
328 | + | func addLabel (assetId,label) = { | |
329 | + | let checkCaller = mustAdmin(i) | |
330 | + | if ((checkCaller == checkCaller)) | |
331 | + | then addLabelActions(assetId, label, true) | |
332 | + | else throw("Strict value is not equal to itself.") | |
333 | + | } | |
334 | + | ||
335 | + | ||
336 | + | ||
337 | + | @Callable(i) | |
338 | + | func deleteLabel (assetId,label) = { | |
339 | + | let checkCaller = mustAdmin(i) | |
340 | + | if ((checkCaller == checkCaller)) | |
341 | + | then deleteLabelActions(assetId, label, true) | |
342 | + | else throw("Strict value is not equal to itself.") | |
343 | + | } | |
344 | + | ||
345 | + | ||
346 | + | ||
347 | + | @Callable(i) | |
348 | + | func updateTicker (assetId,ticker) = { | |
349 | + | let checkCaller = mustAdmin(i) | |
350 | + | if ((checkCaller == checkCaller)) | |
351 | + | then { | |
352 | + | let checkAsset = if (isCreated(assetId)) | |
353 | + | then true | |
354 | + | else throwNoAsset() | |
355 | + | if ((checkAsset == checkAsset)) | |
356 | + | then updateTickerActions(assetId, ticker) | |
357 | + | else throw("Strict value is not equal to itself.") | |
358 | + | } | |
359 | + | else throw("Strict value is not equal to itself.") | |
360 | + | } | |
361 | + | ||
362 | + | ||
363 | + | ||
364 | + | @Callable(i) | |
365 | + | func deleteTicker (assetId) = { | |
366 | + | let checkCaller = mustAdmin(i) | |
367 | + | if ((checkCaller == checkCaller)) | |
368 | + | then { | |
369 | + | let ticker = valueOrErrorMessage(getString(keyAssetIdToTicker(assetId)), "Invalid asset") | |
370 | + | [DeleteEntry(keyAssetIdToTicker(assetId)), DeleteEntry(keyTickerToAssetId(ticker))] | |
371 | + | } | |
372 | + | else throw("Strict value is not equal to itself.") | |
373 | + | } | |
374 | + | ||
375 | + | ||
376 | + | ||
377 | + | @Callable(i) | |
378 | + | func createOrUpdate (assetId,logo,verified) = { | |
379 | + | let checkCaller = mustAdmin(i) | |
380 | + | if ((checkCaller == checkCaller)) | |
381 | + | then { | |
382 | + | let isCreatedNow = !(isCreated(assetId)) | |
383 | + | if ((isCreatedNow == isCreatedNow)) | |
384 | + | then { | |
385 | + | let setLogoActions = if ((logo == "")) | |
386 | + | then nil | |
387 | + | else [StringEntry(keyLogo(assetId), logo)] | |
388 | + | $Tuple2((([BooleanEntry(keyCreated(assetId), true)] ++ setLogoActions) ++ setVerifiedActions(assetId, verified)), isCreatedNow) | |
389 | + | } | |
390 | + | else throw("Strict value is not equal to itself.") | |
391 | + | } | |
392 | + | else throw("Strict value is not equal to itself.") | |
393 | + | } | |
394 | + | ||
395 | + | ||
396 | + | ||
397 | + | @Callable(i) | |
398 | + | func setLogo (assetId,logo) = { | |
399 | + | let checks = [mustAdmin(i), if (isCreated(assetId)) | |
400 | + | then true | |
401 | + | else throwNoAsset()] | |
402 | + | if ((checks == checks)) | |
403 | + | then { | |
404 | + | let action = if ((logo == "")) | |
405 | + | then DeleteEntry(keyLogo(assetId)) | |
406 | + | else StringEntry(keyLogo(assetId), logo) | |
407 | + | [action] | |
408 | + | } | |
409 | + | else throw("Strict value is not equal to itself.") | |
410 | + | } | |
411 | + | ||
412 | + | ||
413 | + | ||
414 | + | @Callable(i) | |
415 | + | func setVerified (assetId,verified) = { | |
416 | + | let checks = [mustAdmin(i), if (isCreated(assetId)) | |
417 | + | then true | |
418 | + | else throwNoAsset()] | |
419 | + | if ((checks == checks)) | |
420 | + | then { | |
421 | + | let onVerificationLossInv = if (!(verified)) | |
422 | + | then { | |
423 | + | let factoryContract = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyFactoryContract())), "invalid factory contract address") | |
424 | + | invoke(factoryContract, "onVerificationLoss", [assetId], nil) | |
425 | + | } | |
426 | + | else unit | |
427 | + | if ((onVerificationLossInv == onVerificationLossInv)) | |
428 | + | then $Tuple2(setVerifiedActions(assetId, verified), unit) | |
429 | + | else throw("Strict value is not equal to itself.") | |
430 | + | } | |
431 | + | else throw("Strict value is not equal to itself.") | |
432 | + | } | |
433 | + | ||
434 | + | ||
435 | + | ||
436 | + | @Callable(i) | |
437 | + | func onEliminate (assetId) = { | |
438 | + | let poolsNumber = valueOrElse(getInteger(keyAssetPoolsNumber(assetId)), 0) | |
439 | + | let actions = if ((poolsNumber > 0)) | |
440 | + | then nil | |
441 | + | else [DeleteEntry(keyLogo(assetId))] | |
442 | + | $Tuple2(actions, unit) | |
443 | + | } | |
444 | + | ||
445 | + | ||
446 | + | ||
447 | + | @Callable(i) | |
448 | + | func setAdmins (adminPubKeys) = { | |
449 | + | let checkCaller = mustManager(i) | |
450 | + | if ((checkCaller == checkCaller)) | |
451 | + | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
452 | + | else throw("Strict value is not equal to itself.") | |
453 | + | } | |
454 | + | ||
455 | + | ||
456 | + | ||
457 | + | @Callable(i) | |
458 | + | func setManager (pendingManagerPublicKey) = { | |
459 | + | let checkCaller = mustManager(i) | |
460 | + | if ((checkCaller == checkCaller)) | |
461 | + | then { | |
462 | + | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
463 | + | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
464 | + | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
465 | + | else throw("Strict value is not equal to itself.") | |
466 | + | } | |
467 | + | else throw("Strict value is not equal to itself.") | |
468 | + | } | |
469 | + | ||
470 | + | ||
471 | + | ||
472 | + | @Callable(i) | |
473 | + | func confirmManager () = { | |
474 | + | let pm = pendingManagerPublicKeyOrUnit() | |
475 | + | let hasPM = if (isDefined(pm)) | |
476 | + | then true | |
477 | + | else throw("No pending manager") | |
478 | + | if ((hasPM == hasPM)) | |
479 | + | then { | |
480 | + | let checkPM = if ((i.callerPublicKey == value(pm))) | |
481 | + | then true | |
482 | + | else throw("You are not pending manager") | |
483 | + | if ((checkPM == checkPM)) | |
484 | + | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
485 | + | else throw("Strict value is not equal to itself.") | |
486 | + | } | |
487 | + | else throw("Strict value is not equal to itself.") | |
488 | + | } | |
489 | + | ||
490 | + | ||
491 | + | ||
492 | + | @Callable(i) | |
493 | + | func isVerifiedREADONLY (assetId) = $Tuple2(nil, isVerified(assetId)) | |
494 | + | ||
495 | + | ||
496 | + | @Verifier(tx) | |
497 | + | func verify () = { | |
498 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
499 | + | case pk: ByteVector => | |
500 | + | pk | |
501 | + | case _: Unit => | |
502 | + | tx.senderPublicKey | |
503 | + | case _ => | |
504 | + | throw("Match error") | |
505 | + | } | |
506 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
507 | + | } | |
508 | + |
github/deemru/w8io/169f3d6 25.54 ms ◑