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