tx · 5F4ARfYLw5n958yG31tTh5W9MNLc2GWYC7fh9ugCry6N
3NCAHkQMZsVNJh9u15MjBDHjY8efFKNArX8: -0.00500000 Waves
2022.10.04 07:58 [2257144] smart account 3NCAHkQMZsVNJh9u15MjBDHjY8efFKNArX8 > SELF 0.00000000 Waves
{
"type": 13,
"id": "5F4ARfYLw5n958yG31tTh5W9MNLc2GWYC7fh9ugCry6N",
"fee": 500000,
"feeAssetId": null,
"timestamp": 1664859525153,
"version": 2,
"chainId": 84,
"sender": "3NCAHkQMZsVNJh9u15MjBDHjY8efFKNArX8",
"senderPublicKey": "83Eyw5Bn6vkLTM9RkbXMAx8DtYNoLRqmeba4WAMvYhzK",
"proofs": [
"2g49VPoqXUayQJmZCjt54nVBEcSQh74rCthnBez3qcn9m2o8F7HkBSrd44gQ6tirDivhthNTfiV7tGXsYygqXUoy"
],
"script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAMAAAAACVJTQVBVQkxJQwIAAAGITUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFsZW1yOTVKMWpaVXM3Y0ptcm1tbE40em83WVZzQkp6SWVKZGs4TERGR2hVS1NJNnlmczIwWnlKZTIxKzZHSndObktVVTFVeW9jMTd3U1dNS2tyWjBNTXZZRStaNUFpaWp2Qks0c1NKM0lnR2pkVTgvTmhJOENCRHUwRit4Uk05cTNUQjNMTGJEeTVzQmR1ZFlmSGZzVU9jK01UdkFENjluMjdkYjJSaDgreVpRTXR1Ymt1VFFOcDg5c3BoSFFhTEd5UUZhTmxLL05hM2xGeDZvbXF6YWExZ2pvcGxVcjZydllLZ2ZBSUNVQjN6Vm1KU2hpRWk3dzdSMGhXbE5SRDNxY1pqQ1VPTlNwRm80V2J6a25HT2F6dzg0QitJTUlGbklwWFd6UUw4Ulgwdk5jZnNCdkxEZk02azJaYWNxd3lNS2FMTHFpZ2RCaUdkSjdXKzBsT1N0T1FJREFRQUIAAAAAAnJwCQACWwAAAAEFAAAACVJTQVBVQkxJQwEAAAABcgAAAAIAAAAEcnNiYgAAAAZnYW1lSWQEAAAABGJnaWQJAAH3AAAAAQkAAZsAAAABBQAAAAZnYW1lSWQEAAAAA3JzdgkACigAAAAEBQAAAAZTSEEyNTYFAAAABGJnaWQFAAAABHJzYmIFAAAAAnJwAwkBAAAAASEAAAABBQAAAANyc3YJAAACAAAAAQIAAAAVSW52YWxpZCBSU0Egc2lnbmF0dXJlBAAAAARyYW5kCQAAagAAAAIJAASxAAAAAQkAAfcAAAABBQAAAARyc2JiAAAAAAAAAAAGCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAA3JzdgkAAaUAAAABBQAAAANyc3YJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAABHJhbmQFAAAABHJhbmQFAAAAA25pbAAAAAEAAAABaQEAAAAEY2FsbAAAAAIAAAACcnMAAAAGZ2FtZUlkBAAAAANyc2IJAAJbAAAAAQUAAAACcnMJAQAAAAFyAAAAAgUAAAADcnNiBQAAAAZnYW1lSWQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlecbFMM0=",
"height": 2257144,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: HK6ZZCkrQRCZkVeBFWJsuLhQaU8vrRxzZADr7Zv5BkwR
Next: 7EZa8yrYpqWYZ9GBMFqxVa9EEnbVjYtzNCKvF6Rdwhvo
Diff:
Old | New | | Differences |
---|
6 | 6 | | let rp = fromBase64String(RSAPUBLIC) |
---|
7 | 7 | | |
---|
8 | 8 | | func r (rsbb,gameId) = { |
---|
9 | | - | let bgid = toBytes(gameId) |
---|
| 9 | + | let bgid = sha256(toBytes(gameId)) |
---|
10 | 10 | | let rsv = rsaVerify_16Kb(SHA256, bgid, rsbb, rp) |
---|
11 | 11 | | if (!(rsv)) |
---|
12 | 12 | | then throw("Invalid RSA signature") |
---|
|
17 | 17 | | } |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
20 | | - | func cd () = [BinaryEntry("rsya", rp)] |
---|
21 | | - | |
---|
22 | | - | |
---|
23 | 20 | | @Callable(i) |
---|
24 | | - | func call (rs,gameId) = cd() |
---|
| 21 | + | func call (rs,gameId) = { |
---|
| 22 | + | let rsb = fromBase64String(rs) |
---|
| 23 | + | r(rsb, gameId) |
---|
| 24 | + | } |
---|
25 | 25 | | |
---|
26 | 26 | | |
---|
27 | 27 | | @Verifier(tx) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let RSAPUBLIC = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlemr95J1jZUs7cJmrmmlN4zo7YVsBJzIeJdk8LDFGhUKSI6yfs20ZyJe21+6GJwNnKUU1Uyoc17wSWMKkrZ0MMvYE+Z5AiijvBK4sSJ3IgGjdU8/NhI8CBDu0F+xRM9q3TB3LLbDy5sBdudYfHfsUOc+MTvAD69n27db2Rh8+yZQMtubkuTQNp89sphHQaLGyQFaNlK/Na3lFx6omqzaa1gjoplUr6rvYKgfAICUB3zVmJShiEi7w7R0hWlNRD3qcZjCUONSpFo4WbzknGOazw84B+IMIFnIpXWzQL8RX0vNcfsBvLDfM6k2ZacqwyMKaLLqigdBiGdJ7W+0lOStOQIDAQAB" |
---|
5 | 5 | | |
---|
6 | 6 | | let rp = fromBase64String(RSAPUBLIC) |
---|
7 | 7 | | |
---|
8 | 8 | | func r (rsbb,gameId) = { |
---|
9 | | - | let bgid = toBytes(gameId) |
---|
| 9 | + | let bgid = sha256(toBytes(gameId)) |
---|
10 | 10 | | let rsv = rsaVerify_16Kb(SHA256, bgid, rsbb, rp) |
---|
11 | 11 | | if (!(rsv)) |
---|
12 | 12 | | then throw("Invalid RSA signature") |
---|
13 | 13 | | else { |
---|
14 | 14 | | let rand = (toInt(sha256(rsbb)) % 6) |
---|
15 | 15 | | [StringEntry("rsv", toString(rsv)), IntegerEntry("rand", rand)] |
---|
16 | 16 | | } |
---|
17 | 17 | | } |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
20 | | - | func cd () = [BinaryEntry("rsya", rp)] |
---|
21 | | - | |
---|
22 | | - | |
---|
23 | 20 | | @Callable(i) |
---|
24 | | - | func call (rs,gameId) = cd() |
---|
| 21 | + | func call (rs,gameId) = { |
---|
| 22 | + | let rsb = fromBase64String(rs) |
---|
| 23 | + | r(rsb, gameId) |
---|
| 24 | + | } |
---|
25 | 25 | | |
---|
26 | 26 | | |
---|
27 | 27 | | @Verifier(tx) |
---|
28 | 28 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
29 | 29 | | |
---|