tx · G4shHT5ubxcDzrv6ebKZY7wVGThTjdDrEKBiFHVLHV5E

3MqzME1djQCpdFpgxV6FvTSCJqrrqubrWW5:  -0.01500000 Waves

2020.06.16 17:38 [1046199] smart account 3MqzME1djQCpdFpgxV6FvTSCJqrrqubrWW5 > SELF 0.00000000 Waves

{ "type": 13, "id": "G4shHT5ubxcDzrv6ebKZY7wVGThTjdDrEKBiFHVLHV5E", "fee": 1500000, "feeAssetId": null, "timestamp": 1592318349365, "version": 1, "sender": "3MqzME1djQCpdFpgxV6FvTSCJqrrqubrWW5", "senderPublicKey": "282r3jhKW4zX7uRgWAQwTxKxHQabz9tmaJEpk2wGwvki", "proofs": [ "3YFocq1pn6k1dTbQ3u4YkJvR3Kett13dF9NsE5VNjh3rPU9Ti8cAhgGzCfP3V9gaA3SCbYPN5EyHTYJJyzmpbVqq" ], "script": "base64:AAIDAAAAAAAAAA0IARIDCgEIEgQKAggCAAAARgAAAAAJUlNBUFVCTElDCQACWwAAAAECAAABj2Jhc2U2NDpNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQW1wdVhjSS9vNHBJQjV5d3Y5RE9PR2FwVEJVd1JWbE0vNitINmhGZWxPWHRrcndZL1lJdG1QeEVEcHo3ckFlclFQUWU5dERQRWFBdi9HbmxFenR5Yk9GWGd1OUR6RGU4WW9NUkQxdmFrZ29BY29nbWJZNThRRDZLTWo1SGtvVmoveVROSWM5c3pqNXFoSWxyQWRtYjNLTEw2aFFVN3k4K0pqNjlCV1ZQc2FRZ2tzcFNkZVl0YjF0SFFjN3Q5NW43T1o1NnIyQTdHMytiUWY2blNNa1BrQWhJckVwYkNtNThvaUdCY3pkVGQvTHFGU1ZvdFpzYkw3WWg2U0hMZm5IZUQrUWdjZkpybmFtOE9ITUdKRUpUUlhqSUxlSEdqbFJDUDhvVnBpb0hyeTFTMnhQeDVzVnpJbTJNTStDelllbkFHbG8wajI2YXRCaGlVTG9UdWx3RDNwUU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Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmpuXcI/o4pIB5ywv9DOOGapTBUwRVlM/6+H6hFelOXtkrwY/YItmPxEDpz7rAerQPQe9tDPEaAv/GnlEztybOFXgu9DzDe8YoMRD1vakgoAcogmbY58QD6KMj5HkoVj/yTNIc9szj5qhIlrAdmb3KLL6hQU7y8+Jj69BWVPsaQgkspSdeYtb1tHQc7t95n7OZ56r2A7G3+bQf6nSMkPkAhIrEpbCm58oiGBczdTd/LqFSVotZsbL7Yh6SHLfnHeD+QgcfJrnam8OHMGJEJTRXjILeHGjlRCP8oVpioHry1S2xPx5sVzIm2MM+CzYenAGlo0j26atBhiULoTulwD3pQIDAQAB")
5+
6+let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j")
7+
8+let RANDORACLETIMEFRAME = 4320
9+
10+let WAVESD = 100000000
11+
12+let USDND = 1000000
13+
14+let DECIMALS = [WAVESD, USDND]
15+
16+let ASSETS = [unit, fromBase58String("25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT")]
17+
18+func getBetMin (assetId) = ((1 * DECIMALS[assetId]) / 2)
19+
20+
21+func getBetMax (assetId) = (6 * DECIMALS[assetId])
22+
23+
24+func getBetStep (assetId) = ((1 * DECIMALS[assetId]) / 10)
25+
26+
27+func getIntOr (key,default) = if (isDefined(getInteger(this, key)))
28+ then getIntegerValue(this, key)
29+ else default
30+
31+
32+func setInt (key,value) = DataEntry(key, value)
33+
34+
35+func incrementInt (key) = setInt(key, (getIntOr(key, -1) + 1))
36+
37+
38+func changeInt (key,by) = setInt(key, (getIntOr(key, 0) + by))
39+
40+
41+let PRECISION = 10000
42+
43+let R1MAX = 96
44+
45+let R1MIN = 94
46+
47+let R1K = 9860
48+
49+let R2MAX = 93
50+
51+let R2MIN = 87
52+
53+let R2K = 9800
54+
55+let R3MAX = 86
56+
57+let R3MIN = 86
58+
59+let R3K = 9750
60+
61+let R4MAX = 85
62+
63+let R4MIN = 84
64+
65+let R4K = 9670
66+
67+let R5MAX = 83
68+
69+let R5MIN = 83
70+
71+let R5K = 9630
72+
73+let R6MAX = 82
74+
75+let R6MIN = 67
76+
77+let R6K = 9610
78+
79+let R7MAX = 66
80+
81+let R7MIN = 56
82+
83+let R7K = 9560
84+
85+let R8MAX = 55
86+
87+let R8MIN = 38
88+
89+let R8K = 9500
90+
91+let R9MAX = 37
92+
93+let R9MIN = 3
94+
95+let R9K = 9290
96+
97+let R10MAX = 2
98+
99+let R10MIN = 1
100+
101+let R10K = 9860
102+
103+let IdxGameState = 0
104+
105+let IdxPlayerChoice = 1
106+
107+let IdxPlayerPubKey58 = 2
108+
109+let IdxStartedHeight = 3
110+
111+let IdxWinAmount = 4
112+
113+let IdxAssetId = 5
114+
115+let RESERVATIONKEY = ["$RESERVED_AMOUNT_WAVES", "$RESERVED_AMOUNT_USDN"]
116+
117+let GAMESCOUNTERKEY = "$GAME_NUM"
118+
119+let MAXBALANCEKEY = "$MAX_BALANCE"
120+
121+let STATESUBMITTED = "SUBMITTED"
122+
123+let STATEWON = "WON"
124+
125+let STATELOST = "LOST"
126+
127+func incrementGameNum () = {
128+ let gameNum = match getInteger(this, GAMESCOUNTERKEY) {
129+ case num: Int =>
130+ num
131+ case _ =>
132+ 0
133+ }
134+ (gameNum + 1)
135+ }
136+
137+
138+func extractReservedAmount (assetId) = match getInteger(this, RESERVATIONKEY[assetId]) {
139+ case a: Int =>
140+ a
141+ case _ =>
142+ 0
143+}
144+
145+
146+func increaseReserveAmount (winAmount,assetId) = {
147+ let newReservedAmount = (getIntOr(RESERVATIONKEY[assetId], 0) + winAmount)
148+ if ((newReservedAmount > assetBalance(this, ASSETS[assetId])))
149+ then throw("Insufficient funds on Dice Roller account. Transaction was rejected for your safety.")
150+ else newReservedAmount
151+ }
152+
153+
154+func decreaseReservedAmount (gameId,assetId,winAmount) = if ((0 > (getIntOr(RESERVATIONKEY[assetId], 0) - winAmount)))
155+ then throw("Invalid Dice Roller account state - reserved amount is less than 0")
156+ else changeInt(RESERVATIONKEY[assetId], -(winAmount))
157+
158+
159+func validateAndGetAssetId (assetId) = if ((assetId == ASSETS[0]))
160+ then 0
161+ else if ((assetId == ASSETS[1]))
162+ then 1
163+ else throw("Invalid payment asset")
164+
165+
166+func validateBetAndGetWinAmount (bet,assetId,playerChoice) = {
167+ let BETMIN = getBetMin(assetId)
168+ let BETMAX = getBetMax(assetId)
169+ let BETSTEP = getBetStep(assetId)
170+ let betAmountValid = if (if ((bet >= BETMIN))
171+ then (BETMAX >= bet)
172+ else false)
173+ then ((bet % BETSTEP) == 0)
174+ else false
175+ if (betAmountValid)
176+ then {
177+ let playerChoiceInt = parseIntValue(playerChoice)
178+ if (if ((playerChoiceInt >= 1))
179+ then (96 >= playerChoiceInt)
180+ else false)
181+ then {
182+ let RKxPrecision = if (if ((R1MAX >= playerChoiceInt))
183+ then (playerChoiceInt >= R1MIN)
184+ else false)
185+ then R1K
186+ else if (if ((R2MAX >= playerChoiceInt))
187+ then (playerChoiceInt >= R2MIN)
188+ else false)
189+ then R2K
190+ else if (if ((R3MAX >= playerChoiceInt))
191+ then (playerChoiceInt >= R3MIN)
192+ else false)
193+ then R3K
194+ else if (if ((R4MAX >= playerChoiceInt))
195+ then (playerChoiceInt >= R4MIN)
196+ else false)
197+ then R4K
198+ else if (if ((R5MAX >= playerChoiceInt))
199+ then (playerChoiceInt >= R5MIN)
200+ else false)
201+ then R5K
202+ else if (if ((R6MAX >= playerChoiceInt))
203+ then (playerChoiceInt >= R6MIN)
204+ else false)
205+ then R6K
206+ else if (if ((R7MAX >= playerChoiceInt))
207+ then (playerChoiceInt >= R7MIN)
208+ else false)
209+ then R7K
210+ else if (if ((R8MAX >= playerChoiceInt))
211+ then (playerChoiceInt >= R8MIN)
212+ else false)
213+ then R8K
214+ else if (if ((R9MAX >= playerChoiceInt))
215+ then (playerChoiceInt >= R9MIN)
216+ else false)
217+ then R9K
218+ else if (if ((R10MAX >= playerChoiceInt))
219+ then (playerChoiceInt >= R10MIN)
220+ else false)
221+ then R10K
222+ else throw(("Couldn't define range: playerChoice=" + playerChoice))
223+ ((((100 * RKxPrecision) / playerChoiceInt) * bet) / PRECISION)
224+ }
225+ else throw("Player choice is out of the condition below: 1 <= choice <= 96")
226+ }
227+ else throw(((((("Bet amount is not in range: minBet=" + toString(BETMIN)) + " maxBet=") + toString(BETMAX)) + " betStep=") + toString(BETSTEP)))
228+ }
229+
230+
231+func randToStr (r) = if (if ((r >= 1))
232+ then (100 >= r)
233+ else false)
234+ then toString(r)
235+ else throw(("Unsupported r parameter passed: expected=[1,...,100] actual=" + toString(r)))
236+
237+
238+func generateRandInt (gameId,rsaSign) = {
239+ let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
240+ if (rsaSigValid)
241+ then {
242+ let rand = (toInt(sha256(rsaSign)) % 100)
243+ if ((0 > rand))
244+ then ((-1 * rand) + 1)
245+ else (rand + 1)
246+ }
247+ else throw("Invalid RSA signature")
248+ }
249+
250+
251+func isPlayerWin (playerChoice,rand) = {
252+ let playerChoiceInt = parseIntValue(playerChoice)
253+ (playerChoiceInt >= rand)
254+ }
255+
256+
257+func formatGameDataParam (p) = {
258+ let s = size(p)
259+ if ((s == 0))
260+ then throw("Parameter size must be greater then 0")
261+ else if ((s > 99))
262+ then throw("Parameter size must be less then 100")
263+ else if ((10 > s))
264+ then (("0" + toString(s)) + p)
265+ else (toString(s) + p)
266+ }
267+
268+
269+func formatGameData (gameState,playerChoice,playerPubKey58,startedHeight,winAmount,assetId,randOrEmpty) = (((((((((((gameState + "_") + playerChoice) + "_") + playerPubKey58) + "_") + toString(startedHeight)) + "_") + toString(winAmount)) + "_") + toString(assetId)) + (if ((randOrEmpty == ""))
270+ then ""
271+ else ("_" + randOrEmpty)))
272+
273+
274+func extractGameData (gameId) = split(match getString(this, gameId) {
275+ case str: String =>
276+ str
277+ case _ =>
278+ throw((("Game: " + gameId) + " not found."))
279+}, "_")
280+
281+
282+func winScriptSet (gameId,playerAddress,winAmount,assetId,newGameDataStr,winByTimeout,decreasedReserves) = {
283+ let wSetCommonData = [decreasedReserves]
284+ let tSetCommonData = [ScriptTransfer(playerAddress, winAmount, ASSETS[assetId])]
285+ if (winByTimeout)
286+ then {
287+ let newGameDataStrAdjusted = (newGameDataStr + "_TIMEOUT")
288+ let gameData = DataEntry(gameId, newGameDataStrAdjusted)
289+ ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData))
290+ }
291+ else {
292+ let gameData = DataEntry(gameId, newGameDataStr)
293+ ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData))
294+ }
295+ }
296+
297+
298+@Callable(i)
299+func bet (playerChoice) = {
300+ let gameId = toBase58String(i.transactionId)
301+ if ((i.payment == unit))
302+ then throw("No payment")
303+ else if (isDefined(getString(this, gameId)))
304+ then throw((("Bet for: " + gameId) + " was already made."))
305+ else if (if ((i.feeAssetId != ASSETS[0]))
306+ then (i.feeAssetId != ASSETS[1])
307+ else false)
308+ then throw("Invalid fee")
309+ else {
310+ let p = extract(i.payment)
311+ if ((i.feeAssetId != p.assetId))
312+ then throw("Fee assetId and payment assetId should match")
313+ else {
314+ let assetId = validateAndGetAssetId(p.assetId)
315+ let commission = i.fee
316+ let winAmount = validateBetAndGetWinAmount((p.amount - i.fee), assetId, playerChoice)
317+ let playerPubKey58 = toBase58String(i.callerPublicKey)
318+ let gameData = formatGameData(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmount, assetId, "")
319+ ScriptResult(WriteSet([DataEntry(RESERVATIONKEY[assetId], increaseReserveAmount(winAmount, assetId)), incrementInt(GAMESCOUNTERKEY), DataEntry(gameId, gameData)]), TransferSet([ScriptTransfer(SERVER, commission, p.assetId)]))
320+ }
321+ }
322+ }
323+
324+
325+
326+@Callable(i)
327+func withdraw (gameId,rsaSign) = {
328+ let gameData = extractGameData(gameId)
329+ let gameState = gameData[IdxGameState]
330+ let playerChoice = gameData[IdxPlayerChoice]
331+ let startedHeight = parseIntValue(gameData[IdxStartedHeight])
332+ let winAmount = parseIntValue(gameData[IdxWinAmount])
333+ let assetId = parseIntValue(gameData[IdxAssetId])
334+ let playerPubKey58 = gameData[IdxPlayerPubKey58]
335+ let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58))
336+ let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME)
337+ let decreasedReserves = decreaseReservedAmount(gameId, assetId, winAmount)
338+ if ((gameState != STATESUBMITTED))
339+ then throw("Invalid game state for passed gameId")
340+ else if (winByTimeout)
341+ then {
342+ let randStr = playerChoice
343+ let newGameDataStr = formatGameData(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmount, assetId, randStr)
344+ winScriptSet(gameId, playerAddress, winAmount, assetId, newGameDataStr, winByTimeout, decreasedReserves)
345+ }
346+ else {
347+ let rand = generateRandInt(gameId, rsaSign)
348+ let randStr = randToStr(rand)
349+ if (isPlayerWin(playerChoice, rand))
350+ then {
351+ let newGameDataStr = formatGameData(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmount, assetId, randStr)
352+ winScriptSet(gameId, playerAddress, winAmount, assetId, newGameDataStr, winByTimeout, decreasedReserves)
353+ }
354+ else {
355+ let newGameDataStr = formatGameData(STATELOST, playerChoice, playerPubKey58, startedHeight, winAmount, assetId, randStr)
356+ WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves])
357+ }
358+ }
359+ }
360+
361+
362+@Verifier(tx)
363+func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
364+ then match tx {
365+ case ttx: TransferTransaction =>
366+ let assetId = validateAndGetAssetId(ttx.assetId)
367+ ((assetBalance(this, ttx.assetId) - ttx.amount) >= getIntOr(RESERVATIONKEY[assetId], 0))
368+ case stx: SetScriptTransaction =>
369+ if ((getIntOr(RESERVATIONKEY[0], 0) == 0))
370+ then (getIntOr(RESERVATIONKEY[1], 0) == 0)
371+ else false
372+ case _ =>
373+ false
374+ }
375+ else false
376+

github/deemru/w8io/169f3d6 
25.72 ms