tx · 26AbUjkCvckCuSS5kHe5WaBdk6xATb2hv7KuqSArjox5

3MpUAHPYLiYxk3JgkCrUnhxSedbUiLCZKLz:  -0.01000000 Waves

2019.02.11 19:19 [490711] smart account 3MpUAHPYLiYxk3JgkCrUnhxSedbUiLCZKLz > SELF 0.00000000 Waves

{ "type": 13, "id": "26AbUjkCvckCuSS5kHe5WaBdk6xATb2hv7KuqSArjox5", "fee": 1000000, "feeAssetId": null, "timestamp": 1549901984647, "version": 1, "sender": "3MpUAHPYLiYxk3JgkCrUnhxSedbUiLCZKLz", "senderPublicKey": "5uraNY8gofjyYrygwYVdzXqBahYW7gNN7wEYSYGXm7Eu", "proofs": [ "sFDUGjRBsVSFv9Ejy2zoi2TmtFVFZByLP8zy44LBp1sPL54oD5QcaX4SZqhDriCBrvVSKm9MX4HhKbnSSoRzPC5" ], "script": "base64:AQQAAAAQc2VydmVyc1B1YmxpY0tleQEAAAAg++4D0np85s4U1tfih28Ct9RpE6ePus2LI+C3n9wjllsEAAAAFmVuY3R5cHRlZFNlcnZlcnNDaG9pY2UBAAAAIFC6CHmz7tzVPQ6mvoKFjhX0GduJl6GZLNYQMx0tOjAYBAAAAAhkb25hdGlvbgAAAAAAC+vCAAQAAAAMcGxheWVyc1ByaXplAAAAAAAX14QABAAAAApib3hlc0NvdW50AAAAAAAAAAAFBAAAABRkYXRhUGxheWVyc1B1YmxpY0tleQEAAAAg++4D0np85s4U1tfih28Ct9RpE6ePus2LI+C3n9wjllsEAAAADGRhdGFMb2NrZWRBdAAAAAAAAAd81wQAAAAWbWF5YmVEYXRhUGxheWVyc0Nob2ljZQkABBoAAAACCAUAAAACdHgAAAAGc2VuZGVyAgAAAA1wbGF5ZXJzQ2hvaWNlBAAAABFkYXRhUGxheWVyc0Nob2ljZQkBAAAAB2V4dHJhY3QAAAABBQAAABZtYXliZURhdGFQbGF5ZXJzQ2hvaWNlBAAAABZtYXliZURhdGFTZXJ2ZXJzQ2hvaWNlCQAEGgAAAAIIBQAAAA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Jlc3MEAAAAEXByaXplR29lc1RvV2lubmVyCQAAAAAAAAIIBQAAAAN0dHgAAAAJcmVjaXBpZW50BQAAAA13aW5uZXJBZGRyZXNzAwMFAAAAD3RyYW5zZmVyRmVlSXNPawUAAAARcHJpemVHb2VzVG9XaW5uZXIHCQAAAAAAAAIIBQAAAAN0dHgAAAAGYW1vdW50CQAAZAAAAAIFAAAADHBsYXllcnNQcml6ZQUAAAAIZG9uYXRpb24HAwUAAAAdaXNTZXJ2ZXJEZWNpZGVkTm90VG9QbGF5U3RhdGUEAAAAEXJlY2lwaWVudElzUGxheWVyCQAAAAAAAAIIBQAAAAN0dHgAAAAJcmVjaXBpZW50BQAAAA5wbGF5ZXJzQWRkcmVzcwMDBQAAAA90cmFuc2ZlckZlZUlzT2sFAAAAEXJlY2lwaWVudElzUGxheWVyBwkAAAAAAAACCAUAAAADdHR4AAAABmFtb3VudAkAAGQAAAACBQAAAAxwbGF5ZXJzUHJpemUFAAAACGRvbmF0aW9uBwMFAAAAJWlzUGxheWVyRGVjaWRlZE5vdFRvU2VuZERvbmF0aW9uU3RhdGUEAAAAEXJlY2lwaWVudElzU2VydmVyCQAAAAAAAAIIBQAAAAN0dHgAAAAJcmVjaXBpZW50BQAAAA5zZXJ2ZXJzQWRkcmVzcwMDBQAAAA90cmFuc2ZlckZlZUlzT2sFAAAAEXJlY2lwaWVudElzU2VydmVyBwkAAAAAAAACCAUAAAADdHR4AAAABmFtb3VudAUAAAAMcGxheWVyc1ByaXplBwcHA/j8cQ==", "chainId": 84, "height": 490711, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 1 #-}
2+{-# CONTENT_TYPE EXPRESSION #-}
3+let serversPublicKey = base58'HxRqMjTQJNEjnaEqWCvg81EZCUky9LhdozdaxFta4SsU'
4+let enctyptedServersChoice = base58'6S89Nuj73AD9Sj33SJTsWy9XvCpEctoFtP7h3CTJpodH'
5+let donation = 200000000
6+let playersPrize = 400000000
7+let boxesCount = 5
8+let dataPlayersPublicKey = base58'HxRqMjTQJNEjnaEqWCvg81EZCUky9LhdozdaxFta4SsU'
9+let dataLockedAt = 490711
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 dataIsValidForLockedState = !(isDefined(maybeDataPlayersChoice))
23+let lockedStateTimeout = (height > (dataLockedAt + timeoutInBlocks))
24+let isLockedState = if (dataIsValidForLockedState)
25+ then !(lockedStateTimeout)
26+ else false
27+let isUserDecidedNotToPlayState = if (dataIsValidForLockedState)
28+ then lockedStateTimeout
29+ else false
30+let dataIsValidForPlayerRevealedState = if (isDefined(maybeDataPlayersChoice))
31+ then !(isDefined(maybeDataServersChoice))
32+ else false
33+let playerRevealedStateTimeout = if ((height > (dataLockedAt + (timeoutInBlocks * 2))))
34+ then (accountBalance >= (((playersPrize + donation) + dataTransactionFee) + transferTransactionFee))
35+ else false
36+let isPlayerRevealedHisChoiceState = if (dataIsValidForPlayerRevealedState)
37+ then !(playerRevealedStateTimeout)
38+ else false
39+let isServerDecidedNotToPlayState = if (dataIsValidForPlayerRevealedState)
40+ then playerRevealedStateTimeout
41+ else false
42+let isDataValidForWinnerIsDeterminedState = isDefined(maybeDataServersChoice)
43+let isBalanceValidForWinnerIsDeterminedState = (accountBalance >= ((playersPrize + donation) + transferTransactionFee))
44+let isWinnerIsDeterminedState = if (isDataValidForWinnerIsDeterminedState)
45+ then isBalanceValidForWinnerIsDeterminedState
46+ else false
47+let isPlayerDecidedNotToSendDonationState = if (isDataValidForWinnerIsDeterminedState)
48+ then !(isBalanceValidForWinnerIsDeterminedState)
49+ else false
50+match tx {
51+ case dtx: DataTransaction =>
52+ let payloadSize = size(dtx.data)
53+ let firstPayloadName = dtx.data[0].key
54+ let secondPayloadName = dtx.data[1].key
55+ let firstPayloadAsInteger = extract(getInteger(dtx.data, firstPayloadName))
56+ let secondPayloadAsString = extract(getString(dtx.data, secondPayloadName))
57+ let dataFeeIsOk = (dtx.fee == dataTransactionFee)
58+ if (isUserDecidedNotToPlayState)
59+ then {
60+ let validLockedAtIsProvided = true
61+ let playersPublicKeyIsProvided = true
62+ if (if (if (if (senderIsServer)
63+ then dataFeeIsOk
64+ else false)
65+ then validLockedAtIsProvided
66+ else false)
67+ then playersPublicKeyIsProvided
68+ else false)
69+ then (payloadSize == 2)
70+ else false
71+ }
72+ else if (isLockedState)
73+ then {
74+ let validPlayersChoiceIsProvided = if ((firstPayloadName == "playersChoice"))
75+ then if ((firstPayloadAsInteger >= 0))
76+ then (boxesCount > firstPayloadAsInteger)
77+ else false
78+ else false
79+ if (if (if (senderIsPlayer)
80+ then dataFeeIsOk
81+ else false)
82+ then validPlayersChoiceIsProvided
83+ else false)
84+ then (payloadSize == 1)
85+ else false
86+ }
87+ else if (isPlayerRevealedHisChoiceState)
88+ then {
89+ let validServerChoiceWasProvided = if ((firstPayloadName == "serversChoice"))
90+ then if ((firstPayloadAsInteger >= 0))
91+ then (boxesCount > firstPayloadAsInteger)
92+ else false
93+ else false
94+ let serversSaltWasProvided = (secondPayloadName == "serversSalt")
95+ let choiceAndSaltMatchesHardcodedValue = (keccak256(toBytes((toString(firstPayloadAsInteger) + secondPayloadAsString))) == enctyptedServersChoice)
96+ if (if (if (if (if (senderIsServer)
97+ then dataFeeIsOk
98+ else false)
99+ then validServerChoiceWasProvided
100+ else false)
101+ then serversSaltWasProvided
102+ else false)
103+ then choiceAndSaltMatchesHardcodedValue
104+ else false)
105+ then (payloadSize == 2)
106+ else false
107+ }
108+ else false
109+ case ttx: TransferTransaction =>
110+ let transferFeeIsOk = (ttx.fee == transferTransactionFee)
111+ if (isWinnerIsDeterminedState)
112+ then {
113+ let winnerAddress = if ((dataServersChoice == dataPlayersChoice))
114+ then playersAddress
115+ else serversAddress
116+ let prizeGoesToWinner = (ttx.recipient == winnerAddress)
117+ if (if (transferFeeIsOk)
118+ then prizeGoesToWinner
119+ else false)
120+ then (ttx.amount == (playersPrize + donation))
121+ else false
122+ }
123+ else if (isServerDecidedNotToPlayState)
124+ then {
125+ let recipientIsPlayer = (ttx.recipient == playersAddress)
126+ if (if (transferFeeIsOk)
127+ then recipientIsPlayer
128+ else false)
129+ then (ttx.amount == (playersPrize + donation))
130+ else false
131+ }
132+ else if (isPlayerDecidedNotToSendDonationState)
133+ then {
134+ let recipientIsServer = (ttx.recipient == serversAddress)
135+ if (if (transferFeeIsOk)
136+ then recipientIsServer
137+ else false)
138+ then (ttx.amount == playersPrize)
139+ else false
140+ }
141+ else false
142+ case _ =>
143+ false
144+}

github/deemru/w8io/026f985 
21.06 ms