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