tx · 56nj27NYSMR1F2HZ18zcfDs4dUsrXwrabJHCMD87RMQP

3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe:  -0.05000000 Waves

2021.04.15 12:31 [1483379] smart account 3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe > SELF 0.00000000 Waves

{ "type": 13, "id": "56nj27NYSMR1F2HZ18zcfDs4dUsrXwrabJHCMD87RMQP", "fee": 5000000, "feeAssetId": null, "timestamp": 1618479133363, "version": 2, "chainId": 84, "sender": "3N7oes1Mab9zmCWuTdXSnKvkN6Y2pJc1dDe", "senderPublicKey": "4MMreyp5fK9PfGwiJTaZTXuPjY9Tj3qHt6pHiGJ8uyXJ", "proofs": [ "4v4FqdBxpnWhM4efdN3trwqf8DmU9jckr71bTKp9NjohJVWFvvXMnvfwssei2r4WbV4KKNQSpDKe1H2mqoFoUkm" ], "script": "base64:AAIDAAAAAAAAAAsIARIAEgUKAwEICAAAAAcAAAAACVJTQVBVQkxJQwkAAlsAAAABAgAAAY9iYXNlNjQ6TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF4WEl1cW1meEROa1Y1Sm85YXhudUZwQWpLSDJjeUdxUWNrandCcEZ6MnRZSlhOL01zRHVSa2gvdFpCdG5uUVRHM0VLK1hid1dGY1lIczRCb0h6aGFLRm9nNHhLclQ0bnRVYmNURTJBcVBzaFhpT3NJZUp2ZUdkSVQ3aC9IMkpkQVVGTXVyM3RsUFZYQTFmUnBsVjFXNjUxT0lhRThGK0NudkI5WVdjQVRCcXFVSzNZWWh3N1ZhK0RvenR2Snd2TnF1Y29ZbWRubmk2ejV2MHJDbEptaWZPSEJYRnMwVVFvN1JxaldoM0w5K2ZHak9qcVFMc0NlbWJJUWJsL1NJcVJtWDFIWWVtQjFHUUJTbDN1NUxpTTlON2hHU091djdNRklmMmV6UXlhZ1NicSt2LzN3QUR2UC9XdytxU2x4aWtKTmJqeFhwTGFMTEpYelR5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AAAAAgAAAAAAAAAAMAUAAAAEcmFuZAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAAB3VzZXJpZDoFAAAABnVzZXJpZAkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABXJhbmQ6CQABpAAAAAEFAAAABHJhbmQCAAAABXJpc2s6CQABpAAAAAEFAAAABHJpc2sCAAAABHdvbjoJAAGkAAAAAQkAAGgAAAACBQAAAAZhbW91bnQAAAAAAAAAAAMFAAAAA25pbAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAAB3VzZXJpZDoFAAAABnVzZXJpZAkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABXJhbmQ6CQABpAAAAAEFAAAABHJhbmQCAAAABXJpc2s6CQABpAAAAAEFAAAABHJpc2sCAAAABWxvc3Q6CQABpAAAAAEFAAAABmFtb3VudAUAAAADbmlsAAAAAE33bdo=", "height": 1483379, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: vz44Jg7SyX5Yidm373ydhQ8WNX6vA31wK3xrAbwNZ6G Next: B7ZfeRuxQMAsVrLUXtU6AKC4wYq4dRsyZpSn51LaKTL5 Diff:
OldNewDifferences
5050 let callerAddress = toBase58String(i.caller.bytes)
5151 let rand = GenerateRandInt(gameId, rsaSign)
5252 let amount = 10000
53- let userid = "1234"
53+ let userid = "12345"
5454 if ((risk == 2))
5555 then if ((73 > rand))
5656 then WriteSet([DataEntry(((callerAddress + "userid:") + userid), ((((("rand:" + toString(rand)) + "risk:") + toString(risk)) + "won:") + toString((amount * 2))))])
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 init () = {
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 game (risk,gameId,rsaSignr) = {
4949 let rsaSign = fromBase64String(rsaSignr)
5050 let callerAddress = toBase58String(i.caller.bytes)
5151 let rand = GenerateRandInt(gameId, rsaSign)
5252 let amount = 10000
53- let userid = "1234"
53+ let userid = "12345"
5454 if ((risk == 2))
5555 then if ((73 > rand))
5656 then WriteSet([DataEntry(((callerAddress + "userid:") + userid), ((((("rand:" + toString(rand)) + "risk:") + toString(risk)) + "won:") + toString((amount * 2))))])
5757 else WriteSet([DataEntry(((callerAddress + "userid:") + userid), ((((("rand:" + toString(rand)) + "risk:") + toString(risk)) + "lost:") + toString(amount)))])
5858 else if ((48 > rand))
5959 then WriteSet([DataEntry(((callerAddress + "userid:") + userid), ((((("rand:" + toString(rand)) + "risk:") + toString(risk)) + "won:") + toString((amount * 3))))])
6060 else WriteSet([DataEntry(((callerAddress + "userid:") + userid), ((((("rand:" + toString(rand)) + "risk:") + toString(risk)) + "lost:") + toString(amount)))])
6161 }
6262
6363

github/deemru/w8io/169f3d6 
60.00 ms