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