tx · 84ZFyw2jT3i9gTzEeZ6HLepr8seyWj4B5MdmXepsZ9ii

3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh:  -0.01800000 Waves

2022.08.17 10:10 [2188151] smart account 3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh > SELF 0.00000000 Waves

{ "type": 13, "id": "84ZFyw2jT3i9gTzEeZ6HLepr8seyWj4B5MdmXepsZ9ii", "fee": 1800000, "feeAssetId": null, "timestamp": 1660720364918, "version": 1, "sender": "3N3g7W8FPoQ7g5EadbAD2GVjrZT5RWpHZZh", "senderPublicKey": "Ap7CkWd6fzBU34kGo4GJJzC5q4qWXuLVunzE25PchdGS", "proofs": [ "4xWCfFHYcS971ZqUjwFocPuhGvQVhwZcC1Qdt2937Bnb8CYcj95tf2euGuvzfC5KQVfSDyv238mq3Gncyu6ciSSd" ], "script": "base64:AAIFAAAAAAAAAC0IAhIJCgcICBgYAQgBEgASCAoGCAgICAgIEgMKARgSAwoBCBIAEgASBAoCCAgAAAA0AAAAAANTRVACAAAAAl9fAAAAAAx3YXZlc0Fzc2V0SWQCAAAABVdBVkVTAAAAABFpbnZhbGlkUHJpY2VBc3NldAIAAAATSW52YWxpZCBwcmljZSBhc3NldAEAAAAIdGhyb3dFcnIAAAABAAAAA21zZwkAAAIAAAABCQAEuQAAAAIJAARMAAAAAgIAAAAQdXNlcl9wb29scy5yaWRlOgkABEwAAAACBQAAAANtc2cFAAAAA25pbAIAAAABIAEAAAAHdGhyb3dQRAAAAAAJAQAAAAh0aHJvd0VycgAAAAECAAAAEVBlcm1pc3Npb24gZGVuaWVkAQAAABR0aHJvd0NyZWF0ZU5vdENhbGxlZAAAAAAJAQAAAAh0aHJvd0VycgAAAAECAAAAJENyZWF0ZSBpcyBub3QgY2FsbGVkIGZvciBhc3NldHMgcGFpcgEAAAARdGhyb3dZb3VOb3RJc3N1ZXIAAAAACQEAAAAIdGhyb3dFcnIAAAABAgAAAB5Zb3UgYXJlIG5vdCBhb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mlmeQAAAAAEAAAAD3RhcmdldFB1YmxpY0tleQQAAAAHJG1hdGNoMAkBAAAAFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAJwawUAAAAHJG1hdGNoMAUAAAACcGsDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXnQKQTQ", "chainId": 84, "height": 2188151, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7MCeyDtGLzXadSpGvAqG3WvPoSA9eYay4FHGQt5pPvhJ Next: G6HBEJcAjqBKwjV4owJRhSa4TXDvGAyd7P7tPPSF111q Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
5-
6-let EMPTY = ""
75
86 let wavesAssetId = "WAVES"
97
115113 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
116114
117115
116+func stringOptionToList (stringOrUnit) = match stringOrUnit {
117+ case s: String =>
118+ if ((size(s) == 0))
119+ then nil
120+ else split(s, SEP)
121+ case _: Unit =>
122+ nil
123+ case _ =>
124+ throw("Match error")
125+}
126+
127+
118128 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
119129
120130 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
161171
162172
163173 func mustAdmin (i) = {
164- let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
174+ let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
165175 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
166176 then true
167177 else mustManager(i)
200210 let amountAssetPayment = value(i.payments[0])
201211 let priceAssetPayment = value(i.payments[1])
202212 let feeAssetPayment = value(i.payments[2])
203- let $t063376409 = getIdAndInfo(amountAssetPayment)
204- let amountAssetId = $t063376409._1
205- let amountAssetInfo = $t063376409._2
206- let $t064126481 = getIdAndInfo(priceAssetPayment)
207- let priceAssetId = $t064126481._1
208- let priceAssetInfo = $t064126481._2
209- let $t064846547 = getIdAndInfo(feeAssetPayment)
210- let feeAssetId = $t064846547._1
211- let feeAssetInfo = $t064846547._2
212- let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
213+ let $t064786550 = getIdAndInfo(amountAssetPayment)
214+ let amountAssetId = $t064786550._1
215+ let amountAssetInfo = $t064786550._2
216+ let $t065536622 = getIdAndInfo(priceAssetPayment)
217+ let priceAssetId = $t065536622._1
218+ let priceAssetInfo = $t065536622._2
219+ let $t066256688 = getIdAndInfo(feeAssetPayment)
220+ let feeAssetId = $t066256688._1
221+ let feeAssetInfo = $t066256688._2
222+ let priceAssetsList = stringOptionToList(getString(keyPriceAssetIds()))
213223 let managerPriceAssetMinAmount = 1
214224 let priceAssetMinAmount = if (isManager(i))
215225 then managerPriceAssetMinAmount
216226 else {
217227 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
218- value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))
228+ value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
219229 }
220230 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
221231 let curIndex = (lastIndex + 1)
338348
339349
340350 @Callable(i)
341-func priceAssetsREADONLY () = {
342- let priceAssets = match getString(keyPriceAssetIds()) {
343- case s: String =>
344- if ((size(s) == 0))
345- then nil
346- else split(s, SEP)
347- case _ =>
348- nil
349- }
350- $Tuple2(nil, priceAssets)
351- }
351+func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssetIds())))
352352
353353
354354
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
5-
6-let EMPTY = ""
75
86 let wavesAssetId = "WAVES"
97
108 let invalidPriceAsset = "Invalid price asset"
119
1210 func throwErr (msg) = throw(makeString(["user_pools.ride:", msg], " "))
1311
1412
1513 func throwPD () = throwErr("Permission denied")
1614
1715
1816 func throwCreateNotCalled () = throwErr("Create is not called for assets pair")
1917
2018
2119 func throwYouNotIssuer () = throwErr("You are not amountAsset issuer")
2220
2321
2422 func throwPoolExists () = throwErr("Pool with such assets already exists")
2523
2624
2725 func throwAssetNotVerified () = throwErr("Asset is not verified")
2826
2927
3028 func throwInvalidPriceAsset () = throwErr(invalidPriceAsset)
3129
3230
3331 func throwInvalidFeeAsset () = throwErr("Invalid fee asset")
3432
3533
3634 func throwInvalidAmountAsset () = throwErr("Invalid amount asset attached")
3735
3836
3937 func throwInvalidStatus () = throwErr("Invalid status")
4038
4139
4240 func throwCanActivateOnlyPendingPool () = throwErr("Can activate pool only in 'pending' status")
4341
4442
4543 func throwFactoryReturnedNotString () = throwErr("FactoryV2 returned not string")
4644
4745
4846 func throwInvalidPriceAssetAmount () = throwErr("invalid price asset amount")
4947
5048
5149 func throwInvalidFee () = throwErr("invalid fee")
5250
5351
5452 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
5553
5654
5755 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
5856
5957
6058 func keyAdminPubKeys () = makeString(["%s", "adminPubKeys"], SEP)
6159
6260
6361 func keyStatus (amountAssetId,priceAssetId) = makeString(["%s%s%s", "status", amountAssetId, priceAssetId], SEP)
6462
6563
6664 func keyFactoryContract () = makeString(["%s", "factoryContract"], SEP)
6765
6866
6967 func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], SEP)
7068
7169
7270 func keySuffix (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suffix", amountAssetId, priceAssetId], SEP)
7371
7472
7573 func keyLastIndex () = makeString(["%s", "lastIndex"], SEP)
7674
7775
7876 let indexSuffix = "u"
7977
8078 let statusPending = "pending"
8179
8280 let statusDeclined = "declined"
8381
8482 let statusActive = "active"
8583
8684 let statuses = [statusPending, statusDeclined, statusActive]
8785
8886 func keyCreateCalled (amountAssetId,priceAssetId) = makeString(["%s%s%s", "createCalled", amountAssetId, priceAssetId], SEP)
8987
9088
9189 func keyAmountAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "amountAssetAmount", amountAssetId, priceAssetId], SEP)
9290
9391
9492 func keyPriceAssetAmount (amountAssetId,priceAssetId) = makeString(["%s%s%s", "priceAssetAmount", amountAssetId, priceAssetId], SEP)
9593
9694
9795 func keyHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "height", amountAssetId, priceAssetId], SEP)
9896
9997
10098 func keyFeeAssetId () = makeString(["%s", "feeAssetId"], SEP)
10199
102100
103101 func keyFeeAmount () = makeString(["%s", "feeAmount"], SEP)
104102
105103
106104 func keyAmountAssetMinAmount () = makeString(["%s", "amountAssetMinAmount"], SEP)
107105
108106
109107 func keyPriceAssetsMinAmount () = makeString(["%s", "priceAssetsMinAmount"], SEP)
110108
111109
112110 func keyPriceAssetIds () = makeString(["%s", "priceAssetIds"], SEP)
113111
114112
115113 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
116114
117115
116+func stringOptionToList (stringOrUnit) = match stringOrUnit {
117+ case s: String =>
118+ if ((size(s) == 0))
119+ then nil
120+ else split(s, SEP)
121+ case _: Unit =>
122+ nil
123+ case _ =>
124+ throw("Match error")
125+}
126+
127+
118128 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract()))
119129
120130 func isCreateCalled (amountAssetId,priceAssetId) = valueOrElse(getBoolean(keyCreateCalled(amountAssetId, priceAssetId)), false)
121131
122132
123133 func mustCreateCalled (amountAssetId,priceAssetId) = if (isCreateCalled(amountAssetId, priceAssetId))
124134 then true
125135 else throwCreateNotCalled()
126136
127137
128138 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
129139 case s: String =>
130140 fromBase58String(s)
131141 case _: Unit =>
132142 unit
133143 case _ =>
134144 throw("Match error")
135145 }
136146
137147
138148 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
139149 case s: String =>
140150 fromBase58String(s)
141151 case _: Unit =>
142152 unit
143153 case _ =>
144154 throw("Match error")
145155 }
146156
147157
148158 func isManager (i) = match managerPublicKeyOrUnit() {
149159 case pk: ByteVector =>
150160 (i.callerPublicKey == pk)
151161 case _: Unit =>
152162 (i.caller == this)
153163 case _ =>
154164 throw("Match error")
155165 }
156166
157167
158168 func mustManager (i) = if (isManager(i))
159169 then true
160170 else throwPD()
161171
162172
163173 func mustAdmin (i) = {
164- let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
174+ let adminPKs = stringOptionToList(getString(keyAdminPubKeys()))
165175 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
166176 then true
167177 else mustManager(i)
168178 }
169179
170180
171181 func isVerified (assetId) = (valueOrElse(getInteger(addressFromStringValue(getStringOrFail(keyAssetsStoreContract())), (("status_<" + assetId) + ">")), 0) == 2)
172182
173183
174184 func getIdAndInfo (payment) = match payment.assetId {
175185 case id: ByteVector =>
176186 let info = value(assetInfo(id))
177187 $Tuple2(toBase58String(id), info)
178188 case _: Unit =>
179189 $Tuple2(wavesAssetId, unit)
180190 case _ =>
181191 throw("Match error")
182192 }
183193
184194
185195 func validStatus (status) = containsElement(statuses, status)
186196
187197
188198 @Callable(i)
189199 func constructor (factoryV2Address,assetsStoreAddress,priceAssetIds,priceAssetsMinAmount,amountAssetMinAmount,feeAssetId,feeAmount) = {
190200 let checkCaller = mustManager(i)
191201 if ((checkCaller == checkCaller))
192202 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)]
193203 else throw("Strict value is not equal to itself.")
194204 }
195205
196206
197207
198208 @Callable(i)
199209 func create () = {
200210 let amountAssetPayment = value(i.payments[0])
201211 let priceAssetPayment = value(i.payments[1])
202212 let feeAssetPayment = value(i.payments[2])
203- let $t063376409 = getIdAndInfo(amountAssetPayment)
204- let amountAssetId = $t063376409._1
205- let amountAssetInfo = $t063376409._2
206- let $t064126481 = getIdAndInfo(priceAssetPayment)
207- let priceAssetId = $t064126481._1
208- let priceAssetInfo = $t064126481._2
209- let $t064846547 = getIdAndInfo(feeAssetPayment)
210- let feeAssetId = $t064846547._1
211- let feeAssetInfo = $t064846547._2
212- let priceAssetsList = split(valueOrElse(getString(keyPriceAssetIds()), EMPTY), SEP)
213+ let $t064786550 = getIdAndInfo(amountAssetPayment)
214+ let amountAssetId = $t064786550._1
215+ let amountAssetInfo = $t064786550._2
216+ let $t065536622 = getIdAndInfo(priceAssetPayment)
217+ let priceAssetId = $t065536622._1
218+ let priceAssetInfo = $t065536622._2
219+ let $t066256688 = getIdAndInfo(feeAssetPayment)
220+ let feeAssetId = $t066256688._1
221+ let feeAssetInfo = $t066256688._2
222+ let priceAssetsList = stringOptionToList(getString(keyPriceAssetIds()))
213223 let managerPriceAssetMinAmount = 1
214224 let priceAssetMinAmount = if (isManager(i))
215225 then managerPriceAssetMinAmount
216226 else {
217227 let priceAssetsIndex = valueOrErrorMessage(indexOf(priceAssetsList, priceAssetId), invalidPriceAsset)
218- value(parseInt(split(valueOrElse(getString(keyPriceAssetsMinAmount()), EMPTY), SEP)[priceAssetsIndex]))
228+ value(parseInt(stringOptionToList(getString(keyPriceAssetsMinAmount()))[priceAssetsIndex]))
219229 }
220230 let lastIndex = valueOrElse(getInteger(keyLastIndex()), 0)
221231 let curIndex = (lastIndex + 1)
222232 let checks = [if (!(isCreateCalled(amountAssetId, priceAssetId)))
223233 then true
224234 else throwPoolExists(), if (if (isManager(i))
225235 then true
226236 else (value(amountAssetInfo).issuer == i.caller))
227237 then true
228238 else throwYouNotIssuer(), if (isVerified(amountAssetId))
229239 then true
230240 else throwAssetNotVerified(), if ((getString(keyFeeAssetId()) == feeAssetId))
231241 then true
232242 else throwInvalidFeeAsset(), if ((amountAssetPayment.amount >= getIntegerValue(keyAmountAssetMinAmount())))
233243 then true
234244 else throwInvalidAmountAsset(), if ((priceAssetPayment.amount >= priceAssetMinAmount))
235245 then true
236246 else throwInvalidPriceAssetAmount(), if ((feeAssetPayment.amount == getInteger(keyFeeAmount())))
237247 then true
238248 else throwInvalidFee()]
239249 if ((checks == checks))
240250 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)]
241251 else throw("Strict value is not equal to itself.")
242252 }
243253
244254
245255
246256 @Callable(i)
247257 func activate (poolAddress,amountAssetId,amountAssetTicker,priceAssetId,priceAssetTicker,logo) = {
248258 let checks = [mustAdmin(i), if (isCreateCalled(amountAssetId, priceAssetId))
249259 then true
250260 else throwCreateNotCalled(), if ((value(getString(keyStatus(amountAssetId, priceAssetId))) == statusPending))
251261 then true
252262 else throwCanActivateOnlyPendingPool()]
253263 if ((checks == checks))
254264 then {
255265 let activateNewPoolInv = invoke(factoryContract, "activateNewPool", [poolAddress, amountAssetId, priceAssetId, ((amountAssetTicker + priceAssetTicker) + "LP"), (((amountAssetTicker + "/") + priceAssetTicker) + " pool liquidity provider token"), 0, "VLTPOOL", logo], nil)
256266 if ((activateNewPoolInv == activateNewPoolInv))
257267 then {
258268 let lpAssetId = match activateNewPoolInv {
259269 case id: String =>
260270 id
261271 case _ =>
262272 throwFactoryReturnedNotString()
263273 }
264274 if ((lpAssetId == lpAssetId))
265275 then {
266276 let beforePut = assetBalance(this, fromBase58String(lpAssetId))
267277 if ((beforePut == beforePut))
268278 then {
269279 let put = invoke(addressFromStringValue(poolAddress), "put", [0, false], [AttachedPayment(fromBase58String(amountAssetId), value(getInteger(keyAmountAssetAmount(amountAssetId, priceAssetId)))), AttachedPayment(if ((priceAssetId == "WAVES"))
270280 then unit
271281 else fromBase58String(priceAssetId), value(getInteger(keyPriceAssetAmount(amountAssetId, priceAssetId))))])
272282 if ((put == put))
273283 then {
274284 let afterPut = assetBalance(this, fromBase58String(lpAssetId))
275285 if ((afterPut == afterPut))
276286 then {
277287 let user = value(assetInfo(fromBase58String(amountAssetId))).issuer
278288 [StringEntry(keyStatus(amountAssetId, priceAssetId), statusActive), ScriptTransfer(user, (afterPut - beforePut), fromBase58String(lpAssetId))]
279289 }
280290 else throw("Strict value is not equal to itself.")
281291 }
282292 else throw("Strict value is not equal to itself.")
283293 }
284294 else throw("Strict value is not equal to itself.")
285295 }
286296 else throw("Strict value is not equal to itself.")
287297 }
288298 else throw("Strict value is not equal to itself.")
289299 }
290300 else throw("Strict value is not equal to itself.")
291301 }
292302
293303
294304
295305 @Callable(i)
296306 func setAdmins (adminPubKeys) = {
297307 let checkCaller = mustManager(i)
298308 if ((checkCaller == checkCaller))
299309 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
300310 else throw("Strict value is not equal to itself.")
301311 }
302312
303313
304314
305315 @Callable(i)
306316 func setManager (pendingManagerPublicKey) = {
307317 let checkCaller = mustManager(i)
308318 if ((checkCaller == checkCaller))
309319 then {
310320 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
311321 if ((checkManagerPublicKey == checkManagerPublicKey))
312322 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
313323 else throw("Strict value is not equal to itself.")
314324 }
315325 else throw("Strict value is not equal to itself.")
316326 }
317327
318328
319329
320330 @Callable(i)
321331 func confirmManager () = {
322332 let pm = pendingManagerPublicKeyOrUnit()
323333 let hasPM = if (isDefined(pm))
324334 then true
325335 else throw("No pending manager")
326336 if ((hasPM == hasPM))
327337 then {
328338 let checkPM = if ((i.callerPublicKey == value(pm)))
329339 then true
330340 else throw("You are not pending manager")
331341 if ((checkPM == checkPM))
332342 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
333343 else throw("Strict value is not equal to itself.")
334344 }
335345 else throw("Strict value is not equal to itself.")
336346 }
337347
338348
339349
340350 @Callable(i)
341-func priceAssetsREADONLY () = {
342- let priceAssets = match getString(keyPriceAssetIds()) {
343- case s: String =>
344- if ((size(s) == 0))
345- then nil
346- else split(s, SEP)
347- case _ =>
348- nil
349- }
350- $Tuple2(nil, priceAssets)
351- }
351+func priceAssetsREADONLY () = $Tuple2(nil, stringOptionToList(getString(keyPriceAssetIds())))
352352
353353
354354
355355 @Callable(i)
356356 func statusREADONLY (amountAssetId,priceAssetId) = {
357357 let status = match getString(keyStatus(amountAssetId, priceAssetId)) {
358358 case s: String =>
359359 s
360360 case _ =>
361361 unit
362362 }
363363 $Tuple2(nil, status)
364364 }
365365
366366
367367 @Verifier(tx)
368368 func verify () = {
369369 let targetPublicKey = match managerPublicKeyOrUnit() {
370370 case pk: ByteVector =>
371371 pk
372372 case _: Unit =>
373373 tx.senderPublicKey
374374 case _ =>
375375 throw("Match error")
376376 }
377377 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
378378 }
379379

github/deemru/w8io/026f985 
53.60 ms