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