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