tx · EAYLknK3v4YoLVn2Dj356m9rSniqpJj6y3jhKcYGjQ1b 3MyShEi4SYFqE48URSFtvMdVL7VwDbNfnSH: -0.01000000 Waves 2019.02.19 16:02 [502105] smart account 3MyShEi4SYFqE48URSFtvMdVL7VwDbNfnSH > SELF 0.00000000 Waves
{ "type": 13, "id": "EAYLknK3v4YoLVn2Dj356m9rSniqpJj6y3jhKcYGjQ1b", "fee": 1000000, "feeAssetId": null, "timestamp": 1550581362425, "version": 1, "sender": "3MyShEi4SYFqE48URSFtvMdVL7VwDbNfnSH", "senderPublicKey": "7znLqP7qEtxc7Vfd2sdmeAsufVseomYVU7sv6sKytrb2", "proofs": [ "ehvZHCt413xsyj8W4hUe5fjwqbkfTLc9bz7MBLUMdHKSAwKemq42Vp1WZCRjDpVeGhRpG9QGdCsMhmQgygqYsFM" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABXR4RmVlAAAAAAAAB6EgBAAAAAd0aW1lb3V0AAAAAAAAAAWgBAAAAAhsaWZlc3BhbgAAAAAAAAAD6AQAAAADZXJyCQAAAgAAAAECAAAAAAQAAAAVc2VydmVyQ2hvaWNlSGFzaEJ5dGVzCQACWQAAAAECAAAALDdzdER4MzhLM3gxTGRidm50d3lxbzN6OFBEd2Q4d2kyWTI5d2dtOEtWNDdlBAAAAAZzZXJ2ZXIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNNcG8yZ1kzMmpNRlNDUm8xcWVIZk1udDhteE1aanRxR0ZnBAAAAAZwbGF5ZXIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNOOHFnS2dFSzNBUDE2U3FMNmlrZVpRTGd3SnRtbjhhNkxVBAAAABB0b3RhbFNlcnZlckZ1bmRzAAAAAAADk4cABAAAAA5zdGFydGluZ0hlaWdodAAAAAAAAAepWQQAAAAJZGljZUNvdW50AAAAAAAAAAACBAAAAANiZXQAAAAAAAHJw4ADCQAAZwAAAA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F5ZXJDaG9pY2UAAAAAAAAAAAQAAAAAAAAAAAEFAAAADHNlcnZlckNob2ljZQcGAwkAAGcAAAACBQAAAAFzAAAAAAAAAAAGCQAAAAAAAAIJAADJAAAAAgkAAMoAAAACBQAAAAxwbGF5ZXJDaG9pY2UAAAAAAAAAAAUAAAAAAAAAAAEFAAAADHNlcnZlckNob2ljZQcDCQAAAAAAAAIIBQAAAAZwYXlvdXQAAAAJcmVjaXBpZW50AwUAAAAKcGxheWVyV2lucwUAAAAGcGxheWVyBQAAAAZzZXJ2ZXIJAAAAAAAAAgkAAfUAAAABBQAAABRzZXJ2ZXJDaG9pY2VXaXRoU2FsdAUAAAAVc2VydmVyQ2hvaWNlSGFzaEJ5dGVzBwkAAAAAAAACCAUAAAAGcGF5b3V0AAAACXJlY2lwaWVudAUAAAAGcGxheWVyBwUAAAADZXJyBwUAAAADZXJyB23qd6g=", "chainId": 84, "height": 502105, "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("7stDx38K3x1Ldbvntwyqo3z8PDwd8wi2Y29wgm8KV47e") | |
9 | + | let server = addressFromString("3Mpo2gY32jMFSCRo1qeHfMnt8mxMZjtqGFg") | |
10 | + | let player = addressFromString("3N8qgKgEK3AP16SqL6ikeZQLgwJtmn8a6LU") | |
11 | + | let totalServerFunds = 60000000 | |
12 | + | let startingHeight = 502105 | |
13 | + | let diceCount = 2 | |
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 playerWins = if (if (if (if (if (if ((diceCount >= s)) | |
47 | + | then if ((s >= 1)) | |
48 | + | then (take(drop(playerChoice, 0), 1) == serverChoice) | |
49 | + | else false | |
50 | + | else false) | |
51 | + | then true | |
52 | + | else if ((s >= 2)) | |
53 | + | then (take(drop(playerChoice, 1), 1) == serverChoice) | |
54 | + | else false) | |
55 | + | then true | |
56 | + | else if ((s >= 3)) | |
57 | + | then (take(drop(playerChoice, 2), 1) == serverChoice) | |
58 | + | else false) | |
59 | + | then true | |
60 | + | else if ((s >= 4)) | |
61 | + | then (take(drop(playerChoice, 3), 1) == serverChoice) | |
62 | + | else false) | |
63 | + | then true | |
64 | + | else if ((s >= 5)) | |
65 | + | then (take(drop(playerChoice, 4), 1) == serverChoice) | |
66 | + | else false) | |
67 | + | then true | |
68 | + | else if ((s >= 6)) | |
69 | + | then (take(drop(playerChoice, 5), 1) == serverChoice) | |
70 | + | else false | |
71 | + | if ((payout.recipient == (if (playerWins) | |
72 | + | then player | |
73 | + | else server))) | |
74 | + | then (keccak256(serverChoiceWithSalt) == serverChoiceHashBytes) | |
75 | + | else false | |
76 | + | } | |
77 | + | else (payout.recipient == player) | |
78 | + | else false | |
79 | + | case _ => | |
80 | + | err | |
81 | + | } | |
82 | + | } | |
83 | + | else false | |
84 | + | case _ => | |
85 | + | err | |
86 | + | } | |
87 | + | else false |
github/deemru/w8io/169f3d6 16.07 ms ◑