tx · HNq9CTN16rBJc8gpz69Qc1wJFhAdWNjuvpZF5BXJVX92 3NAanbcN7JiXAB4nyAk6gkNhZjYahLpvzLZ: -0.01000000 Waves 2019.01.16 18:23 [452743] smart account 3NAanbcN7JiXAB4nyAk6gkNhZjYahLpvzLZ > SELF 0.00000000 Waves
{ "type": 13, "id": "HNq9CTN16rBJc8gpz69Qc1wJFhAdWNjuvpZF5BXJVX92", "fee": 1000000, "feeAssetId": null, "timestamp": 1547652239068, "version": 1, "sender": "3NAanbcN7JiXAB4nyAk6gkNhZjYahLpvzLZ", "senderPublicKey": "AYk3aUgXzy24o9AqGRHNbRE7W1egmzArxSqK3zV4rUEW", "proofs": [ "2SGaXeui6BesmBGqVZBgLa2ozgKaZiDHvCFhK4DqBdTvqMXzPNyNsE5RBE7Djft8rSujgFuW9UYGXpLdNveg1YDZ" ], "script": "base64:AQQAAAAQc2VydmVyc1B1YmxpY0tleQEAAAAgHipkt9S/3AqIOKX1DANBMFpryhD+GIFz8RTy9kyu4UcEAAAAFmVuY3R5cHRlZFNlcnZlcnNDaG9pY2UBAAAAINSAYTFJb4JgHDORsO3Ai/KbeoRDBi1SNSK8rkq1kwIEBAAAAAhkb25hdGlvbgAAAAAAATEtAAQAAAAMcGxheWVyc1ByaXplAAAAAAABMS0ABAAAAApib3hlc0NvdW50AAAAAAAAAAAFBAAAABRkYXRhUGxheWVyc1B1YmxpY0tleQEAAAAg0vq/zXjvXOHEggBQ1JvIhDFRWFgYk8nc8rSHWcpwpxcEAAAADGRhdGFMb2NrZWRBdAAAAAAAAAbohgQAAAAWbWF5YmVEYXRhUGxheWVyc0Nob2ljZQkABBoAAAACCAUAAAACdHgAAAAGc2VuZGVyAgAAAA1wbGF5ZXJzQ2hvaWNlBAAAABFkYXRhUGxheWVyc0Nob2ljZQkBAAAAB2V4dHJhY3QAAAABBQAAABZtYXliZURhdGFQbGF5ZXJzQ2hvaWNlBAAAABZtYXliZURhdGFTZXJ2ZXJzQ2hvaWNlCQAEGg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WRlZE5vdFRvU2VuZERvbmF0aW9uU3RhdGUEAAAAEXJlY2lwaWVudElzU2VydmVyCQAAAAAAAAIIBQAAAAN0dHgAAAAJcmVjaXBpZW50BQAAAA5zZXJ2ZXJzQWRkcmVzcwMDBQAAAA90cmFuc2ZlckZlZUlzT2sFAAAAEXJlY2lwaWVudElzU2VydmVyBwkAAAAAAAACCAUAAAADdHR4AAAABmFtb3VudAUAAAAMcGxheWVyc1ByaXplBwcHk2ZJSA==", "chainId": 84, "height": 452743, "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 serversPublicKey = base58'32kizC3bBgzqzBEXSp9A4tiJUWgcYLR8wGPMC6aA3MdG' | |
4 | + | let enctyptedServersChoice = base58'FJWyMHHPjRf8YkaimsHSgbYYDfYvZGnX8Hj3oqNJN9Bh' | |
5 | + | let donation = 20000000 | |
6 | + | let playersPrize = 20000000 | |
7 | + | let boxesCount = 5 | |
8 | + | let dataPlayersPublicKey = base58'FCaP4jLhLawzEqbwAQGAVvPQBv2h3LdERCx7fckDvnzr' | |
9 | + | let dataLockedAt = 452742 | |
10 | + | let maybeDataPlayersChoice = getInteger(tx.sender, "playersChoice") | |
11 | + | let dataPlayersChoice = extract(maybeDataPlayersChoice) | |
12 | + | let maybeDataServersChoice = getInteger(tx.sender, "serversChoice") | |
13 | + | let dataServersChoice = extract(maybeDataServersChoice) | |
14 | + | let timeoutInBlocks = 120 | |
15 | + | let dataTransactionFee = 500000 | |
16 | + | let transferTransactionFee = 500000 | |
17 | + | let serversAddress = addressFromPublicKey(serversPublicKey) | |
18 | + | let playersAddress = addressFromPublicKey(dataPlayersPublicKey) | |
19 | + | let accountBalance = wavesBalance(tx.sender) | |
20 | + | let senderIsServer = sigVerify(tx.bodyBytes, tx.proofs[0], serversPublicKey) | |
21 | + | let senderIsPlayer = sigVerify(tx.bodyBytes, tx.proofs[0], dataPlayersPublicKey) | |
22 | + | let isInitialState = (accountBalance >= ((playersPrize + (dataTransactionFee * 3)) + transferTransactionFee)) | |
23 | + | let dataIsValidForLockedState = !(isDefined(maybeDataPlayersChoice)) | |
24 | + | let lockedStateTimeout = (height > (dataLockedAt + timeoutInBlocks)) | |
25 | + | let isLockedState = if (dataIsValidForLockedState) | |
26 | + | then !(lockedStateTimeout) | |
27 | + | else false | |
28 | + | let isUserDecidedNotToPlayState = if (dataIsValidForLockedState) | |
29 | + | then lockedStateTimeout | |
30 | + | else false | |
31 | + | let dataIsValidForPlayerRevealedState = if (isDefined(maybeDataPlayersChoice)) | |
32 | + | then !(isDefined(maybeDataServersChoice)) | |
33 | + | else false | |
34 | + | let playerRevealedStateTimeout = if ((height > (dataLockedAt + (timeoutInBlocks * 2)))) | |
35 | + | then (accountBalance >= (((playersPrize + donation) + dataTransactionFee) + transferTransactionFee)) | |
36 | + | else false | |
37 | + | let isPlayerRevealedHisChoiceState = if (dataIsValidForPlayerRevealedState) | |
38 | + | then !(playerRevealedStateTimeout) | |
39 | + | else false | |
40 | + | let isServerDecidedNotToPlayState = if (dataIsValidForPlayerRevealedState) | |
41 | + | then playerRevealedStateTimeout | |
42 | + | else false | |
43 | + | let isDataValidForWinnerIsDeterminedState = isDefined(maybeDataServersChoice) | |
44 | + | let isBalanceValidForWinnerIsDeterminedState = (accountBalance >= ((playersPrize + donation) + transferTransactionFee)) | |
45 | + | let isWinnerIsDeterminedState = if (isDataValidForWinnerIsDeterminedState) | |
46 | + | then isBalanceValidForWinnerIsDeterminedState | |
47 | + | else false | |
48 | + | let isPlayerDecidedNotToSendDonationState = if (isDataValidForWinnerIsDeterminedState) | |
49 | + | then !(isBalanceValidForWinnerIsDeterminedState) | |
50 | + | else false | |
51 | + | match tx { | |
52 | + | case dtx: DataTransaction => | |
53 | + | let payloadSize = size(dtx.data) | |
54 | + | let firstPayloadName = dtx.data[0].key | |
55 | + | let secondPayloadName = dtx.data[1].key | |
56 | + | let firstPayloadAsInteger = extract(getInteger(dtx.data, firstPayloadName)) | |
57 | + | let secondPayloadAsString = extract(getString(dtx.data, secondPayloadName)) | |
58 | + | let dataFeeIsOk = (dtx.fee == dataTransactionFee) | |
59 | + | if (if (isInitialState) | |
60 | + | then true | |
61 | + | else isUserDecidedNotToPlayState) | |
62 | + | then { | |
63 | + | let validLockedAtIsProvided = if ((firstPayloadName == "lockedAt")) | |
64 | + | then if ((height >= firstPayloadAsInteger)) | |
65 | + | then (5 >= (height - firstPayloadAsInteger)) | |
66 | + | else false | |
67 | + | else false | |
68 | + | let playersPublicKeyIsProvided = (secondPayloadName == "playersPublicKey") | |
69 | + | if (if (if (if (senderIsServer) | |
70 | + | then dataFeeIsOk | |
71 | + | else false) | |
72 | + | then validLockedAtIsProvided | |
73 | + | else false) | |
74 | + | then playersPublicKeyIsProvided | |
75 | + | else false) | |
76 | + | then (payloadSize == 2) | |
77 | + | else false | |
78 | + | } | |
79 | + | else if (isLockedState) | |
80 | + | then { | |
81 | + | let validPlayersChoiceIsProvided = if ((firstPayloadName == "playersChoice")) | |
82 | + | then if ((firstPayloadAsInteger >= 0)) | |
83 | + | then (boxesCount > firstPayloadAsInteger) | |
84 | + | else false | |
85 | + | else false | |
86 | + | if (if (if (senderIsPlayer) | |
87 | + | then dataFeeIsOk | |
88 | + | else false) | |
89 | + | then validPlayersChoiceIsProvided | |
90 | + | else false) | |
91 | + | then (payloadSize == 1) | |
92 | + | else false | |
93 | + | } | |
94 | + | else if (isPlayerRevealedHisChoiceState) | |
95 | + | then { | |
96 | + | let validServerChoiceWasProvided = if ((firstPayloadName == "serversChoice")) | |
97 | + | then if ((firstPayloadAsInteger >= 0)) | |
98 | + | then (boxesCount > firstPayloadAsInteger) | |
99 | + | else false | |
100 | + | else false | |
101 | + | let serversSaltWasProvided = (secondPayloadName == "serversSalt") | |
102 | + | let choiceAndSaltMatchesHardcodedValue = (keccak256(toBytes((toString(firstPayloadAsInteger) + secondPayloadAsString))) == enctyptedServersChoice) | |
103 | + | if (if (if (if (if (senderIsServer) | |
104 | + | then dataFeeIsOk | |
105 | + | else false) | |
106 | + | then validServerChoiceWasProvided | |
107 | + | else false) | |
108 | + | then serversSaltWasProvided | |
109 | + | else false) | |
110 | + | then choiceAndSaltMatchesHardcodedValue | |
111 | + | else false) | |
112 | + | then (payloadSize == 2) | |
113 | + | else false | |
114 | + | } | |
115 | + | else false | |
116 | + | case ttx: TransferTransaction => | |
117 | + | let transferFeeIsOk = (ttx.fee == transferTransactionFee) | |
118 | + | if (isWinnerIsDeterminedState) | |
119 | + | then { | |
120 | + | let winnerAddress = if ((dataServersChoice == dataPlayersChoice)) | |
121 | + | then playersAddress | |
122 | + | else serversAddress | |
123 | + | let prizeGoesToWinner = (ttx.recipient == winnerAddress) | |
124 | + | if (if (transferFeeIsOk) | |
125 | + | then prizeGoesToWinner | |
126 | + | else false) | |
127 | + | then (ttx.amount == (playersPrize + donation)) | |
128 | + | else false | |
129 | + | } | |
130 | + | else if (isServerDecidedNotToPlayState) | |
131 | + | then { | |
132 | + | let recipientIsPlayer = (ttx.recipient == playersAddress) | |
133 | + | if (if (transferFeeIsOk) | |
134 | + | then recipientIsPlayer | |
135 | + | else false) | |
136 | + | then (ttx.amount == (playersPrize + donation)) | |
137 | + | else false | |
138 | + | } | |
139 | + | else if (isPlayerDecidedNotToSendDonationState) | |
140 | + | then { | |
141 | + | let recipientIsServer = (ttx.recipient == serversAddress) | |
142 | + | if (if (transferFeeIsOk) | |
143 | + | then recipientIsServer | |
144 | + | else false) | |
145 | + | then (ttx.amount == playersPrize) | |
146 | + | else false | |
147 | + | } | |
148 | + | else false | |
149 | + | case _ => | |
150 | + | false | |
151 | + | } |
github/deemru/w8io/026f985 20.95 ms ◑