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