tx · 51kDzNyF4P6xFHidCDgoaDWKXxMV9KDwwgTUuEN7vkUK 3ND68eBy9NyJPeq4eRqi42c45hoDAzzRjSm: -0.01500000 Waves 2019.06.28 15:01 [561941] smart account 3ND68eBy9NyJPeq4eRqi42c45hoDAzzRjSm > SELF 0.00000000 Waves
{ "type": 13, "id": "51kDzNyF4P6xFHidCDgoaDWKXxMV9KDwwgTUuEN7vkUK", "fee": 1500000, "feeAssetId": null, "timestamp": 1561723259395, "version": 1, "sender": "3ND68eBy9NyJPeq4eRqi42c45hoDAzzRjSm", "senderPublicKey": "G96KjJm4zuY2fBkuSsXDF78nNX921QaQtck3gaF3AksA", "proofs": [ "3ZrmpV4vyUm89VB3qhkX1tcUk4ZJjuC1ZQkyZkURwGWXZz3bdctWqUNToNuxDHU6JfC1YmbWAcUD8B1DB1EELpJq" ], "script": "base64:AAIDAAAAAAAAAAAAAAAmAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcWxBaUFOU21CcERIWUtQOXNLZ2VOL2wxYkFiMjhnL3RHbGdEa3dUNUZpTU40WDNwd2R2ZHhFN212U1I4LzQxZFU5cng0akcrNnRacGIxVUxWRFBzNDMxdFIySVJhVFh3NUNqK0FjMnZoTCs1SmFtQ2VyR0QxVVcrYmgvRUdRdHhvOFczWUxEcm9mWEI1UUhKeDRQa3oyS2dmK29TL0M4aEh1Qi9VNGtyTzc2VTA1MDdHVGpaUFA5a1JRMHVMU01lcVFYdDh3WFMrbk1wNXdhanF4UHBETE1hU1JFZ3NLd3YvQUVrUDRkenBUWWJpa0xCWWw0cXRkSnNEODRITEZTa2l3ZDNCaGNPclBqb0lZbUx4UXVCRDVUSU1LVEtEM3NkWmdhWTlyc3lxeDNBMDBpbm55eEQ2enAzYjRnRnBVT1g4SnhLWmRFQzJteUVxbGVOZ2c3R3p3SURBUUFCAAAAAAZTRVJ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QEAAAASRXh0cmFjdFJlc2VydmVkQW10AAAAAAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAA3N0eAUAAAAHJG1hdGNoMAYHByvZf68=", "chainId": 84, "height": 561941, "spentComplexity": 0 } View: original | compacted Prev: 9xigoFb6rVaKmCj9SKj4qj2PdzBKGdV4zEPaLARrwLWz Next: 6D5jukQNyDTQ3VzjosRZ1TCYpEj63M1fJqgdwCJP8JZS Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB") | |
5 | 5 | ||
6 | - | let SERVER = addressFromStringValue(" | |
6 | + | let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j") | |
7 | 7 | ||
8 | 8 | let RANDORACLETIMEFRAME = 2880 | |
9 | 9 | ||
210 | 210 | ||
211 | 211 | ||
212 | 212 | @Callable(i) | |
213 | - | func bet (playerChoice) = { | |
214 | - | let newGameNum = IncrementGameNum() | |
215 | - | let gameId = toBase58String(i.transactionId) | |
216 | - | let pmt = extract(i.payment) | |
217 | - | let betNotInWaves = isDefined(pmt.assetId) | |
218 | - | let feeNotInWaves = isDefined(pmt.assetId) | |
219 | - | let winAmt = ValidateBetAndDefineWinAmt(pmt.amount, playerChoice) | |
220 | - | let txIdUsed = isDefined(getString(this, gameId)) | |
221 | - | if (betNotInWaves) | |
222 | - | then throw("Bet amount must be in Waves") | |
223 | - | else if (feeNotInWaves) | |
224 | - | then throw("Transaction's fee must be in Waves") | |
225 | - | else if (txIdUsed) | |
226 | - | then throw("Passed txId had been used before. Game aborted.") | |
227 | - | else { | |
228 | - | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
229 | - | let gameDataStr = FormatGameDataStr(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmt, "") | |
230 | - | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(SERVER, COMMISSION, unit)])) | |
231 | - | } | |
232 | - | } | |
233 | - | ||
234 | - | ||
235 | - | ||
236 | - | @Callable(i) | |
237 | 213 | func withdraw (gameId,rsaSign) = { | |
238 | 214 | let gameDataList = ExtractGameDataList(gameId) | |
239 | 215 | let gameState = gameDataList[IdxGameState] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB") | |
5 | 5 | ||
6 | - | let SERVER = addressFromStringValue(" | |
6 | + | let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j") | |
7 | 7 | ||
8 | 8 | let RANDORACLETIMEFRAME = 2880 | |
9 | 9 | ||
10 | 10 | let WAVELET = ((100 * 1000) * 1000) | |
11 | 11 | ||
12 | 12 | let COMMISSION = ((5 * WAVELET) / 1000) | |
13 | 13 | ||
14 | 14 | let BET1 = (1 * WAVELET) | |
15 | 15 | ||
16 | 16 | let BET2 = (2 * WAVELET) | |
17 | 17 | ||
18 | 18 | let BET4 = (4 * WAVELET) | |
19 | 19 | ||
20 | 20 | let BET8 = (8 * WAVELET) | |
21 | 21 | ||
22 | 22 | let BET14 = (14 * WAVELET) | |
23 | 23 | ||
24 | 24 | let RATEMULT = 10000 | |
25 | 25 | ||
26 | 26 | let RATE = 19000 | |
27 | 27 | ||
28 | 28 | let IdxGameState = 0 | |
29 | 29 | ||
30 | 30 | let IdxPlayerChoice = 1 | |
31 | 31 | ||
32 | 32 | let IdxPlayerPubKey58 = 2 | |
33 | 33 | ||
34 | 34 | let IdxStartedHeight = 3 | |
35 | 35 | ||
36 | 36 | let IdxWinAmt = 4 | |
37 | 37 | ||
38 | 38 | let IdxRandOrEmpty = 5 | |
39 | 39 | ||
40 | 40 | let RESERVATIONKEY = "$RESERVED_AMOUNT" | |
41 | 41 | ||
42 | 42 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
43 | 43 | ||
44 | 44 | let STATESUBMITTED = "SUBMITTED" | |
45 | 45 | ||
46 | 46 | let STATEWON = "WON" | |
47 | 47 | ||
48 | 48 | let STATELOST = "LOST" | |
49 | 49 | ||
50 | 50 | func IncrementGameNum () = { | |
51 | 51 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
52 | 52 | case num: Int => | |
53 | 53 | num | |
54 | 54 | case _ => | |
55 | 55 | 0 | |
56 | 56 | } | |
57 | 57 | (gameNum + 1) | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
62 | 62 | case a: Int => | |
63 | 63 | a | |
64 | 64 | case _ => | |
65 | 65 | 0 | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func ValidateAndIncreaseReservedAmt (winAmt) = { | |
70 | 70 | let newReservedAmount = (ExtractReservedAmt() + winAmt) | |
71 | 71 | let balance = wavesBalance(this) | |
72 | 72 | if ((newReservedAmount > balance)) | |
73 | 73 | then throw("Insufficient funds on Dice Roller account. Transaction was rejected for your safety.") | |
74 | 74 | else newReservedAmount | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func DecreaseReservedAmt (gameId,winAmt) = { | |
79 | 79 | let newReservedAmount = (ExtractReservedAmt() - winAmt) | |
80 | 80 | if ((0 > newReservedAmount)) | |
81 | 81 | then throw("Invalid Dice Roller account state - reserved amount is less than 0") | |
82 | 82 | else DataEntry(RESERVATIONKEY, newReservedAmount) | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func ValidateBetAndDefineWinAmt (betAmt,playerChoice) = { | |
87 | 87 | let betAmtValid = if (if (if (if ((betAmt == (BET1 + COMMISSION))) | |
88 | 88 | then true | |
89 | 89 | else (betAmt == (BET2 + COMMISSION))) | |
90 | 90 | then true | |
91 | 91 | else (betAmt == (BET4 + COMMISSION))) | |
92 | 92 | then true | |
93 | 93 | else (betAmt == (BET8 + COMMISSION))) | |
94 | 94 | then true | |
95 | 95 | else (betAmt == (BET14 + COMMISSION)) | |
96 | 96 | if (betAmtValid) | |
97 | 97 | then { | |
98 | 98 | let choiceSize = size(playerChoice) | |
99 | 99 | let bet = (betAmt - COMMISSION) | |
100 | 100 | if ((choiceSize == 1)) | |
101 | 101 | then ((bet * RATE) / RATEMULT) | |
102 | 102 | else throw("Invalid player's choice format") | |
103 | 103 | } | |
104 | 104 | else throw("Bet amount is not in range") | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func RandToStr (r) = if ((r == 0)) | |
109 | 109 | then "0" | |
110 | 110 | else if ((r == 1)) | |
111 | 111 | then "1" | |
112 | 112 | else throw(("Unsupported r parameter passed: expected=[0,...,1] actual=" + toString(r))) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func GenerateRandInt (gameId,rsaSign) = { | |
116 | 116 | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
117 | 117 | if (rsaSigValid) | |
118 | 118 | then { | |
119 | 119 | let rand = (toInt(sha256(rsaSign)) % 2) | |
120 | 120 | if ((0 > rand)) | |
121 | 121 | then (-1 * rand) | |
122 | 122 | else rand | |
123 | 123 | } | |
124 | 124 | else throw("Invalid RSA signature") | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func IsPlayerWin (playerChoice,randStr) = { | |
129 | 129 | let s = size(playerChoice) | |
130 | 130 | if ((s == 1)) | |
131 | 131 | then (playerChoice == randStr) | |
132 | 132 | else false | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func FormatGameDataParam (p) = { | |
137 | 137 | let s = size(p) | |
138 | 138 | if ((s == 0)) | |
139 | 139 | then throw("Parameter size must be greater then 0") | |
140 | 140 | else if ((s > 99)) | |
141 | 141 | then throw("Parameter size must be less then 100") | |
142 | 142 | else if ((10 > s)) | |
143 | 143 | then (("0" + toString(s)) + p) | |
144 | 144 | else (toString(s) + p) | |
145 | 145 | } | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func FormatGameDataStr (gameState,playerChoice,playerPubKey58,startedHeight,winAmt,randOrEmpty) = { | |
149 | 149 | let fullStateStr = ((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(playerChoice)) + "_") + FormatGameDataParam(playerPubKey58)) + "_") + FormatGameDataParam(toString(startedHeight))) + "_") + FormatGameDataParam(toString(winAmt))) | |
150 | 150 | if ((randOrEmpty == "")) | |
151 | 151 | then fullStateStr | |
152 | 152 | else ((fullStateStr + "_") + FormatGameDataParam(randOrEmpty)) | |
153 | 153 | } | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0)) | |
157 | 157 | then drop(remaining, 1) | |
158 | 158 | else remaining | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func ParseNextAttribute (remaining) = { | |
162 | 162 | let s = size(remaining) | |
163 | 163 | if ((s > 0)) | |
164 | 164 | then { | |
165 | 165 | let nn = parseIntValue(take(remaining, 2)) | |
166 | 166 | let v = take(drop(remaining, 2), nn) | |
167 | 167 | let tmpRemaining = drop(remaining, (nn + 2)) | |
168 | 168 | let remainingState = RemoveUnderscoreIfPresent(tmpRemaining) | |
169 | 169 | [v, remainingState] | |
170 | 170 | } | |
171 | 171 | else throw("Empty string was passed into parseNextAttribute func") | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func ParseGameRawDataStr (rawStateStr) = { | |
176 | 176 | let gameState = ParseNextAttribute(rawStateStr) | |
177 | 177 | let playerChoice = ParseNextAttribute(gameState[1]) | |
178 | 178 | let playerPubKey58 = ParseNextAttribute(playerChoice[1]) | |
179 | 179 | let startedHeight = ParseNextAttribute(playerPubKey58[1]) | |
180 | 180 | let winAmt = ParseNextAttribute(startedHeight[1]) | |
181 | 181 | [gameState[0], playerChoice[0], playerPubKey58[0], startedHeight[0], winAmt[0]] | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func ExtractGameDataList (gameId) = { | |
186 | 186 | let rawDataStr = match getString(this, gameId) { | |
187 | 187 | case str: String => | |
188 | 188 | str | |
189 | 189 | case _ => | |
190 | 190 | throw(("Couldn't find game by " + gameId)) | |
191 | 191 | } | |
192 | 192 | ParseGameRawDataStr(rawDataStr) | |
193 | 193 | } | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func WinScriptSet (gameId,playerAddress,winAmt,newGameDataStr,winByTimeout,decreasedReserves) = { | |
197 | 197 | let wSetCommonData = [decreasedReserves] | |
198 | 198 | let tSetCommonData = [ScriptTransfer(playerAddress, winAmt, unit)] | |
199 | 199 | if (winByTimeout) | |
200 | 200 | then { | |
201 | 201 | let newGameDataStrAdjusted = ((newGameDataStr + "_") + FormatGameDataParam("TIMEOUT")) | |
202 | 202 | let gameData = DataEntry(gameId, newGameDataStrAdjusted) | |
203 | 203 | ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData)) | |
204 | 204 | } | |
205 | 205 | else { | |
206 | 206 | let gameData = DataEntry(gameId, newGameDataStr) | |
207 | 207 | ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData)) | |
208 | 208 | } | |
209 | 209 | } | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | @Callable(i) | |
213 | - | func bet (playerChoice) = { | |
214 | - | let newGameNum = IncrementGameNum() | |
215 | - | let gameId = toBase58String(i.transactionId) | |
216 | - | let pmt = extract(i.payment) | |
217 | - | let betNotInWaves = isDefined(pmt.assetId) | |
218 | - | let feeNotInWaves = isDefined(pmt.assetId) | |
219 | - | let winAmt = ValidateBetAndDefineWinAmt(pmt.amount, playerChoice) | |
220 | - | let txIdUsed = isDefined(getString(this, gameId)) | |
221 | - | if (betNotInWaves) | |
222 | - | then throw("Bet amount must be in Waves") | |
223 | - | else if (feeNotInWaves) | |
224 | - | then throw("Transaction's fee must be in Waves") | |
225 | - | else if (txIdUsed) | |
226 | - | then throw("Passed txId had been used before. Game aborted.") | |
227 | - | else { | |
228 | - | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
229 | - | let gameDataStr = FormatGameDataStr(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmt, "") | |
230 | - | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(SERVER, COMMISSION, unit)])) | |
231 | - | } | |
232 | - | } | |
233 | - | ||
234 | - | ||
235 | - | ||
236 | - | @Callable(i) | |
237 | 213 | func withdraw (gameId,rsaSign) = { | |
238 | 214 | let gameDataList = ExtractGameDataList(gameId) | |
239 | 215 | let gameState = gameDataList[IdxGameState] | |
240 | 216 | let playerChoice = gameDataList[IdxPlayerChoice] | |
241 | 217 | let startedHeight = parseIntValue(gameDataList[IdxStartedHeight]) | |
242 | 218 | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
243 | 219 | let playerPubKey58 = gameDataList[IdxPlayerPubKey58] | |
244 | 220 | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
245 | 221 | let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME) | |
246 | 222 | let decreasedReserves = DecreaseReservedAmt(gameId, winAmt) | |
247 | 223 | if ((gameState != STATESUBMITTED)) | |
248 | 224 | then throw("Invalid game state for passed gameId") | |
249 | 225 | else if (winByTimeout) | |
250 | 226 | then { | |
251 | 227 | let randStr = take(playerChoice, 1) | |
252 | 228 | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
253 | 229 | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves) | |
254 | 230 | } | |
255 | 231 | else { | |
256 | 232 | let randStr = RandToStr(GenerateRandInt(gameId, rsaSign)) | |
257 | 233 | if (IsPlayerWin(playerChoice, randStr)) | |
258 | 234 | then { | |
259 | 235 | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
260 | 236 | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves) | |
261 | 237 | } | |
262 | 238 | else { | |
263 | 239 | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, playerPubKey58, startedHeight, winAmt, randStr) | |
264 | 240 | WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves]) | |
265 | 241 | } | |
266 | 242 | } | |
267 | 243 | } | |
268 | 244 | ||
269 | 245 | ||
270 | 246 | @Verifier(tx) | |
271 | 247 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
272 | 248 | then match tx { | |
273 | 249 | case ttx: TransferTransaction => | |
274 | 250 | ((wavesBalance(this) - ttx.amount) >= ExtractReservedAmt()) | |
275 | 251 | case stx: SetScriptTransaction => | |
276 | 252 | true | |
277 | 253 | case _ => | |
278 | 254 | false | |
279 | 255 | } | |
280 | 256 | else false | |
281 | 257 |
github/deemru/w8io/026f985 42.41 ms ◑