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+MrRqQJlrrmZ7DVX3O3dmzXFLPgNW0BGAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBeGk1enkxSDZUMnBReDdxZ01waDlzNy9XZzgxOXNvYjlBdlFzR3NjM0R6ejVaalRraHZOTFFQZjF3dFEralZDSVQ4U0FqZ1BWV1dQM1lJOG96R3pLVzQ5U3FMaWFTcW1VNUduNHBqUjlOWUlxc05ESm1YKzlHTXBGMWRlcm1QVjVIRVl4Qk1RMk5Ba01zV0ExWElZYy9hSWEwZi93VmdNZTIwOU1VTTJvVXd5RUtBMXFBRUptc1FrWENqSk9BQWtVUUhpNkhUeXVvUXFqdDVPWmxvUytpeDJ3Tnl5ZnRCajN3cE5nUTh3K0phSTZodGc3Tm1sNy9OZW91a3VJZHRVU3o5bk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R2FtZV9GT1JCSURFTgQAAAAHJG1hdGNoMAkBAAAAFGdhbWVzU2V0dXBHZXRDb3VudGVyAAAAAAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAABFTRVRVUEdBTUVTQ09VTlRFUgUAAAAHJG1hdGNoMAQAAAAKcmFuZG9taXplcgkAAGoAAAACCQAEsQAAAAEJAAH3AAAAAQkAAMsAAAACCQAAyQAAAAIIBQAAAAlsYXN0QmxvY2sAAAATZ2VuZXJhdGlvblNpZ25hdHVyZQAAAAAAAAAAEAkAAMkAAAACCAUAAAABaQAAAA10cmFuc2FjdGlvbklkAAAAAAAAAAAQAAAAAAAAAAACBAAAAAtjdXJyZW50R2FtZQkAAGQAAAACBQAAABFTRVRVUEdBTUVTQ09VTlRFUgAAAAAAAAAAAQMJAQAAAAIhPQAAAAIFAAAACmdhbWVOdW1iZXIFAAAAC2N1cnJlbnRHYW1lCQAAAgAAAAECAAAAEldyb25nIGdhbWUgbnVtYmVyLgkBAAAADGdldEdhbWVTZXR1cAAAAAMFAAAAC2N1cnJlbnRHYW1lBQAAAApyYW5kb21pemVyBQAAAAZjYXJkczAJAAACAAAAAQIAAAARSW5pdEdhbWUgUmVxdWlyZWQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleXkSSGs=", "height": 1873559, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6sJDtxdQ7VWdQJgtGxfAz5KydbTYv1rSi7p28Lu3VUyN Next: 9tTeEjZKwdLMcf5MqFQ4ypKk6pAo1jcxvxoMP1EAAUiZ Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let gameMasterPublicKey = base58'T6KCB5F31CtyYUmUoR4QEe16AkJboVcubXTyRZZECS9'
5+
6+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxi5zy1H6T2pQx7qgMph9s7/Wg819sob9AvQsGsc3Dzz5ZjTkhvNLQPf1wtQ+jVCIT8SAjgPVWWP3YI8ozGzKW49SqLiaSqmU5Gn4pjR9NYIqsNDJmX+9GMpF1dermPV5HEYxBMQ2NAkMsWA1XIYc/aIa0f/wVgMe209MUM2oUwyEKA1qAEJmsQkXCjJOAAkUQHi6HTyuoQqjt5OZloS+ix2wNyyftBj3wpNgQ8w+JaI6htg7Nml7/NeoukuIdtUSz9nJi4asGco9jYr7q0tgVDQl6NlBHMN6CNJahpPZN/YNAb+CzAitZGlNcWIawLFec1fZOO8hbaHTuQ843j6jVQIDAQAB")
57
68 let setupGamesCounterLabel = "G_SETUPGAMESCOUNTER"
79
2325 func getGameCardsSignatureLabel (gameNumber,card) = ((("G_" + toString(gameNumber)) + "_CARDSIGNATURE_") + toString(card))
2426
2527
28+func getGameCardsSignature (gameNumber,card) = getString(this, getGameCardsSignatureLabel(gameNumber, card))
29+
30+
2631 func getGameCardsLabel (gameNumber,card) = ((("G_" + toString(gameNumber)) + "_CARD_") + toString(card))
2732
2833
3338
3439
3540 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+
3649
3750
3851 @Callable(i)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let gameMasterPublicKey = base58'T6KCB5F31CtyYUmUoR4QEe16AkJboVcubXTyRZZECS9'
5+
6+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxi5zy1H6T2pQx7qgMph9s7/Wg819sob9AvQsGsc3Dzz5ZjTkhvNLQPf1wtQ+jVCIT8SAjgPVWWP3YI8ozGzKW49SqLiaSqmU5Gn4pjR9NYIqsNDJmX+9GMpF1dermPV5HEYxBMQ2NAkMsWA1XIYc/aIa0f/wVgMe209MUM2oUwyEKA1qAEJmsQkXCjJOAAkUQHi6HTyuoQqjt5OZloS+ix2wNyyftBj3wpNgQ8w+JaI6htg7Nml7/NeoukuIdtUSz9nJi4asGco9jYr7q0tgVDQl6NlBHMN6CNJahpPZN/YNAb+CzAitZGlNcWIawLFec1fZOO8hbaHTuQ843j6jVQIDAQAB")
57
68 let setupGamesCounterLabel = "G_SETUPGAMESCOUNTER"
79
810 let usedGamesCounterLabel = "G_USEDGAMESCOUNTER"
911
1012 let dealerQueueLabel = "G_DEALERQUEUE"
1113
1214 let gameMaxBetLabel = "G_MAXBET"
1315
1416 func gamesSetupGetCounter () = getInteger(this, setupGamesCounterLabel)
1517
1618
1719 func gamesUsedGetCounter () = getInteger(this, usedGamesCounterLabel)
1820
1921
2022 func checkPermission (callerPublicKey) = (callerPublicKey != gameMasterPublicKey)
2123
2224
2325 func getGameCardsSignatureLabel (gameNumber,card) = ((("G_" + toString(gameNumber)) + "_CARDSIGNATURE_") + toString(card))
2426
2527
28+func getGameCardsSignature (gameNumber,card) = getString(this, getGameCardsSignatureLabel(gameNumber, card))
29+
30+
2631 func getGameCardsLabel (gameNumber,card) = ((("G_" + toString(gameNumber)) + "_CARD_") + toString(card))
2732
2833
2934 func getGameStateLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_STATE")
3035
3136
3237 func getGameShuffelOffesetLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_OFFSET")
3338
3439
3540 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+
3649
3750
3851 @Callable(i)
3952 func initGame () = if (checkPermission(i.callerPublicKey))
4053 then throw("initGame_FORBBIDEN")
4154 else match gamesSetupGetCounter() {
4255 case GAMESCOUNTER: Int =>
4356 throw("INIT_ALREADY_DONE")
4457 case _ =>
4558 [IntegerEntry(setupGamesCounterLabel, 0), IntegerEntry(usedGamesCounterLabel, 0), IntegerEntry(gameMaxBetLabel, 100000000), StringEntry(dealerQueueLabel, "")]
4659 }
4760
4861
4962
5063 @Callable(i)
5164 func setupGame (gameNumber,cards0,cards1,cards2,cards3) = if (checkPermission(i.callerPublicKey))
5265 then throw("setupGame_FORBIDEN")
5366 else match gamesSetupGetCounter() {
5467 case SETUPGAMESCOUNTER: Int =>
5568 let randomizer = (toInt(sha256((take(lastBlock.generationSignature, 16) + take(i.transactionId, 16)))) % 2)
5669 let currentGame = (SETUPGAMESCOUNTER + 1)
5770 if ((gameNumber != currentGame))
5871 then throw("Wrong game number.")
5972 else getGameSetup(currentGame, randomizer, cards0)
6073 case _ =>
6174 throw("InitGame Required")
6275 }
6376
6477
6578 @Verifier(tx)
6679 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6780

github/deemru/w8io/026f985 
21.50 ms