tx · 67ffeZSrYouGwdbdezH9zCXdwxMxqjNv46FCPtLv8H7b 3N99AehMbVA6HtBi6W6uuhw9uYqLLBpjyYs: -0.01000000 Waves 2021.04.21 19:57 [1492493] smart account 3N99AehMbVA6HtBi6W6uuhw9uYqLLBpjyYs > SELF 0.00000000 Waves
{ "type": 13, "id": "67ffeZSrYouGwdbdezH9zCXdwxMxqjNv46FCPtLv8H7b", "fee": 1000000, "feeAssetId": null, "timestamp": 1619024275923, "version": 2, "chainId": 84, "sender": "3N99AehMbVA6HtBi6W6uuhw9uYqLLBpjyYs", "senderPublicKey": "G4HkY7YuejrFmLakJczxFdVRpKUECFdbT61iEG1vSkE5", "proofs": [ "3FnGY7xtYrhtESCBubFr24SvhPpu3GzXwfYNsDzi3FMbXFHM2GXvwSqAKc3pwPN8xh9CeLq8QL2R9Lu7SvoxD48y" ], "script": "base64:AAIDAAAAAAAAAAgIARIECgIICAAAAAcAAAAACVJTQVBVQkxJQwkAAlsAAAABAgAAAY9iYXNlNjQ6TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF4WEl1cW1meEROa1Y1Sm85YXhudUZwQWpLSDJjeUdxUWNrandCcEZ6MnRZSlhOL01zRHVSa2gvdFpCdG5uUVRHM0VLK1hid1dGY1lIczRCb0h6aGFLRm9nNHhLclQ0bnRVYmNURTJBcVBzaFhpT3NJZUp2ZUdkSVQ3aC9IMkpkQVVGTXVyM3RsUFZYQTFmUnBsVjFXNjUxT0lhRThGK0NudkI5WVdjQVRCcXFVSzNZWWh3N1ZhK0RvenR2Snd2TnF1Y29ZbWRubmk2ejV2MHJDbEptaWZPSEJYRnMwVVFvN1JxaldoM0w5K2ZHak9qcVFMc0NlbWJJUWJsL1NJcVJtWDFIWWVtQjFHUUJTbDN1NUxpTTlON2hHU091djdNRklmMmV6UXlhZ1NicSt2LzN3QUR2UC9XdytxU2x4aWtKTmJqeFhwTGFMTEpYelR5ZUpEK2t0NHdJRE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ZUlkCQABLAAAAAICAAAABXJhbmQ6CQABpAAAAAEFAAAABHJhbmQFAAAAA25pbAAAAAB/1kJh", "height": 1492493, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxXIuqmfxDNkV5Jo9axnuFpAjKH2cyGqQckjwBpFz2tYJXN/MsDuRkh/tZBtnnQTG3EK+XbwWFcYHs4BoHzhaKFog4xKrT4ntUbcTE2AqPshXiOsIeJveGdIT7h/H2JdAUFMur3tlPVXA1fRplV1W651OIaE8F+CnvB9YWcATBqqUK3YYhw7Va+DoztvJwvNqucoYmdnni6z5v0rClJmifOHBXFs0UQo7RqjWh3L9+fGjOjqQLsCembIQbl/SIqRmX1HYemB1GQBSl3u5LiM9N7hGSOuv7MFIf2ezQyagSbq+v/3wADvP/Ww+qSlxikJNbjxXpLaLLJXzTyeJD+kt4wIDAQAB") | |
5 | + | ||
6 | + | let GAMESCOUNTERKEY = "$GAME_NUM" | |
7 | + | ||
8 | + | let STATESUBMITTED = "SUBMITTED" | |
9 | + | ||
10 | + | let STATEWON = "WON" | |
11 | + | ||
12 | + | let STATELOST = "LOST" | |
13 | + | ||
14 | + | func IncrementGameNum () = { | |
15 | + | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
16 | + | case num: Int => | |
17 | + | num | |
18 | + | case _ => | |
19 | + | 0 | |
20 | + | } | |
21 | + | (gameNum + 1) | |
22 | + | } | |
23 | + | ||
24 | + | ||
25 | + | func GenerateRandInt (gameId,rsaSign) = { | |
26 | + | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
27 | + | if (rsaSigValid) | |
28 | + | then { | |
29 | + | let rand = (toInt(sha256(rsaSign)) % 150) | |
30 | + | if ((0 > rand)) | |
31 | + | then ((-1 * rand) + 1) | |
32 | + | else (rand + 1) | |
33 | + | } | |
34 | + | else throw("Invalid RSA signature") | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | @Callable(i) | |
39 | + | func test (gameId,rsaSignr) = { | |
40 | + | let rsaSign = fromBase64String(rsaSignr) | |
41 | + | let rand = GenerateRandInt(gameId, rsaSign) | |
42 | + | WriteSet([DataEntry(gameId, ("rand:" + toString(rand)))]) | |
43 | + | } | |
44 | + | ||
45 | + |
github/deemru/w8io/169f3d6 18.84 ms ◑