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