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