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