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