tx · 5q33ofW7UwEF3vQiK1DzS1XaLH1TTFoSqFGMydqNyc8T

3MsD5LWNJmQkkWpj3RtaeRVrKGLgoCE7kpB:  -0.01400000 Waves

2019.08.21 07:57 [640424] smart account 3MsD5LWNJmQkkWpj3RtaeRVrKGLgoCE7kpB > SELF 0.00000000 Waves

{ "type": 13, "id": "5q33ofW7UwEF3vQiK1DzS1XaLH1TTFoSqFGMydqNyc8T", "fee": 1400000, "feeAssetId": null, "timestamp": 1566362778851, "version": 1, "sender": "3MsD5LWNJmQkkWpj3RtaeRVrKGLgoCE7kpB", "senderPublicKey": "6f7rQN8AP2zH649ga8sXpVDY7aM2AgjJijB2qGmJBaMo", "proofs": [ "ygYTE564mqxrWFEX71Ph4EhxD6KU4S1qUVAboHGWsacWSsM7Kz1xGzQVVfK6jkYwNjf4AQjzYP5TfiUKndLw7u2" ], "script": null, "chainId": 84, "height": 640424, "spentComplexity": 0 } View: original | compacted Prev: WDfkA1kxWyD2MubAodwzbm63sTpptRsNKAGjhokRUoH Next: none Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlemr95J1jZUs7cJmrmmlN4zo7YVsBJzIeJdk8LDFGhUKSI6yfs20ZyJe21+6GJwNnKUU1Uyoc17wSWMKkrZ0MMvYE+Z5AiijvBK4sSJ3IgGjdU8/NhI8CBDu0F+xRM9q3TB3LLbDy5sBdudYfHfsUOc+MTvAD69n27db2Rh8+yZQMtubkuTQNp89sphHQaLGyQFaNlK/Na3lFx6omqzaa1gjoplUr6rvYKgfAICUB3zVmJShiEi7w7R0hWlNRD3qcZjCUONSpFo4WbzknGOazw84B+IMIFnIpXWzQL8RX0vNcfsBvLDfM6k2ZacqwyMKaLLqigdBiGdJ7W+0lOStOQIDAQAB")
5-
6-let RANDORACLETIMEFRAME = 4320
7-
8-let WAVELET = ((100 * 1000) * 1000)
9-
10-let COMMISSION = ((5 * WAVELET) / 1000)
11-
12-let BET1 = (1 * WAVELET)
13-
14-let BET2 = (2 * WAVELET)
15-
16-let BET4 = (4 * WAVELET)
17-
18-let BET8 = (8 * WAVELET)
19-
20-let BET14 = (14 * WAVELET)
21-
22-func getAnswer (playerChoice) = BET14
23-
24-
25-@Callable(i)
26-func bet (playerChoice) = {
27- let playerAddress = toBase58String(i.caller.bytes)
28- let answer = getAnswer(playerChoice)
29- let amount = i.payment
30- let game = [DataEntry((playerAddress + " это Ставка Игрока"), playerChoice), DataEntry("Ответ Сервера", answer)]
31- let playerAddressTx = Address(i.caller.bytes)
32- let tSetCommonData = [ScriptTransfer(playerAddressTx, 10, unit)]
33- ScriptResult(WriteSet(game), TransferSet(tSetCommonData))
34- }
35-
36-
37-
38-@Callable(i)
39-func withdraw (amount) = {
40- let currentKey = toBase58String(i.caller.bytes)
41- let currentAmount = match getInteger(this, currentKey) {
42- case a: Int =>
43- a
44- case _ =>
45- 0
46- }
47- let newAmount = (currentAmount - amount)
48- if ((0 > amount))
49- then throw("Can't withdraw negative amount")
50- else if ((0 > newAmount))
51- then throw("Not enough balance")
52- else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
53- }
54-
55-
1+# no script

github/deemru/w8io/169f3d6 
43.14 ms