tx · 9tTeEjZKwdLMcf5MqFQ4ypKk6pAo1jcxvxoMP1EAAUiZ 3NCCNgEjGtWKLt78jWc9DiA3Jd2jmfg7BZX: -0.10000000 Waves 2022.01.13 18:45 [1877384] smart account 3NCCNgEjGtWKLt78jWc9DiA3Jd2jmfg7BZX > SELF 0.00000000 Waves
{ "type": 13, "id": "9tTeEjZKwdLMcf5MqFQ4ypKk6pAo1jcxvxoMP1EAAUiZ", "fee": 10000000, "feeAssetId": null, "timestamp": 1642088756113, "version": 2, "chainId": 84, "sender": "3NCCNgEjGtWKLt78jWc9DiA3Jd2jmfg7BZX", "senderPublicKey": "AcdhXSF5aWK6Lmdtv3cyCZ7vehbxsNNGagWCd2FpZo1M", "proofs": [ "n8tpyCHDXKBfwhQ7tupGYcLfga1BmHvLwyjorB5pKjqxjya7squNZEQ2bosNWtXuygA9NyDqzajiVdztdZerR8T" ], "script": "base64:AAIFAAAAAAAAABQIAhIFCgMIAQESABIHCgUBCAgICAAAAA8AAAAAE2dhbWVNYXN0ZXJQdWJsaWNLZXkBAAAAIF1t2Oq4Jp6DRGnJV2x+n66xACBB37xnTL7cQnLLqBNvAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGTYmFzZTY0Ok1JSUJJekFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUkFBTUlJQkN3S0NBUUlBK0NwYnpNQktwcSs3VmFyU0RITFcwd1FTb2gyTFRiZ2wxckFoZnJ1WkdDanQ2TU80bzF2MWlMcUt5TkgzRkpzdndsTFVxbXFFN0UyV2w3TGJJUEEyNlB4TzJYQ0RmdmowT1dwN2NFSmtVQkVpeVBZQ24raXVQWFVQd3Vkb0ZnTTRXSGYwSVBiREoyTzZPZ3pRbEJCbU51Nk93cjduYUlUaUpyUEF2YWtQZ0FkbVVQdjRyT3pjdTZCUjBUOEd3c3p3cHJ2d1dabEtGNkFkMDBvbUxGRG14NjZIdkJFNTFzUkJpWElSYkpuakRobG9waXplNExvUjFGSXJRYUF1MXNmczVi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ABJzZXR1cEdhbWVfRk9SQklERU4EAAAAByRtYXRjaDAJAQAAABRnYW1lc1NldHVwR2V0Q291bnRlcgAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAARU0VUVVBHQU1FU0NPVU5URVIFAAAAByRtYXRjaDAEAAAACnJhbmRvbWl6ZXIJAABqAAAAAgkABLEAAAABCQAB9wAAAAEJAADLAAAAAgkAAMkAAAACCAUAAAAJbGFzdEJsb2NrAAAAE2dlbmVyYXRpb25TaWduYXR1cmUAAAAAAAAAABAJAADJAAAAAggFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAAAAAAAAAAAEAAAAAAAAAAAAgQAAAALY3VycmVudEdhbWUJAABkAAAAAgUAAAARU0VUVVBHQU1FU0NPVU5URVIAAAAAAAAAAAEDCQEAAAACIT0AAAACBQAAAApnYW1lTnVtYmVyBQAAAAtjdXJyZW50R2FtZQkAAAIAAAABAgAAABJXcm9uZyBnYW1lIG51bWJlci4JAQAAAAxnZXRHYW1lU2V0dXAAAAADBQAAAAtjdXJyZW50R2FtZQUAAAAKcmFuZG9taXplcgUAAAAGY2FyZHMwCQAAAgAAAAECAAAAEUluaXRHYW1lIFJlcXVpcmVkAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkCscfv", "height": 1877384, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: j4JvrbH7eAoRKn1vA2ULCLpFMGd9YBumDoVHTnKJmeN Next: 9zgD8NoTc6ZJ1zbBFLpqNarUF5BXD7PenxGTucHDMARM Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let gameMasterPublicKey = base58' | |
4 | + | let gameMasterPublicKey = base58'7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi' | |
5 | 5 | ||
6 | - | let RSAPUBLIC = fromBase64String("base64: | |
6 | + | let RSAPUBLIC = fromBase64String("base64:MIIBIzANBgkqhkiG9w0BAQEFAAOCARAAMIIBCwKCAQIA+CpbzMBKpq+7VarSDHLW0wQSoh2LTbgl1rAhfruZGCjt6MO4o1v1iLqKyNH3FJsvwlLUqmqE7E2Wl7LbIPA26PxO2XCDfvj0OWp7cEJkUBEiyPYCn+iuPXUPwudoFgM4WHf0IPbDJ2O6OgzQlBBmNu6Owr7naITiJrPAvakPgAdmUPv4rOzcu6BR0T8GwszwprvwWZlKF6Ad00omLFDmx66HvBE51sRBiXIRbJnjDhlopize4LoR1FIrQaAu1sfs5bEHLA33jvKybne+IDawCsiINZYdPZV1WWcURC+XAFfBiYCw4PYyguxaBRHotzLc2dOsBV1HDNIjLKVoRknyt50CAwEAAQ==") | |
7 | 7 | ||
8 | 8 | let setupGamesCounterLabel = "G_SETUPGAMESCOUNTER" | |
9 | 9 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let gameMasterPublicKey = base58' | |
4 | + | let gameMasterPublicKey = base58'7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi' | |
5 | 5 | ||
6 | - | let RSAPUBLIC = fromBase64String("base64: | |
6 | + | let RSAPUBLIC = fromBase64String("base64:MIIBIzANBgkqhkiG9w0BAQEFAAOCARAAMIIBCwKCAQIA+CpbzMBKpq+7VarSDHLW0wQSoh2LTbgl1rAhfruZGCjt6MO4o1v1iLqKyNH3FJsvwlLUqmqE7E2Wl7LbIPA26PxO2XCDfvj0OWp7cEJkUBEiyPYCn+iuPXUPwudoFgM4WHf0IPbDJ2O6OgzQlBBmNu6Owr7naITiJrPAvakPgAdmUPv4rOzcu6BR0T8GwszwprvwWZlKF6Ad00omLFDmx66HvBE51sRBiXIRbJnjDhlopize4LoR1FIrQaAu1sfs5bEHLA33jvKybne+IDawCsiINZYdPZV1WWcURC+XAFfBiYCw4PYyguxaBRHotzLc2dOsBV1HDNIjLKVoRknyt50CAwEAAQ==") | |
7 | 7 | ||
8 | 8 | let setupGamesCounterLabel = "G_SETUPGAMESCOUNTER" | |
9 | 9 | ||
10 | 10 | let usedGamesCounterLabel = "G_USEDGAMESCOUNTER" | |
11 | 11 | ||
12 | 12 | let dealerQueueLabel = "G_DEALERQUEUE" | |
13 | 13 | ||
14 | 14 | let gameMaxBetLabel = "G_MAXBET" | |
15 | 15 | ||
16 | 16 | func gamesSetupGetCounter () = getInteger(this, setupGamesCounterLabel) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func gamesUsedGetCounter () = getInteger(this, usedGamesCounterLabel) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func checkPermission (callerPublicKey) = (callerPublicKey != gameMasterPublicKey) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func getGameCardsSignatureLabel (gameNumber,card) = ((("G_" + toString(gameNumber)) + "_CARDSIGNATURE_") + toString(card)) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getGameCardsSignature (gameNumber,card) = getString(this, getGameCardsSignatureLabel(gameNumber, card)) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func getGameCardsLabel (gameNumber,card) = ((("G_" + toString(gameNumber)) + "_CARD_") + toString(card)) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func getGameStateLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_STATE") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func getGameShuffelOffesetLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_OFFSET") | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getGameSetup (gameNumber,randomizer,cards0) = [IntegerEntry(setupGamesCounterLabel, gameNumber), IntegerEntry(getGameStateLabel(gameNumber), 0), IntegerEntry(getGameShuffelOffesetLabel(gameNumber), randomizer), StringEntry(getGameCardsSignatureLabel(gameNumber, 0), cards0)] | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(i) | |
44 | 44 | func verifyCard (card,gameNumber,cardNumber) = { | |
45 | 45 | let t = rsaVerify_16Kb(SHA256, toBytes(card), fromBase64String(split(value(getGameCardsSignature(gameNumber, cardNumber)), " ")[0]), RSAPUBLIC) | |
46 | 46 | throw(toString(t)) | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(i) | |
52 | 52 | func initGame () = if (checkPermission(i.callerPublicKey)) | |
53 | 53 | then throw("initGame_FORBBIDEN") | |
54 | 54 | else match gamesSetupGetCounter() { | |
55 | 55 | case GAMESCOUNTER: Int => | |
56 | 56 | throw("INIT_ALREADY_DONE") | |
57 | 57 | case _ => | |
58 | 58 | [IntegerEntry(setupGamesCounterLabel, 0), IntegerEntry(usedGamesCounterLabel, 0), IntegerEntry(gameMaxBetLabel, 100000000), StringEntry(dealerQueueLabel, "")] | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func setupGame (gameNumber,cards0,cards1,cards2,cards3) = if (checkPermission(i.callerPublicKey)) | |
65 | 65 | then throw("setupGame_FORBIDEN") | |
66 | 66 | else match gamesSetupGetCounter() { | |
67 | 67 | case SETUPGAMESCOUNTER: Int => | |
68 | 68 | let randomizer = (toInt(sha256((take(lastBlock.generationSignature, 16) + take(i.transactionId, 16)))) % 2) | |
69 | 69 | let currentGame = (SETUPGAMESCOUNTER + 1) | |
70 | 70 | if ((gameNumber != currentGame)) | |
71 | 71 | then throw("Wrong game number.") | |
72 | 72 | else getGameSetup(currentGame, randomizer, cards0) | |
73 | 73 | case _ => | |
74 | 74 | throw("InitGame Required") | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | @Verifier(tx) | |
79 | 79 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
80 | 80 |
github/deemru/w8io/169f3d6 43.81 ms ◑