tx · CidM7rFsnzzgXsPWFgTryr6VwMGBqtDhPTvy8iwvhyr 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd: -0.10020000 Waves 2021.12.03 05:07 [1817475] smart account 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd > SELF 0.00000000 Waves
{ "type": 13, "id": "CidM7rFsnzzgXsPWFgTryr6VwMGBqtDhPTvy8iwvhyr", "fee": 10020000, "feeAssetId": null, "timestamp": 1638497274475, "version": 2, "chainId": 84, "sender": "3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd", "senderPublicKey": "7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi", "proofs": [ "5HzvuMakyHtGYhtAtoaqra6T6wCu2QHBs57XD51HpL4aVQfL5nUs44L9zm9ZPEP3ZdT8Ee4D9szQVh6ve1ZkxWAf" ], "script": "base64:AAIFAAAAAAAAAA4IAhIAEgMKAQESAwoBAQAAAA8AAAAABmNhc2lubwIAAAAjM010YUNMNHYxYmpUYWJVcXM3b1U0b2ZTOGZiYWkzNFdNMWkAAAAABVdBVkVTAAAAAAA7msoAAAAAAAZtYXhCZXQJAABoAAAAAgAAAAAAAAAAZAUAAAAFV0FWRVMAAAAACXNlcGFyYXRvcgIAAAABLAEAAAAKZ2V0TmV3RGVjawAAAAAJAARMAAAAAgIAAAADMDFDCQAETAAAAAICAAAAAzAyQwkABEwAAAACAgAAAAMwM0MJAARMAAAAAgIAAAADMDRDCQAETAAAAAICAAAAAzA1QwkABEwAAAACAgAAAAMwNkMJAARMAAAAAgIAAAADMDdDCQAETAAAAAICAAAAAzA4QwkABEwAAAACAgAAAAMwOUMJAARMAAAAAgIAAAADMTBDCQAETAAAAAICAAAAAzExQwkABEwAAAACAgAAAAMxMkMJAARMAAAAAgIAAAADMTNDCQAETAAAAAICAAAAAzAxRAkABEwAAAACAgAAAAMwMkQJAARMAAAAAgIAAAADMDNECQAETAAAAAICAAAAAzA0RAkABEwAAAACAgAAAAMwNUQJAARMAAAAAgIAAAADMDZECQAETAAAAAICAAAAAzA3RAkABEwAAAACAgAAAAMwOEQJAARMAAAAAgIAAAADMDlECQAETAAAAAICAAAAAzEwRAkABEwAAAACAgAAAAMxMUQJAARMAAAAAgIAAAADMTJECQAETAAAAAICAAAAAzEzRAkABEwAAAACAgAAAAMwMUgJAARMAAAAAgIAAAADMDJICQAETAAAAAICAAAAAzAzSAkABEwAAAACAgAAAAMwNEgJAARMAAAAAgIAAAADMDVICQAETAAAAAICAAAAAzA2SAkABEwAAAACAgAAAAMwN0gJAARMAAAAAgIAAAADMDhICQAETAAAAAICAAAAAzA5SAkABEwAAAACAgAAAAMxMEgJAARMAAAAAgIAAAADMTFICQAETAAAAAICAAAAAzEySAkABEwAAAACAgAAAAMxM0gJAARMAAAAAgIAAAADMDFTCQAETAAAAAICAAAAAzAyUwkABEwAAAACAgAAAAMwM1MJAARMAAAAAgIAAAADMDRTCQAETAAAAAICAAAAAzA1UwkABEwAAAACAgAAAAMwNlMJAARMAAAAAgIAAAADMDdTCQAETAAAAAICAAAAAzA4UwkABEwAAAACAgAAAAMwOVMJAARMAAAAAgIAAAADMTBTCQAETAAAAAICAAAAAzExUwkABEwAAAACAgAAAAMxMlMJAARMAAAAAgIAAAADMTNTBQAAAANuaWwBAAAADmdldFNpeE5ld0RlY2tzAAAAAAkABE4AAAACCQAETgAAAAIJAAROAAAAAgkABE4AAAACCQAETgAAAAIJAQAAAApnZXROZXdEZWNrAAAAAAkBAAAACmdldE5ld0RlY2sAAAAACQEAAAAKZ2V0TmV3RGVjawAAAAAJAQAAAApnZXROZXdEZWNrAAAAAAkBAAAACmdldE5ld0RlY2sAAAAACQEAAAAKZ2V0TmV3RGVjawAAAAABAAAAB2dldERlY2sAAAABAAAABGRlY2sDCQAAZwAAAAIAAAAAAAAAAAAJAAGQAAAAAQUAAAAEZGVjawkBAAAADmdldFNpeE5ld0RlY2tzAAAAAAUAAAAEZGVjawEAAAAPZ2V0UmFuZG9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AAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5eZEclQ==", "height": 1817475, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3GzD2Kzydqm13Kxv3TQSPxhyBRjxLgbLHCg1tGG75xjQ Next: 6pczZxYRahQXyoDHAsn8MAcpCGYxrF7wTUSeJXovjerv Diff:
Old | New | Differences | |
---|---|---|---|
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | + | func getCurrentRound (customRound,callerAddress) = if ((customRound == 0)) | |
97 | + | then { | |
98 | + | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
99 | + | case a: Int => | |
100 | + | a | |
101 | + | case _ => | |
102 | + | throw("Unable to find the round") | |
103 | + | } | |
104 | + | currentRound | |
105 | + | } | |
106 | + | else customRound | |
107 | + | ||
108 | + | ||
96 | 109 | @Callable(i) | |
97 | 110 | func bet () = { | |
98 | 111 | let callerAddress = toBase58String(i.caller.bytes) | |
99 | - | let $ | |
100 | - | let p = $ | |
101 | - | let t = $ | |
112 | + | let $t032983324 = getPayments(i) | |
113 | + | let p = $t032983324._1 | |
114 | + | let t = $t032983324._2 | |
102 | 115 | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
103 | 116 | case a: Int => | |
104 | 117 | (a + 1) | |
113 | 126 | else { | |
114 | 127 | let availableProp = (round + "_deck") | |
115 | 128 | let avDeck = getAvailableDeck(this, availableProp) | |
116 | - | let $ | |
117 | - | let cardPlayer = $ | |
118 | - | let cardPositionPlayer = $ | |
119 | - | let avDeck1 = $ | |
120 | - | let $ | |
121 | - | let cardCasino = $ | |
122 | - | let cardPositionCasino = $ | |
123 | - | let avDeck2 = $ | |
129 | + | let $t038043911 = getPlayerCardAndPositionAndUpdateDeck(round, round, avDeck) | |
130 | + | let cardPlayer = $t038043911._1 | |
131 | + | let cardPositionPlayer = $t038043911._2 | |
132 | + | let avDeck1 = $t038043911._3 | |
133 | + | let $t039164035 = getPlayerCardAndPositionAndUpdateDeck((round + cardPlayer), round, avDeck1) | |
134 | + | let cardCasino = $t039164035._1 | |
135 | + | let cardPositionCasino = $t039164035._2 | |
136 | + | let avDeck2 = $t039164035._3 | |
124 | 137 | if ((1 == 1)) | |
125 | 138 | then { | |
126 | 139 | let currentDraws = 1 | |
127 | 140 | if ((t != 0)) | |
128 | - | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, (t * 10)=") + toString(((t * 10) + t))) + ", unit)")), ScriptTransfer(i.caller, ((t * 10) + t), unit)] | |
129 | - | else [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)] | |
141 | + | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), BooleanEntry(round, true), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, (t * 10)=") + toString(((t * 10) + t))) + ", unit)")), ScriptTransfer(i.caller, ((t * 10) + t), unit)] | |
142 | + | else [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), BooleanEntry(round, true), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)] | |
130 | 143 | } | |
131 | 144 | else if (isPlayerWinner(cardPlayer, cardCasino)) | |
132 | - | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, p=") + toString(p)) + ", unit)")), ScriptTransfer(i.caller, p, unit), BooleanEntry((round + "_stop"), true)] | |
133 | - | else [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)] | |
145 | + | then [StringEntry(availableProp, makeString(avDeck2, separator)), BooleanEntry(round, true), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, p=") + toString(p)) + ", unit)")), ScriptTransfer(i.caller, p, unit), BooleanEntry((round + "_stop"), true)] | |
146 | + | else [StringEntry(availableProp, makeString(avDeck2, separator)), BooleanEntry(round, true), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)] | |
134 | 147 | } | |
135 | 148 | } | |
136 | 149 | ||
137 | 150 | ||
138 | 151 | ||
139 | 152 | @Callable(i) | |
140 | - | func surrender () = { | |
153 | + | func surrender (customRound) = { | |
141 | 154 | let callerAddress = toBase58String(i.caller.bytes) | |
142 | - | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
143 | - | case a: Int => | |
144 | - | toString(a) | |
145 | - | case _ => | |
146 | - | throw("Unable to find the round") | |
147 | - | } | |
148 | - | let round = ((callerAddress + "_") + currentRound) | |
149 | - | if (isDefined(getBoolean(this, (round + "_stop")))) | |
150 | - | then throw("This round is already played") | |
151 | - | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
152 | - | then throw("This game is not on war") | |
153 | - | else { | |
154 | - | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
155 | - | case a: Int => | |
156 | - | a | |
157 | - | case _ => | |
158 | - | throw("Unable to find original bet amount") | |
159 | - | } | |
155 | + | let roundToUse = getCurrentRound(customRound, callerAddress) | |
156 | + | let round = ((callerAddress + "_") + toString(roundToUse)) | |
157 | + | if (!(isDefined(getBoolean(this, round)))) | |
158 | + | then throw("This round is not played") | |
159 | + | else if (isDefined(getBoolean(this, (round + "_stop")))) | |
160 | + | then throw("This round is already played") | |
161 | + | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
162 | + | then throw("This game is not on war") | |
163 | + | else { | |
164 | + | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
165 | + | case a: Int => | |
166 | + | a | |
167 | + | case _ => | |
168 | + | throw("Unable to find original bet amount") | |
169 | + | } | |
160 | 170 | [StringEntry(((round + toString(betAmount)) + " _debug"), (("ScriptTransfer(i.caller, betAmount / 2=" + toString((betAmount / 2))) + ", unit)")), ScriptTransfer(i.caller, (betAmount / 2), unit), BooleanEntry((round + "_stop"), true)] | |
161 | - | } | |
171 | + | } | |
162 | 172 | } | |
163 | 173 | ||
164 | 174 | ||
166 | 176 | @Callable(i) | |
167 | 177 | func goToWar (customRound) = { | |
168 | 178 | let callerAddress = toBase58String(i.caller.bytes) | |
169 | - | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
170 | - | case a: Int => | |
171 | - | a | |
172 | - | case _ => | |
173 | - | throw("Unable to find the round") | |
174 | - | } | |
175 | - | let round = ((callerAddress + "_") + toString(currentRound)) | |
176 | - | if (isDefined(getBoolean(this, (round + "_stop")))) | |
177 | - | then throw("This round is already played") | |
178 | - | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
179 | - | then throw("This game is not on war") | |
180 | - | else { | |
181 | - | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
182 | - | case a: Int => | |
183 | - | a | |
184 | - | case _ => | |
185 | - | throw("Unable to find original bet amount") | |
186 | - | } | |
187 | - | let $t080488074 = getPayments(i) | |
188 | - | let p = $t080488074._1 | |
189 | - | let t = $t080488074._2 | |
190 | - | if ((p != betAmount)) | |
191 | - | then throw((((("original bet amount (" + toString(betAmount)) + ") different to the current payment (") + toString(p)) + ")")) | |
192 | - | else { | |
193 | - | let availableProp = (round + "_deck") | |
194 | - | let avDeck = getAvailableDeck(this, availableProp) | |
195 | - | let $t083648464 = getPlayerCardAndPositionAndUpdateDeck(round, round, avDeck) | |
196 | - | let burned1 = $t083648464._1 | |
197 | - | let burnedPos1 = $t083648464._2 | |
198 | - | let burnedDeck1 = $t083648464._3 | |
199 | - | let $t084778590 = getPlayerCardAndPositionAndUpdateDeck((round + burned1), round, burnedDeck1) | |
200 | - | let burned2 = $t084778590._1 | |
201 | - | let burnedPos2 = $t084778590._2 | |
202 | - | let burnedDeck2 = $t084778590._3 | |
203 | - | let $t086038716 = getPlayerCardAndPositionAndUpdateDeck((round + burned2), round, burnedDeck2) | |
204 | - | let burned3 = $t086038716._1 | |
205 | - | let burnedPos3 = $t086038716._2 | |
206 | - | let burnedDeck3 = $t086038716._3 | |
207 | - | let $t087298849 = getPlayerCardAndPositionAndUpdateDeck((round + burned3), round, burnedDeck3) | |
208 | - | let cardPlayer = $t087298849._1 | |
209 | - | let cardPositionPlayer = $t087298849._2 | |
210 | - | let avDeck1 = $t087298849._3 | |
211 | - | let $t088628981 = getPlayerCardAndPositionAndUpdateDeck((round + cardPlayer), round, avDeck1) | |
212 | - | let cardCasino = $t088628981._1 | |
213 | - | let cardPositionCasino = $t088628981._2 | |
214 | - | let avDeck2 = $t088628981._3 | |
215 | - | if (((cardPositionCasino % 2) == 0)) | |
216 | - | then { | |
217 | - | let currentDraws = match getInteger(this, (round + "_drawSequence")) { | |
218 | - | case a: Int => | |
219 | - | (a + 1) | |
220 | - | case _ => | |
221 | - | 0 | |
222 | - | } | |
223 | - | [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)] | |
224 | - | } | |
225 | - | else if (isPlayerWinner(cardPlayer, cardCasino)) | |
226 | - | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, p=") + toString(p)) + ", unit)")), ScriptTransfer(i.caller, p, unit), BooleanEntry((round + "_stop"), true)] | |
227 | - | else [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_round"), round), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)] | |
228 | - | } | |
229 | - | } | |
179 | + | let roundToUse = getCurrentRound(customRound, callerAddress) | |
180 | + | let round = ((callerAddress + "_") + toString(roundToUse)) | |
181 | + | if (!(isDefined(getBoolean(this, round)))) | |
182 | + | then throw("This round is not played") | |
183 | + | else if (isDefined(getBoolean(this, (round + "_stop")))) | |
184 | + | then throw("This round is already played") | |
185 | + | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
186 | + | then throw("This game is not on war") | |
187 | + | else { | |
188 | + | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
189 | + | case a: Int => | |
190 | + | a | |
191 | + | case _ => | |
192 | + | throw("Unable to find original bet amount") | |
193 | + | } | |
194 | + | let $t085598585 = getPayments(i) | |
195 | + | let p = $t085598585._1 | |
196 | + | let t = $t085598585._2 | |
197 | + | if ((p != betAmount)) | |
198 | + | then throw((((("original bet amount (" + toString(betAmount)) + ") different to the current payment (") + toString(p)) + ")")) | |
199 | + | else { | |
200 | + | let availableProp = (round + "_deck") | |
201 | + | let avDeck = getAvailableDeck(this, availableProp) | |
202 | + | let $t088758975 = getPlayerCardAndPositionAndUpdateDeck(round, round, avDeck) | |
203 | + | let burned1 = $t088758975._1 | |
204 | + | let burnedPos1 = $t088758975._2 | |
205 | + | let burnedDeck1 = $t088758975._3 | |
206 | + | let $t089889101 = getPlayerCardAndPositionAndUpdateDeck((round + burned1), round, burnedDeck1) | |
207 | + | let burned2 = $t089889101._1 | |
208 | + | let burnedPos2 = $t089889101._2 | |
209 | + | let burnedDeck2 = $t089889101._3 | |
210 | + | let $t091149227 = getPlayerCardAndPositionAndUpdateDeck((round + burned2), round, burnedDeck2) | |
211 | + | let burned3 = $t091149227._1 | |
212 | + | let burnedPos3 = $t091149227._2 | |
213 | + | let burnedDeck3 = $t091149227._3 | |
214 | + | let $t092409360 = getPlayerCardAndPositionAndUpdateDeck((round + burned3), round, burnedDeck3) | |
215 | + | let cardPlayer = $t092409360._1 | |
216 | + | let cardPositionPlayer = $t092409360._2 | |
217 | + | let avDeck1 = $t092409360._3 | |
218 | + | let $t093739492 = getPlayerCardAndPositionAndUpdateDeck((round + cardPlayer), round, avDeck1) | |
219 | + | let cardCasino = $t093739492._1 | |
220 | + | let cardPositionCasino = $t093739492._2 | |
221 | + | let avDeck2 = $t093739492._3 | |
222 | + | if (((cardPositionCasino % 2) == 0)) | |
223 | + | then { | |
224 | + | let currentDraws = match getInteger(this, (round + "_drawSequence")) { | |
225 | + | case a: Int => | |
226 | + | (a + 1) | |
227 | + | case _ => | |
228 | + | 0 | |
229 | + | } | |
230 | + | [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)] | |
231 | + | } | |
232 | + | else if (isPlayerWinner(cardPlayer, cardCasino)) | |
233 | + | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, p=") + toString(p)) + ", unit)")), ScriptTransfer(i.caller, p, unit), BooleanEntry((round + "_stop"), true)] | |
234 | + | else [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_round"), round), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)] | |
235 | + | } | |
236 | + | } | |
230 | 237 | } | |
231 | 238 | ||
232 | 239 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let casino = "3MtaCL4v1bjTabUqs7oU4ofS8fbai34WM1i" | |
5 | 5 | ||
6 | 6 | let WAVES = 1000000000 | |
7 | 7 | ||
8 | 8 | let maxBet = (100 * WAVES) | |
9 | 9 | ||
10 | 10 | let separator = "," | |
11 | 11 | ||
12 | 12 | func getNewDeck () = ["01C", "02C", "03C", "04C", "05C", "06C", "07C", "08C", "09C", "10C", "11C", "12C", "13C", "01D", "02D", "03D", "04D", "05D", "06D", "07D", "08D", "09D", "10D", "11D", "12D", "13D", "01H", "02H", "03H", "04H", "05H", "06H", "07H", "08H", "09H", "10H", "11H", "12H", "13H", "01S", "02S", "03S", "04S", "05S", "06S", "07S", "08S", "09S", "10S", "11S", "12S", "13S"] | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func getSixNewDecks () = (((((getNewDeck() ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func getDeck (deck) = if ((0 >= size(deck))) | |
19 | 19 | then getSixNewDecks() | |
20 | 20 | else deck | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getRandomNumber (salt1,salt2,answersCount) = { | |
24 | 24 | let hash = sha256(toBytes((salt1 + salt2))) | |
25 | 25 | let index = toInt(hash) | |
26 | 26 | let rand = (index % answersCount) | |
27 | 27 | if ((0 > rand)) | |
28 | 28 | then ((-1 * rand) + 1) | |
29 | 29 | else (rand + 1) | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getPreviousRandomNumber (address) = match getInteger(this, (address + "_LastRandonNumber")) { | |
34 | 34 | case n: Int => | |
35 | 35 | toString(n) | |
36 | 36 | case _ => | |
37 | 37 | address | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getPayments (i) = if ((size(i.payments) == 0)) | |
42 | 42 | then throw("Payment must be attached") | |
43 | 43 | else if ((size(i.payments) == 1)) | |
44 | 44 | then { | |
45 | 45 | let pmt = i.payments[0] | |
46 | 46 | if (isDefined(pmt.assetId)) | |
47 | 47 | then throw("This function accepts WAVES tokens only (0)") | |
48 | 48 | else $Tuple2(pmt.amount, 0) | |
49 | 49 | } | |
50 | 50 | else { | |
51 | 51 | let pmt = i.payments[0] | |
52 | 52 | if (isDefined(pmt.assetId)) | |
53 | 53 | then throw("This function accepts WAVES tokens only (10)") | |
54 | 54 | else { | |
55 | 55 | let pmt2 = i.payments[1] | |
56 | 56 | if (isDefined(pmt2.assetId)) | |
57 | 57 | then throw("This function accepts WAVES tokens only (11)") | |
58 | 58 | else $Tuple2(pmt.amount, pmt2.amount) | |
59 | 59 | } | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getCardValue (stringCard) = { | |
64 | 64 | let p = parseIntValue(take(stringCard, 2)) | |
65 | 65 | if ((p == 1)) | |
66 | 66 | then 20 | |
67 | 67 | else p | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func isPlayerWinner (cardPlayer,cardCasino) = { | |
72 | 72 | let p = getCardValue(cardPlayer) | |
73 | 73 | let o = getCardValue(cardCasino) | |
74 | 74 | (p > o) | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getAvailableDeck (this,availableProp) = if (isDefined(getString(this, availableProp))) | |
79 | 79 | then { | |
80 | 80 | let stringDeck = getStringValue(this, availableProp) | |
81 | 81 | let deck = split(stringDeck, separator) | |
82 | 82 | getDeck(deck) | |
83 | 83 | } | |
84 | 84 | else getSixNewDecks() | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func getPlayerCardAndPositionAndUpdateDeck (meKey,callerAddress,deck) = { | |
88 | 88 | let avDeck2 = getDeck(deck) | |
89 | 89 | let cardPosition = getRandomNumber(((meKey + makeString(avDeck2, separator)) + callerAddress), getPreviousRandomNumber(callerAddress), size(avDeck2)) | |
90 | 90 | let card = avDeck2[(cardPosition % size(avDeck2))] | |
91 | 91 | let avDeck3 = removeByIndex(avDeck2, (cardPosition % size(avDeck2))) | |
92 | 92 | $Tuple3(card, cardPosition, avDeck3) | |
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | + | func getCurrentRound (customRound,callerAddress) = if ((customRound == 0)) | |
97 | + | then { | |
98 | + | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
99 | + | case a: Int => | |
100 | + | a | |
101 | + | case _ => | |
102 | + | throw("Unable to find the round") | |
103 | + | } | |
104 | + | currentRound | |
105 | + | } | |
106 | + | else customRound | |
107 | + | ||
108 | + | ||
96 | 109 | @Callable(i) | |
97 | 110 | func bet () = { | |
98 | 111 | let callerAddress = toBase58String(i.caller.bytes) | |
99 | - | let $ | |
100 | - | let p = $ | |
101 | - | let t = $ | |
112 | + | let $t032983324 = getPayments(i) | |
113 | + | let p = $t032983324._1 | |
114 | + | let t = $t032983324._2 | |
102 | 115 | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
103 | 116 | case a: Int => | |
104 | 117 | (a + 1) | |
105 | 118 | case _ => | |
106 | 119 | 1 | |
107 | 120 | } | |
108 | 121 | let round = ((callerAddress + "_") + toString(currentRound)) | |
109 | 122 | if (isDefined(getBoolean(this, (round + "_stop")))) | |
110 | 123 | then throw("This round is already played") | |
111 | 124 | else if (isDefined(getString(this, round))) | |
112 | 125 | then throw("You cannot bet on this game") | |
113 | 126 | else { | |
114 | 127 | let availableProp = (round + "_deck") | |
115 | 128 | let avDeck = getAvailableDeck(this, availableProp) | |
116 | - | let $ | |
117 | - | let cardPlayer = $ | |
118 | - | let cardPositionPlayer = $ | |
119 | - | let avDeck1 = $ | |
120 | - | let $ | |
121 | - | let cardCasino = $ | |
122 | - | let cardPositionCasino = $ | |
123 | - | let avDeck2 = $ | |
129 | + | let $t038043911 = getPlayerCardAndPositionAndUpdateDeck(round, round, avDeck) | |
130 | + | let cardPlayer = $t038043911._1 | |
131 | + | let cardPositionPlayer = $t038043911._2 | |
132 | + | let avDeck1 = $t038043911._3 | |
133 | + | let $t039164035 = getPlayerCardAndPositionAndUpdateDeck((round + cardPlayer), round, avDeck1) | |
134 | + | let cardCasino = $t039164035._1 | |
135 | + | let cardPositionCasino = $t039164035._2 | |
136 | + | let avDeck2 = $t039164035._3 | |
124 | 137 | if ((1 == 1)) | |
125 | 138 | then { | |
126 | 139 | let currentDraws = 1 | |
127 | 140 | if ((t != 0)) | |
128 | - | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, (t * 10)=") + toString(((t * 10) + t))) + ", unit)")), ScriptTransfer(i.caller, ((t * 10) + t), unit)] | |
129 | - | else [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)] | |
141 | + | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), BooleanEntry(round, true), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, (t * 10)=") + toString(((t * 10) + t))) + ", unit)")), ScriptTransfer(i.caller, ((t * 10) + t), unit)] | |
142 | + | else [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), BooleanEntry(round, true), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)] | |
130 | 143 | } | |
131 | 144 | else if (isPlayerWinner(cardPlayer, cardCasino)) | |
132 | - | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, p=") + toString(p)) + ", unit)")), ScriptTransfer(i.caller, p, unit), BooleanEntry((round + "_stop"), true)] | |
133 | - | else [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)] | |
145 | + | then [StringEntry(availableProp, makeString(avDeck2, separator)), BooleanEntry(round, true), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, p=") + toString(p)) + ", unit)")), ScriptTransfer(i.caller, p, unit), BooleanEntry((round + "_stop"), true)] | |
146 | + | else [StringEntry(availableProp, makeString(avDeck2, separator)), BooleanEntry(round, true), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)] | |
134 | 147 | } | |
135 | 148 | } | |
136 | 149 | ||
137 | 150 | ||
138 | 151 | ||
139 | 152 | @Callable(i) | |
140 | - | func surrender () = { | |
153 | + | func surrender (customRound) = { | |
141 | 154 | let callerAddress = toBase58String(i.caller.bytes) | |
142 | - | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
143 | - | case a: Int => | |
144 | - | toString(a) | |
145 | - | case _ => | |
146 | - | throw("Unable to find the round") | |
147 | - | } | |
148 | - | let round = ((callerAddress + "_") + currentRound) | |
149 | - | if (isDefined(getBoolean(this, (round + "_stop")))) | |
150 | - | then throw("This round is already played") | |
151 | - | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
152 | - | then throw("This game is not on war") | |
153 | - | else { | |
154 | - | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
155 | - | case a: Int => | |
156 | - | a | |
157 | - | case _ => | |
158 | - | throw("Unable to find original bet amount") | |
159 | - | } | |
155 | + | let roundToUse = getCurrentRound(customRound, callerAddress) | |
156 | + | let round = ((callerAddress + "_") + toString(roundToUse)) | |
157 | + | if (!(isDefined(getBoolean(this, round)))) | |
158 | + | then throw("This round is not played") | |
159 | + | else if (isDefined(getBoolean(this, (round + "_stop")))) | |
160 | + | then throw("This round is already played") | |
161 | + | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
162 | + | then throw("This game is not on war") | |
163 | + | else { | |
164 | + | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
165 | + | case a: Int => | |
166 | + | a | |
167 | + | case _ => | |
168 | + | throw("Unable to find original bet amount") | |
169 | + | } | |
160 | 170 | [StringEntry(((round + toString(betAmount)) + " _debug"), (("ScriptTransfer(i.caller, betAmount / 2=" + toString((betAmount / 2))) + ", unit)")), ScriptTransfer(i.caller, (betAmount / 2), unit), BooleanEntry((round + "_stop"), true)] | |
161 | - | } | |
171 | + | } | |
162 | 172 | } | |
163 | 173 | ||
164 | 174 | ||
165 | 175 | ||
166 | 176 | @Callable(i) | |
167 | 177 | func goToWar (customRound) = { | |
168 | 178 | let callerAddress = toBase58String(i.caller.bytes) | |
169 | - | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
170 | - | case a: Int => | |
171 | - | a | |
172 | - | case _ => | |
173 | - | throw("Unable to find the round") | |
174 | - | } | |
175 | - | let round = ((callerAddress + "_") + toString(currentRound)) | |
176 | - | if (isDefined(getBoolean(this, (round + "_stop")))) | |
177 | - | then throw("This round is already played") | |
178 | - | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
179 | - | then throw("This game is not on war") | |
180 | - | else { | |
181 | - | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
182 | - | case a: Int => | |
183 | - | a | |
184 | - | case _ => | |
185 | - | throw("Unable to find original bet amount") | |
186 | - | } | |
187 | - | let $t080488074 = getPayments(i) | |
188 | - | let p = $t080488074._1 | |
189 | - | let t = $t080488074._2 | |
190 | - | if ((p != betAmount)) | |
191 | - | then throw((((("original bet amount (" + toString(betAmount)) + ") different to the current payment (") + toString(p)) + ")")) | |
192 | - | else { | |
193 | - | let availableProp = (round + "_deck") | |
194 | - | let avDeck = getAvailableDeck(this, availableProp) | |
195 | - | let $t083648464 = getPlayerCardAndPositionAndUpdateDeck(round, round, avDeck) | |
196 | - | let burned1 = $t083648464._1 | |
197 | - | let burnedPos1 = $t083648464._2 | |
198 | - | let burnedDeck1 = $t083648464._3 | |
199 | - | let $t084778590 = getPlayerCardAndPositionAndUpdateDeck((round + burned1), round, burnedDeck1) | |
200 | - | let burned2 = $t084778590._1 | |
201 | - | let burnedPos2 = $t084778590._2 | |
202 | - | let burnedDeck2 = $t084778590._3 | |
203 | - | let $t086038716 = getPlayerCardAndPositionAndUpdateDeck((round + burned2), round, burnedDeck2) | |
204 | - | let burned3 = $t086038716._1 | |
205 | - | let burnedPos3 = $t086038716._2 | |
206 | - | let burnedDeck3 = $t086038716._3 | |
207 | - | let $t087298849 = getPlayerCardAndPositionAndUpdateDeck((round + burned3), round, burnedDeck3) | |
208 | - | let cardPlayer = $t087298849._1 | |
209 | - | let cardPositionPlayer = $t087298849._2 | |
210 | - | let avDeck1 = $t087298849._3 | |
211 | - | let $t088628981 = getPlayerCardAndPositionAndUpdateDeck((round + cardPlayer), round, avDeck1) | |
212 | - | let cardCasino = $t088628981._1 | |
213 | - | let cardPositionCasino = $t088628981._2 | |
214 | - | let avDeck2 = $t088628981._3 | |
215 | - | if (((cardPositionCasino % 2) == 0)) | |
216 | - | then { | |
217 | - | let currentDraws = match getInteger(this, (round + "_drawSequence")) { | |
218 | - | case a: Int => | |
219 | - | (a + 1) | |
220 | - | case _ => | |
221 | - | 0 | |
222 | - | } | |
223 | - | [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)] | |
224 | - | } | |
225 | - | else if (isPlayerWinner(cardPlayer, cardCasino)) | |
226 | - | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, p=") + toString(p)) + ", unit)")), ScriptTransfer(i.caller, p, unit), BooleanEntry((round + "_stop"), true)] | |
227 | - | else [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_round"), round), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)] | |
228 | - | } | |
229 | - | } | |
179 | + | let roundToUse = getCurrentRound(customRound, callerAddress) | |
180 | + | let round = ((callerAddress + "_") + toString(roundToUse)) | |
181 | + | if (!(isDefined(getBoolean(this, round)))) | |
182 | + | then throw("This round is not played") | |
183 | + | else if (isDefined(getBoolean(this, (round + "_stop")))) | |
184 | + | then throw("This round is already played") | |
185 | + | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
186 | + | then throw("This game is not on war") | |
187 | + | else { | |
188 | + | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
189 | + | case a: Int => | |
190 | + | a | |
191 | + | case _ => | |
192 | + | throw("Unable to find original bet amount") | |
193 | + | } | |
194 | + | let $t085598585 = getPayments(i) | |
195 | + | let p = $t085598585._1 | |
196 | + | let t = $t085598585._2 | |
197 | + | if ((p != betAmount)) | |
198 | + | then throw((((("original bet amount (" + toString(betAmount)) + ") different to the current payment (") + toString(p)) + ")")) | |
199 | + | else { | |
200 | + | let availableProp = (round + "_deck") | |
201 | + | let avDeck = getAvailableDeck(this, availableProp) | |
202 | + | let $t088758975 = getPlayerCardAndPositionAndUpdateDeck(round, round, avDeck) | |
203 | + | let burned1 = $t088758975._1 | |
204 | + | let burnedPos1 = $t088758975._2 | |
205 | + | let burnedDeck1 = $t088758975._3 | |
206 | + | let $t089889101 = getPlayerCardAndPositionAndUpdateDeck((round + burned1), round, burnedDeck1) | |
207 | + | let burned2 = $t089889101._1 | |
208 | + | let burnedPos2 = $t089889101._2 | |
209 | + | let burnedDeck2 = $t089889101._3 | |
210 | + | let $t091149227 = getPlayerCardAndPositionAndUpdateDeck((round + burned2), round, burnedDeck2) | |
211 | + | let burned3 = $t091149227._1 | |
212 | + | let burnedPos3 = $t091149227._2 | |
213 | + | let burnedDeck3 = $t091149227._3 | |
214 | + | let $t092409360 = getPlayerCardAndPositionAndUpdateDeck((round + burned3), round, burnedDeck3) | |
215 | + | let cardPlayer = $t092409360._1 | |
216 | + | let cardPositionPlayer = $t092409360._2 | |
217 | + | let avDeck1 = $t092409360._3 | |
218 | + | let $t093739492 = getPlayerCardAndPositionAndUpdateDeck((round + cardPlayer), round, avDeck1) | |
219 | + | let cardCasino = $t093739492._1 | |
220 | + | let cardPositionCasino = $t093739492._2 | |
221 | + | let avDeck2 = $t093739492._3 | |
222 | + | if (((cardPositionCasino % 2) == 0)) | |
223 | + | then { | |
224 | + | let currentDraws = match getInteger(this, (round + "_drawSequence")) { | |
225 | + | case a: Int => | |
226 | + | (a + 1) | |
227 | + | case _ => | |
228 | + | 0 | |
229 | + | } | |
230 | + | [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)] | |
231 | + | } | |
232 | + | else if (isPlayerWinner(cardPlayer, cardCasino)) | |
233 | + | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), StringEntry((round + "_debug"), (((((toString(p) + "-") + toString(t)) + " ScriptTransfer(i.caller, p=") + toString(p)) + ", unit)")), ScriptTransfer(i.caller, p, unit), BooleanEntry((round + "_stop"), true)] | |
234 | + | else [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_round"), round), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)] | |
235 | + | } | |
236 | + | } | |
230 | 237 | } | |
231 | 238 | ||
232 | 239 | ||
233 | 240 | @Verifier(tx) | |
234 | 241 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
235 | 242 |
github/deemru/w8io/026f985 61.99 ms ◑