tx · 2RywGzV8hfW7Ga7kJwu6NkdTUaeSPoRrbHgXJZktsCTg

3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe:  -0.04000000 Waves

2021.04.13 15:57 [1480701] smart account 3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe > SELF 0.00000000 Waves

{ "type": 13, "id": "2RywGzV8hfW7Ga7kJwu6NkdTUaeSPoRrbHgXJZktsCTg", "fee": 4000000, "feeAssetId": null, "timestamp": 1618318666959, "version": 2, "chainId": 84, "sender": "3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe", "senderPublicKey": "4MMreyp5fK9PfGwiJTaZTXuPjY9Tj3qHt6pHiGJ8uyXJ", "proofs": [ "3jeciKvAdWS4oZMrTDvErDyvh3MRLAgiYpqUzSeav6TC9KgoZZGxCkEgqrcAvocaQtkBRSAqhzeeSzCXMKBMRNNF" ], "script": "base64:AAIDAAAAAAAAAA8IARIFCgMIAQESBAoCCAgAAAAHAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBeFhJdXFtZnhETmtWNUpvOWF4bnVGcEFqS0gyY3lHcVFja2p3QnBGejJ0WUpYTi9Nc0R1UmtoL3RaQnRublFURzNFSytYYndXRmNZSHM0Qm9IemhhS0ZvZzR4S3JUNG50VWJjVEUyQXFQc2hYaU9zSWVKdmVHZElUN2gvSDJKZEFVRk11cjN0bFBWWEExZlJwbFYxVzY1MU9JYUU4RitDbnZCOVlXY0FUQnFxVUszWVlodzdWYStEb3p0dkp3dk5xdWNvWW1kbm5pNno1djByQ2xKbWlmT0hCWEZzMFVRbzdScWpXaDNMOStmR2pPanFRTHNDZW1iSVFibC9TSXFSbVgxSFllbUIxR1FCU2wzdTVMaU05TjdoR1NPdXY3TUZJZjJlelF5YWdTYnErdi8zd0FEdlAvV3crcVNseGlrSk5ianhYcExhTExKWHpU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QAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAAAl9nBQAAAAZnYW1lSWQFAAAAA25pbAAAAAFpAQAAAAhyZWFkc3BpbgAAAAIAAAAGZ2FtZUlkAAAACHJzYVNpZ25yBAAAAAdyc2FTaWduCQACWwAAAAEFAAAACHJzYVNpZ25yBAAAAA1jYWxsZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABHJhbmQJAQAAAA9HZW5lcmF0ZVJhbmRJbnQAAAACBQAAAAZnYW1lSWQFAAAAB3JzYVNpZ24JAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAANY2FsbGVyQWRkcmVzcwIAAAACX3IFAAAABHJhbmQFAAAAA25pbAAAAACoaD2N", "height": 1480701, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4xtryPsa9UtWeWmjQVHUFCUJEbFquGaeP6MfubsJBTJ Next: B7XYP7wogHRxr5ysTP2NG7TEFcKt1Y7YmgjJJN6LhDd7 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxXIuqmfxDNkV5Jo9axnuFpAjKH2cyGqQckjwBpFz2tYJXN/MsDuRkh/tZBtnnQTG3EK+XbwWFcYHs4BoHzhaKFog4xKrT4ntUbcTE2AqPshXiOsIeJveGdIT7h/H2JdAUFMur3tlPVXA1fRplV1W651OIaE8F+CnvB9YWcATBqqUK3YYhw7Va+DoztvJwvNqucoYmdnni6z5v0rClJmifOHBXFs0UQo7RqjWh3L9+fGjOjqQLsCembIQbl/SIqRmX1HYemB1GQBSl3u5LiM9N7hGSOuv7MFIf2ezQyagSbq+v/3wADvP/Ww+qSlxikJNbjxXpLaLLJXzTyeJD+kt4wIDAQAB")
55
66 let GAMESCOUNTERKEY = "$GAME_NUM"
77
88 let STATESUBMITTED = "SUBMITTED"
99
1010 let STATEWON = "WON"
1111
1212 let STATELOST = "LOST"
1313
1414 func IncrementGameNum () = {
1515 let gameNum = match getInteger(this, GAMESCOUNTERKEY) {
1616 case num: Int =>
1717 num
1818 case _ =>
1919 0
2020 }
2121 (gameNum + 1)
2222 }
2323
2424
2525 func GenerateRandInt (gameId,rsaSign) = {
2626 let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
2727 if (rsaSigValid)
2828 then {
2929 let rand = (toInt(sha256(rsaSign)) % 150)
3030 if ((0 > rand))
3131 then ((-1 * rand) + 1)
3232 else (rand + 1)
3333 }
3434 else throw("Invalid RSA signature")
3535 }
3636
3737
3838 @Callable(i)
3939 func suffle (client,amount,target) = {
4040 let callerAddress = toBase58String(i.caller.bytes)
4141 let gameId = toBase58String(i.transactionId)
4242 WriteSet([DataEntry((callerAddress + "_g"), gameId)])
4343 }
4444
4545
4646
4747 @Callable(i)
4848 func readspin (gameId,rsaSignr) = {
4949 let rsaSign = fromBase64String(rsaSignr)
5050 let callerAddress = toBase58String(i.caller.bytes)
5151 let rand = GenerateRandInt(gameId, rsaSign)
5252 WriteSet([DataEntry((callerAddress + "_r"), rand)])
5353 }
5454
5555

github/deemru/w8io/169f3d6 
39.22 ms