tx · C6BVxkC4o14UBNcA5r9YrqtbVuDsDvAXyShBAjCgvhvw 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD: -0.01500000 Waves 2019.10.05 15:14 [706422] smart account 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD > SELF 0.00000000 Waves
{ "type": 13, "id": "C6BVxkC4o14UBNcA5r9YrqtbVuDsDvAXyShBAjCgvhvw", "fee": 1500000, "feeAssetId": null, "timestamp": 1570277702918, "version": 1, "sender": "3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD", "senderPublicKey": "8W9JLTJTfxrJrBNXxngzueBF4vJqeb6p9jFob7wb6QWQ", "proofs": [ "32UqUxGQFMYaxeAG1VUNTZSq32UAapASsrhucS7UQN8kwi14huuQiS2oavyxLja1PpwLCHMZjnpNSkvXnWN8cMgL" ], "script": "base64:AAIDAAAAAAAAAAwIARIAEgYKBAgICAgAAAAkAAAAAA1yc2FQdWJsaWNLZXkxCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9raXV6L0JWNEVqb3hHaFRtTkNidDJUZ2tiU1BIL3c2OWIzRjFyS21ENjFKaVBYdnZGOEwycEk5eE9ZY1c0Rm1vRVpWSGxSUXRBbGFKeWtsMytyc3JFQ0F3RUFBUT09AAAAAA1yc2FQdWJsaWNLZXkyCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQUpuWHpiTS9WMnNEVjFVTGJQU09sSGtsZE9UV1JySGk1ZnhJa0JtdWV2ckNsTVBWSDdycWNjd2lyRE5jTWRJZHdYSEk5QWRoajlGV2p3R0l3ZlUvSzZNQ0F3RUFBUT09AAAAAA1yc2FQdWJsaWNLZXkzCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9SRGV2eTByNGt6THFPeVNsb0I2M0h1djJlNHplSEtI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jcmlwdFRyYW5zYWN0aW9uBAAAAARzc3R4BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAARzc3R4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAAEc3N0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAARzc3R4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAABGlzdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAABGlzdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAARpc3R4AAAABnByb29mcwAAAAAAAAAAAAgFAAAABGlzdHgAAAAPc2VuZGVyUHVibGljS2V5B21kymc=", "chainId": 84, "height": 706422, "spentComplexity": 0 } View: original | compacted Prev: 6RhvMkHuiRQWbRM2MxGbMC5CCL81SBcyC1oY93tASMP9 Next: 5mQsmZJmPFCJhXUDARfCcsAjr863bBCGYJrh2mKmdjA1 Diff:
Old | New | Differences | |
---|---|---|---|
8 | 8 | let rsaPublicKey3 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAORDevy0r4kzLqOySloB63Huv2e4zeHKHjCsy5vtFKmWZbXJa8gZYt4+EklFIo1K9oqu5BAPVfJ3FOzs2U1A+g0CAwEAAQ==") | |
9 | 9 | ||
10 | 10 | let gameTimeFrame = (1440 * 2) | |
11 | + | ||
12 | + | let commission = 500000 | |
11 | 13 | ||
12 | 14 | let stateAcc = "Accepted" | |
13 | 15 | ||
55 | 57 | ||
56 | 58 | let VstMaxAmt = (VstMinAmt * 10) | |
57 | 59 | ||
58 | - | func pmtAmtCheck (pmtAssetId, | |
59 | - | then if (if (( | |
60 | - | then (WavesMaxAmt >= | |
60 | + | func pmtAmtCheck (pmtAssetId,betAmount) = if ((pmtAssetId == "WAVES")) | |
61 | + | then if (if ((betAmount >= WavesMinAmt)) | |
62 | + | then (WavesMaxAmt >= betAmount) | |
61 | 63 | else false) | |
62 | 64 | then true | |
63 | 65 | else throw("Bet amount is not in range") | |
64 | 66 | else if ((pmtAssetId == "BTC")) | |
65 | - | then if (if (( | |
66 | - | then (BtcMaxAmt >= | |
67 | + | then if (if ((betAmount >= BtcMinAmt)) | |
68 | + | then (BtcMaxAmt >= betAmount) | |
67 | 69 | else false) | |
68 | 70 | then true | |
69 | 71 | else throw("Bet amount is not in range") | |
70 | 72 | else if ((pmtAssetId == "ETH")) | |
71 | - | then if (if (( | |
72 | - | then (EthMaxAmt >= | |
73 | + | then if (if ((betAmount >= EthMinAmt)) | |
74 | + | then (EthMaxAmt >= betAmount) | |
73 | 75 | else false) | |
74 | 76 | then true | |
75 | 77 | else throw("Bet amount is not in range") | |
76 | 78 | else if ((pmtAssetId == "LTC")) | |
77 | - | then if (if (( | |
78 | - | then (LtcMaxAmt >= | |
79 | + | then if (if ((betAmount >= LtcMinAmt)) | |
80 | + | then (LtcMaxAmt >= betAmount) | |
79 | 81 | else false) | |
80 | 82 | then true | |
81 | 83 | else throw("Bet amount is not in range") | |
82 | 84 | else if ((pmtAssetId == "WCT")) | |
83 | - | then if (if (( | |
84 | - | then (WctMaxAmt >= | |
85 | + | then if (if ((betAmount >= WctMinAmt)) | |
86 | + | then (WctMaxAmt >= betAmount) | |
85 | 87 | else false) | |
86 | 88 | then true | |
87 | 89 | else throw("Bet amount is not in range") | |
88 | - | else if (if (( | |
89 | - | then (VstMaxAmt >= | |
90 | + | else if (if ((betAmount >= VstMinAmt)) | |
91 | + | then (VstMaxAmt >= betAmount) | |
90 | 92 | else false) | |
91 | 93 | then true | |
92 | 94 | else throw("Bet amount is not in range") | |
218 | 220 | @Callable(i) | |
219 | 221 | func makeBet () = { | |
220 | 222 | let pmt = extract(i.payment) | |
221 | - | let | |
223 | + | let betAmount = (pmt.amount - commission) | |
222 | 224 | let gameId = toBase58String(i.transactionId) | |
223 | 225 | let gameStart = height | |
224 | 226 | let playerPublicKey = toBase58String(i.callerPublicKey) | |
235 | 237 | else if ((pmt.assetId == vstId)) | |
236 | 238 | then "VST" | |
237 | 239 | else throw("AssetId is incorrect") | |
238 | - | let setReservedBalance = increaseReservedBalance( | |
239 | - | let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, | |
240 | + | let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName) | |
241 | + | let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, betAmount) | |
240 | 242 | if (pmtAmtCorrect) | |
241 | 243 | then { | |
242 | - | let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString( | |
244 | + | let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(betAmount)) + "_") + pmtAssetName) + "_") + toString(gameStart)) | |
243 | 245 | WriteSet([DataEntry(gameId, dataString), DataEntry(("Reserved_" + pmtAssetName), setReservedBalance)]) | |
244 | 246 | } | |
245 | 247 | else throw("assetId is incorrect") | |
274 | 276 | let multiplier = defineMultiplier(threeDrums, twoDrums) | |
275 | 277 | ((betAmt * multiplier) / 10) | |
276 | 278 | } | |
279 | + | let winPmtAmt = { | |
280 | + | let balance = assetBalance(this, assetId58) | |
281 | + | if ((winAmt > balance)) | |
282 | + | then (betAmt * 2) | |
283 | + | else winAmt | |
284 | + | } | |
277 | 285 | let stringForNewData = ((((((dataList[1] + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4]) | |
278 | 286 | let droppedElements = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
279 | 287 | if (stateCorrect) | |
280 | 288 | then if (gameTimeCheck) | |
281 | 289 | then if ((winAmt == 0)) | |
282 | 290 | then WriteSet([DataEntry(gameId, ((((((stateLose + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]) | |
283 | - | else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, | |
291 | + | else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winPmtAmt, assetId58)])) | |
284 | 292 | else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, betAmt, assetId58)])) | |
285 | 293 | else throw("Game state is incorrect") | |
286 | 294 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let rsaPublicKey1 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAOkiuz/BV4EjoxGhTmNCbt2TgkbSPH/w69b3F1rKmD61JiPXvvF8L2pI9xOYcW4FmoEZVHlRQtAlaJykl3+rsrECAwEAAQ==") | |
5 | 5 | ||
6 | 6 | let rsaPublicKey2 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnXzbM/V2sDV1ULbPSOlHkldOTWRrHi5fxIkBmuevrClMPVH7rqccwirDNcMdIdwXHI9Adhj9FWjwGIwfU/K6MCAwEAAQ==") | |
7 | 7 | ||
8 | 8 | let rsaPublicKey3 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAORDevy0r4kzLqOySloB63Huv2e4zeHKHjCsy5vtFKmWZbXJa8gZYt4+EklFIo1K9oqu5BAPVfJ3FOzs2U1A+g0CAwEAAQ==") | |
9 | 9 | ||
10 | 10 | let gameTimeFrame = (1440 * 2) | |
11 | + | ||
12 | + | let commission = 500000 | |
11 | 13 | ||
12 | 14 | let stateAcc = "Accepted" | |
13 | 15 | ||
14 | 16 | let stateWin = "Win" | |
15 | 17 | ||
16 | 18 | let stateTimeout = "WinByTimeout" | |
17 | 19 | ||
18 | 20 | let stateLose = "Lose" | |
19 | 21 | ||
20 | 22 | let wavesId = unit | |
21 | 23 | ||
22 | 24 | let btcId = base58'Gt4HLkHunts7bWbtYP5UCsAPW7TUA4gmQEnjgjbZ2NqB' | |
23 | 25 | ||
24 | 26 | let ethId = base58'6A79GDQj8bdHqUaoJQ3qE1TCPnBc3wFirNCSsAY5RKry' | |
25 | 27 | ||
26 | 28 | let ltcId = base58'7oRhs4zoufHM4KiBDuJwRXUWb9JQaFt98N8ubpmytMmw' | |
27 | 29 | ||
28 | 30 | let vstId = base58'5UyDjBMx1Q8UWhJj1r7JuA6h4aCkKrHE1J19HvMXRpRd' | |
29 | 31 | ||
30 | 32 | let wctId = base58'Ae5W927iuKSLLT6Sdt3bqWze6ZUbYHDWzPY6dLKQusZv' | |
31 | 33 | ||
32 | 34 | let divider = 1000 | |
33 | 35 | ||
34 | 36 | let WavesMinAmt = (100000000 / divider) | |
35 | 37 | ||
36 | 38 | let WavesMaxAmt = (WavesMinAmt * 10) | |
37 | 39 | ||
38 | 40 | let BtcMinAmt = (10000 / divider) | |
39 | 41 | ||
40 | 42 | let BtcMaxAmt = (BtcMinAmt * 10) | |
41 | 43 | ||
42 | 44 | let EthMinAmt = (1000000 / divider) | |
43 | 45 | ||
44 | 46 | let EthMaxAmt = (EthMinAmt * 10) | |
45 | 47 | ||
46 | 48 | let LtcMinAmt = (2000000 / divider) | |
47 | 49 | ||
48 | 50 | let LtcMaxAmt = (LtcMinAmt * 10) | |
49 | 51 | ||
50 | 52 | let WctMinAmt = (500000000 / divider) | |
51 | 53 | ||
52 | 54 | let WctMaxAmt = (WctMinAmt * 10) | |
53 | 55 | ||
54 | 56 | let VstMinAmt = (500000000 / divider) | |
55 | 57 | ||
56 | 58 | let VstMaxAmt = (VstMinAmt * 10) | |
57 | 59 | ||
58 | - | func pmtAmtCheck (pmtAssetId, | |
59 | - | then if (if (( | |
60 | - | then (WavesMaxAmt >= | |
60 | + | func pmtAmtCheck (pmtAssetId,betAmount) = if ((pmtAssetId == "WAVES")) | |
61 | + | then if (if ((betAmount >= WavesMinAmt)) | |
62 | + | then (WavesMaxAmt >= betAmount) | |
61 | 63 | else false) | |
62 | 64 | then true | |
63 | 65 | else throw("Bet amount is not in range") | |
64 | 66 | else if ((pmtAssetId == "BTC")) | |
65 | - | then if (if (( | |
66 | - | then (BtcMaxAmt >= | |
67 | + | then if (if ((betAmount >= BtcMinAmt)) | |
68 | + | then (BtcMaxAmt >= betAmount) | |
67 | 69 | else false) | |
68 | 70 | then true | |
69 | 71 | else throw("Bet amount is not in range") | |
70 | 72 | else if ((pmtAssetId == "ETH")) | |
71 | - | then if (if (( | |
72 | - | then (EthMaxAmt >= | |
73 | + | then if (if ((betAmount >= EthMinAmt)) | |
74 | + | then (EthMaxAmt >= betAmount) | |
73 | 75 | else false) | |
74 | 76 | then true | |
75 | 77 | else throw("Bet amount is not in range") | |
76 | 78 | else if ((pmtAssetId == "LTC")) | |
77 | - | then if (if (( | |
78 | - | then (LtcMaxAmt >= | |
79 | + | then if (if ((betAmount >= LtcMinAmt)) | |
80 | + | then (LtcMaxAmt >= betAmount) | |
79 | 81 | else false) | |
80 | 82 | then true | |
81 | 83 | else throw("Bet amount is not in range") | |
82 | 84 | else if ((pmtAssetId == "WCT")) | |
83 | - | then if (if (( | |
84 | - | then (WctMaxAmt >= | |
85 | + | then if (if ((betAmount >= WctMinAmt)) | |
86 | + | then (WctMaxAmt >= betAmount) | |
85 | 87 | else false) | |
86 | 88 | then true | |
87 | 89 | else throw("Bet amount is not in range") | |
88 | - | else if (if (( | |
89 | - | then (VstMaxAmt >= | |
90 | + | else if (if ((betAmount >= VstMinAmt)) | |
91 | + | then (VstMaxAmt >= betAmount) | |
90 | 92 | else false) | |
91 | 93 | then true | |
92 | 94 | else throw("Bet amount is not in range") | |
93 | 95 | ||
94 | 96 | ||
95 | 97 | func increaseReservedBalance (pmtAmt,pmtAssetName) = { | |
96 | 98 | let currentReservedBalance = { | |
97 | 99 | let valueReservedBalance = getInteger(this, ("Reserved_" + pmtAssetName)) | |
98 | 100 | match valueReservedBalance { | |
99 | 101 | case a: Int => | |
100 | 102 | a | |
101 | 103 | case _ => | |
102 | 104 | 0 | |
103 | 105 | } | |
104 | 106 | } | |
105 | 107 | let newReservedBalance = (currentReservedBalance + pmtAmt) | |
106 | 108 | if ((wavesBalance(this) >= newReservedBalance)) | |
107 | 109 | then { | |
108 | 110 | let increaseReservedBalance = newReservedBalance | |
109 | 111 | increaseReservedBalance | |
110 | 112 | } | |
111 | 113 | else throw("Bet was rejected. Insufficient funds on game account.") | |
112 | 114 | } | |
113 | 115 | ||
114 | 116 | ||
115 | 117 | func getDataList (gameId) = { | |
116 | 118 | let getDataString = getString(this, gameId) | |
117 | 119 | let a = match getDataString { | |
118 | 120 | case a: String => | |
119 | 121 | a | |
120 | 122 | case _ => | |
121 | 123 | throw("GameId was not found") | |
122 | 124 | } | |
123 | 125 | split(a, "_") | |
124 | 126 | } | |
125 | 127 | ||
126 | 128 | ||
127 | 129 | func intToElem (rsaInt) = if ((2 > rsaInt)) | |
128 | 130 | then "7" | |
129 | 131 | else if ((4 > rsaInt)) | |
130 | 132 | then "6" | |
131 | 133 | else if ((6 > rsaInt)) | |
132 | 134 | then "5" | |
133 | 135 | else if ((8 > rsaInt)) | |
134 | 136 | then "4" | |
135 | 137 | else if ((10 > rsaInt)) | |
136 | 138 | then "3" | |
137 | 139 | else if ((12 > rsaInt)) | |
138 | 140 | then "2" | |
139 | 141 | else "1" | |
140 | 142 | ||
141 | 143 | ||
142 | 144 | func rsaToInt (gameId,rsaSign,rsaPublicKey) = { | |
143 | 145 | let rsaCheck = rsaVerify(SHA256, toBytes(gameId), fromBase64String(rsaSign), rsaPublicKey) | |
144 | 146 | if (rsaCheck) | |
145 | 147 | then { | |
146 | 148 | let rsaInt = ((toInt(sha256(fromBase64String(rsaSign))) % 19) + 1) | |
147 | 149 | if (if ((rsaInt > 0)) | |
148 | 150 | then (20 >= rsaInt) | |
149 | 151 | else false) | |
150 | 152 | then rsaInt | |
151 | 153 | else throw("Integer is not in range") | |
152 | 154 | } | |
153 | 155 | else throw("Rsa Signature is invalid") | |
154 | 156 | } | |
155 | 157 | ||
156 | 158 | ||
157 | 159 | func decreaseReservedBalance (betAmt,assetId) = { | |
158 | 160 | let valueReservedBalance = getInteger(this, ("Reserved_" + assetId)) | |
159 | 161 | let extractReservedBalance = match valueReservedBalance { | |
160 | 162 | case a: Int => | |
161 | 163 | a | |
162 | 164 | case _ => | |
163 | 165 | 0 | |
164 | 166 | } | |
165 | 167 | let decreaseReservedBalance = (extractReservedBalance - betAmt) | |
166 | 168 | if ((decreaseReservedBalance > 0)) | |
167 | 169 | then decreaseReservedBalance | |
168 | 170 | else throw("Reserved balance couldn't be less than 0") | |
169 | 171 | } | |
170 | 172 | ||
171 | 173 | ||
172 | 174 | func defineMultiplier (threeDrums,twoDrums) = if ((threeDrums == "777")) | |
173 | 175 | then 5370 | |
174 | 176 | else if ((threeDrums == "666")) | |
175 | 177 | then 1300 | |
176 | 178 | else if ((threeDrums == "555")) | |
177 | 179 | then 450 | |
178 | 180 | else if ((threeDrums == "444")) | |
179 | 181 | then 200 | |
180 | 182 | else if ((threeDrums == "333")) | |
181 | 183 | then 150 | |
182 | 184 | else if ((threeDrums == "222")) | |
183 | 185 | then 110 | |
184 | 186 | else if ((threeDrums == "111")) | |
185 | 187 | then 40 | |
186 | 188 | else if ((twoDrums == "77")) | |
187 | 189 | then 270 | |
188 | 190 | else if ((twoDrums == "66")) | |
189 | 191 | then 130 | |
190 | 192 | else if ((twoDrums == "55")) | |
191 | 193 | then 65 | |
192 | 194 | else if ((twoDrums == "44")) | |
193 | 195 | then 30 | |
194 | 196 | else if ((twoDrums == "33")) | |
195 | 197 | then 20 | |
196 | 198 | else if ((twoDrums == "22")) | |
197 | 199 | then 15 | |
198 | 200 | else if ((twoDrums == "11")) | |
199 | 201 | then 10 | |
200 | 202 | else 0 | |
201 | 203 | ||
202 | 204 | ||
203 | 205 | func AssetNameToBase58 (assetName) = if ((assetName == "WAVES")) | |
204 | 206 | then wavesId | |
205 | 207 | else if ((assetName == "BTC")) | |
206 | 208 | then btcId | |
207 | 209 | else if ((assetName == "ETH")) | |
208 | 210 | then ethId | |
209 | 211 | else if ((assetName == "LTC")) | |
210 | 212 | then ltcId | |
211 | 213 | else if ((assetName == "VST")) | |
212 | 214 | then vstId | |
213 | 215 | else if ((assetName == "WCT")) | |
214 | 216 | then wctId | |
215 | 217 | else throw("Asset name is incorrect") | |
216 | 218 | ||
217 | 219 | ||
218 | 220 | @Callable(i) | |
219 | 221 | func makeBet () = { | |
220 | 222 | let pmt = extract(i.payment) | |
221 | - | let | |
223 | + | let betAmount = (pmt.amount - commission) | |
222 | 224 | let gameId = toBase58String(i.transactionId) | |
223 | 225 | let gameStart = height | |
224 | 226 | let playerPublicKey = toBase58String(i.callerPublicKey) | |
225 | 227 | let pmtAssetName = if (!(isDefined(pmt.assetId))) | |
226 | 228 | then "WAVES" | |
227 | 229 | else if ((pmt.assetId == btcId)) | |
228 | 230 | then "BTC" | |
229 | 231 | else if ((pmt.assetId == ethId)) | |
230 | 232 | then "ETH" | |
231 | 233 | else if ((pmt.assetId == ltcId)) | |
232 | 234 | then "LTC" | |
233 | 235 | else if ((pmt.assetId == wctId)) | |
234 | 236 | then "WCT" | |
235 | 237 | else if ((pmt.assetId == vstId)) | |
236 | 238 | then "VST" | |
237 | 239 | else throw("AssetId is incorrect") | |
238 | - | let setReservedBalance = increaseReservedBalance( | |
239 | - | let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, | |
240 | + | let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName) | |
241 | + | let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, betAmount) | |
240 | 242 | if (pmtAmtCorrect) | |
241 | 243 | then { | |
242 | - | let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString( | |
244 | + | let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(betAmount)) + "_") + pmtAssetName) + "_") + toString(gameStart)) | |
243 | 245 | WriteSet([DataEntry(gameId, dataString), DataEntry(("Reserved_" + pmtAssetName), setReservedBalance)]) | |
244 | 246 | } | |
245 | 247 | else throw("assetId is incorrect") | |
246 | 248 | } | |
247 | 249 | ||
248 | 250 | ||
249 | 251 | ||
250 | 252 | @Callable(i) | |
251 | 253 | func playGame (gameId,rsaSign1,rsaSign2,rsaSign3) = { | |
252 | 254 | let dataList = getDataList(gameId) | |
253 | 255 | let gameState = dataList[0] | |
254 | 256 | let playerAddress = addressFromPublicKey(fromBase58String(dataList[1])) | |
255 | 257 | let betAmt = parseIntValue(dataList[2]) | |
256 | 258 | let assetName = dataList[3] | |
257 | 259 | let gameStart = parseIntValue(dataList[4]) | |
258 | 260 | let assetId58 = AssetNameToBase58(assetName) | |
259 | 261 | let gameTimeCheck = (gameTimeFrame > (height - gameStart)) | |
260 | 262 | let stateCorrect = (gameState == stateAcc) | |
261 | 263 | let setReservedBalance = decreaseReservedBalance(betAmt, assetName) | |
262 | 264 | let droppedElementsList = { | |
263 | 265 | let roll1Int = rsaToInt(gameId, rsaSign1, rsaPublicKey1) | |
264 | 266 | let roll2Int = rsaToInt(gameId, rsaSign2, rsaPublicKey2) | |
265 | 267 | let roll3Int = rsaToInt(gameId, rsaSign3, rsaPublicKey3) | |
266 | 268 | let element1 = intToElem(roll1Int) | |
267 | 269 | let element2 = intToElem(roll2Int) | |
268 | 270 | let element3 = intToElem(roll3Int) | |
269 | 271 | [element1, element2, element3] | |
270 | 272 | } | |
271 | 273 | let winAmt = { | |
272 | 274 | let threeDrums = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
273 | 275 | let twoDrums = (droppedElementsList[0] + droppedElementsList[1]) | |
274 | 276 | let multiplier = defineMultiplier(threeDrums, twoDrums) | |
275 | 277 | ((betAmt * multiplier) / 10) | |
276 | 278 | } | |
279 | + | let winPmtAmt = { | |
280 | + | let balance = assetBalance(this, assetId58) | |
281 | + | if ((winAmt > balance)) | |
282 | + | then (betAmt * 2) | |
283 | + | else winAmt | |
284 | + | } | |
277 | 285 | let stringForNewData = ((((((dataList[1] + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4]) | |
278 | 286 | let droppedElements = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
279 | 287 | if (stateCorrect) | |
280 | 288 | then if (gameTimeCheck) | |
281 | 289 | then if ((winAmt == 0)) | |
282 | 290 | then WriteSet([DataEntry(gameId, ((((((stateLose + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]) | |
283 | - | else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, | |
291 | + | else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winPmtAmt, assetId58)])) | |
284 | 292 | else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, betAmt, assetId58)])) | |
285 | 293 | else throw("Game state is incorrect") | |
286 | 294 | } | |
287 | 295 | ||
288 | 296 | ||
289 | 297 | @Verifier(tx) | |
290 | 298 | func verify () = match tx { | |
291 | 299 | case ttx: TransferTransaction => | |
292 | 300 | let valueReservedBalance = getInteger(this, "Reserved") | |
293 | 301 | let reservedBalance = match valueReservedBalance { | |
294 | 302 | case a: Int => | |
295 | 303 | a | |
296 | 304 | case _ => | |
297 | 305 | 0 | |
298 | 306 | } | |
299 | 307 | let availableBalance = (wavesBalance(this) - reservedBalance) | |
300 | 308 | let availibleAmount = (availableBalance >= ttx.amount) | |
301 | 309 | let signature = sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) | |
302 | 310 | if (availibleAmount) | |
303 | 311 | then signature | |
304 | 312 | else false | |
305 | 313 | case sstx: SetScriptTransaction => | |
306 | 314 | sigVerify(sstx.bodyBytes, sstx.proofs[0], sstx.senderPublicKey) | |
307 | 315 | case istx: InvokeScriptTransaction => | |
308 | 316 | sigVerify(istx.bodyBytes, istx.proofs[0], istx.senderPublicKey) | |
309 | 317 | case _ => | |
310 | 318 | false | |
311 | 319 | } | |
312 | 320 |
github/deemru/w8io/169f3d6 57.45 ms ◑