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