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