tx · 5Art3AvCP9Y6E6JTsguRqCBLVCh1Hem5XJrTdwnvF7g1 3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun: -0.01400000 Waves 2019.09.15 01:43 [676487] smart account 3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun > SELF 0.00000000 Waves
{ "type": 13, "id": "5Art3AvCP9Y6E6JTsguRqCBLVCh1Hem5XJrTdwnvF7g1", "fee": 1400000, "feeAssetId": null, "timestamp": 1568500977163, "version": 1, "sender": "3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun", "senderPublicKey": "7uRSDXQUkUS7719CDA4wXghhzsWrF22gb18FGDPZyA6P", "proofs": [ "NFB87yspRKtWwZ3J9pi9SS45cgHYkpVwEHL2M9s67cFJ6ppmxMfqEbvFibstaE6BNA54BznkXpQrpcfB8aVwdDr" ], "script": "base64:AAIDAAAAAAAAAAAAAAASAAAAAAlXaW5TZXJ2ZXIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM045WG55UHBXeFlvaEtIN3o1ZEV1cThycG5vYnB5elByekUAAAAAB1dBVkVMRVQJAABoAAAAAgkAAGgAAAACAAAAAAAAAABkAAAAAAAAAAPoAAAAAAAAAAPoAAAAAApDT01NSVNTSU9OCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAHV0FWRUxFVAAAAAAAAAAD6AAAAAAOVGlja2V0c1BlcldhdmUAAAAAAAAAAGQAAAAAC0NVUlJFTlRHQU1FAgAAAA0kQ1VSUkVOVF9HQU1FAAAAAA9HQU1FU0NPVU5URVJLRVkCAAAACSRHQU1FX05VTQAAAAAKTEFTVFRJQ0tFVAIAAAAMJExBU1RfVElDS0VUAAAAAARCQU5LAgAAAAokR0FNRV9CQU5LAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIAAAAGZ2FtZUlkAAAADWN1cnJlbnRQbGF5ZXIEAAAAEHBsYXllcnNQcmVzZW50ZWQJAQAA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YW1lSWQFAAAAEHBsYXllckFkZHJlc3NTdHIAAAAAAAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAABmdhbWVJZAIAAAABXwUAAAAQcGxheWVyQWRkcmVzc1N0cgIAAAANX3RvdGFsQmV0c0FtdAUAAAAVbmV3VG90YWxQbGF5ZXJCZXRzQW10CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAABmdhbWVJZAIAAAAIX3BsYXllcnMJAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIFAAAABmdhbWVJZAUAAAAQcGxheWVyQWRkcmVzc1N0cgkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAABmdhbWVJZAIAAAABXwUAAAAEQkFOSwUAAAAObmV3QmFua0JhbGFuY2UFAAAAA25pbAQAAAALdG9XaW5TZXJ2ZXIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJV2luU2VydmVyBQAAAApwYXltZW50QW10BQAAAAR1bml0BQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABBQAAAAdiZXREYXRhCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAAt0b1dpblNlcnZlcgAAAADjVlcl", "chainId": 84, "height": 676487, "spentComplexity": 0 } View: original | compacted Prev: D7SkS2NjKTnwPQU7JqG6YLpTLvCFJPx8CyCoftKVGVCH Next: 71bAeZXJKHVw8VATmnqsfXWPbpJ8FsWr6j6swtPXvfHP Diff:
Old | New | Differences | |
---|---|---|---|
149 | 149 | let gameId = getCurrentGame(txId) | |
150 | 150 | let gameNum = IncrementGameNum(gameId, txId) | |
151 | 151 | let pmt = extract(i.payment) | |
152 | - | let paymentAmt = pmt.amount | |
152 | + | let paymentAmt = (pmt.amount - COMMISSION) | |
153 | 153 | let betNotInWaves = isDefined(pmt.assetId) | |
154 | 154 | let feeNotInWaves = isDefined(pmt.assetId) | |
155 | 155 | let playerPubKey58 = toBase58String(i.callerPublicKey) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let WinServer = addressFromStringValue("3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE") | |
5 | 5 | ||
6 | 6 | let WAVELET = ((100 * 1000) * 1000) | |
7 | 7 | ||
8 | 8 | let COMMISSION = ((5 * WAVELET) / 1000) | |
9 | 9 | ||
10 | 10 | let TicketsPerWave = 100 | |
11 | 11 | ||
12 | 12 | let CURRENTGAME = "$CURRENT_GAME" | |
13 | 13 | ||
14 | 14 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
15 | 15 | ||
16 | 16 | let LASTTICKET = "$LAST_TICKET" | |
17 | 17 | ||
18 | 18 | let BANK = "$GAME_BANK" | |
19 | 19 | ||
20 | 20 | func getPlayersList (gameId,currentPlayer) = { | |
21 | 21 | let playersPresented = isDefined(getString(this, (gameId + "_players"))) | |
22 | 22 | if (!(playersPresented)) | |
23 | 23 | then currentPlayer | |
24 | 24 | else if (isDefined(getString(this, (((gameId + "_") + currentPlayer) + "_tickets")))) | |
25 | 25 | then getStringValue(this, (gameId + "_players")) | |
26 | 26 | else ((getStringValue(this, (gameId + "_players")) + "_") + currentPlayer) | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func getOrCreateLastTicket () = { | |
31 | 31 | let isLastTicketPresented = isDefined(getInteger(this, LASTTICKET)) | |
32 | 32 | if (!(isLastTicketPresented)) | |
33 | 33 | then 0 | |
34 | 34 | else getIntegerValue(this, LASTTICKET) | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func getPlayerBetsCount (gameId,playerAddressStr) = { | |
39 | 39 | let betsCount = match getInteger(this, (((gameId + "_") + playerAddressStr) + "_betsCount")) { | |
40 | 40 | case num: Int => | |
41 | 41 | num | |
42 | 42 | case _ => | |
43 | 43 | 0 | |
44 | 44 | } | |
45 | 45 | betsCount | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getTickets (gameId,playerAddressStr,paymentAmt) = { | |
50 | 50 | let lastTicket = getOrCreateLastTicket() | |
51 | 51 | let wavesPayment = (paymentAmt / WAVELET) | |
52 | 52 | let firstNewTicket = (lastTicket + 1) | |
53 | 53 | let lastNewTicket = ((firstNewTicket + (wavesPayment * TicketsPerWave)) - 1) | |
54 | 54 | let firstNewTicketStr = toString(firstNewTicket) | |
55 | 55 | let lastNewTicketStr = toString(lastNewTicket) | |
56 | 56 | let ticketsStr = isDefined(getString(this, (((gameId + "_") + playerAddressStr) + "_tickets"))) | |
57 | 57 | if (ticketsStr) | |
58 | 58 | then { | |
59 | 59 | let currentTickets = getStringValue(this, (((gameId + "_") + playerAddressStr) + "_tickets")) | |
60 | 60 | let currentPlayerBetNum = getPlayerBetsCount(gameId, playerAddressStr) | |
61 | 61 | let CTL = split(currentTickets, "_") | |
62 | 62 | if ((currentPlayerBetNum == 1)) | |
63 | 63 | then (((((((CTL[0] + "_") + CTL[1]) + "_") + firstNewTicketStr) + "_") + lastNewTicketStr) + "_0_0_0_0") | |
64 | 64 | else if ((currentPlayerBetNum == 2)) | |
65 | 65 | then (((((((((((CTL[0] + "_") + CTL[1]) + "_") + CTL[2]) + "_") + CTL[3]) + "_") + firstNewTicketStr) + "_") + lastNewTicketStr) + "_0_0") | |
66 | 66 | else if ((currentPlayerBetNum == 3)) | |
67 | 67 | then ((((((((((((((CTL[0] + "_") + CTL[1]) + "_") + CTL[2]) + "_") + CTL[3]) + "_") + CTL[4]) + "_") + CTL[5]) + "_") + firstNewTicketStr) + "_") + lastNewTicketStr) | |
68 | 68 | else throw("Error, bid limit exceeded") | |
69 | 69 | } | |
70 | 70 | else (((firstNewTicketStr + "_") + lastNewTicketStr) + "_0_0_0_0_0_0") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func getLastTicket (paymentAmt) = { | |
75 | 75 | let lastTicket = getOrCreateLastTicket() | |
76 | 76 | let wavesPayment = (paymentAmt / WAVELET) | |
77 | 77 | (lastTicket + (wavesPayment * TicketsPerWave)) | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func IncrementGameNum (gameId,txId) = { | |
82 | 82 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
83 | 83 | case num: Int => | |
84 | 84 | num | |
85 | 85 | case _ => | |
86 | 86 | 0 | |
87 | 87 | } | |
88 | 88 | if ((gameId == txId)) | |
89 | 89 | then (gameNum + 1) | |
90 | 90 | else gameNum | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func getOrCreateCurrentGame (txId) = { | |
95 | 95 | let isCurrentGamePresented = isDefined(getString(this, CURRENTGAME)) | |
96 | 96 | if (!(isCurrentGamePresented)) | |
97 | 97 | then txId | |
98 | 98 | else if ((getStringValue(this, CURRENTGAME) == "")) | |
99 | 99 | then txId | |
100 | 100 | else getStringValue(this, CURRENTGAME) | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getCurrentGame (txId) = { | |
105 | 105 | let gameId = getOrCreateCurrentGame(txId) | |
106 | 106 | let gameAlreadyPlayed = isDefined(getString(this, (gameId + "_result"))) | |
107 | 107 | if (gameAlreadyPlayed) | |
108 | 108 | then txId | |
109 | 109 | else gameId | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getBankBalance (gameId,paymentAmt) = { | |
114 | 114 | let bankBalance = match getInteger(this, ((gameId + "_") + BANK)) { | |
115 | 115 | case num: Int => | |
116 | 116 | num | |
117 | 117 | case _ => | |
118 | 118 | 0 | |
119 | 119 | } | |
120 | 120 | (bankBalance + paymentAmt) | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getTotalPlayerBetsAmt (gameId,playerAddressStr,paymentAmt) = { | |
125 | 125 | let totalPlayerBets = match getInteger(this, (((gameId + "_") + playerAddressStr) + "_totalBetsAmt")) { | |
126 | 126 | case num: Int => | |
127 | 127 | num | |
128 | 128 | case _ => | |
129 | 129 | 0 | |
130 | 130 | } | |
131 | 131 | (totalPlayerBets + paymentAmt) | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | @Callable(i) | |
136 | 136 | func resetGameData (gameId) = { | |
137 | 137 | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
138 | 138 | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
139 | 139 | let playerAddressStr = toString(playerAddress) | |
140 | 140 | let zeroData = [DataEntry(CURRENTGAME, ""), DataEntry(GAMESCOUNTERKEY, 0), DataEntry((((gameId + "_") + playerAddressStr) + "_tickets"), ""), DataEntry((((gameId + "_") + playerAddressStr) + "_betsCount"), 0), DataEntry((((gameId + "_") + playerAddressStr) + "_totalBetsAmt"), 0), DataEntry(((gameId + "_") + BANK), 0), DataEntry((gameId + "_players"), ""), DataEntry(LASTTICKET, 0)] | |
141 | 141 | WriteSet(zeroData) | |
142 | 142 | } | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | ||
146 | 146 | @Callable(i) | |
147 | 147 | func bet () = { | |
148 | 148 | let txId = toBase58String(i.transactionId) | |
149 | 149 | let gameId = getCurrentGame(txId) | |
150 | 150 | let gameNum = IncrementGameNum(gameId, txId) | |
151 | 151 | let pmt = extract(i.payment) | |
152 | - | let paymentAmt = pmt.amount | |
152 | + | let paymentAmt = (pmt.amount - COMMISSION) | |
153 | 153 | let betNotInWaves = isDefined(pmt.assetId) | |
154 | 154 | let feeNotInWaves = isDefined(pmt.assetId) | |
155 | 155 | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
156 | 156 | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
157 | 157 | if (betNotInWaves) | |
158 | 158 | then throw("Bet amount must be in Waves") | |
159 | 159 | else if (feeNotInWaves) | |
160 | 160 | then throw("Transaction's fee must be in Waves") | |
161 | 161 | else { | |
162 | 162 | let playerAddressStr = toString(playerAddress) | |
163 | 163 | let newBankBalance = getBankBalance(gameId, paymentAmt) | |
164 | 164 | let newTotalPlayerBetsAmt = getTotalPlayerBetsAmt(gameId, playerAddressStr, paymentAmt) | |
165 | 165 | let betData = [DataEntry(CURRENTGAME, gameId), DataEntry(GAMESCOUNTERKEY, gameNum), DataEntry(LASTTICKET, getLastTicket(paymentAmt)), DataEntry((((gameId + "_") + playerAddressStr) + "_tickets"), getTickets(gameId, playerAddressStr, paymentAmt)), DataEntry((((gameId + "_") + playerAddressStr) + "_betsCount"), (getPlayerBetsCount(gameId, playerAddressStr) + 1)), DataEntry((((gameId + "_") + playerAddressStr) + "_totalBetsAmt"), newTotalPlayerBetsAmt), DataEntry((gameId + "_players"), getPlayersList(gameId, playerAddressStr)), DataEntry(((gameId + "_") + BANK), newBankBalance)] | |
166 | 166 | let toWinServer = [ScriptTransfer(WinServer, paymentAmt, unit)] | |
167 | 167 | ScriptResult(WriteSet(betData), TransferSet(toWinServer)) | |
168 | 168 | } | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 |
github/deemru/w8io/026f985 31.33 ms ◑