tx · Cx2RyauDeyKtNWe12j7NYhkbbKqh9SbCsthNBYhAsWwK 3MsRwmD7y81CVbsgJf5Jzub7o3gKFH4Yb4y: -0.01000000 Waves 2019.02.19 17:59 [502203] smart account 3MsRwmD7y81CVbsgJf5Jzub7o3gKFH4Yb4y > SELF 0.00000000 Waves
{ "type": 13, "id": "Cx2RyauDeyKtNWe12j7NYhkbbKqh9SbCsthNBYhAsWwK", "fee": 1000000, "feeAssetId": null, "timestamp": 1550588362505, "version": 1, "sender": "3MsRwmD7y81CVbsgJf5Jzub7o3gKFH4Yb4y", "senderPublicKey": "Gi9uvpN1EzVp4Xj8UiCVX4KuzhEkAb8ANSQccYvvNWVB", "proofs": [ "2ArhZNPfgf8cdzb5UbY41Mp7ZjRChGGFceJYs9ECxonT4bbK6MCBzq4kGS9cBeWZyGrLGLxJsHXvQwk11Csunuib" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABXR4RmVlAAAAAAAAB6EgBAAAAAd0aW1lb3V0AAAAAAAAAAWgBAAAAAhsaWZlc3BhbgAAAAAAAAAD6AQAAAADZXJyCQAAAgAAAAECAAAAAAQAAAAVc2VydmVyQ2hvaWNlSGFzaEJ5dGVzCQACWQAAAAECAAAALDlpZXpOQ2IzRmhjcnVHaFdkZnJ2cUdzTlQ0NjJtVmRncVI5NGZZVlI3NnZQBAAAAAZzZXJ2ZXIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNONzJicDlicTFCYjllRFRvMWJOQU1YQkhEZnNqa1lSZ3pQBAAAAAZwbGF5ZXIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNNdXZDa2RTbjZRVTJiVVJWVTY5NGhialJYN01GRlBYNVc0BAAAABB0b3RhbFNlcnZlckZ1bmRzAAAAAAADk4cABAAAAA5zdGFydGluZ0hlaWdodAAAAAAAAAepugQAAAAJZGljZUNvdW50AAAAAAAAAAABBAAAAANiZXQAAAAAAAHJw4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AAAMcGxheWVyQ2hvaWNlAAAAAAAAAAABAAAAAAAAAAABBQAAAAxzZXJ2ZXJDaG9pY2UHBgMJAABnAAAAAgUAAAABcwAAAAAAAAAAAwkAAAAAAAACCQAAyQAAAAIJAADKAAAAAgUAAAAMcGxheWVyQ2hvaWNlAAAAAAAAAAACAAAAAAAAAAABBQAAAAxzZXJ2ZXJDaG9pY2UHBgMJAABnAAAAAgUAAAABcwAAAAAAAAAABAkAAAAAAAACCQAAyQAAAAIJAADKAAAAAgUAAAAMcGxheWVyQ2hvaWNlAAAAAAAAAAADAAAAAAAAAAABBQAAAAxzZXJ2ZXJDaG9pY2UHBgMJAABnAAAAAgUAAAABcwAAAAAAAAAABQkAAAAAAAACCQAAyQAAAAIJAADKAAAAAgUAAAAMcGxheWVyQ2hvaWNlAAAAAAAAAAAEAAAAAAAAAAABBQAAAAxzZXJ2ZXJDaG9pY2UHBgMJAABnAAAAAgUAAAABcwAAAAAAAAAABgkAAAAAAAACCQAAyQAAAAIJAADKAAAAAgUAAAAMcGxheWVyQ2hvaWNlAAAAAAAAAAAFAAAAAAAAAAABBQAAAAxzZXJ2ZXJDaG9pY2UHAwkAAAAAAAACCAUAAAAGcGF5b3V0AAAACXJlY2lwaWVudAMFAAAACnBsYXllcldpbnMFAAAABnBsYXllcgUAAAAGc2VydmVyCQAAAAAAAAIJAAH1AAAAAQUAAAAUc2VydmVyQ2hvaWNlV2l0aFNhbHQFAAAAFXNlcnZlckNob2ljZUhhc2hCeXRlcwcJAAAAAAAAAggFAAAABnBheW91dAAAAAlyZWNpcGllbnQFAAAABnBsYXllcgcFAAAAA2VycgcFAAAAA2VycgdTWMvV", "chainId": 84, "height": 502203, "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("9iezNCb3FhcruGhWdfrvqGsNT462mVdgqR94fYVR76vP") | |
9 | + | let server = addressFromString("3N72bp9bq1Bb9eDTo1bNAMXBHDfsjkYRgzP") | |
10 | + | let player = addressFromString("3MuvCkdSn6QU2bURVU694hbjRX7MFFPX5W4") | |
11 | + | let totalServerFunds = 60000000 | |
12 | + | let startingHeight = 502202 | |
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 (!(serverChoiceValid)) | |
58 | + | then true | |
59 | + | else if (if (if (if (if (if ((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.03 ms ◑