tx · 4TFnEEEZGNH6qxfgtBZdDpPoVyLn97ExuhC6vKkCskJT 3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8: -0.01400000 Waves 2019.12.11 01:50 [803315] smart account 3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8 > SELF 0.00000000 Waves
{ "type": 13, "id": "4TFnEEEZGNH6qxfgtBZdDpPoVyLn97ExuhC6vKkCskJT", "fee": 1400000, "feeAssetId": null, "timestamp": 1576018189636, "version": 1, "sender": "3Mz7zzdQoHabgytXU3UuTAzADXPBBLgFqu8", "senderPublicKey": "6uncmj7GmSzxFAGGX8NcToqPxTxWUHW7Aj1WSbMH2qXw", "proofs": [ "5WZoGHAb7F6XDjNYLferozUMQ8cNU4LqxP5NKfpw6WoczEDuuaanZ2Ym8hu9CxFSqAns6ibunHAo6PsKmfRwkKFz" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAADwAAAAAJUlNBUFVCTElDCQACWwAAAAECAAABj2Jhc2U2NDpNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQWc0ZEFSNlhiQkRBUzloci9FajNkSnY2RmZjNDY2eC9tT0dNV1UzbHJBQnMzcWE4QkhtdUpHbmtmYnBFZjJ2QXdZVE9XUHZ2emZNMTBPQmJmbG9TeXEzYzlNS3Z5VGUxbHVCTEdxVzR2WlVYSXl2U2d6MWxpeVVWZWZJUXkzZHlGOWpiZVRaYkMwYmJjVC83TzNERUwrMDF6NkErckRDYWNTWjBsR29sU1E2QW5oTHh6SWtWcE9RSmJyQm1DK3grWnVaUENNV3pKeW5kNWFlT243amFqL21rUlZ5eGU2Zy8wT2hXejROaWlaWGV1TVJCKzhtS3kwZldEL1VsSWxaV0hzQVMyWm1ya1hLcWpMcTAvMHdyOElMSmt6bmpTcWRuSTVJYmpnM3VRcmovNEFOK2k5cjI4YVE3My9aa1B0WTVTYncwQU9pQUJCdTdnSG1xOWF5VnhaUUlEQVFBQ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A9jYWxsZXJQdWJsaWNLZXkEAAAAC2dhbWVEYXRhU3RyCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAADlNUQVRFU1VCTUlUVEVEAgAAAAFfBQAAAA5wbGF5ZXJQdWJLZXk1OAIAAAABXwUAAAAEYmV0cwkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAD0dBTUVTQ09VTlRFUktFWQUAAAAKbmV3R2FtZU51bQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAGZ2FtZUlkBQAAAAtnYW1lRGF0YVN0cgUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAAA2x1kTA==", "chainId": 84, "height": 803315, "spentComplexity": 0 } View: original | compacted Prev: BkeAYrsim4zz7fwZHGJwqC5ED9nwaNkMjSeum7bKY8E8 Next: 6JkRa4ErCMiCbFSgakUMvXJRJLUCJ6wmnU1kTCD5AfL4 Diff:
Old | New | Differences | |
---|---|---|---|
70 | 70 | else if (gameIdUsed) | |
71 | 71 | then throw("Passed gameId had been used before. Game aborted.") | |
72 | 72 | else if ((a != payment.amount)) | |
73 | - | then throw("Payment value is different from bet value.") | |
73 | + | then throw(("Payment value is different from bet value. " + toString(a))) | |
74 | 74 | else { | |
75 | 75 | let newGameNum = IncrementGameNum() | |
76 | 76 | 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 RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB") | |
5 | 5 | ||
6 | 6 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
7 | 7 | ||
8 | 8 | let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw' | |
9 | 9 | ||
10 | 10 | let WALLETWAVESBET = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8') | |
11 | 11 | ||
12 | 12 | let WALLETMCAFEE = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8') | |
13 | 13 | ||
14 | 14 | let WAVELET = 100000000 | |
15 | 15 | ||
16 | 16 | let FEEWAVESBET = 4 | |
17 | 17 | ||
18 | 18 | let FEEMCAFEE = 2 | |
19 | 19 | ||
20 | 20 | let STATESUBMITTED = "SUBMITTED" | |
21 | 21 | ||
22 | 22 | let STATEWON = "WON" | |
23 | 23 | ||
24 | 24 | let STATELOST = "LOST" | |
25 | 25 | ||
26 | 26 | let BETMIN = (1 * WAVELET) | |
27 | 27 | ||
28 | 28 | let BETMAX = (20000000 * WAVELET) | |
29 | 29 | ||
30 | 30 | func getAmt (bets) = { | |
31 | 31 | let b01 = take(drop(bets, 4), 10) | |
32 | 32 | let b02 = take(drop(bets, 19), 10) | |
33 | 33 | let b03 = take(drop(bets, 34), 10) | |
34 | 34 | let b04 = take(drop(bets, 49), 10) | |
35 | 35 | let b05 = take(drop(bets, 64), 10) | |
36 | 36 | let b06 = take(drop(bets, 79), 10) | |
37 | 37 | let b07 = take(drop(bets, 94), 10) | |
38 | 38 | let b08 = take(drop(bets, 109), 10) | |
39 | 39 | let b09 = take(drop(bets, 124), 10) | |
40 | 40 | let b10 = take(drop(bets, 139), 10) | |
41 | 41 | (((((((((parseIntValue(b01) + parseIntValue(b02)) + parseIntValue(b03)) + parseIntValue(b04)) + parseIntValue(b05)) + parseIntValue(b06)) + parseIntValue(b07)) + parseIntValue(b08)) + parseIntValue(b09)) + parseIntValue(b10)) | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func IncrementGameNum () = { | |
46 | 46 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
47 | 47 | case num: Int => | |
48 | 48 | num | |
49 | 49 | case _ => | |
50 | 50 | 0 | |
51 | 51 | } | |
52 | 52 | (gameNum + 1) | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | 57 | func playRoulette (bets) = { | |
58 | 58 | let gameId = toBase58String(i.transactionId) | |
59 | 59 | let gameIdUsed = isDefined(getString(this, gameId)) | |
60 | 60 | let payment = extract(i.payment) | |
61 | 61 | let feeAssetId = isDefined(i.feeAssetId) | |
62 | 62 | let playerBalance = wavesBalance(i.caller) | |
63 | 63 | let a = getAmt(bets) | |
64 | 64 | if ((payment.assetId != WBET)) | |
65 | 65 | then throw("Payment should be in Wavesbet") | |
66 | 66 | else if ((1000000 > playerBalance)) | |
67 | 67 | then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.") | |
68 | 68 | else if (feeAssetId) | |
69 | 69 | then throw("Transaction's fee must be in Waves. Game aborted.") | |
70 | 70 | else if (gameIdUsed) | |
71 | 71 | then throw("Passed gameId had been used before. Game aborted.") | |
72 | 72 | else if ((a != payment.amount)) | |
73 | - | then throw("Payment value is different from bet value.") | |
73 | + | then throw(("Payment value is different from bet value. " + toString(a))) | |
74 | 74 | else { | |
75 | 75 | let newGameNum = IncrementGameNum() | |
76 | 76 | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
77 | 77 | let gameDataStr = ((((STATESUBMITTED + "_") + playerPubKey58) + "_") + bets) | |
78 | 78 | ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil)) | |
79 | 79 | } | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 |
github/deemru/w8io/169f3d6 41.35 ms ◑