tx · ATpPFcLMXmKvVMfWXYvgVqw3tCqYw8uCe15RKV6Nue6p 3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE: -0.01400000 Waves 2019.09.08 14:34 [667049] smart account 3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE > SELF 0.00000000 Waves
{ "type": 13, "id": "ATpPFcLMXmKvVMfWXYvgVqw3tCqYw8uCe15RKV6Nue6p", "fee": 1400000, "feeAssetId": null, "timestamp": 1567942468618, "version": 1, "sender": "3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE", "senderPublicKey": "ESNVczQiY4oxY2hoRSZcruKNBwsPdXVu1nSCbpprDGJB", "proofs": [ "3rzBeDdhq9UZZFjP8wQLcto9iSjYP64LQd4aS2gcsziFVRxXbfjpNkrTMzSMbhXVY2hNBEcPqLXeEw58xwX9GEYN" ], "script": "base64:AAIDAAAAAAAAAAAAAAALAAAAAA9TZXJ2ZXJQdWJsaWNLZXkJAAJZAAAAAQIAAAAsN2ltOWNhaUNtRTRTTDZqVG00S1RpY0hINGJHUGY1djU5cm5mVUEzY0NSRGoAAAAACUJldFNlcnZlcgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTjZ5Rko1WjhOVVVRdmZHR01McDVlZm1ldlJSdFRnUXV1bgAAAAAHV0FWRUxFVAkAAGgAAAACCQAAaAAAAAIAAAAAAAAAAGQAAAAAAAAAA+gAAAAAAAAAA+gAAAAACkNPTU1JU1NJT04JAABpAAAAAgkAAGgAAAACAAAAAAAAAAAFBQAAAAdXQVZFTEVUAAAAAAAAAAPoAAAAAA5UaWNrZXRzUGVyV2F2ZQAAAAAAAAAAZAAAAAALQ1VSUkVOVEdBTUUCAAAADSRDVVJSRU5UX0dBTUUAAAAACkxBU1RUSUNLRVQCAAAADCRMQVNUX1RJQ0tFVAAAAAAEQkFOSwIAAAAKJEdBTUVfQkFOSwEAAAAPR2VuZXJhdGVSYW5kSW50AAAAAgAAAAZn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ABXwkAAZEAAAACBQAAAAtwbGF5ZXJzTGlzdAAAAAAAAAAABAIAAAANX3RvdGFsQmV0c0FtdAkAAAIAAAABAgAAAAVFcnJvcgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABBDdXJyZW50IEdhbWUgaXMgBQAAAAtjdXJyZW50R2FtZQIAAAAKLCBidXQgbm90IAUAAAAGZ2FtZUlkAAAAAA/aLK4=", "chainId": 84, "height": 667049, "spentComplexity": 0 } View: original | compacted Prev: 8z9ntPpH32zATzu2Z5zobFBvJKhJ2Dh2jycwRSAUDaKV Next: rkk2us1fdwEDqcUhojN8xa3h6Qv5R7cRdGjttQyfdLT Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | let CURRENTGAME = "$CURRENT_GAME" | |
15 | 15 | ||
16 | 16 | let LASTTICKET = "$LAST_TICKET" | |
17 | + | ||
18 | + | let BANK = "$GAME_BANK" | |
17 | 19 | ||
18 | 20 | func GenerateRandInt (gameId,rsaSign) = { | |
19 | 21 | let lastTicket = getIntegerValue(BetServer, LASTTICKET) | |
51 | 53 | } | |
52 | 54 | ||
53 | 55 | ||
54 | - | func win (gameId,winTicket,winnerAddressStr,winAmt) = { | |
56 | + | func win (gameId,winTicket,winnerAddressStr,bankBalance,totalWinnerBetsAmt) = { | |
57 | + | let winAmt = (((bankBalance - totalWinnerBetsAmt) * 90) / 100) | |
55 | 58 | let winTX = [ScriptTransfer(addressFromStringValue(winnerAddressStr), winAmt, unit)] | |
56 | 59 | let gameResult = [DataEntry((gameId + "_result"), toString(winTicket)), DataEntry((gameId + "_winner"), winnerAddressStr), DataEntry((gameId + "_winAmt"), winAmt)] | |
57 | 60 | ScriptResult(WriteSet(gameResult), TransferSet(winTX)) | |
67 | 70 | let winTicket = GenerateRandInt(gameId, rsaSign) | |
68 | 71 | let players = getStringValue(BetServer, (gameId + "_players")) | |
69 | 72 | let playersList = split(players, "_") | |
70 | - | let winAmts = getStringValue(BetServer, (gameId + "_winAmts")) | |
71 | - | let winAmtsList = split(winAmts, "_") | |
73 | + | let bankBalance = getIntegerValue(BetServer, BANK) | |
72 | 74 | if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[0]) + "_tickets")), winTicket)) | |
73 | - | then win(gameId, winTicket, playersList[0], | |
75 | + | then win(gameId, winTicket, playersList[0], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[0]) + "_totalBetsAmt"))) | |
74 | 76 | else if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[1]) + "_tickets")), winTicket)) | |
75 | - | then win(gameId, winTicket, playersList[1], | |
77 | + | then win(gameId, winTicket, playersList[1], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[1]) + "_totalBetsAmt"))) | |
76 | 78 | else if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[2]) + "_tickets")), winTicket)) | |
77 | - | then win(gameId, winTicket, playersList[2], | |
79 | + | then win(gameId, winTicket, playersList[2], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[2]) + "_totalBetsAmt"))) | |
78 | 80 | else if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[3]) + "_tickets")), winTicket)) | |
79 | - | then win(gameId, winTicket, playersList[3], | |
81 | + | then win(gameId, winTicket, playersList[3], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[3]) + "_totalBetsAmt"))) | |
80 | 82 | else if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[4]) + "_tickets")), winTicket)) | |
81 | - | then win(gameId, winTicket, playersList[4], | |
83 | + | then win(gameId, winTicket, playersList[4], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[4]) + "_totalBetsAmt"))) | |
82 | 84 | else throw("Error") | |
83 | 85 | } | |
84 | 86 | else throw(((("Current Game is " + currentGame) + ", but not ") + gameId)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ServerPublicKey = fromBase58String("7im9caiCmE4SL6jTm4KTicHH4bGPf5v59rnfUA3cCRDj") | |
5 | 5 | ||
6 | 6 | let BetServer = addressFromStringValue("3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun") | |
7 | 7 | ||
8 | 8 | let WAVELET = ((100 * 1000) * 1000) | |
9 | 9 | ||
10 | 10 | let COMMISSION = ((5 * WAVELET) / 1000) | |
11 | 11 | ||
12 | 12 | let TicketsPerWave = 100 | |
13 | 13 | ||
14 | 14 | let CURRENTGAME = "$CURRENT_GAME" | |
15 | 15 | ||
16 | 16 | let LASTTICKET = "$LAST_TICKET" | |
17 | + | ||
18 | + | let BANK = "$GAME_BANK" | |
17 | 19 | ||
18 | 20 | func GenerateRandInt (gameId,rsaSign) = { | |
19 | 21 | let lastTicket = getIntegerValue(BetServer, LASTTICKET) | |
20 | 22 | let rsaSigValid = sigVerify(toBytes(gameId), rsaSign, ServerPublicKey) | |
21 | 23 | if (rsaSigValid) | |
22 | 24 | then { | |
23 | 25 | let rand = (toInt(sha256(rsaSign)) % lastTicket) | |
24 | 26 | if ((0 > rand)) | |
25 | 27 | then ((-1 * rand) + 1) | |
26 | 28 | else (rand + 1) | |
27 | 29 | } | |
28 | 30 | else throw("Invalid RSA signature") | |
29 | 31 | } | |
30 | 32 | ||
31 | 33 | ||
32 | 34 | func isWinner (ticketsStr,winTicket) = { | |
33 | 35 | let tickets = split(ticketsStr, "_") | |
34 | 36 | if (if ((winTicket >= parseIntValue(tickets[0]))) | |
35 | 37 | then (parseIntValue(tickets[1]) >= winTicket) | |
36 | 38 | else false) | |
37 | 39 | then true | |
38 | 40 | else if (if ((winTicket >= parseIntValue(tickets[2]))) | |
39 | 41 | then (parseIntValue(tickets[3]) >= winTicket) | |
40 | 42 | else false) | |
41 | 43 | then true | |
42 | 44 | else if (if ((winTicket >= parseIntValue(tickets[4]))) | |
43 | 45 | then (parseIntValue(tickets[5]) >= winTicket) | |
44 | 46 | else false) | |
45 | 47 | then true | |
46 | 48 | else if (if ((winTicket >= parseIntValue(tickets[6]))) | |
47 | 49 | then (parseIntValue(tickets[7]) >= winTicket) | |
48 | 50 | else false) | |
49 | 51 | then true | |
50 | 52 | else false | |
51 | 53 | } | |
52 | 54 | ||
53 | 55 | ||
54 | - | func win (gameId,winTicket,winnerAddressStr,winAmt) = { | |
56 | + | func win (gameId,winTicket,winnerAddressStr,bankBalance,totalWinnerBetsAmt) = { | |
57 | + | let winAmt = (((bankBalance - totalWinnerBetsAmt) * 90) / 100) | |
55 | 58 | let winTX = [ScriptTransfer(addressFromStringValue(winnerAddressStr), winAmt, unit)] | |
56 | 59 | let gameResult = [DataEntry((gameId + "_result"), toString(winTicket)), DataEntry((gameId + "_winner"), winnerAddressStr), DataEntry((gameId + "_winAmt"), winAmt)] | |
57 | 60 | ScriptResult(WriteSet(gameResult), TransferSet(winTX)) | |
58 | 61 | } | |
59 | 62 | ||
60 | 63 | ||
61 | 64 | @Callable(i) | |
62 | 65 | func generateResult (gameId,rsaSignCrypted) = { | |
63 | 66 | let currentGame = getStringValue(BetServer, CURRENTGAME) | |
64 | 67 | if ((currentGame == gameId)) | |
65 | 68 | then { | |
66 | 69 | let rsaSign = fromBase58String(rsaSignCrypted) | |
67 | 70 | let winTicket = GenerateRandInt(gameId, rsaSign) | |
68 | 71 | let players = getStringValue(BetServer, (gameId + "_players")) | |
69 | 72 | let playersList = split(players, "_") | |
70 | - | let winAmts = getStringValue(BetServer, (gameId + "_winAmts")) | |
71 | - | let winAmtsList = split(winAmts, "_") | |
73 | + | let bankBalance = getIntegerValue(BetServer, BANK) | |
72 | 74 | if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[0]) + "_tickets")), winTicket)) | |
73 | - | then win(gameId, winTicket, playersList[0], | |
75 | + | then win(gameId, winTicket, playersList[0], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[0]) + "_totalBetsAmt"))) | |
74 | 76 | else if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[1]) + "_tickets")), winTicket)) | |
75 | - | then win(gameId, winTicket, playersList[1], | |
77 | + | then win(gameId, winTicket, playersList[1], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[1]) + "_totalBetsAmt"))) | |
76 | 78 | else if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[2]) + "_tickets")), winTicket)) | |
77 | - | then win(gameId, winTicket, playersList[2], | |
79 | + | then win(gameId, winTicket, playersList[2], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[2]) + "_totalBetsAmt"))) | |
78 | 80 | else if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[3]) + "_tickets")), winTicket)) | |
79 | - | then win(gameId, winTicket, playersList[3], | |
81 | + | then win(gameId, winTicket, playersList[3], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[3]) + "_totalBetsAmt"))) | |
80 | 82 | else if (isWinner(getStringValue(BetServer, (((gameId + "_") + playersList[4]) + "_tickets")), winTicket)) | |
81 | - | then win(gameId, winTicket, playersList[4], | |
83 | + | then win(gameId, winTicket, playersList[4], bankBalance, getIntegerValue(BetServer, (((gameId + "_") + playersList[4]) + "_totalBetsAmt"))) | |
82 | 84 | else throw("Error") | |
83 | 85 | } | |
84 | 86 | else throw(((("Current Game is " + currentGame) + ", but not ") + gameId)) | |
85 | 87 | } | |
86 | 88 | ||
87 | 89 |
github/deemru/w8io/169f3d6 36.36 ms ◑