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