tx · 69dtrikdaWmYbFZakk7WSgctktoczStLcPbugcDq7ueq 3N5rArS48EzGxpGyAj1iX3VAF13pLmVYf7S: -0.01000000 Waves 2019.02.19 17:54 [502199] smart account 3N5rArS48EzGxpGyAj1iX3VAF13pLmVYf7S > SELF 0.00000000 Waves
{ "type": 13, "id": "69dtrikdaWmYbFZakk7WSgctktoczStLcPbugcDq7ueq", "fee": 1000000, "feeAssetId": null, "timestamp": 1550588136202, "version": 1, "sender": "3N5rArS48EzGxpGyAj1iX3VAF13pLmVYf7S", "senderPublicKey": "A5gzL3rMJyG5GwAoQoW4mUBJTButZwJLgJjUtn8YqbY6", "proofs": [ "4rQB3rRfEZYXk8UVU5Qdoaimgnx5J8N7AiDzDGSHrrosRvwxGyjCPNNj8v4an9x992n13sDUhWLfBXhdkkmjfzMs" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABXR4RmVlAAAAAAAAB6EgBAAAAAd0aW1lb3V0AAAAAAAAAAWgBAAAAAhsaWZlc3BhbgAAAAAAAAAD6AQAAAADZXJyCQAAAgAAAAECAAAAAAQAAAAVc2VydmVyQ2hvaWNlSGFzaEJ5dGVzCQACWQAAAAECAAAALEZiQjN1dnd6b1VkYWFYZndXNEw5eTZGbkJIVlRGZERaNWIzYTlOdG03SzVUBAAAAAZzZXJ2ZXIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNNd2tMdUFydWlSYW5NSEFMelNkVWZodWRSdnc5Q3MzTDJDBAAAAAZwbGF5ZXIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNNdTd5NlplUDJFNHV5Y2JLNzJ0d2E3YzJzd2hKV1NHQzVVBAAAABB0b3RhbFNlcnZlckZ1bmRzAAAAAAADk4cABAAAAA5zdGFydGluZ0hlaWdodAAAAAAAAAeptwQAAAAJZGljZUNvdW50AAAAAAAAAAABBAAAAANiZXQAAAAAAAHJw4ADCQAAZwAAAAIFAAAABmhla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AAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwYDCQAAZwAAAAIFAAAAAXMAAAAAAAAAAAMJAAAAAAAAAgkAAMkAAAACCQAAygAAAAIFAAAADHBsYXllckNob2ljZQAAAAAAAAAAAgAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwYDCQAAZwAAAAIFAAAAAXMAAAAAAAAAAAQJAAAAAAAAAgkAAMkAAAACCQAAygAAAAIFAAAADHBsYXllckNob2ljZQAAAAAAAAAAAwAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwYDCQAAZwAAAAIFAAAAAXMAAAAAAAAAAAUJAAAAAAAAAgkAAMkAAAACCQAAygAAAAIFAAAADHBsYXllckNob2ljZQAAAAAAAAAABAAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwYDCQAAZwAAAAIFAAAAAXMAAAAAAAAAAAYJAAAAAAAAAgkAAMkAAAACCQAAygAAAAIFAAAADHBsYXllckNob2ljZQAAAAAAAAAABQAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwMJAAAAAAAAAggFAAAABnBheW91dAAAAAlyZWNpcGllbnQDBQAAAApwbGF5ZXJXaW5zBQAAAAZwbGF5ZXIFAAAABnNlcnZlcgkAAAAAAAACCQAB9QAAAAEFAAAAFHNlcnZlckNob2ljZVdpdGhTYWx0BQAAABVzZXJ2ZXJDaG9pY2VIYXNoQnl0ZXMHCQAAAAAAAAIIBQAAAAZwYXlvdXQAAAAJcmVjaXBpZW50BQAAAAZwbGF5ZXIHBQAAAANlcnIHBQAAAANlcnIHZyCkzQ==", "chainId": 84, "height": 502199, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 1 #-} | |
2 | + | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let me = tx.sender | |
4 | + | let txFee = 500000 | |
5 | + | let timeout = 1440 | |
6 | + | let lifespan = 1000 | |
7 | + | let err = throw("") | |
8 | + | let serverChoiceHashBytes = fromBase58String("FbB3uvwzoUdaaXfwW4L9y6FnBHVTFdDZ5b3a9Ntm7K5T") | |
9 | + | let server = addressFromString("3MwkLuAruiRanMHALzSdUfhudRvw9Cs3L2C") | |
10 | + | let player = addressFromString("3Mu7y6ZeP2E4uycbK72twa7c2swhJWSGC5U") | |
11 | + | let totalServerFunds = 60000000 | |
12 | + | let startingHeight = 502199 | |
13 | + | let diceCount = 1 | |
14 | + | let bet = 30000000 | |
15 | + | if ((height >= startingHeight)) | |
16 | + | then match tx { | |
17 | + | case payout: TransferTransaction => | |
18 | + | if (if (if (if ((payout.amount == (wavesBalance(me) - txFee))) | |
19 | + | then !(isDefined(payout.assetId)) | |
20 | + | else false) | |
21 | + | then !(isDefined(payout.feeAssetId)) | |
22 | + | else false) | |
23 | + | then (payout.fee == txFee) | |
24 | + | else false) | |
25 | + | then if (((height - startingHeight) > lifespan)) | |
26 | + | then (payout.recipient == server) | |
27 | + | else { | |
28 | + | let paymentId = payout.proofs[0] | |
29 | + | match transactionById(paymentId) { | |
30 | + | case payment: TransferTransaction => | |
31 | + | if (if (if (if ((payment.amount == bet)) | |
32 | + | then (payment.recipient == me) | |
33 | + | else false) | |
34 | + | then (payment.sender == player) | |
35 | + | else false) | |
36 | + | then !(isDefined(payment.assetId)) | |
37 | + | else false) | |
38 | + | then if (if ((timeout >= (height - startingHeight))) | |
39 | + | then (wavesBalance(me) >= totalServerFunds) | |
40 | + | else false) | |
41 | + | then { | |
42 | + | let serverChoiceWithSalt = payout.attachment | |
43 | + | let playerChoice = payment.attachment | |
44 | + | let s = size(playerChoice) | |
45 | + | let serverChoice = take(serverChoiceWithSalt, 1) | |
46 | + | let serverChoiceValid = if (if (if (if (if ((serverChoice == toBytes("1"))) | |
47 | + | then true | |
48 | + | else (serverChoice == toBytes("2"))) | |
49 | + | then true | |
50 | + | else (serverChoice == toBytes("3"))) | |
51 | + | then true | |
52 | + | else (serverChoice == toBytes("4"))) | |
53 | + | then true | |
54 | + | else (serverChoice == toBytes("5"))) | |
55 | + | then true | |
56 | + | else (serverChoice == toBytes("6")) | |
57 | + | let playerWins = if (if (if (if (if (if (if (serverChoiceValid) | |
58 | + | then true | |
59 | + | else (diceCount >= s)) | |
60 | + | then if ((s >= 1)) | |
61 | + | then (take(drop(playerChoice, 0), 1) == serverChoice) | |
62 | + | else false | |
63 | + | else false) | |
64 | + | then true | |
65 | + | else if ((s >= 2)) | |
66 | + | then (take(drop(playerChoice, 1), 1) == serverChoice) | |
67 | + | else false) | |
68 | + | then true | |
69 | + | else if ((s >= 3)) | |
70 | + | then (take(drop(playerChoice, 2), 1) == serverChoice) | |
71 | + | else false) | |
72 | + | then true | |
73 | + | else if ((s >= 4)) | |
74 | + | then (take(drop(playerChoice, 3), 1) == serverChoice) | |
75 | + | else false) | |
76 | + | then true | |
77 | + | else if ((s >= 5)) | |
78 | + | then (take(drop(playerChoice, 4), 1) == serverChoice) | |
79 | + | else false) | |
80 | + | then true | |
81 | + | else if ((s >= 6)) | |
82 | + | then (take(drop(playerChoice, 5), 1) == serverChoice) | |
83 | + | else false | |
84 | + | if ((payout.recipient == (if (playerWins) | |
85 | + | then player | |
86 | + | else server))) | |
87 | + | then (keccak256(serverChoiceWithSalt) == serverChoiceHashBytes) | |
88 | + | else false | |
89 | + | } | |
90 | + | else (payout.recipient == player) | |
91 | + | else false | |
92 | + | case _ => | |
93 | + | err | |
94 | + | } | |
95 | + | } | |
96 | + | else false | |
97 | + | case _ => | |
98 | + | err | |
99 | + | } | |
100 | + | else false |
github/deemru/w8io/026f985 20.01 ms ◑