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