tx · 3V3by1xoZsgKpwxFzKaNmu6w2759VdxqmYDmoMW5LN8c 3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi: -0.01400000 Waves 2019.11.05 01:41 [750759] smart account 3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi > SELF 0.00000000 Waves
{ "type": 13, "id": "3V3by1xoZsgKpwxFzKaNmu6w2759VdxqmYDmoMW5LN8c", "fee": 1400000, "feeAssetId": null, "timestamp": 1572907432056, "version": 1, "sender": "3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi", "senderPublicKey": "BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH", "proofs": [ "3MVMp3KWvePLVV4bKZFthURHRiwyPgASuMDWeqKztpifDHxEvWM9oFSKjkco4YfY2kGjqKG4PdLfWAureckUKYsu" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAACQAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIJzk8c0RpUC/4FTtbn+K+nnFooxwPYgbvcStVfoh24hqAAAAAAxSYW5kb21pemVLZXkJAAJZAAAAAQIAAAAsQlpUNWZ6djhaZUhWbjh4QUdaVlhaSFV2b0FrZFJOQ2J0RXVCbjNwQ3VYRUgAAAAACmRlcGxveUluZm8CAAAAJGFkZGVkIGRhdGEgZnVuY3Rpb25hbGl0eSAodGVzdHBoYXNlKQEAAAALZW5jcnlwdERhdGEAAAACAAAAB21lc3NhZ2UAAAAEcEtleQQAAAAGb3V0cHV0AgAAACRyc2FWZXJpZnkoU2hhMjU2ICxtZXNzYWdlLHBLZXkscEtleSkFAAAABm91dHB1dAEAAAAJc2Vzc2lvbklkAAAAAAQAAAADZ2lkCQAEsQAAAAEJAAH3AAAAAQkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAUAAAADZ2lkAQAAAAlyYW5kb21pemUAAAACAAAAB3JzYVNpZ24AAAALdGhpc1Nlc3Npb24EAAAABmdhbWVJZAUAAAALdGhpc1Nlc3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ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAElJlaXNzdWVUcmFuc2FjdGlvbgYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAEElzc3VlVHJhbnNhY3Rpb24GCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAOb3duZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADm93bmVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgdCUW+D", "chainId": 84, "height": 750759, "spentComplexity": 0 } View: original | compacted Prev: DLaSBB12NKsc9TiRgJVXdW4VUoDrsoqYEqzwyoKiFjK8 Next: HfsuBxwEwcqAbd26XgsgHLCqhuxCy1547RLSCuUTtG8n Diff:
Old | New | Differences | |
---|---|---|---|
72 | 72 | then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract") | |
73 | 73 | else { | |
74 | 74 | let tokenAmount = (paid.amount * 3) | |
75 | - | | |
75 | + | WriteSet([DataEntry(gameId, messageData)]) | |
76 | 76 | } | |
77 | 77 | } | |
78 | 78 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ownerPublicKey = base58'BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH' | |
5 | 5 | ||
6 | 6 | let RandomizeKey = fromBase58String("BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH") | |
7 | 7 | ||
8 | 8 | let deployInfo = "added data functionality (testphase)" | |
9 | 9 | ||
10 | 10 | func encryptData (message,pKey) = { | |
11 | 11 | let output = "rsaVerify(Sha256 ,message,pKey,pKey)" | |
12 | 12 | output | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func sessionId () = { | |
17 | 17 | let gid = toInt(sha256(toBytes(lastBlock.height))) | |
18 | 18 | gid | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func randomize (rsaSign,thisSession) = { | |
23 | 23 | let gameId = thisSession | |
24 | 24 | let rsaSigValid = sigVerify(toBytes(gameId), toBytes(rsaSign), RandomizeKey) | |
25 | 25 | if (rsaSigValid) | |
26 | 26 | then { | |
27 | 27 | let rand = (toInt(sha256(toBytes(rsaSign))) % 6) | |
28 | 28 | if ((0 > rand)) | |
29 | 29 | then ((-1 * rand) + 1) | |
30 | 30 | else (rand + 1) | |
31 | 31 | } | |
32 | 32 | else throw("Invalid RSA signature") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func listParser (dataString,separator) = { | |
37 | 37 | let choppedlist = "x" | |
38 | 38 | choppedlist | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func listBuilder (receiver,amount,txid) = { | |
43 | 43 | let compiledList = "placeholder" | |
44 | 44 | compiledList | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func getData (dataKey) = { | |
49 | 49 | let dataPackage = getStringValue(this, dataKey) | |
50 | 50 | dataPackage | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(i) | |
55 | 55 | func initiate () = { | |
56 | 56 | let gameId = toBase58String(i.transactionId) | |
57 | 57 | let paid = extract(i.payment) | |
58 | 58 | let message = "default message for now" | |
59 | 59 | let callerAccount = toBase58String(extract(i.callerPublicKey)) | |
60 | 60 | let callerAddress = toBase58String(extract(i.caller.bytes)) | |
61 | 61 | let callerTxId = i.transactionId | |
62 | 62 | let asset = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m' | |
63 | 63 | let sizing = if ((paid.amount == 100000000)) | |
64 | 64 | then "S" | |
65 | 65 | else if ((paid.amount == 200000000)) | |
66 | 66 | then "M" | |
67 | 67 | else if ((paid.amount == 400000000)) | |
68 | 68 | then "L" | |
69 | 69 | else "error" | |
70 | 70 | let messageData = (((((((("SUBMITTED" + ";") + toBase58String(extract(i.callerPublicKey))) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + sizing) | |
71 | 71 | if ((sizing == "error")) | |
72 | 72 | then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract") | |
73 | 73 | else { | |
74 | 74 | let tokenAmount = (paid.amount * 3) | |
75 | - | | |
75 | + | WriteSet([DataEntry(gameId, messageData)]) | |
76 | 76 | } | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Verifier(tx) | |
81 | 81 | func verify () = match tx { | |
82 | 82 | case d: ReissueTransaction|IssueTransaction|SetScriptTransaction => | |
83 | 83 | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) | |
84 | 84 | case d: DataTransaction => | |
85 | 85 | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) | |
86 | 86 | case d: TransferTransaction => | |
87 | 87 | true | |
88 | 88 | case _ => | |
89 | 89 | false | |
90 | 90 | } | |
91 | 91 |
github/deemru/w8io/169f3d6 33.58 ms ◑