tx · DjFXPaQdrcPYN4gz6aNTTiLZe19kFBaUUZBsPB7Ht2Nm 3MuMTmGoACSiyXJzcioMw4sYoXk2Ui4aanJ: -0.01700000 Waves 2022.08.31 00:13 [2207707] smart account 3MuMTmGoACSiyXJzcioMw4sYoXk2Ui4aanJ > SELF 0.00000000 Waves
{ "type": 13, "id": "DjFXPaQdrcPYN4gz6aNTTiLZe19kFBaUUZBsPB7Ht2Nm", "fee": 1700000, "feeAssetId": null, "timestamp": 1661893983168, "version": 2, "chainId": 84, "sender": "3MuMTmGoACSiyXJzcioMw4sYoXk2Ui4aanJ", "senderPublicKey": "7opDBgjwGmchRaJn7irNojWPe6uCjvWZc3JGS9FGsd9p", "proofs": [ "4bMFr9pu27XPEgN5o5tWEuxyLASRxmxnsJ5Cx9v4DB3mePHqkNxCPjhyqJwrisV9gCGAY2hscS1E3JabX3jNkPhH" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAAeAAAAAAlnYW1lVG9rZW4BAAAAIJeJnkMy+NLP5OT6k3WKNNG/oDTmgYr0XJzGEku3CrKZAAAAABNnYW1lTWFzdGVyUHVibGljS2V5AQAAACBlJDgo+Fq7PRSc0ciebD/XFlx5Eoi6BjIFEFF4VxVLDwAAAAAXZ2FtZU1hc3RlclB1YmxpY0tleVRlc3QBAAAAIGUkOCj4Wrs9FJzRyJ5sP9cWXHkSiLoGMgUQUXhXFUsPAAAAAAx0b2tlbkFzc2V0SWQCAAAALEJDWUdwM3VmQVk2WVdHektZbWl0ckpTY0FDTjdKWmQzZnBmbWYyZmNYN3EyAAAAAAlnYW1lSW5kZXgCAAAABkdBUkxJQwAAAAAIdG9rZW5BSWQJAAEsAAAAAgkAASwAAAACBQAAAAlnYW1lSW5kZXgCAAAAAV8CAAAAFWYyTXdybU40ZmRzZjQzMkZWOWtTZQAAAAAIdG9rZW5CSWQJAAEsAAAAAgkAASwAAAACBQAAAAlnYW1lSW5kZXgCAAAAAV8CAAAAFWYxTXp3cm1OZGY0MzR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YXRpb25zIHlvdSB3b24hPC9oMT48YnI+PHA+WW91IGhhdmUgd29uIAUAAAAOY29udmVydGVkUHJpY2UCAAAAASAFAAAADHRva2VuQXNzZXRJZAIAAAAEITxwPgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAEmxvdHRlcnlQcmljZVRva2VuQgkAAlkAAAABBQAAAAx0b2tlbkFzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAABpMYXN0IGJsb2NrIGRvZXMgbm90IGV4aXN0LgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAicGF5bWVudCBpcyBub3QgaW4gY29ycmVjdCBhc3NldElkIAkAAlgAAAABBQAAAAlnYW1lVG9rZW4CAAAAAS4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkK7rjM", "height": 2207707, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7u5r5CLbBY6CsE3xKTwk8dnWp4h2LZH7udEFTqf5So8M Next: 53KeKKBTbngaqKrG5jMUk3dpMp6wm6MiPBGCXKi6G4uf Diff:
Old | New | Differences | |
---|---|---|---|
162 | 162 | if ((10000000000 > balance)) | |
163 | 163 | then throw("Amount is less than 100 GRLC, not enough Amount.") | |
164 | 164 | else if (if ((size(i.payments) != 1)) | |
165 | - | then ( | |
165 | + | then (100000000 > p.amount) | |
166 | 166 | else false) | |
167 | 167 | then throw((("Payment not attached or there is more then 1 payment attached with minimum 1 GRLC.[" + toString(tokensPerPlay)) + "-Int]")) | |
168 | 168 | else { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let gameToken = base58'BCYGp3ufAY6YWGzKYmitrJScACN7JZd3fpfmf2fcX7q2' | |
5 | 5 | ||
6 | 6 | let gameMasterPublicKey = base58'7opDBgjwGmchRaJn7irNojWPe6uCjvWZc3JGS9FGsd9p' | |
7 | 7 | ||
8 | 8 | let gameMasterPublicKeyTest = base58'7opDBgjwGmchRaJn7irNojWPe6uCjvWZc3JGS9FGsd9p' | |
9 | 9 | ||
10 | 10 | let tokenAssetId = "BCYGp3ufAY6YWGzKYmitrJScACN7JZd3fpfmf2fcX7q2" | |
11 | 11 | ||
12 | 12 | let gameIndex = "GARLIC" | |
13 | 13 | ||
14 | 14 | let tokenAId = ((gameIndex + "_") + "f2MwrmN4fdsf432FV9kSe") | |
15 | 15 | ||
16 | 16 | let tokenBId = ((gameIndex + "_") + "f1MzwrmNdf434Ffsdfs-0") | |
17 | 17 | ||
18 | 18 | let tokenCId = ((gameIndex + "_") + "f3MzwrmN4widf434Ffsdw") | |
19 | 19 | ||
20 | 20 | let tokensPerPlay = 100000000 | |
21 | 21 | ||
22 | 22 | let lotteryprobability = "_probability" | |
23 | 23 | ||
24 | 24 | let lotteryprobabilitydecimal = "_probability_decimal" | |
25 | 25 | ||
26 | 26 | let lotteryWinningAddress = (gameIndex + "_winning_address") | |
27 | 27 | ||
28 | 28 | let lotteryPrice = "_price" | |
29 | 29 | ||
30 | 30 | let lotteryPrices = ((gameIndex + "_") + "lottery_prices") | |
31 | 31 | ||
32 | 32 | let lotteryAssetId = ((gameIndex + "_") + "lottery_asset_id") | |
33 | 33 | ||
34 | 34 | let countOfPrices = ((gameIndex + "_") + "garlic_count_prices") | |
35 | 35 | ||
36 | 36 | let gameSpinLabel = ((gameIndex + "_") + "SPIN_COUNTER") | |
37 | 37 | ||
38 | 38 | let allowSizeLottery = 3 | |
39 | 39 | ||
40 | 40 | let totalPricesInPool = ((gameIndex + "_") + "total_prizes_pool") | |
41 | 41 | ||
42 | 42 | func checkPermission (callerPublicKey) = (callerPublicKey != gameMasterPublicKey) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func gameSumShaLabel (spin) = (((gameIndex + "_") + toString(spin)) + "_SPIN_RANDOM_HASH") | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func gameGetSumSha (spin) = getString(this, gameSumShaLabel(spin)) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func gameSpinNumber () = getInteger(this, gameSpinLabel) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | let listRandomHash = ["V2F2ZXNMb3R0b1Yy", "V2F2ZXNMb3R0b1Yy", "V2F2ZXNMb3R0b1Yy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "V2F2ZXNMb3Nzb1Yy", "V2F2ZXNMb3Nzb1Yy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "V2F2ZXNMb3Bwb1Yy", "V2F2ZXNMb3Bwb1Yy", "V2F2ZXNMb3Bwb1Yy", "V2F2ZXNMb3Bwb1Yy", "V2F2ZXNMb3Bwb1Yy", "V2F2ZXNMb3Bwb1Yy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "TWF2ZXNNb3Nzb1Yy", "TWF2ZXNNb3Nzb1Yy", "TWF2ZXNNb3Nzb1Yy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "V2F2ZXNNb3Nzb1Yy", "V2F2ZXNNb3Nzb1Yy", "V2F2ZXNNb3Nzb1Yy", "V2F2ZXNNb3Nzb1Yy", "V2F2ZXNNb3Nzb1Yy", "V2F2ZXNNb3Nzb1Yy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "V2F2ZXNMb3R0b1Yy", "V2F2ZXNMb3R0b1Yy", "pdHlFeGNoYW5nZVYy", "pdHlFeGNoYW5nZVYy", "V2F2ZXNMb3Nzb1Yy", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNMb3Nzb1Yy", "V2F2ZXNMb3Nzb1Yy", "V2F2ZXNMb3Nzb1Yy", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "V2F2ZXNMb3R0b1Yy", "V2F2ZXNMb3R0b1Yy", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI", "TWF2ZXNNb3Nzb1Yy", "TWF2ZXNNb3Nzb1Yy", "TWF2ZXNNb3Nzb1Yy", "V2F2ZXNUZWFtVjI", "V2F2ZXNUZWFtVjI"] | |
55 | 55 | ||
56 | 56 | func randomizer (inv,lastPlayHash) = { | |
57 | 57 | let rand = (((((lastPlayHash + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
58 | 58 | sha256(rand) | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getNumberDecimal (number) = if ((number == 1)) | |
63 | 63 | then "0.0" | |
64 | 64 | else if ((number == 2)) | |
65 | 65 | then "0.00" | |
66 | 66 | else if ((number == 3)) | |
67 | 67 | then "0.000" | |
68 | 68 | else if ((number == 4)) | |
69 | 69 | then "0.0000" | |
70 | 70 | else if ((number == 5)) | |
71 | 71 | then "0.00000" | |
72 | 72 | else if ((number == 6)) | |
73 | 73 | then "0.000000" | |
74 | 74 | else if ((number == 7)) | |
75 | 75 | then "0.0000000" | |
76 | 76 | else throw("exceed number") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getPriceArray () = { | |
80 | 80 | let currentPrices = match getString(this, lotteryPrices) { | |
81 | 81 | case a: String => | |
82 | 82 | a | |
83 | 83 | case _: Unit => | |
84 | 84 | "" | |
85 | 85 | case _ => | |
86 | 86 | throw("Match error") | |
87 | 87 | } | |
88 | 88 | let sizePrices = size(currentPrices) | |
89 | 89 | if ((sizePrices == 0)) | |
90 | 90 | then nil | |
91 | 91 | else { | |
92 | 92 | let trimPrices = take(currentPrices, (size(currentPrices) - 1)) | |
93 | 93 | let newArray = split(trimPrices, ",") | |
94 | 94 | newArray | |
95 | 95 | } | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getCurrentBalance () = assetBalance(this, fromBase58String(tokenAssetId)) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func procedLottery (win,token) = if (if (isDefined(token)) | |
103 | 103 | then true | |
104 | 104 | else (token != "")) | |
105 | 105 | then { | |
106 | 106 | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
107 | 107 | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
108 | 108 | let sizeOfWin = size(win) | |
109 | 109 | if ((sizeOfWin == 1)) | |
110 | 110 | then { | |
111 | 111 | let randomNumber = win[0] | |
112 | 112 | let convertedRandomNumber = fromBase64String(randomNumber) | |
113 | 113 | let convertedDecimalNumber = (tokenProbabilityDecimal * 500) | |
114 | 114 | let comparisonNumber = (toInt(convertedRandomNumber) % convertedDecimalNumber) | |
115 | 115 | if ((tokenProbability > comparisonNumber)) | |
116 | 116 | then token :: win | |
117 | 117 | else win | |
118 | 118 | } | |
119 | 119 | else win | |
120 | 120 | } | |
121 | 121 | else win | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func convertAmountToDecimalString (tokenAmount,decimalVal) = { | |
125 | 125 | let tokenAmountSize = size(toString(tokenAmount)) | |
126 | 126 | if ((tokenAmountSize > decimalVal)) | |
127 | 127 | then { | |
128 | 128 | let sufixAmount = takeRight(toString(tokenAmount), decimalVal) | |
129 | 129 | let prefixNumber = take(toString(tokenAmount), (size(toString(tokenAmount)) - decimalVal)) | |
130 | 130 | let finaResult = ((prefixNumber + ".") + sufixAmount) | |
131 | 131 | finaResult | |
132 | 132 | } | |
133 | 133 | else if ((tokenAmountSize == decimalVal)) | |
134 | 134 | then { | |
135 | 135 | let valTemp = (decimalVal - tokenAmountSize) | |
136 | 136 | let finalResult = ("0." + toString(tokenAmount)) | |
137 | 137 | finalResult | |
138 | 138 | } | |
139 | 139 | else { | |
140 | 140 | let diffPriceAndDecimal = (decimalVal - tokenAmountSize) | |
141 | 141 | let prefixAmount = getNumberDecimal(diffPriceAndDecimal) | |
142 | 142 | let finalResult = (prefixAmount + toString(tokenAmount)) | |
143 | 143 | finalResult | |
144 | 144 | } | |
145 | 145 | } | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | @Callable(i) | |
149 | 149 | func setGarlicCoinLottery () = if (checkPermission(i.callerPublicKey)) | |
150 | 150 | then throw((("initGame_FORBBIDEN, Only owner of Pubkey [" + toBase58String(gameMasterPublicKey)) + "] is allowded to Set Factors.")) | |
151 | 151 | else { | |
152 | 152 | let storedTokensValues = (((((tokenAId + ",") + tokenBId) + ",") + tokenCId) + ",") | |
153 | 153 | [IntegerEntry((tokenAId + lotteryprobability), 69), IntegerEntry((tokenAId + lotteryPrice), 69), IntegerEntry((tokenAId + lotteryprobabilitydecimal), 100), StringEntry((tokenAId + lotteryAssetId), tokenAssetId), IntegerEntry((tokenBId + lotteryprobability), 69), IntegerEntry((tokenBId + lotteryPrice), 6900000000), IntegerEntry((tokenBId + lotteryprobabilitydecimal), 10), StringEntry((tokenBId + lotteryAssetId), tokenAssetId), IntegerEntry((tokenCId + lotteryprobability), 69), IntegerEntry((tokenCId + lotteryPrice), 500000000), IntegerEntry((tokenCId + lotteryprobabilitydecimal), 1), StringEntry((tokenCId + lotteryAssetId), tokenAssetId), StringEntry(lotteryPrices, storedTokensValues), IntegerEntry(countOfPrices, 3), IntegerEntry(gameSpinLabel, 0)] | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
158 | 158 | @Callable(i) | |
159 | 159 | func startGarlicLotto () = { | |
160 | 160 | let balance = getCurrentBalance() | |
161 | 161 | let p = i.payments[0] | |
162 | 162 | if ((10000000000 > balance)) | |
163 | 163 | then throw("Amount is less than 100 GRLC, not enough Amount.") | |
164 | 164 | else if (if ((size(i.payments) != 1)) | |
165 | - | then ( | |
165 | + | then (100000000 > p.amount) | |
166 | 166 | else false) | |
167 | 167 | then throw((("Payment not attached or there is more then 1 payment attached with minimum 1 GRLC.[" + toString(tokensPerPlay)) + "-Int]")) | |
168 | 168 | else { | |
169 | 169 | let totalBet = (p.amount + i.fee) | |
170 | 170 | if ((i.payments[0].assetId == gameToken)) | |
171 | 171 | then match blockInfoByHeight((lastBlock.height - 1)) { | |
172 | 172 | case previousBlock: BlockInfo => | |
173 | 173 | let lastSpin = match gameSpinNumber() { | |
174 | 174 | case sp: Int => | |
175 | 175 | sp | |
176 | 176 | case _: Unit => | |
177 | 177 | throw("Garlic lottery has not been initialed yet- missing spin") | |
178 | 178 | case _ => | |
179 | 179 | throw("Match error") | |
180 | 180 | } | |
181 | 181 | let randomNumberToPickup = (toInt(sha256((take(i.transactionId, 16) + take(lastBlock.generationSignature, 16)))) % 17728) | |
182 | 182 | let numberToPick = ((toInt(toBytes(pow(randomNumberToPickup, 0, 2, 0, 0, UP))) + lastSpin) % 64) | |
183 | 183 | let priceList = getPriceArray() | |
184 | 184 | let randomHashToSelect = match gameGetSumSha(randomNumberToPickup) { | |
185 | 185 | case hash: String => | |
186 | 186 | hash | |
187 | 187 | case _ => | |
188 | 188 | listRandomHash[numberToPick] | |
189 | 189 | } | |
190 | 190 | let randomHash = randomizer(i, toBytes(randomHashToSelect)) | |
191 | 191 | let randNumber = toBase64String(randomHash) | |
192 | 192 | let tes = fromBase64String(randNumber) | |
193 | 193 | let listWinningPrices = [randNumber] | |
194 | 194 | let winningToken = { | |
195 | 195 | let $l = priceList | |
196 | 196 | let $s = size($l) | |
197 | 197 | let $acc0 = listWinningPrices | |
198 | 198 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
199 | 199 | then $a | |
200 | 200 | else procedLottery($a, $l[$i]) | |
201 | 201 | ||
202 | 202 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
203 | 203 | then $a | |
204 | 204 | else throw("List size exceeds 3") | |
205 | 205 | ||
206 | 206 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
207 | 207 | } | |
208 | 208 | let sizeOfWinPrices = size(winningToken) | |
209 | 209 | let divider = (500 * 1) | |
210 | 210 | let tas = (toInt(tes) % divider) | |
211 | 211 | if ((sizeOfWinPrices == 1)) | |
212 | 212 | then [StringEntry("message", "<h1>Better luck next time!</h1><br><p>Invite more friends to keep playing!<p>"), StringEntry(gameSumShaLabel(numberToPick), toBase64String(randomHash)), IntegerEntry((toString((lastSpin + 1)) + "_last_hash_number"), tas), IntegerEntry((toString((lastSpin + 1)) + "_last_selected_number"), numberToPick), IntegerEntry(gameSpinLabel, (lastSpin + 1))] | |
213 | 213 | else { | |
214 | 214 | let token = winningToken[0] | |
215 | 215 | let callerAddress = toBase58String(i.caller.bytes) | |
216 | 216 | let addressBalance = getCurrentBalance() | |
217 | 217 | if ((addressBalance == 0)) | |
218 | 218 | then throw("Not Enough Garlic Coin") | |
219 | 219 | else if ((token == tokenAId)) | |
220 | 220 | then { | |
221 | 221 | let lotteryPriceTokenA = match getInteger(this, (tokenAId + lotteryPrice)) { | |
222 | 222 | case t: Int => | |
223 | 223 | t | |
224 | 224 | case _: Unit => | |
225 | 225 | 0 | |
226 | 226 | case _ => | |
227 | 227 | throw("Match error") | |
228 | 228 | } | |
229 | 229 | let winningAmount = ((lotteryPriceTokenA * addressBalance) / 100) | |
230 | 230 | let tokenDecimal = match assetInfo(fromBase58String(tokenAssetId)) { | |
231 | 231 | case asset: Asset => | |
232 | 232 | asset.decimals | |
233 | 233 | case _: Unit => | |
234 | 234 | throw("Can't find asset") | |
235 | 235 | case _ => | |
236 | 236 | throw("Match error") | |
237 | 237 | } | |
238 | 238 | let convertedPrice = convertAmountToDecimalString(winningAmount, tokenDecimal) | |
239 | 239 | [StringEntry((token + lotteryWinningAddress), callerAddress), StringEntry(gameSumShaLabel(numberToPick), toBase64String(randomHash)), IntegerEntry(gameSpinLabel, (lastSpin + 1)), StringEntry("message", (((("<h1>Congratulations you won!</h1><br><p>You have won " + convertedPrice) + " ") + tokenAssetId) + "!<p>")), ScriptTransfer(i.caller, winningAmount, fromBase58String(tokenAssetId))] | |
240 | 240 | } | |
241 | 241 | else { | |
242 | 242 | let lotteryPriceTokenB = match getInteger(this, (token + lotteryPrice)) { | |
243 | 243 | case t: Int => | |
244 | 244 | t | |
245 | 245 | case _: Unit => | |
246 | 246 | 0 | |
247 | 247 | case _ => | |
248 | 248 | throw("Match error") | |
249 | 249 | } | |
250 | 250 | let tokenDecimal = match assetInfo(fromBase58String(tokenAssetId)) { | |
251 | 251 | case asset: Asset => | |
252 | 252 | asset.decimals | |
253 | 253 | case _: Unit => | |
254 | 254 | throw("Can't find asset") | |
255 | 255 | case _ => | |
256 | 256 | throw("Match error") | |
257 | 257 | } | |
258 | 258 | let convertedPrice = convertAmountToDecimalString(lotteryPriceTokenB, tokenDecimal) | |
259 | 259 | [StringEntry((token + lotteryWinningAddress), callerAddress), StringEntry(gameSumShaLabel(numberToPick), toBase64String(randomHash)), IntegerEntry(gameSpinLabel, (lastSpin + 1)), StringEntry("message", (((("<h1>Congratulations you won!</h1><br><p>You have won " + convertedPrice) + " ") + tokenAssetId) + "!<p>")), ScriptTransfer(i.caller, lotteryPriceTokenB, fromBase58String(tokenAssetId))] | |
260 | 260 | } | |
261 | 261 | } | |
262 | 262 | case _ => | |
263 | 263 | throw("Last block does not exist.") | |
264 | 264 | } | |
265 | 265 | else throw((("payment is not in correct assetId " + toBase58String(gameToken)) + ".")) | |
266 | 266 | } | |
267 | 267 | } | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | @Verifier(tx) | |
271 | 271 | func verify () = match tx { | |
272 | 272 | case _ => | |
273 | 273 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
274 | 274 | } | |
275 | 275 |
github/deemru/w8io/169f3d6 110.13 ms ◑