tx · 8FR533YiSajVwX3MYfK5V8KYJF9QrBBSAjNTNETbVA2y 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh: -0.01800000 Waves 2022.05.25 15:27 [2067216] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves
{ "type": 13, "id": "8FR533YiSajVwX3MYfK5V8KYJF9QrBBSAjNTNETbVA2y", "fee": 1800000, "feeAssetId": null, "timestamp": 1653481635200, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "3sbHeWeZGLcd7MLcSeEdTQzfKMCf5x6YW7rbLAxTmgEZy9m6u9MgK9YykpYZPkt84UzsHGxHvvJwtzikJTDmc8iF" ], "script": "base64:AAIFAAAAAAAAAC0IAhIJCgcICBgYAQgBEgASCAoGCAgICAgIEgMKARgSAwoBCBIAEgASBAoCCAgAAAAvAAAAAANTRVACAAAAAl9fAAAAAAVFTVBUWQIAAAAAAAAAABFpbnZhbGlkUHJpY2VBc3NldAIAAAATSW52YWxpZCBwcmljZSBhc3NldAEAAAAHdGhyb3dQRAAAAAAJAAACAAAAAQIAAAARUGVybWlzc2lvbiBkZW5pZWQBAAAAFHRocm93Q3JlYXRlTm90Q2FsbGVkAAAAAAkAAAIAAAABAgAAACRDcmVhdGUgaXMgbm90IGNhbGxlZCBmb3IgYXNzZXRzIHBhaXIBAAAAEXRocm93WW91Tm90SXNzdWVyAAAAAAkAAAIAAAABAgAAAB5Zb3UgYXJlIG5vdCBhbW91bnRBc3NldCBpc3N1ZXIBAAAAD3Rocm93UG9vbEV4aXN0cwAAAAAJAAACAAAAAQIAAAAkUG9vbCB3aXRoIHN1Y2ggYXNzZXRzIGFscmVhZHkgZXhpc3RzAQAAABV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQAAAAACQAAAgAAAAECAAAAFUFzc2V0IGl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ACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwUAAAAEdW5pdAkABRQAAAACBQAAAANuaWwFAAAABnN0YXR1cwAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAD3RhcmdldFB1YmxpY0tleQQAAAAHJG1hdGNoMAkBAAAAFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAJwawUAAAAHJG1hdGNoMAUAAAACcGsDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXlVntpL", "chainId": 84, "height": 2067216, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ETUBV2M8wdf1jrfCn8JiWNSinYapDMBAqCox5B8hYzNS Next: T88UsL6ZTdyzGK4nXyBU466zzu9XuuaJoXpj3zseNzL Diff:
Old | New | Differences | |
---|---|---|---|
225 | 225 | ||
226 | 226 | ||
227 | 227 | @Callable(i) | |
228 | - | func | |
228 | + | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
229 | 229 | let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
230 | - | then true | |
231 | - | else throwCreateNotCalled(), if (validStatus(newStatus)) | |
232 | - | then true | |
233 | - | else throwInvalidStatus()] | |
234 | - | if ((checks == checks)) | |
235 | - | then [StringEntry(keyStatus(amountAssetId, priceAssetId), newStatus)] | |
236 | - | else throw("Strict value is not equal to itself.") | |
237 | - | } | |
238 | - | ||
239 | - | ||
240 | - | ||
241 | - | @Callable(i) | |
242 | - | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
243 | - | let checks = [mustManager(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
244 | 230 | then true | |
245 | 231 | else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending)) | |
246 | 232 | then true |
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 invalidPriceAsset = "Invalid price asset" | |
9 | 9 | ||
10 | 10 | func throwPD () = throw("Permission denied") | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func throwCreateNotCalled () = throw("Create is not called for assets pair") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func throwYouNotIssuer () = throw("You are not amountAsset issuer") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func throwPoolExists () = throw("Pool with such assets already exists") | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func throwAssetNotVerified () = throw("Asset is not verified") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func throwInvalidPriceAsset () = throw(invalidPriceAsset) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func throwInvalidFeeAsset () = throw("Invalid fee asset") | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func throwInvalidAmountAsset () = throw("Invalid amount asset attached") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func throwInvalidStatus () = throw("Invalid status") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func throwCanActivateOnlyPendingPool () = throw("Can activate pool only in 'pending' status") | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func throwFactoryReturnedNotString () = throw("FactoryV2 returned not string") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyLastIndex () = makeString(["%s", "lastIndex"], SEP) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | let indexSuffix = "u" | |
68 | 68 | ||
69 | 69 | let statusPending = "pending" | |
70 | 70 | ||
71 | 71 | let statusDeclined = "declined" | |
72 | 72 | ||
73 | 73 | let statusActive = "active" | |
74 | 74 | ||
75 | 75 | let statuses = [statusPending, statusDeclined, statusActive] | |
76 | 76 | ||
77 | 77 | func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func keyPriceAssetIds () = makeString(["%s", "priceAssetIds"], SEP) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract())) | |
108 | 108 | ||
109 | 109 | func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId)) | |
113 | 113 | then true | |
114 | 114 | else throwCreateNotCalled() | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
118 | 118 | case s: String => | |
119 | 119 | fromBase58String(s) | |
120 | 120 | case _: Unit => | |
121 | 121 | unit | |
122 | 122 | case _ => | |
123 | 123 | throw("Match error") | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
128 | 128 | case s: String => | |
129 | 129 | fromBase58String(s) | |
130 | 130 | case _: Unit => | |
131 | 131 | unit | |
132 | 132 | case _ => | |
133 | 133 | throw("Match error") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
138 | 138 | case pk: ByteVector => | |
139 | 139 | if ((i.callerPublicKey == pk)) | |
140 | 140 | then true | |
141 | 141 | else throwPD() | |
142 | 142 | case _: Unit => | |
143 | 143 | if ((i.caller == this)) | |
144 | 144 | then true | |
145 | 145 | else throwPD() | |
146 | 146 | case _ => | |
147 | 147 | throw("Match error") | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func mustAdmin (i) = { | |
152 | 152 | let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP) | |
153 | 153 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
154 | 154 | then true | |
155 | 155 | else { | |
156 | 156 | let isManager = mustManager(i) | |
157 | 157 | if ((isManager == isManager)) | |
158 | 158 | then true | |
159 | 159 | else throw("Strict value is not equal to itself.") | |
160 | 160 | } | |
161 | 161 | } | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2) | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func getIdAndInfo (payment) = { | |
168 | 168 | let id = value(payment.assetId) | |
169 | 169 | let info = value(assetInfo(id)) | |
170 | 170 | $Tuple2(toBase58String(id), info) | |
171 | 171 | } | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func validStatus (status) = containsElement(statuses, status) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | @Callable(i) | |
178 | 178 | func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = { | |
179 | 179 | let checkCaller = mustManager(i) | |
180 | 180 | if ((checkCaller == checkCaller)) | |
181 | 181 | then [StringEntry(keyFactoryContract(), factoryV2Address), StringEntry(keyAssetsStoreContract(), assetsStoreAddress), StringEntry(keyPriceAssetIds(), makeString(priceAssetIds, SEP)), StringEntry(keyPriceAssetsMinAmount(), makeString(priceAssetsMinAmount, SEP)), IntegerEntry(keyAmountAssetMinAmount(), amountAssetMinAmount), StringEntry(keyFeeAssetId(), feeAssetId), IntegerEntry(keyFeeAmount(), feeAmount)] | |
182 | 182 | else throw("Strict value is not equal to itself.") | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | ||
187 | 187 | @Callable(i) | |
188 | 188 | func create () = { | |
189 | 189 | let amountAssetPayment = value(i.payments[0]) | |
190 | 190 | let priceAssetPayment = value(i.payments[1]) | |
191 | 191 | let feeAssetPayment = value(i.payments[2]) | |
192 | 192 | let $t059786049 = getIdAndInfo(amountAssetPayment) | |
193 | 193 | let amountAssetId = $t059786049._1 | |
194 | 194 | let amountAssetInfo = $t059786049._2 | |
195 | 195 | let $t060526120 = getIdAndInfo(priceAssetPayment) | |
196 | 196 | let priceAssetId = $t060526120._1 | |
197 | 197 | let priceAssetInfo = $t060526120._2 | |
198 | 198 | let $t061236185 = getIdAndInfo(feeAssetPayment) | |
199 | 199 | let feeAssetId = $t061236185._1 | |
200 | 200 | let feeAssetInfo = $t061236185._2 | |
201 | 201 | let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP) | |
202 | 202 | let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset) | |
203 | 203 | let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0) | |
204 | 204 | let curIndex = (lastIndex + 1) | |
205 | 205 | let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId))) | |
206 | 206 | then true | |
207 | 207 | else throwPoolExists(), if ((amountAssetInfo.issuer == i.caller)) | |
208 | 208 | then true | |
209 | 209 | else throwYouNotIssuer(), if (isVerified(amountAssetId)) | |
210 | 210 | then true | |
211 | 211 | else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId)) | |
212 | 212 | then true | |
213 | 213 | else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount()))) | |
214 | 214 | then true | |
215 | 215 | else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex])))) | |
216 | 216 | then true | |
217 | 217 | else throw(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount()))) | |
218 | 218 | then true | |
219 | 219 | else throw()] | |
220 | 220 | if ((checks == checks)) | |
221 | 221 | then [BooleanEntry(keyCreateCalled(amountAssetId, priceAssetId), true), IntegerEntry(keyLastIndex(), curIndex), StringEntry(keySuffix(amountAssetId, priceAssetId), (toString(curIndex) + indexSuffix)), IntegerEntry(keyHeight(amountAssetId, priceAssetId), height), StringEntry(keyStatus(amountAssetId, priceAssetId), statusPending), IntegerEntry(keyAmountAssetAmount(amountAssetId, priceAssetId), amountAssetPayment.amount), IntegerEntry(keyPriceAssetAmount(amountAssetId, priceAssetId), priceAssetPayment.amount)] | |
222 | 222 | else throw("Strict value is not equal to itself.") | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | ||
227 | 227 | @Callable(i) | |
228 | - | func | |
228 | + | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
229 | 229 | let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
230 | - | then true | |
231 | - | else throwCreateNotCalled(), if (validStatus(newStatus)) | |
232 | - | then true | |
233 | - | else throwInvalidStatus()] | |
234 | - | if ((checks == checks)) | |
235 | - | then [StringEntry(keyStatus(amountAssetId, priceAssetId), newStatus)] | |
236 | - | else throw("Strict value is not equal to itself.") | |
237 | - | } | |
238 | - | ||
239 | - | ||
240 | - | ||
241 | - | @Callable(i) | |
242 | - | func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = { | |
243 | - | let checks = [mustManager(i), if (isCreateCalled(amountAssetId, priceAssetId)) | |
244 | 230 | then true | |
245 | 231 | else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending)) | |
246 | 232 | then true | |
247 | 233 | else throwCanActivateOnlyPendingPool()] | |
248 | 234 | if ((checks == checks)) | |
249 | 235 | then { | |
250 | 236 | let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil) | |
251 | 237 | if ((activateNewPoolInv == activateNewPoolInv)) | |
252 | 238 | then { | |
253 | 239 | let lpAssetId = match activateNewPoolInv { | |
254 | 240 | case id: String => | |
255 | 241 | id | |
256 | 242 | case _ => | |
257 | 243 | throwFactoryReturnedNotString() | |
258 | 244 | } | |
259 | 245 | if ((lpAssetId == lpAssetId)) | |
260 | 246 | then { | |
261 | 247 | let beforePut = assetBalance(this, fromBase58String(lpAssetId)) | |
262 | 248 | if ((beforePut == beforePut)) | |
263 | 249 | then { | |
264 | 250 | let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))]) | |
265 | 251 | if ((put == put)) | |
266 | 252 | then { | |
267 | 253 | let afterPut = assetBalance(this, fromBase58String(lpAssetId)) | |
268 | 254 | if ((afterPut == afterPut)) | |
269 | 255 | then { | |
270 | 256 | let user = value(assetInfo(fromBase58String(amountAssetId))).issuer | |
271 | 257 | [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))] | |
272 | 258 | } | |
273 | 259 | else throw("Strict value is not equal to itself.") | |
274 | 260 | } | |
275 | 261 | else throw("Strict value is not equal to itself.") | |
276 | 262 | } | |
277 | 263 | else throw("Strict value is not equal to itself.") | |
278 | 264 | } | |
279 | 265 | else throw("Strict value is not equal to itself.") | |
280 | 266 | } | |
281 | 267 | else throw("Strict value is not equal to itself.") | |
282 | 268 | } | |
283 | 269 | else throw("Strict value is not equal to itself.") | |
284 | 270 | } | |
285 | 271 | ||
286 | 272 | ||
287 | 273 | ||
288 | 274 | @Callable(i) | |
289 | 275 | func setAdmins (adminPubKeys) = { | |
290 | 276 | let checkCaller = mustManager(i) | |
291 | 277 | if ((checkCaller == checkCaller)) | |
292 | 278 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
293 | 279 | else throw("Strict value is not equal to itself.") | |
294 | 280 | } | |
295 | 281 | ||
296 | 282 | ||
297 | 283 | ||
298 | 284 | @Callable(i) | |
299 | 285 | func setManager (pendingManagerPublicKey) = { | |
300 | 286 | let checkCaller = mustManager(i) | |
301 | 287 | if ((checkCaller == checkCaller)) | |
302 | 288 | then { | |
303 | 289 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
304 | 290 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
305 | 291 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
306 | 292 | else throw("Strict value is not equal to itself.") | |
307 | 293 | } | |
308 | 294 | else throw("Strict value is not equal to itself.") | |
309 | 295 | } | |
310 | 296 | ||
311 | 297 | ||
312 | 298 | ||
313 | 299 | @Callable(i) | |
314 | 300 | func confirmManager () = { | |
315 | 301 | let pm = pendingManagerPublicKeyOrUnit() | |
316 | 302 | let hasPM = if (isDefined(pm)) | |
317 | 303 | then true | |
318 | 304 | else throw("No pending manager") | |
319 | 305 | if ((hasPM == hasPM)) | |
320 | 306 | then { | |
321 | 307 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
322 | 308 | then true | |
323 | 309 | else throw("You are not pending manager") | |
324 | 310 | if ((checkPM == checkPM)) | |
325 | 311 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
326 | 312 | else throw("Strict value is not equal to itself.") | |
327 | 313 | } | |
328 | 314 | else throw("Strict value is not equal to itself.") | |
329 | 315 | } | |
330 | 316 | ||
331 | 317 | ||
332 | 318 | ||
333 | 319 | @Callable(i) | |
334 | 320 | func priceAssetsREADONLY () = { | |
335 | 321 | let priceAssets = match getString(keyPriceAssetIds()) { | |
336 | 322 | case s: String => | |
337 | 323 | if ((size(s) == 0)) | |
338 | 324 | then nil | |
339 | 325 | else split(s, SEP) | |
340 | 326 | case _ => | |
341 | 327 | nil | |
342 | 328 | } | |
343 | 329 | $Tuple2(nil, priceAssets) | |
344 | 330 | } | |
345 | 331 | ||
346 | 332 | ||
347 | 333 | ||
348 | 334 | @Callable(i) | |
349 | 335 | func statusREADONLY (amountAssetId,priceAssetId) = { | |
350 | 336 | let status = match getString(keyStatus(amountAssetId, priceAssetId)) { | |
351 | 337 | case s: String => | |
352 | 338 | s | |
353 | 339 | case _ => | |
354 | 340 | unit | |
355 | 341 | } | |
356 | 342 | $Tuple2(nil, status) | |
357 | 343 | } | |
358 | 344 | ||
359 | 345 | ||
360 | 346 | @Verifier(tx) | |
361 | 347 | func verify () = { | |
362 | 348 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
363 | 349 | case pk: ByteVector => | |
364 | 350 | pk | |
365 | 351 | case _: Unit => | |
366 | 352 | tx.senderPublicKey | |
367 | 353 | case _ => | |
368 | 354 | throw("Match error") | |
369 | 355 | } | |
370 | 356 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
371 | 357 | } | |
372 | 358 |
github/deemru/w8io/026f985 44.40 ms ◑