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