tx · T88UsL6ZTdyzGK4nXyBU466zzu9XuuaJoXpj3zseNzL

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01800000 Waves

2022.08.16 14:40 [2186973] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "T88UsL6ZTdyzGK4nXyBU466zzu9XuuaJoXpj3zseNzL", "fee": 1800000, "feeAssetId": null, "timestamp": 1660650079685, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "5qeDSSQ6TZ7PCYMH21JNZvzm7TBchJ8ethNxAfRp43TFPFxjsRxt6oRpSp2FtbX8YKiu3Zx4tqkFiGVyykMk2XSL" ], "script": "base64:AAIFAAAAAAAAAC0IAhIJCgcICBgYAQgBEgASCAoGCAgICAgIEgMKARgSAwoBCBIAEgASBAoCCAgAAAAwAAAAAANTRVACAAAAAl9fAAAAAAVFTVBUWQIAAAAAAAAAABFpbnZhbGlkUHJpY2VBc3NldAIAAAATSW52YWxpZCBwcmljZSBhc3NldAEAAAAHdGhyb3dQRAAAAAAJAAACAAAAAQIAAAARUGVybWlzc2lvbiBkZW5pZWQBAAAAFHRocm93Q3JlYXRlTm90Q2FsbGVkAAAAAAkAAAIAAAABAgAAACRDcmVhdGUgaXMgbm90IGNhbGxlZCBmb3IgYXNzZXRzIHBhaXIBAAAAEXRocm93WW91Tm90SXNzdWVyAAAAAAkAAAIAAAABAgAAAB5Zb3UgYXJlIG5vdCBhbW91bnRBc3NldCBpc3N1ZXIBAAAAD3Rocm93UG9vbEV4aXN0cwAAAAAJAAACAAAAAQIAAAAkUG9vbCB3aXRoIHN1Y2ggYXNzZXRzIGFscmVhZHkgZXhpc3RzAQAAABV0aHJvd0Fzc2V0Tm90VmVyaWZpZWQAAAAACQAAAgAAAAECAAAAFUFzc2V0I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AAAHJG1hdGNoMAkABCIAAAABCQEAAAAJa2V5U3RhdHVzAAAAAgUAAAANYW1vdW50QXNzZXRJZAUAAAAMcHJpY2VBc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMFAAAABHVuaXQJAAUUAAAAAgUAAAADbmlsBQAAAAZzdGF0dXMAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAA90YXJnZXRQdWJsaWNLZXkEAAAAByRtYXRjaDAJAQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAACcGsFAAAAByRtYXRjaDAFAAAAAnBrAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0CAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V5s5ordQ==", "chainId": 84, "height": 2186973, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8FR533YiSajVwX3MYfK5V8KYJF9QrBBSAjNTNETbVA2y Next: AhJ6m9whffe9z9uf4dMo8b6VLrSsWMRYPFCKMW2CyHVQ Diff:
OldNewDifferences
134134 }
135135
136136
137-func mustManager (i) = match managerPublicKeyOrUnit() {
137+func isManager (i) = match managerPublicKeyOrUnit() {
138138 case pk: ByteVector =>
139- if ((i.callerPublicKey == pk))
140- then true
141- else throwPD()
139+ (i.callerPublicKey == pk)
142140 case _: Unit =>
143- if ((i.caller == this))
144- then true
145- else throwPD()
141+ (i.caller == this)
146142 case _ =>
147143 throw("Match error")
148144 }
145+
146+
147+func mustManager (i) = if (isManager(i))
148+ then true
149+ else throwPD()
149150
150151
151152 func mustAdmin (i) = {
152153 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
153154 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
154155 then true
155- else {
156- let isManager = mustManager(i)
157- if ((isManager == isManager))
158- then true
159- else throw("Strict value is not equal to itself.")
160- }
156+ else mustManager(i)
161157 }
162158
163159
189185 let amountAssetPayment = value(i.payments[0])
190186 let priceAssetPayment = value(i.payments[1])
191187 let feeAssetPayment = value(i.payments[2])
192- let $t059786049 = getIdAndInfo(amountAssetPayment)
193- let amountAssetId = $t059786049._1
194- let amountAssetInfo = $t059786049._2
195- let $t060526120 = getIdAndInfo(priceAssetPayment)
196- let priceAssetId = $t060526120._1
197- let priceAssetInfo = $t060526120._2
198- let $t061236185 = getIdAndInfo(feeAssetPayment)
199- let feeAssetId = $t061236185._1
200- let feeAssetInfo = $t061236185._2
188+ let $t059906061 = getIdAndInfo(amountAssetPayment)
189+ let amountAssetId = $t059906061._1
190+ let amountAssetInfo = $t059906061._2
191+ let $t060646132 = getIdAndInfo(priceAssetPayment)
192+ let priceAssetId = $t060646132._1
193+ let priceAssetInfo = $t060646132._2
194+ let $t061356197 = getIdAndInfo(feeAssetPayment)
195+ let feeAssetId = $t061356197._1
196+ let feeAssetInfo = $t061356197._2
201197 let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
202- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
198+ let managerPriceAssetMinAmount = 1
199+ let priceAssetMinAmount = if (isManager(i))
200+ then managerPriceAssetMinAmount
201+ else {
202+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
203+ value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))
204+ }
203205 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
204206 let curIndex = (lastIndex + 1)
205207 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
212214 then true
213215 else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
214216 then true
215- else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))))
217+ else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= priceAssetMinAmount))
216218 then true
217- else throw(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
219+ else throw("invalid price asset amount"), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
218220 then true
219221 else throw()]
220222 if ((checks == checks))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let invalidPriceAsset = "Invalid price asset"
99
1010 func throwPD () = throw("Permission denied")
1111
1212
1313 func throwCreateNotCalled () = throw("Create is not called for assets pair")
1414
1515
1616 func throwYouNotIssuer () = throw("You are not amountAsset issuer")
1717
1818
1919 func throwPoolExists () = throw("Pool with such assets already exists")
2020
2121
2222 func throwAssetNotVerified () = throw("Asset is not verified")
2323
2424
2525 func throwInvalidPriceAsset () = throw(invalidPriceAsset)
2626
2727
2828 func throwInvalidFeeAsset () = throw("Invalid fee asset")
2929
3030
3131 func throwInvalidAmountAsset () = throw("Invalid amount asset attached")
3232
3333
3434 func throwInvalidStatus () = throw("Invalid status")
3535
3636
3737 func throwCanActivateOnlyPendingPool () = throw("Can activate pool only in 'pending' status")
3838
3939
4040 func throwFactoryReturnedNotString () = throw("FactoryV2 returned not string")
4141
4242
4343 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
4444
4545
4646 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
4747
4848
4949 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
5050
5151
5252 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
5353
5454
5555 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
5656
5757
5858 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
5959
6060
6161 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
6262
6363
6464 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
6565
6666
6767 let indexSuffix = "u"
6868
6969 let statusPending = "pending"
7070
7171 let statusDeclined = "declined"
7272
7373 let statusActive = "active"
7474
7575 let statuses = [statusPending, statusDeclined, statusActive]
7676
7777 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
7878
7979
8080 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
8181
8282
8383 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
8484
8585
8686 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
8787
8888
8989 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
9090
9191
9292 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
9393
9494
9595 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
9696
9797
9898 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
9999
100100
101101 func keyPriceAssetIds () = makeString(["%s", "priceAssetIds"], SEP)
102102
103103
104104 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
105105
106106
107107 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
108108
109109 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
110110
111111
112112 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
113113 then true
114114 else throwCreateNotCalled()
115115
116116
117117 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
118118 case s: String =>
119119 fromBase58String(s)
120120 case _: Unit =>
121121 unit
122122 case _ =>
123123 throw("Match error")
124124 }
125125
126126
127127 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
128128 case s: String =>
129129 fromBase58String(s)
130130 case _: Unit =>
131131 unit
132132 case _ =>
133133 throw("Match error")
134134 }
135135
136136
137-func mustManager (i) = match managerPublicKeyOrUnit() {
137+func isManager (i) = match managerPublicKeyOrUnit() {
138138 case pk: ByteVector =>
139- if ((i.callerPublicKey == pk))
140- then true
141- else throwPD()
139+ (i.callerPublicKey == pk)
142140 case _: Unit =>
143- if ((i.caller == this))
144- then true
145- else throwPD()
141+ (i.caller == this)
146142 case _ =>
147143 throw("Match error")
148144 }
145+
146+
147+func mustManager (i) = if (isManager(i))
148+ then true
149+ else throwPD()
149150
150151
151152 func mustAdmin (i) = {
152153 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
153154 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
154155 then true
155- else {
156- let isManager = mustManager(i)
157- if ((isManager == isManager))
158- then true
159- else throw("Strict value is not equal to itself.")
160- }
156+ else mustManager(i)
161157 }
162158
163159
164160 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
165161
166162
167163 func getIdAndInfo (payment) = {
168164 let id = value(payment.assetId)
169165 let info = value(assetInfo(id))
170166 $Tuple2(toBase58String(id), info)
171167 }
172168
173169
174170 func validStatus (status) = containsElement(statuses, status)
175171
176172
177173 @Callable(i)
178174 func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
179175 let checkCaller = mustManager(i)
180176 if ((checkCaller == checkCaller))
181177 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)]
182178 else throw("Strict value is not equal to itself.")
183179 }
184180
185181
186182
187183 @Callable(i)
188184 func create () = {
189185 let amountAssetPayment = value(i.payments[0])
190186 let priceAssetPayment = value(i.payments[1])
191187 let feeAssetPayment = value(i.payments[2])
192- let $t059786049 = getIdAndInfo(amountAssetPayment)
193- let amountAssetId = $t059786049._1
194- let amountAssetInfo = $t059786049._2
195- let $t060526120 = getIdAndInfo(priceAssetPayment)
196- let priceAssetId = $t060526120._1
197- let priceAssetInfo = $t060526120._2
198- let $t061236185 = getIdAndInfo(feeAssetPayment)
199- let feeAssetId = $t061236185._1
200- let feeAssetInfo = $t061236185._2
188+ let $t059906061 = getIdAndInfo(amountAssetPayment)
189+ let amountAssetId = $t059906061._1
190+ let amountAssetInfo = $t059906061._2
191+ let $t060646132 = getIdAndInfo(priceAssetPayment)
192+ let priceAssetId = $t060646132._1
193+ let priceAssetInfo = $t060646132._2
194+ let $t061356197 = getIdAndInfo(feeAssetPayment)
195+ let feeAssetId = $t061356197._1
196+ let feeAssetInfo = $t061356197._2
201197 let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
202- let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
198+ let managerPriceAssetMinAmount = 1
199+ let priceAssetMinAmount = if (isManager(i))
200+ then managerPriceAssetMinAmount
201+ else {
202+ let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
203+ value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))
204+ }
203205 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
204206 let curIndex = (lastIndex + 1)
205207 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
206208 then true
207209 else throwPoolExists(), if ((amountAssetInfo.issuer == i.caller))
208210 then true
209211 else throwYouNotIssuer(), if (isVerified(amountAssetId))
210212 then true
211213 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
212214 then true
213215 else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
214216 then true
215- else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))))
217+ else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= priceAssetMinAmount))
216218 then true
217- else throw(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
219+ else throw("invalid price asset amount"), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
218220 then true
219221 else throw()]
220222 if ((checks == checks))
221223 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)]
222224 else throw("Strict value is not equal to itself.")
223225 }
224226
225227
226228
227229 @Callable(i)
228230 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
229231 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
230232 then true
231233 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
232234 then true
233235 else throwCanActivateOnlyPendingPool()]
234236 if ((checks == checks))
235237 then {
236238 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
237239 if ((activateNewPoolInv == activateNewPoolInv))
238240 then {
239241 let lpAssetId = match activateNewPoolInv {
240242 case id: String =>
241243 id
242244 case _ =>
243245 throwFactoryReturnedNotString()
244246 }
245247 if ((lpAssetId == lpAssetId))
246248 then {
247249 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
248250 if ((beforePut == beforePut))
249251 then {
250252 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
251253 if ((put == put))
252254 then {
253255 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
254256 if ((afterPut == afterPut))
255257 then {
256258 let user = value(assetInfo(fromBase58String(amountAssetId))).issuer
257259 [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
258260 }
259261 else throw("Strict value is not equal to itself.")
260262 }
261263 else throw("Strict value is not equal to itself.")
262264 }
263265 else throw("Strict value is not equal to itself.")
264266 }
265267 else throw("Strict value is not equal to itself.")
266268 }
267269 else throw("Strict value is not equal to itself.")
268270 }
269271 else throw("Strict value is not equal to itself.")
270272 }
271273
272274
273275
274276 @Callable(i)
275277 func setAdmins (adminPubKeys) = {
276278 let checkCaller = mustManager(i)
277279 if ((checkCaller == checkCaller))
278280 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
279281 else throw("Strict value is not equal to itself.")
280282 }
281283
282284
283285
284286 @Callable(i)
285287 func setManager (pendingManagerPublicKey) = {
286288 let checkCaller = mustManager(i)
287289 if ((checkCaller == checkCaller))
288290 then {
289291 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
290292 if ((checkManagerPublicKey == checkManagerPublicKey))
291293 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
292294 else throw("Strict value is not equal to itself.")
293295 }
294296 else throw("Strict value is not equal to itself.")
295297 }
296298
297299
298300
299301 @Callable(i)
300302 func confirmManager () = {
301303 let pm = pendingManagerPublicKeyOrUnit()
302304 let hasPM = if (isDefined(pm))
303305 then true
304306 else throw("No pending manager")
305307 if ((hasPM == hasPM))
306308 then {
307309 let checkPM = if ((i.callerPublicKey == value(pm)))
308310 then true
309311 else throw("You are not pending manager")
310312 if ((checkPM == checkPM))
311313 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
312314 else throw("Strict value is not equal to itself.")
313315 }
314316 else throw("Strict value is not equal to itself.")
315317 }
316318
317319
318320
319321 @Callable(i)
320322 func priceAssetsREADONLY () = {
321323 let priceAssets = match getString(keyPriceAssetIds()) {
322324 case s: String =>
323325 if ((size(s) == 0))
324326 then nil
325327 else split(s, SEP)
326328 case _ =>
327329 nil
328330 }
329331 $Tuple2(nil, priceAssets)
330332 }
331333
332334
333335
334336 @Callable(i)
335337 func statusREADONLY (amountAssetId,priceAssetId) = {
336338 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
337339 case s: String =>
338340 s
339341 case _ =>
340342 unit
341343 }
342344 $Tuple2(nil, status)
343345 }
344346
345347
346348 @Verifier(tx)
347349 func verify () = {
348350 let targetPublicKey = match managerPublicKeyOrUnit() {
349351 case pk: ByteVector =>
350352 pk
351353 case _: Unit =>
352354 tx.senderPublicKey
353355 case _ =>
354356 throw("Match error")
355357 }
356358 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
357359 }
358360

github/deemru/w8io/026f985 
54.52 ms