tx · 45CfCJFQWcxtf7iJ8ucmVxYjaWtBzYPCBW2sbm3ufigv 3Mpwh8Q1gGv6gwtzViR9mgruFyy6Jdm4GCG: -0.01600000 Waves 2023.06.19 17:23 [2629629] smart account 3Mpwh8Q1gGv6gwtzViR9mgruFyy6Jdm4GCG > SELF 0.00000000 Waves
{ "type": 13, "id": "45CfCJFQWcxtf7iJ8ucmVxYjaWtBzYPCBW2sbm3ufigv", "fee": 1600000, "feeAssetId": null, "timestamp": 1687184585180, "version": 2, "chainId": 84, "sender": "3Mpwh8Q1gGv6gwtzViR9mgruFyy6Jdm4GCG", "senderPublicKey": "FLnBQATnBGWeMDB5MhixoEef8W61cnZUFXeCcwWAWQaR", "proofs": [ "45Y97xsjLPpLQpoGv8oyAbLvazWYNq88g7UsVZ4jRHCYucmBByA8PZ3ZhW2tReirrUuNo6wfN4hMeEVZSStsrQVC" ], "script": "base64:AAIFAAAAAAAABbsIAhIECgIICBIECgIICBIECgIIGBIDCgEIEgUKAwgICBIDCgEIEgMKAQgSAwoBCBIECgIICBIECgIICBIECgIICBIDCgEIEgUKAwgIBBIECgIICBIECgIIBBIDCgEIEgMKARgSAwoBCCIDU0VQIgVFTVBUWSIOc3RhdHVzVmVyaWZpZWQiEHN0YXR1c1VudmVyaWZpZWQiFmxhYmVsQ29tbXVuaXR5VmVyaWZpZWQiDGxhYmVsUG9vbHNMcCINZGVmYXVsdExhYmVscyIHdGhyb3dQRCIMdGhyb3dOb0Fzc2V0IhJ0aHJvd0ludmFsaWRUaWNrZXIiD2tleUFkbWluUHViS2V5cyIUa2V5VXNlclBvb2xzQ29udHJhY3QiEmtleUZhY3RvcnlDb250cmFjdCIKa2V5Q3JlYXRlZCIHYXNzZXRJZCIHa2V5TG9nbyIJa2V5VGlja2VyIglrZXlTdGF0dXMiE2tleUFzc2V0UG9vbHNOdW1iZXIiEmtleVRpY2tlclRvQXNzZXRJZCIGdGlja2VyIhJrZXlBc3NldElkVG9UaWNrZXIiIGtleUFtb3VudE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AAAAIIBQAAAAJhUgAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmFUaNIhdg==", "height": 2629629, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hoxib9WVnTye26KN7cMcvnwVZFVBBkXpFyvE7gnHak1E Next: 3JssRsmSbzK9Z1K1XcjxuPSw79bxU2XxsJUqPMT8Miex Diff:
Old | New | Differences | |
---|---|---|---|
491 | 491 | func isVerifiedREADONLY (assetId) = $Tuple2(nil, isVerified(assetId)) | |
492 | 492 | ||
493 | 493 | ||
494 | - | ||
495 | - | @Callable(i) | |
496 | - | func deletePool (amountAssetId,priceAssetId) = { | |
497 | - | let factoryContract = addressFromStringValue(getStringValue(keyFactoryContract())) | |
498 | - | let checkCaller = if ((i.caller == factoryContract)) | |
499 | - | then true | |
500 | - | else mustManager(i) | |
501 | - | if ((checkCaller == checkCaller)) | |
502 | - | then { | |
503 | - | let lpAssetId = valueOrElse(getString(keyAmountAndPriceAssetsToLpAsset(amountAssetId, priceAssetId)), "") | |
504 | - | let poolKeysDeleteActions = if ((lpAssetId == "")) | |
505 | - | then nil | |
506 | - | 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))] | |
507 | - | poolKeysDeleteActions | |
508 | - | } | |
509 | - | else throw("Strict value is not equal to itself.") | |
510 | - | } | |
511 | - | ||
512 | - | ||
513 | 494 | @Verifier(tx) | |
514 | 495 | func verify () = { | |
515 | 496 | 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 setVerified (assetId,verified) = { | |
449 | 449 | let checks = [mustAdmin(i), if (isCreated(assetId)) | |
450 | 450 | then true | |
451 | 451 | else throwNoAsset()] | |
452 | 452 | if ((checks == checks)) | |
453 | 453 | then { | |
454 | 454 | let onVerificationLossInv = if (!(verified)) | |
455 | 455 | then { | |
456 | 456 | let factoryContract = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyFactoryContract())), "invalid factory contract address") | |
457 | 457 | invoke(factoryContract, "onVerificationLoss", [assetId], nil) | |
458 | 458 | } | |
459 | 459 | else unit | |
460 | 460 | if ((onVerificationLossInv == onVerificationLossInv)) | |
461 | 461 | then $Tuple2(setVerifiedActions(assetId, verified), unit) | |
462 | 462 | else throw("Strict value is not equal to itself.") | |
463 | 463 | } | |
464 | 464 | else throw("Strict value is not equal to itself.") | |
465 | 465 | } | |
466 | 466 | ||
467 | 467 | ||
468 | 468 | ||
469 | 469 | @Callable(i) | |
470 | 470 | func onEliminate (assetId) = { | |
471 | 471 | let poolsNumber = valueOrElse(getInteger(keyAssetPoolsNumber(assetId)), 0) | |
472 | 472 | let actions = if ((poolsNumber > 0)) | |
473 | 473 | then nil | |
474 | 474 | else [DeleteEntry(keyLogo(assetId))] | |
475 | 475 | $Tuple2(actions, unit) | |
476 | 476 | } | |
477 | 477 | ||
478 | 478 | ||
479 | 479 | ||
480 | 480 | @Callable(i) | |
481 | 481 | func setAdmins (adminPubKeys) = { | |
482 | 482 | let checkCaller = mustManager(i) | |
483 | 483 | if ((checkCaller == checkCaller)) | |
484 | 484 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
485 | 485 | else throw("Strict value is not equal to itself.") | |
486 | 486 | } | |
487 | 487 | ||
488 | 488 | ||
489 | 489 | ||
490 | 490 | @Callable(i) | |
491 | 491 | func isVerifiedREADONLY (assetId) = $Tuple2(nil, isVerified(assetId)) | |
492 | 492 | ||
493 | 493 | ||
494 | - | ||
495 | - | @Callable(i) | |
496 | - | func deletePool (amountAssetId,priceAssetId) = { | |
497 | - | let factoryContract = addressFromStringValue(getStringValue(keyFactoryContract())) | |
498 | - | let checkCaller = if ((i.caller == factoryContract)) | |
499 | - | then true | |
500 | - | else mustManager(i) | |
501 | - | if ((checkCaller == checkCaller)) | |
502 | - | then { | |
503 | - | let lpAssetId = valueOrElse(getString(keyAmountAndPriceAssetsToLpAsset(amountAssetId, priceAssetId)), "") | |
504 | - | let poolKeysDeleteActions = if ((lpAssetId == "")) | |
505 | - | then nil | |
506 | - | 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))] | |
507 | - | poolKeysDeleteActions | |
508 | - | } | |
509 | - | else throw("Strict value is not equal to itself.") | |
510 | - | } | |
511 | - | ||
512 | - | ||
513 | 494 | @Verifier(tx) | |
514 | 495 | func verify () = { | |
515 | 496 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
516 | 497 | case pk: ByteVector => | |
517 | 498 | pk | |
518 | 499 | case _: Unit => | |
519 | 500 | tx.senderPublicKey | |
520 | 501 | case _ => | |
521 | 502 | throw("Match error") | |
522 | 503 | } | |
523 | 504 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
524 | 505 | } | |
525 | 506 |
github/deemru/w8io/026f985 51.56 ms ◑