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