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