tx · 72FAy3i2Gmp7L12rbGeBoUQHdyXmvpmXPTdikneVh5pr 3NAGTY2TW4wcXEUBr3b42FgvqogWg9u854E: -0.01000000 Waves 2019.02.19 21:49 [502438] smart account 3NAGTY2TW4wcXEUBr3b42FgvqogWg9u854E > SELF 0.00000000 Waves
{ "type": 13, "id": "72FAy3i2Gmp7L12rbGeBoUQHdyXmvpmXPTdikneVh5pr", "fee": 1000000, "feeAssetId": null, "timestamp": 1550602202889, "version": 1, "sender": "3NAGTY2TW4wcXEUBr3b42FgvqogWg9u854E", "senderPublicKey": "4Gy1Q6Zimjw5R7149qspKzkbBd5vRJn94fSR5ZvigF2w", "proofs": [ "4Pj848dxYmvJPcsUB12HQpULLhyzZHTaJqskncqYf1iM9yacXne625iMR44KrBHJ3dtGtcYbHU9jVPpxD87L8FN2" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABXR4RmVlAAAAAAAAB6EgBAAAAAd0aW1lb3V0AAAAAAAAAAWgBAAAAAhsaWZlc3BhbgAAAAAAAAAD6AQAAAADZXJyCQAAAgAAAAECAAAAAAQAAAAVc2VydmVyQ2hvaWNlSGFzaEJ5dGVzCQACWQAAAAECAAAALDh4Nnhzb05rbXZ2YkdvWG1KUVBLRXZnSjFGd05NVEZRbldNZDg0dnpMcDhaBAAAAAZzZXJ2ZXIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNOOFg4d012UUNVdktSa0JEbU0zaG9ha1hYZkdXU21DcXo0BAAAAAZwbGF5ZXIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNOOGM4NEMyTVM1eGJFWHNoWUNWRU5EdURqN25jWnNFVzJGBAAAABB0b3RhbFNlcnZlckZ1bmRzAAAAAAABycOABAAAAA5zdGFydGluZ0hlaWdodAAAAAAAAAeqpgQAAAAJZGljZUNvdW50AAAAAAAAAAABBAAAAANiZXQAAAAAAAHJw4ADCQAAZwAAAAIFAAAABmhlaW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AIFAAAADHBsYXllckNob2ljZQAAAAAAAAAAAQAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwYDCQAAZwAAAAIFAAAAAXMAAAAAAAAAAAMJAAAAAAAAAgkAAMkAAAACCQAAygAAAAIFAAAADHBsYXllckNob2ljZQAAAAAAAAAAAgAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwYDCQAAZwAAAAIFAAAAAXMAAAAAAAAAAAQJAAAAAAAAAgkAAMkAAAACCQAAygAAAAIFAAAADHBsYXllckNob2ljZQAAAAAAAAAAAwAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwYDCQAAZwAAAAIFAAAAAXMAAAAAAAAAAAUJAAAAAAAAAgkAAMkAAAACCQAAygAAAAIFAAAADHBsYXllckNob2ljZQAAAAAAAAAABAAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwYDCQAAZwAAAAIFAAAAAXMAAAAAAAAAAAYJAAAAAAAAAgkAAMkAAAACCQAAygAAAAIFAAAADHBsYXllckNob2ljZQAAAAAAAAAABQAAAAAAAAAAAQUAAAAMc2VydmVyQ2hvaWNlBwMJAAAAAAAAAggFAAAABnBheW91dAAAAAlyZWNpcGllbnQDBQAAAApwbGF5ZXJXaW5zBQAAAAZwbGF5ZXIFAAAABnNlcnZlcgkAAAAAAAACCQAB9QAAAAEFAAAAFHNlcnZlckNob2ljZVdpdGhTYWx0BQAAABVzZXJ2ZXJDaG9pY2VIYXNoQnl0ZXMHCQAAAAAAAAIIBQAAAAZwYXlvdXQAAAAJcmVjaXBpZW50BQAAAAZwbGF5ZXIHBQAAAANlcnIHBQAAAANlcnIHyulUrQ==", "chainId": 84, "height": 502438, "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("8x6xsoNkmvvbGoXmJQPKEvgJ1FwNMTFQnWMd84vzLp8Z") | |
9 | + | let server = addressFromString("3N8X8wMvQCUvKRkBDmM3hoakXXfGWSmCqz4") | |
10 | + | let player = addressFromString("3N8c84C2MS5xbEXshYCVENDuDj7ncZsEW2F") | |
11 | + | let totalServerFunds = 30000000 | |
12 | + | let startingHeight = 502438 | |
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 + bet)) | |
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 (!(serverChoiceValid)) | |
58 | + | then true | |
59 | + | else if (if (if (if (if (if ((s == diceCount)) | |
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 23.72 ms ◑