tx · CAK7VB7HetjWs7CmcJLgQFeFAkJhoHpG7o9DreBJSHdb 3Mvw7h4w6UjKtDLNar45DTuBWkSg6PjGjto: -0.01000000 Waves 2019.02.20 12:50 [503321] smart account 3Mvw7h4w6UjKtDLNar45DTuBWkSg6PjGjto > SELF 0.00000000 Waves
{ "type": 13, "id": "CAK7VB7HetjWs7CmcJLgQFeFAkJhoHpG7o9DreBJSHdb", "fee": 1000000, "feeAssetId": null, "timestamp": 1550656265780, "version": 1, "sender": "3Mvw7h4w6UjKtDLNar45DTuBWkSg6PjGjto", "senderPublicKey": "ESvzytr7bPMfFz2RUSBdfydx3mAGx5pQqXzYniaYi7H6", "proofs": [ "31k3CTFJeGw6xBdJgjEkEKyTH5PDKSPHpgJYRpp1cXVDAxQE5LTshAKrG7Yh4JjNxvaK3x79VoBC6C1fYfsCLvfE" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABXR4RmVlAAAAAAAAB6EgBAAAAAd0aW1lb3V0AAAAAAAAAAWgBAAAABBzZXJ2ZXJUaW1lb3V0R2FwAAAAAAAAAAAeBAAAAAhsaWZlc3BhbgAAAAAAAAAD6AQAAAADZXJyCQAAAgAAAAECAAAAAAQAAAAVc2VydmVyQ2hvaWNlSGFzaEJ5dGVzCQACWQAAAAECAAAALEFGV3NqcGRXY0NkaHQya0REdUpQV2dLQnRvOWVWQ3N2bnIxNmVKRFlxd3RzBAAAAA9zZXJ2ZXJQdWJsaWNLZXkJAAJZAAAAAQIAAAAsOE40WWtWUkNld1E1Y1VCalNoaTNNd0JNR3p0UllpV1M0eEVhWHA1eDI5aEwEAAAABnNlcnZlcgkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM01xdFpwcmdLU2VROHdXVHdiNFJOSlZWcXI1OGFHeHFyUVMEAAAABnBsYXllcgkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM01wTUpxVmtoRXBjYlBrcVVWdHVZQU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xzZXJ2ZXJDaG9pY2UHAwMDCQAB9AAAAAMIBQAAAAZwYXlvdXQAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAZwYXlvdXQAAAAGcHJvb2ZzAAAAAAAAAAABBQAAAA9zZXJ2ZXJQdWJsaWNLZXkJAAAAAAAAAggFAAAABnBheW91dAAAAAlyZWNpcGllbnQDBQAAAApwbGF5ZXJXaW5zBQAAAAZwbGF5ZXIFAAAABnNlcnZlcgcJAAAAAAAAAgkAAfUAAAABBQAAABRzZXJ2ZXJDaG9pY2VXaXRoU2FsdAUAAAAVc2VydmVyQ2hvaWNlSGFzaEJ5dGVzBwkAAAAAAAACCQAAyAAAAAEFAAAAFHNlcnZlckNob2ljZVdpdGhTYWx0AAAAAAAAAAAmBwcFAAAAA2VycgcFAAAAA2Vycgd9kRrb", "chainId": 84, "height": 503321, "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 serverTimeoutGap = 30 | |
7 | + | let lifespan = 1000 | |
8 | + | let err = throw("") | |
9 | + | let serverChoiceHashBytes = fromBase58String("AFWsjpdWcCdht2kDDuJPWgKBto9eVCsvnr16eJDYqwts") | |
10 | + | let serverPublicKey = fromBase58String("8N4YkVRCewQ5cUBjShi3MwBMGztRYiWS4xEaXp5x29hL") | |
11 | + | let server = addressFromString("3MqtZprgKSeQ8wWTwb4RNJVVqr58aGxqrQS") | |
12 | + | let player = addressFromString("3MpMJqVkhEpcbPkqUVtuYAE8VeT8Y6i3hqn") | |
13 | + | let totalServerFunds = 30000000 | |
14 | + | let startingHeight = 503321 | |
15 | + | let diceCount = 1 | |
16 | + | let bet = 30000000 | |
17 | + | if ((height >= startingHeight)) | |
18 | + | then match tx { | |
19 | + | case payout: TransferTransaction => | |
20 | + | if (if (if (if ((payout.amount == (wavesBalance(me) - txFee))) | |
21 | + | then !(isDefined(payout.assetId)) | |
22 | + | else false) | |
23 | + | then !(isDefined(payout.feeAssetId)) | |
24 | + | else false) | |
25 | + | then (payout.fee == txFee) | |
26 | + | else false) | |
27 | + | then if (((height - startingHeight) > lifespan)) | |
28 | + | then (payout.recipient == server) | |
29 | + | else { | |
30 | + | let paymentId = payout.proofs[0] | |
31 | + | match transactionById(paymentId) { | |
32 | + | case payment: TransferTransaction => | |
33 | + | let paymentHeight = extract(transactionHeightById(paymentId)) | |
34 | + | if (if (if (if ((payment.amount == bet)) | |
35 | + | then (payment.recipient == me) | |
36 | + | else false) | |
37 | + | then (payment.sender == player) | |
38 | + | else false) | |
39 | + | then !(isDefined(payment.assetId)) | |
40 | + | else false) | |
41 | + | then if ((paymentHeight > ((startingHeight + timeout) - serverTimeoutGap))) | |
42 | + | then (payout.recipient == server) | |
43 | + | else if (if ((wavesBalance(me) >= (totalServerFunds + bet))) | |
44 | + | then true | |
45 | + | else (height > (startingHeight + timeout))) | |
46 | + | then (payout.recipient == player) | |
47 | + | else { | |
48 | + | let serverChoiceWithSalt = payout.attachment | |
49 | + | let playerChoice = payment.attachment | |
50 | + | let s = size(playerChoice) | |
51 | + | let serverChoice = take(serverChoiceWithSalt, 1) | |
52 | + | let serverChoiceValid = if (if (if (if (if ((serverChoice == toBytes("1"))) | |
53 | + | then true | |
54 | + | else (serverChoice == toBytes("2"))) | |
55 | + | then true | |
56 | + | else (serverChoice == toBytes("3"))) | |
57 | + | then true | |
58 | + | else (serverChoice == toBytes("4"))) | |
59 | + | then true | |
60 | + | else (serverChoice == toBytes("5"))) | |
61 | + | then true | |
62 | + | else (serverChoice == toBytes("6")) | |
63 | + | let playerWins = if (!(serverChoiceValid)) | |
64 | + | then true | |
65 | + | else if (if (if (if (if (if ((s == diceCount)) | |
66 | + | then if ((s >= 1)) | |
67 | + | then (take(drop(playerChoice, 0), 1) == serverChoice) | |
68 | + | else false | |
69 | + | else false) | |
70 | + | then true | |
71 | + | else if ((s >= 2)) | |
72 | + | then (take(drop(playerChoice, 1), 1) == serverChoice) | |
73 | + | else false) | |
74 | + | then true | |
75 | + | else if ((s >= 3)) | |
76 | + | then (take(drop(playerChoice, 2), 1) == serverChoice) | |
77 | + | else false) | |
78 | + | then true | |
79 | + | else if ((s >= 4)) | |
80 | + | then (take(drop(playerChoice, 3), 1) == serverChoice) | |
81 | + | else false) | |
82 | + | then true | |
83 | + | else if ((s >= 5)) | |
84 | + | then (take(drop(playerChoice, 4), 1) == serverChoice) | |
85 | + | else false) | |
86 | + | then true | |
87 | + | else if ((s >= 6)) | |
88 | + | then (take(drop(playerChoice, 5), 1) == serverChoice) | |
89 | + | else false | |
90 | + | if (if (if (sigVerify(payout.bodyBytes, payout.proofs[1], serverPublicKey)) | |
91 | + | then (payout.recipient == (if (playerWins) | |
92 | + | then player | |
93 | + | else server)) | |
94 | + | else false) | |
95 | + | then (keccak256(serverChoiceWithSalt) == serverChoiceHashBytes) | |
96 | + | else false) | |
97 | + | then (size(serverChoiceWithSalt) == 38) | |
98 | + | else false | |
99 | + | } | |
100 | + | else false | |
101 | + | case _ => | |
102 | + | err | |
103 | + | } | |
104 | + | } | |
105 | + | else false | |
106 | + | case _ => | |
107 | + | err | |
108 | + | } | |
109 | + | else false |
github/deemru/w8io/169f3d6 34.88 ms ◑