tx · 9hDZnMaLZAZsiNwbLdqL8ketyeHoG8oiokQzcLpnoF5C

3N5RZzJX5VLb937k1HkfCPj464fa6a916hj:  -0.02000000 Waves

2019.10.21 18:48 [730040] smart account 3N5RZzJX5VLb937k1HkfCPj464fa6a916hj > SELF 0.00000000 Waves

{ "type": 13, "id": "9hDZnMaLZAZsiNwbLdqL8ketyeHoG8oiokQzcLpnoF5C", "fee": 2000000, "feeAssetId": null, "timestamp": 1571672988639, "version": 1, "sender": "3N5RZzJX5VLb937k1HkfCPj464fa6a916hj", "senderPublicKey": "DabN1B19F6fW9mT8w79uNApEku9kf5cVL1kBhoDGqvoN", "proofs": [ "38gHJik2BVYYohiNEWaVsiJ4yBEzY4TncvxyDTQjDho3dRssRYu2X8KCdHZLBHGydoW9j25DHRDEEV4xNCjA1Jt8" ], "script": "base64:AAIDAAAAAAAAAAoIARIAEgQKAgEIAAAAKQAAAAAHV0FWRUxFVAkAAGgAAAACCQAAaAAAAAIAAAAAAAAAAGQAAAAAAAAAA+gAAAAAAAAAA+gAAAAABU1SVEVDAAAAAAAAAABkAAAAAAltYXhSb3VuZHMAAAAAAAX14QAAAAAAB3BtdFN0ZXAJAABoAAAAAgAAAAAAAAAACgUAAAAFTVJURUMAAAAAEHBhcnR5T3duZXJQdWJLZXkJAAJZAAAAAQIAAAAsRkNhUDRqTGhMYXd6RXFid0FRR0FWdlBRQnYyaDNMZEVSQ3g3ZmNrRHZuenIAAAAAEXBhcnR5T3duZXJBZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABBwYXJ0eU93bmVyUHViS2V5AAAAAA1sZWFzaW5nUGVyaW9kAAAAAAAACSfAAAAAABFsZWFzaW5nSWRMaWZldGltZQAAAAAAAAAAlgAAAAAXbGVhc2luZ0lkRGlmZkluTGlmZXRpbWUAAAAAAAAAAAoAAAAACmxlYXNpbmdBbXQJAABoAAAAAgAAAAAAAAAAAQUAAAAHV0FWRUxFVAAAAAAKaGVpZ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zIG9yIGdyZWF0ZXIgdGhhbiAJAAGkAAAAAQUAAAAGTWluRkVFBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAADdHR4BQAAAAckbWF0Y2gwAwkBAAAAASEAAAABBQAAABJsZWFzaW5nUGVyaW9kRW5kZWQJAAACAAAAAQIAAAA4TVJUIHBhcnR5IGhhcyBub3QgZmluaXNoZWQgeWV0LiBUcmFuc2ZlciBpcyBub3QgYWxsb3dlZC4DCQEAAAACIT0AAAACCAkABCQAAAABCAUAAAADdHR4AAAACXJlY2lwaWVudAAAAAVieXRlcwgFAAAAEXBhcnR5T3duZXJBZGRyZXNzAAAABWJ5dGVzCQAAAgAAAAECAAAAL1RyYW5zZmVyIGlzIGFsbG93ZWQgdG8gUGFydHkgT3duZXIgYWRkcmVzcyBvbmx5AwkBAAAAASEAAAABCQAB9AAAAAMIBQAAAAN0dHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAN0dHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAABBwYXJ0eU93bmVyUHViS2V5CQAAAgAAAAECAAAAKVRyYW5zZmVyIGlzIGFsbG93ZWQgZm9yIFBhcnR5IE93bmVyIG9ubHkuBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAA3N0eAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkHOQLvOg==", "chainId": 84, "height": 730040, "spentComplexity": 0 } View: original | compacted Prev: C2V1K2hkYC6SUW6vC4KCRD5z1ccHQx89ggEuPm8gra51 Next: 3d2MqhrBi6PDcT6oxVRZTkb365JbwjmDNwDoot6LwvA8 Diff:
OldNewDifferences
44 let WAVELET = ((100 * 1000) * 1000)
55
66 let MRTEC = 100
7-
8-let B0 = "q"
9-
10-let B1 = "r"
11-
12-let B2 = "s"
13-
14-let B3 = "t"
15-
16-let B4 = "u"
17-
18-let B5 = "v"
19-
20-let B6 = "w"
21-
22-let B7 = "x"
23-
24-let B8 = "y"
25-
26-let B9 = "z"
27-
28-func convertChar (charBase58) = if ((charBase58 == B0))
29- then "0"
30- else if ((charBase58 == B1))
31- then "1"
32- else if ((charBase58 == B2))
33- then "2"
34- else if ((charBase58 == B3))
35- then "3"
36- else if ((charBase58 == B4))
37- then "4"
38- else if ((charBase58 == B5))
39- then "5"
40- else if ((charBase58 == B6))
41- then "6"
42- else if ((charBase58 == B7))
43- then "7"
44- else if ((charBase58 == B8))
45- then "8"
46- else if ((charBase58 == B9))
47- then "9"
48- else throw("Unsupported char")
49-
50-
51-func convertIntoStringFromBase58 (roundInBase58Str) = {
52- let length = size(roundInBase58Str)
53- if ((length > 2))
54- then throw("Invalid ecoded round")
55- else if ((0 >= length))
56- then throw("Invalid ecoded round")
57- else if ((length == 1))
58- then convertChar(take(roundInBase58Str, 1))
59- else if ((length == 2))
60- then (convertChar(take(roundInBase58Str, 1)) + convertChar(take(drop(roundInBase58Str, 1), 1)))
61- else throw("Invalid encoded round")
62- }
63-
647
658 let maxRounds = 100000000
669
9740 let IdxLeasingId = 2
9841
9942 let IdxLeasingIdValidTill = 3
43+
44+func convertChar (char) = {
45+ let B0 = toBytes("0")
46+ let B1 = toBytes("1")
47+ let B2 = toBytes("2")
48+ let B3 = toBytes("3")
49+ let B4 = toBytes("4")
50+ let B5 = toBytes("5")
51+ let B6 = toBytes("6")
52+ let B7 = toBytes("7")
53+ let B8 = toBytes("8")
54+ let B9 = toBytes("9")
55+ if ((char == B0))
56+ then "0"
57+ else if ((char == B1))
58+ then "1"
59+ else if ((char == B2))
60+ then "2"
61+ else if ((char == B3))
62+ then "3"
63+ else if ((char == B4))
64+ then "4"
65+ else if ((char == B5))
66+ then "5"
67+ else if ((char == B6))
68+ then "6"
69+ else if ((char == B7))
70+ then "7"
71+ else if ((char == B8))
72+ then "8"
73+ else if ((char == B9))
74+ then "9"
75+ else throw("Unsupported char")
76+ }
77+
78+
79+func proofToStr (roundNumProof) = {
80+ let s = size(roundNumProof)
81+ if ((s > 2))
82+ then throw("Invalid ecoded round - size couldn't be greater than 2")
83+ else if ((0 >= s))
84+ then throw("Invalid ecoded round - size couldn't be less than or equals 0")
85+ else if ((s == 1))
86+ then convertChar(take(roundNumProof, 1))
87+ else if ((s == 2))
88+ then (convertChar(take(roundNumProof, 1)) + convertChar(take(drop(roundNumProof, 1), 1)))
89+ else throw("Invalid encoded round")
90+ }
91+
10092
10193 func getRoundDataKeyOrFail (round) = if ((0 > round))
10294 then throw("Invalid round number")
224216 then isCompetition
225217 else false)
226218 then throw("Impossible to register leasing transaction - winner has not been determined yet")
227- else if ((size(leasingId58) != 44))
219+ else if ((size(fromBase58String(leasingId58)) > 20))
228220 then throw("Invalid leasing transaction id length")
229221 else if ((0 >= size(leasingId)))
230222 then throw("Leasing transaction id is not encoded as Base58 format")
231223 else if (isDefined(transactionHeightById(leasingId)))
232224 then throw("Passed leasingId has already existed in blockchain")
233225 else if (if ((leaseIdExpirationHeight != 0))
234- then (height > leaseIdExpirationHeight)
226+ then (leaseIdExpirationHeight > height)
235227 else false)
236228 then throw(("Leasing id can be re-registered only on " + toString(leaseIdExpirationHeight)))
237229 else if ((roundDataList[IdxLeasingId] != "?"))
251243 match tx {
252244 case ltx: LeaseTransaction =>
253245 let sig = ltx.proofs[0]
254- let roundBase58Str = toBase58String(ltx.proofs[1])
255- let round = valueOrErrorMessage(parseInt(convertIntoStringFromBase58(roundBase58Str)), "Error during converting round num into integer representation")
246+ let round = valueOrErrorMessage(parseInt(proofToStr(ltx.proofs[1])), "Error during converting round num into integer representation")
256247 let roundDataList = readRoundDataListOrFail(round)
257248 let roundWinPubKey = fromBase58String(roundDataList[IdxWinPubKey])
258249 let registeredLeasingId = fromBase58String(roundDataList[IdxLeasingId])
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let WAVELET = ((100 * 1000) * 1000)
55
66 let MRTEC = 100
7-
8-let B0 = "q"
9-
10-let B1 = "r"
11-
12-let B2 = "s"
13-
14-let B3 = "t"
15-
16-let B4 = "u"
17-
18-let B5 = "v"
19-
20-let B6 = "w"
21-
22-let B7 = "x"
23-
24-let B8 = "y"
25-
26-let B9 = "z"
27-
28-func convertChar (charBase58) = if ((charBase58 == B0))
29- then "0"
30- else if ((charBase58 == B1))
31- then "1"
32- else if ((charBase58 == B2))
33- then "2"
34- else if ((charBase58 == B3))
35- then "3"
36- else if ((charBase58 == B4))
37- then "4"
38- else if ((charBase58 == B5))
39- then "5"
40- else if ((charBase58 == B6))
41- then "6"
42- else if ((charBase58 == B7))
43- then "7"
44- else if ((charBase58 == B8))
45- then "8"
46- else if ((charBase58 == B9))
47- then "9"
48- else throw("Unsupported char")
49-
50-
51-func convertIntoStringFromBase58 (roundInBase58Str) = {
52- let length = size(roundInBase58Str)
53- if ((length > 2))
54- then throw("Invalid ecoded round")
55- else if ((0 >= length))
56- then throw("Invalid ecoded round")
57- else if ((length == 1))
58- then convertChar(take(roundInBase58Str, 1))
59- else if ((length == 2))
60- then (convertChar(take(roundInBase58Str, 1)) + convertChar(take(drop(roundInBase58Str, 1), 1)))
61- else throw("Invalid encoded round")
62- }
63-
647
658 let maxRounds = 100000000
669
6710 let pmtStep = (10 * MRTEC)
6811
6912 let partyOwnerPubKey = fromBase58String("FCaP4jLhLawzEqbwAQGAVvPQBv2h3LdERCx7fckDvnzr")
7013
7114 let partyOwnerAddress = addressFromPublicKey(partyOwnerPubKey)
7215
7316 let leasingPeriod = 600000
7417
7518 let leasingIdLifetime = 150
7619
7720 let leasingIdDiffInLifetime = 10
7821
7922 let leasingAmt = (1 * WAVELET)
8023
8124 let heightStep = 2
8225
8326 let blocksOnGameStart = 729556
8427
8528 let blocksPerRound = 12
8629
8730 let blocksPerCompetition = 8
8831
8932 let MRT = fromBase58String("8b4jE7X1yCNcbF4YXZGBKc8T5xdit7b1gENxxx31daua")
9033
9134 let MinFEE = ((5 * WAVELET) / 1000)
9235
9336 let IdxWinHeight = 0
9437
9538 let IdxWinPubKey = 1
9639
9740 let IdxLeasingId = 2
9841
9942 let IdxLeasingIdValidTill = 3
43+
44+func convertChar (char) = {
45+ let B0 = toBytes("0")
46+ let B1 = toBytes("1")
47+ let B2 = toBytes("2")
48+ let B3 = toBytes("3")
49+ let B4 = toBytes("4")
50+ let B5 = toBytes("5")
51+ let B6 = toBytes("6")
52+ let B7 = toBytes("7")
53+ let B8 = toBytes("8")
54+ let B9 = toBytes("9")
55+ if ((char == B0))
56+ then "0"
57+ else if ((char == B1))
58+ then "1"
59+ else if ((char == B2))
60+ then "2"
61+ else if ((char == B3))
62+ then "3"
63+ else if ((char == B4))
64+ then "4"
65+ else if ((char == B5))
66+ then "5"
67+ else if ((char == B6))
68+ then "6"
69+ else if ((char == B7))
70+ then "7"
71+ else if ((char == B8))
72+ then "8"
73+ else if ((char == B9))
74+ then "9"
75+ else throw("Unsupported char")
76+ }
77+
78+
79+func proofToStr (roundNumProof) = {
80+ let s = size(roundNumProof)
81+ if ((s > 2))
82+ then throw("Invalid ecoded round - size couldn't be greater than 2")
83+ else if ((0 >= s))
84+ then throw("Invalid ecoded round - size couldn't be less than or equals 0")
85+ else if ((s == 1))
86+ then convertChar(take(roundNumProof, 1))
87+ else if ((s == 2))
88+ then (convertChar(take(roundNumProof, 1)) + convertChar(take(drop(roundNumProof, 1), 1)))
89+ else throw("Invalid encoded round")
90+ }
91+
10092
10193 func getRoundDataKeyOrFail (round) = if ((0 > round))
10294 then throw("Invalid round number")
10395 else ("round" + toString(round))
10496
10597
10698 func readRoundDataListOrFail (round) = {
10799 let roundDataOpt = getString(this, getRoundDataKeyOrFail(round))
108100 let roundDataStr = if (isDefined(roundDataOpt))
109101 then extract(roundDataOpt)
110102 else ""
111103 let partyOwnerAddressStr = toBase58String(partyOwnerAddress.bytes)
112104 if ((roundDataStr != ""))
113105 then split(roundDataStr, "_")
114106 else ["0", toString(pmtStep), partyOwnerAddressStr, "?", "0"]
115107 }
116108
117109
118110 func readSharedState () = {
119111 let sharedStateOpt = getString(this, "RoundsSharedState")
120112 let sharedStateStr = if (isDefined(sharedStateOpt))
121113 then extract(sharedStateOpt)
122114 else ""
123115 if ((sharedStateStr != ""))
124116 then split(sharedStateStr, "_")
125117 else ["", "0", ""]
126118 }
127119
128120
129121 func writeSetOfRoundData (type,round,newWinHeight,newWinPubKeyStr,newWinPubKey,leasingId58,leaseIdExpirationHeight) = {
130122 let newWinHeightStr = toString(newWinHeight)
131123 let roundData = DataEntry(getRoundDataKeyOrFail(round), ((((((newWinHeightStr + "_") + newWinPubKeyStr) + "_") + leasingId58) + "_") + toString(leaseIdExpirationHeight)))
132124 if ((type == "MOVE"))
133125 then {
134126 let newWinAddressStr = toString(addressFromPublicKey(newWinPubKey))
135127 let addressLength = size(newWinAddressStr)
136128 let sharedState = readSharedState()
137129 let newTotalGamesCountStr = toString((parseIntValue(sharedState[1]) + 1))
138130 let currLastPlayersAddr = sharedState[2]
139131 let newLastPlayersAddr = if (if ((currLastPlayersAddr != ""))
140132 then (size(currLastPlayersAddr) > ((addressLength + 1) * 10))
141133 else false)
142134 then (("-" + newWinAddressStr) + dropRight(currLastPlayersAddr, (addressLength + 1)))
143135 else (("-" + newWinAddressStr) + currLastPlayersAddr)
144136 WriteSet([roundData, DataEntry("RoundsSharedState", ((((newWinHeightStr + "_") + newTotalGamesCountStr) + "_") + newLastPlayersAddr))])
145137 }
146138 else if ((type == "LEASING"))
147139 then WriteSet([roundData])
148140 else throw(("Unsupported type in writeSetOfRoundData method: " + type))
149141 }
150142
151143
152144 let offset = (height - blocksOnGameStart)
153145
154146 let currRoundNum = if ((offset >= 0))
155147 then (offset / blocksPerRound)
156148 else throw(("Please do not hurry. MRT party will start on " + toString(blocksOnGameStart)))
157149
158150 let currRoundHeight = (offset % blocksPerRound)
159151
160152 let currRoundHeightStart = ((currRoundNum * blocksPerRound) + blocksOnGameStart)
161153
162154 let currRoundCompetitionEnd = (currRoundHeightStart + blocksPerCompetition)
163155
164156 let currRoundDataList = readRoundDataListOrFail(currRoundNum)
165157
166158 let currWinHeight = parseIntValue(currRoundDataList[IdxWinHeight])
167159
168160 let currMinPmtAmt = pmtStep
169161
170162 func isWinByHeight (h) = (height >= h)
171163
172164
173165 let atLeastOneMoveInRoundPresent = (currWinHeight > currRoundHeightStart)
174166
175167 let firstCountdownFinished = if ((currWinHeight == 0))
176168 then isWinByHeight((currRoundHeightStart + heightStep))
177169 else false
178170
179171 let isPauseByWin = if (isWinByHeight(currWinHeight))
180172 then atLeastOneMoveInRoundPresent
181173 else false
182174
183175 let isPauseByTime = if ((currRoundHeight > blocksPerCompetition))
184176 then true
185177 else firstCountdownFinished
186178
187179 let isPause = if (isPauseByWin)
188180 then true
189181 else isPauseByTime
190182
191183 let isCompetition = !(isPause)
192184
193185 @Callable(inv)
194186 func move () = {
195187 let overflowedNewWinHeight = (height + heightStep)
196188 let newWinHeight = if ((overflowedNewWinHeight >= currRoundCompetitionEnd))
197189 then currRoundCompetitionEnd
198190 else overflowedNewWinHeight
199191 let payment = if (isDefined(inv.payment))
200192 then extract(inv.payment)
201193 else throw("Please attach payment with MRT to participate in MRT party")
202194 if ((currRoundNum >= maxRounds))
203195 then throw("MRT party is over")
204196 else if (isPause)
205197 then throw((("Sorry but round #" + toString(currRoundNum)) + " is finished."))
206198 else if ((payment.assetId != MRT))
207199 then throw("Please use MRT as a payment asset to participate in MRT party")
208200 else if ((currMinPmtAmt > payment.amount))
209201 then throw(("Sorry my friend but your payment is to small. Current min payment is " + toString(currMinPmtAmt)))
210202 else writeSetOfRoundData("MOVE", currRoundNum, newWinHeight, toBase58String(inv.callerPublicKey), inv.callerPublicKey, "?", 0)
211203 }
212204
213205
214206
215207 @Callable(inv)
216208 func registerLeasingTx (round,leasingId58) = {
217209 let leasingId = fromBase58String(leasingId58)
218210 let roundDataList = readRoundDataListOrFail(round)
219211 let winnerPubKey = fromBase58String(roundDataList[IdxWinPubKey])
220212 let leaseIdExpirationHeight = parseIntValue(roundDataList[IdxLeasingIdValidTill])
221213 if ((round > currRoundNum))
222214 then throw("Impossible to register leasing transaction for round in future")
223215 else if (if ((round == currRoundNum))
224216 then isCompetition
225217 else false)
226218 then throw("Impossible to register leasing transaction - winner has not been determined yet")
227- else if ((size(leasingId58) != 44))
219+ else if ((size(fromBase58String(leasingId58)) > 20))
228220 then throw("Invalid leasing transaction id length")
229221 else if ((0 >= size(leasingId)))
230222 then throw("Leasing transaction id is not encoded as Base58 format")
231223 else if (isDefined(transactionHeightById(leasingId)))
232224 then throw("Passed leasingId has already existed in blockchain")
233225 else if (if ((leaseIdExpirationHeight != 0))
234- then (height > leaseIdExpirationHeight)
226+ then (leaseIdExpirationHeight > height)
235227 else false)
236228 then throw(("Leasing id can be re-registered only on " + toString(leaseIdExpirationHeight)))
237229 else if ((roundDataList[IdxLeasingId] != "?"))
238230 then throw(("Leasing tx id has already registered for round " + toString(round)))
239231 else if ((inv.callerPublicKey != winnerPubKey))
240232 then throw("Leasing tx can be registered by round winner only")
241233 else {
242234 let roundWinHeight = parseIntValue(roundDataList[IdxWinHeight])
243235 writeSetOfRoundData("LEASING", round, roundWinHeight, roundDataList[IdxWinPubKey], toBytes(""), leasingId58, (height + leasingIdLifetime))
244236 }
245237 }
246238
247239
248240 @Verifier(tx)
249241 func verify () = {
250242 let leasingPeriodEnded = (height > ((blocksOnGameStart + (maxRounds * blocksPerRound)) + leasingPeriod))
251243 match tx {
252244 case ltx: LeaseTransaction =>
253245 let sig = ltx.proofs[0]
254- let roundBase58Str = toBase58String(ltx.proofs[1])
255- let round = valueOrErrorMessage(parseInt(convertIntoStringFromBase58(roundBase58Str)), "Error during converting round num into integer representation")
246+ let round = valueOrErrorMessage(parseInt(proofToStr(ltx.proofs[1])), "Error during converting round num into integer representation")
256247 let roundDataList = readRoundDataListOrFail(round)
257248 let roundWinPubKey = fromBase58String(roundDataList[IdxWinPubKey])
258249 let registeredLeasingId = fromBase58String(roundDataList[IdxLeasingId])
259250 let leaseIdExpirationHeight = parseIntValue(roundDataList[IdxLeasingIdValidTill])
260251 if (leasingPeriodEnded)
261252 then throw("Sorry but leasing period has been ended")
262253 else if ((height > (leaseIdExpirationHeight - leasingIdDiffInLifetime)))
263254 then throw("Sorry but lifetime of your leasing transaction id has been expired")
264255 else if (!(sigVerify(ltx.bodyBytes, sig, roundWinPubKey)))
265256 then throw("Invalid leasing transaction signature. Leasing is allowed for winner only.")
266257 else if ((ltx.id != registeredLeasingId))
267258 then throw("Leasing transaction id doesn't match with registered leasing id")
268259 else if ((ltx.amount != leasingAmt))
269260 then throw(("Impossible to lease less or greater than " + toString(leasingAmt)))
270261 else if ((ltx.fee != MinFEE))
271262 then throw(("Impossible to lease with fee less or greater than " + toString(MinFEE)))
272263 else true
273264 case cltx: LeaseCancelTransaction =>
274265 if (!(leasingPeriodEnded))
275266 then throw("MRT party has not finished yet. Leasing Cancel is not allowed.")
276267 else if (!(sigVerify(tx.bodyBytes, tx.proofs[0], partyOwnerPubKey)))
277268 then throw("Leasing Cancel is allowed to Party Owner only")
278269 else if ((cltx.fee != MinFEE))
279270 then throw(("Impossible to cancle leasing with fee less or greater than " + toString(MinFEE)))
280271 else true
281272 case ttx: TransferTransaction =>
282273 if (!(leasingPeriodEnded))
283274 then throw("MRT party has not finished yet. Transfer is not allowed.")
284275 else if ((addressFromRecipient(ttx.recipient).bytes != partyOwnerAddress.bytes))
285276 then throw("Transfer is allowed to Party Owner address only")
286277 else if (!(sigVerify(ttx.bodyBytes, ttx.proofs[0], partyOwnerPubKey)))
287278 then throw("Transfer is allowed for Party Owner only.")
288279 else true
289280 case stx: SetScriptTransaction =>
290281 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
291282 case _ =>
292283 false
293284 }
294285 }
295286

github/deemru/w8io/169f3d6 
54.34 ms