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