tx · B7XboCLWGEZEALiaT6tJSMqQy6j6UZoD7dN3oQxJrdCT

3MwR2FzFtbHeds3NzvkbiaYMVNhbtqcfRPU:  -0.01400000 Waves

2019.02.12 10:08 [491595] smart account 3MwR2FzFtbHeds3NzvkbiaYMVNhbtqcfRPU > SELF 0.00000000 Waves

{ "type": 13, "id": "B7XboCLWGEZEALiaT6tJSMqQy6j6UZoD7dN3oQxJrdCT", "fee": 1400000, "feeAssetId": null, "timestamp": 1549955293104, "version": 1, "sender": "3MwR2FzFtbHeds3NzvkbiaYMVNhbtqcfRPU", "senderPublicKey": "H5rtwGVnkSHDfz6msD7itGURoKMXvvDwPoup1VESxfjJ", "proofs": [ "5TX9Eqiy5ncfm3RjQvaJw3GVrXcUyevgvUDSai1xGrzjsbWtXtz1Dk22M6uHx1a11givXaxkhYEarESMjKMs4AtQ" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABm9yYWNsZQkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTkN6YVlUTkRHdFI4emY5eWZjcWVQRmpDcUZ4OVM1emhzNAQAAAAObWluV2l0aGRyYXdGZWUAAAAAAAAHoSAEAAAAEHJlZ2lzdGVyQmV0VHhGZWUAAAAAAAAHoSAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAp3aXRoZHJhd1R4BQAAAAckbWF0Y2gwBAAAAAR0eElkCQEAAAAHZXh0cmFjdAAAAAEJAAQdAAAAAgUAAAACbWUJAAEsAAAAAgkAAlgAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAECAAAACV93aXRoZHJhdwQAAAAHJG1hdGNoMQkAA+gAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEDCQAAAQAAAAIFAAAAByRt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AAAAAAAQUAAAAHdmFsUmVhbAQAAAASaXNNb25leVN0aWxsRW5vdWdoCQAAZgAAAAIJAABkAAAAAgkAAGgAAAACCQAAZQAAAAIIBQAAAAlwYXltZW50VHgAAAAGYW1vdW50BQAAABByZWdpc3RlckJldFR4RmVlBQAAAAVrb2VmZgUAAAAObWluV2l0aGRyYXdGZWUFAAAAB25ld0ZlZXMDBQAAAAVpc1dpbgUAAAASaXNNb25leVN0aWxsRW5vdWdoBwcHBwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkUW+xy", "chainId": 84, "height": 491595, "spentComplexity": 0 } View: original | compacted Prev: BDFs5ipHmHPQhEhdLEJr4PSWWBPtwsWJXK3nnXW59LZC Next: J2DYAoL1eR7apYBCpC5fMi3WoJzpg2MwKz8q6hJcFQ66 Diff:
OldNewDifferences
5353 false
5454 }
5555 case dtx: DataTransaction =>
56- if ((size(dtx.data) == 2))
56+ if ((size(dtx.data) == 3))
5757 then {
58- let isDataCountOk = (size(dtx.data) == 2)
59- let paymentTxIdStr = dropRight(extract(dtx.data[0].key), 9)
60- let feesKey = (paymentTxIdStr + "_withdraw_fees")
58+ let minBet = 50000000
59+ let maxSumBet = 1000000000
60+ let paymentTxIdStr = extract(dtx.data[0].key)
61+ let guessStr = extract(getString(dtx.data, paymentTxIdStr))
62+ let paymentRoundKey = (paymentTxIdStr + "_round")
63+ let paymentRound = extract(getString(dtx.data, paymentRoundKey))
64+ let sumBetsOld = if (isDefined(getInteger(me, (paymentRound + "_betsSum"))))
65+ then extract(getInteger(me, (paymentRound + "_betsSum")))
66+ else 0
67+ let sumBetsNew = extract(getInteger(dtx.data, (paymentRound + "_betsSum")))
68+ let itsTooLate = isDefined(getString(me, (paymentRound + "_stop")))
69+ let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr))
6170 let paymentTx = transactionById(fromBase58String(paymentTxIdStr))
62- let newFees = extract(getInteger(dtx.data, feesKey))
63- let oldFeesUnit = getInteger(me, feesKey)
64- let oldFees = if (isDefined(oldFeesUnit))
65- then extract(oldFeesUnit)
66- else 0
67- let isFeeCorrect = (newFees == (oldFees + dtx.fee))
68- let withdrawTxIdUnit = getString(me, paymentTxIdStr)
69- let isPaymentAlreadyMentioned = isDefined(withdrawTxIdUnit)
70- let withdrawTransactionId = fromBase58String(extract(withdrawTxIdUnit))
7171 match paymentTx {
7272 case paymentTx: TransferTransaction =>
7373 let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey)
74- if (if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me))
74+ let correctSumBets = ((sumBetsOld + paymentTx.amount) - dtx.fee)
75+ if (if (if (if (if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me))
76+ then true
77+ else throw("Incorrect recipient of the payment"))
7578 then if (!(isPaymentAlreadyMentioned))
7679 then true
77- else !(isDefined(transactionById(withdrawTransactionId)))
80+ else throw("This transfer is already used as a bet")
7881 else false)
79- then isDtxSignedByPayer
82+ then if ((sumBetsNew == correctSumBets))
83+ then true
84+ else throw(("Wrong value for Sum of Bets. Must be " + toString(correctSumBets)))
8085 else false)
81- then isFeeCorrect
86+ then if ((maxSumBet > sumBetsNew))
87+ then true
88+ else throw(((("Maximum amount of bets for round " + toString(maxSumBet)) + ". With your bet it's ") + toString(sumBetsNew)))
8289 else false)
83- then isDataCountOk
90+ then if ((dtx.fee == registerBetTxFee))
91+ then true
92+ else throw(("Fee of bet registration data transaction must be " + toString(registerBetTxFee)))
8493 else false)
85- then {
86- let guess = extract(getBinary(me, paymentTxIdStr))
87- let type = take(guess, 1)
88- let key = extract(getString(me, (paymentTxIdStr + "_round")))
89- let itsTooLate = isDefined(getString(me, (key + "_stop")))
90- let valComplex = extract(getBinary(oracle, key))
91- let koeff = if ((type == drop(toBytes(0), 7)))
92- then 35
93- else if ((type == drop(toBytes(1), 7)))
94- then 2
95- else if ((type == drop(toBytes(2), 7)))
96- then 2
97- else if ((type == drop(toBytes(3), 7)))
98- then 2
99- else if ((type == drop(toBytes(4), 7)))
100- then 3
101- else if ((type == drop(toBytes(5), 7)))
102- then 3
103- else 0
104- let valReal = if ((type == drop(toBytes(0), 7)))
105- then drop(take(valComplex, 2), 1)
106- else if ((type == drop(toBytes(1), 7)))
107- then drop(take(valComplex, 3), 2)
108- else if ((type == drop(toBytes(2), 7)))
109- then drop(take(valComplex, 4), 3)
110- else if ((type == drop(toBytes(3), 7)))
111- then drop(take(valComplex, 5), 4)
112- else if ((type == drop(toBytes(4), 7)))
113- then drop(take(valComplex, 6), 5)
114- else if ((type == drop(toBytes(5), 7)))
115- then drop(take(valComplex, 7), 6)
116- else throw("Incorrect type of guess provided")
117- let isWin = (drop(guess, 1) == valReal)
118- let isMoneyStillEnough = ((((paymentTx.amount - registerBetTxFee) * koeff) + minWithdrawFee) > newFees)
119- if (if (isWin)
120- then isMoneyStillEnough
121- else false)
122- then !(itsTooLate)
123- else false
124- }
94+ then if ((paymentTx.amount >= minBet))
95+ then true
96+ else throw(("Your Bet amount is less then minimal bet " + toString(minBet)))
97+ else false)
98+ then if (!(isDefined(paymentTx.feeAssetId)))
99+ then true
100+ else throw("Paymnet must be in WAVES")
101+ else false)
102+ then if (!(itsTooLate))
103+ then true
104+ else throw("It's too late to play this round. Try next one")
125105 else false
126106 case _ =>
127107 false
128108 }
129109 }
130- else if ((size(dtx.data) == 3))
110+ else if ((size(dtx.data) == 2))
131111 then {
132- let minBet = 50000000
133- let maxSumBet = 1000000000
134- let paymentTxIdStr = extract(dtx.data[0].key)
135- let guessStr = extract(getString(dtx.data, paymentTxIdStr))
136- let paymentRoundKey = (paymentTxIdStr + "_round")
137- let paymentRound = extract(getString(dtx.data, paymentRoundKey))
138- let sumBetsOld = if (isDefined(getInteger(me, (paymentRound + "_betsSum"))))
139- then extract(getInteger(me, (paymentRound + "_betsSum")))
112+ let isDataCountOk = (size(dtx.data) == 2)
113+ let paymentTxIdStr = dropRight(extract(dtx.data[0].key), 9)
114+ let feesKey = (paymentTxIdStr + "_withdraw_fees")
115+ let paymentTx = transactionById(fromBase58String(paymentTxIdStr))
116+ let newFees = extract(getInteger(dtx.data, feesKey))
117+ let oldFeesUnit = getInteger(me, feesKey)
118+ let oldFees = if (isDefined(oldFeesUnit))
119+ then extract(oldFeesUnit)
140120 else 0
141- let sumBetsNew = extract(getInteger(dtx.data, (paymentRound + "_betsSum")))
142- let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr))
143- let paymentTx = transactionById(fromBase58String(paymentTxIdStr))
121+ let isFeeCorrect = (newFees == (oldFees + dtx.fee))
122+ let withdrawTxIdUnit = getString(me, paymentTxIdStr)
123+ let isPaymentAlreadyMentioned = isDefined(withdrawTxIdUnit)
124+ let withdrawTransactionId = fromBase58String(extract(withdrawTxIdUnit))
144125 match paymentTx {
145126 case paymentTx: TransferTransaction =>
146127 let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey)
147- let correctSumBets = ((sumBetsOld + paymentTx.amount) - dtx.fee)
148- if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me))
149- then !(isPaymentAlreadyMentioned)
128+ if (if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me))
129+ then if (!(isPaymentAlreadyMentioned))
130+ then true
131+ else !(isDefined(transactionById(withdrawTransactionId)))
150132 else false)
151- then if ((sumBetsNew == correctSumBets))
152- then true
153- else throw(("Wrong value for Sum of Bets. Must be " + toString(correctSumBets)))
133+ then isDtxSignedByPayer
154134 else false)
155- then if ((maxSumBet > sumBetsNew))
156- then true
157- else throw(((("Maximum amount of bets for round " + toString(maxSumBet)) + ". With your bet it's ") + toString(sumBetsNew)))
135+ then isFeeCorrect
158136 else false)
159- then if ((dtx.fee == registerBetTxFee))
160- then true
161- else throw(("Fee of bet registration data transaction must be " + toString(registerBetTxFee)))
137+ then isDataCountOk
138+ else false)
139+ then {
140+ let guess = extract(getBinary(me, paymentTxIdStr))
141+ let type = take(guess, 1)
142+ let key = extract(getString(me, (paymentTxIdStr + "_round")))
143+ let valComplex = extract(getBinary(oracle, key))
144+ let koeff = if ((type == drop(toBytes(0), 7)))
145+ then 35
146+ else if ((type == drop(toBytes(1), 7)))
147+ then 2
148+ else if ((type == drop(toBytes(2), 7)))
149+ then 2
150+ else if ((type == drop(toBytes(3), 7)))
151+ then 2
152+ else if ((type == drop(toBytes(4), 7)))
153+ then 3
154+ else if ((type == drop(toBytes(5), 7)))
155+ then 3
156+ else 0
157+ let valReal = if ((type == drop(toBytes(0), 7)))
158+ then drop(take(valComplex, 2), 1)
159+ else if ((type == drop(toBytes(1), 7)))
160+ then drop(take(valComplex, 3), 2)
161+ else if ((type == drop(toBytes(2), 7)))
162+ then drop(take(valComplex, 4), 3)
163+ else if ((type == drop(toBytes(3), 7)))
164+ then drop(take(valComplex, 5), 4)
165+ else if ((type == drop(toBytes(4), 7)))
166+ then drop(take(valComplex, 6), 5)
167+ else if ((type == drop(toBytes(5), 7)))
168+ then drop(take(valComplex, 7), 6)
169+ else throw("Incorrect type of guess provided")
170+ let isWin = (drop(guess, 1) == valReal)
171+ let isMoneyStillEnough = ((((paymentTx.amount - registerBetTxFee) * koeff) + minWithdrawFee) > newFees)
172+ if (isWin)
173+ then isMoneyStillEnough
174+ else false
175+ }
162176 else false
163177 case _ =>
164178 false
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 1 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
33 let me = tx.sender
44 let oracle = extract(addressFromString("3NCzaYTNDGtR8zf9yfcqePFjCqFx9S5zhs4"))
55 let minWithdrawFee = 500000
66 let registerBetTxFee = 500000
77 match tx {
88 case withdrawTx: TransferTransaction =>
99 let txId = extract(getString(me, (toBase58String(tx.proofs[1]) + "_withdraw")))
1010 match transactionById(tx.proofs[1]) {
1111 case paymentTx: TransferTransaction =>
1212 let isPaymentTookPlace = if ((txId == toBase58String(tx.id)))
1313 then sigVerify(tx.bodyBytes, tx.proofs[0], paymentTx.senderPublicKey)
1414 else false
1515 let feesKey = (toBase58String(tx.proofs[1]) + "_withdraw_fees")
1616 let dataTxsFees = extract(getInteger(me, feesKey))
1717 let guess = extract(getBinary(me, toBase58String(tx.proofs[1])))
1818 let type = take(guess, 1)
1919 let val = drop(guess, 1)
2020 let key = extract(getString(me, (toBase58String(tx.proofs[1]) + "_round")))
2121 let valComplex = extract(getBinary(oracle, key))
2222 let koeff = if ((type == drop(toBytes(0), 7)))
2323 then 35
2424 else if ((type == drop(toBytes(1), 7)))
2525 then 2
2626 else if ((type == drop(toBytes(2), 7)))
2727 then 2
2828 else if ((type == drop(toBytes(3), 7)))
2929 then 2
3030 else if ((type == drop(toBytes(4), 7)))
3131 then 3
3232 else if ((type == drop(toBytes(5), 7)))
3333 then 3
3434 else 0
3535 let correctAmount = ((((paymentTx.amount - registerBetTxFee) * koeff) - dataTxsFees) - withdrawTx.fee)
3636 let isInWaves = if (!(isDefined(withdrawTx.feeAssetId)))
3737 then !(isDefined(withdrawTx.assetId))
3838 else false
3939 if (if (if (isPaymentTookPlace)
4040 then true
4141 else throw("There was no bet"))
4242 then if ((withdrawTx.amount == correctAmount))
4343 then true
4444 else throw(("Amount is incorrect. Correct amount is " + toString(correctAmount)))
4545 else false)
4646 then if (if (!(isDefined(withdrawTx.feeAssetId)))
4747 then !(isDefined(withdrawTx.assetId))
4848 else false)
4949 then true
5050 else throw("Withdraw and fee must be in WAVES")
5151 else false
5252 case _ =>
5353 false
5454 }
5555 case dtx: DataTransaction =>
56- if ((size(dtx.data) == 2))
56+ if ((size(dtx.data) == 3))
5757 then {
58- let isDataCountOk = (size(dtx.data) == 2)
59- let paymentTxIdStr = dropRight(extract(dtx.data[0].key), 9)
60- let feesKey = (paymentTxIdStr + "_withdraw_fees")
58+ let minBet = 50000000
59+ let maxSumBet = 1000000000
60+ let paymentTxIdStr = extract(dtx.data[0].key)
61+ let guessStr = extract(getString(dtx.data, paymentTxIdStr))
62+ let paymentRoundKey = (paymentTxIdStr + "_round")
63+ let paymentRound = extract(getString(dtx.data, paymentRoundKey))
64+ let sumBetsOld = if (isDefined(getInteger(me, (paymentRound + "_betsSum"))))
65+ then extract(getInteger(me, (paymentRound + "_betsSum")))
66+ else 0
67+ let sumBetsNew = extract(getInteger(dtx.data, (paymentRound + "_betsSum")))
68+ let itsTooLate = isDefined(getString(me, (paymentRound + "_stop")))
69+ let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr))
6170 let paymentTx = transactionById(fromBase58String(paymentTxIdStr))
62- let newFees = extract(getInteger(dtx.data, feesKey))
63- let oldFeesUnit = getInteger(me, feesKey)
64- let oldFees = if (isDefined(oldFeesUnit))
65- then extract(oldFeesUnit)
66- else 0
67- let isFeeCorrect = (newFees == (oldFees + dtx.fee))
68- let withdrawTxIdUnit = getString(me, paymentTxIdStr)
69- let isPaymentAlreadyMentioned = isDefined(withdrawTxIdUnit)
70- let withdrawTransactionId = fromBase58String(extract(withdrawTxIdUnit))
7171 match paymentTx {
7272 case paymentTx: TransferTransaction =>
7373 let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey)
74- if (if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me))
74+ let correctSumBets = ((sumBetsOld + paymentTx.amount) - dtx.fee)
75+ if (if (if (if (if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me))
76+ then true
77+ else throw("Incorrect recipient of the payment"))
7578 then if (!(isPaymentAlreadyMentioned))
7679 then true
77- else !(isDefined(transactionById(withdrawTransactionId)))
80+ else throw("This transfer is already used as a bet")
7881 else false)
79- then isDtxSignedByPayer
82+ then if ((sumBetsNew == correctSumBets))
83+ then true
84+ else throw(("Wrong value for Sum of Bets. Must be " + toString(correctSumBets)))
8085 else false)
81- then isFeeCorrect
86+ then if ((maxSumBet > sumBetsNew))
87+ then true
88+ else throw(((("Maximum amount of bets for round " + toString(maxSumBet)) + ". With your bet it's ") + toString(sumBetsNew)))
8289 else false)
83- then isDataCountOk
90+ then if ((dtx.fee == registerBetTxFee))
91+ then true
92+ else throw(("Fee of bet registration data transaction must be " + toString(registerBetTxFee)))
8493 else false)
85- then {
86- let guess = extract(getBinary(me, paymentTxIdStr))
87- let type = take(guess, 1)
88- let key = extract(getString(me, (paymentTxIdStr + "_round")))
89- let itsTooLate = isDefined(getString(me, (key + "_stop")))
90- let valComplex = extract(getBinary(oracle, key))
91- let koeff = if ((type == drop(toBytes(0), 7)))
92- then 35
93- else if ((type == drop(toBytes(1), 7)))
94- then 2
95- else if ((type == drop(toBytes(2), 7)))
96- then 2
97- else if ((type == drop(toBytes(3), 7)))
98- then 2
99- else if ((type == drop(toBytes(4), 7)))
100- then 3
101- else if ((type == drop(toBytes(5), 7)))
102- then 3
103- else 0
104- let valReal = if ((type == drop(toBytes(0), 7)))
105- then drop(take(valComplex, 2), 1)
106- else if ((type == drop(toBytes(1), 7)))
107- then drop(take(valComplex, 3), 2)
108- else if ((type == drop(toBytes(2), 7)))
109- then drop(take(valComplex, 4), 3)
110- else if ((type == drop(toBytes(3), 7)))
111- then drop(take(valComplex, 5), 4)
112- else if ((type == drop(toBytes(4), 7)))
113- then drop(take(valComplex, 6), 5)
114- else if ((type == drop(toBytes(5), 7)))
115- then drop(take(valComplex, 7), 6)
116- else throw("Incorrect type of guess provided")
117- let isWin = (drop(guess, 1) == valReal)
118- let isMoneyStillEnough = ((((paymentTx.amount - registerBetTxFee) * koeff) + minWithdrawFee) > newFees)
119- if (if (isWin)
120- then isMoneyStillEnough
121- else false)
122- then !(itsTooLate)
123- else false
124- }
94+ then if ((paymentTx.amount >= minBet))
95+ then true
96+ else throw(("Your Bet amount is less then minimal bet " + toString(minBet)))
97+ else false)
98+ then if (!(isDefined(paymentTx.feeAssetId)))
99+ then true
100+ else throw("Paymnet must be in WAVES")
101+ else false)
102+ then if (!(itsTooLate))
103+ then true
104+ else throw("It's too late to play this round. Try next one")
125105 else false
126106 case _ =>
127107 false
128108 }
129109 }
130- else if ((size(dtx.data) == 3))
110+ else if ((size(dtx.data) == 2))
131111 then {
132- let minBet = 50000000
133- let maxSumBet = 1000000000
134- let paymentTxIdStr = extract(dtx.data[0].key)
135- let guessStr = extract(getString(dtx.data, paymentTxIdStr))
136- let paymentRoundKey = (paymentTxIdStr + "_round")
137- let paymentRound = extract(getString(dtx.data, paymentRoundKey))
138- let sumBetsOld = if (isDefined(getInteger(me, (paymentRound + "_betsSum"))))
139- then extract(getInteger(me, (paymentRound + "_betsSum")))
112+ let isDataCountOk = (size(dtx.data) == 2)
113+ let paymentTxIdStr = dropRight(extract(dtx.data[0].key), 9)
114+ let feesKey = (paymentTxIdStr + "_withdraw_fees")
115+ let paymentTx = transactionById(fromBase58String(paymentTxIdStr))
116+ let newFees = extract(getInteger(dtx.data, feesKey))
117+ let oldFeesUnit = getInteger(me, feesKey)
118+ let oldFees = if (isDefined(oldFeesUnit))
119+ then extract(oldFeesUnit)
140120 else 0
141- let sumBetsNew = extract(getInteger(dtx.data, (paymentRound + "_betsSum")))
142- let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr))
143- let paymentTx = transactionById(fromBase58String(paymentTxIdStr))
121+ let isFeeCorrect = (newFees == (oldFees + dtx.fee))
122+ let withdrawTxIdUnit = getString(me, paymentTxIdStr)
123+ let isPaymentAlreadyMentioned = isDefined(withdrawTxIdUnit)
124+ let withdrawTransactionId = fromBase58String(extract(withdrawTxIdUnit))
144125 match paymentTx {
145126 case paymentTx: TransferTransaction =>
146127 let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey)
147- let correctSumBets = ((sumBetsOld + paymentTx.amount) - dtx.fee)
148- if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me))
149- then !(isPaymentAlreadyMentioned)
128+ if (if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me))
129+ then if (!(isPaymentAlreadyMentioned))
130+ then true
131+ else !(isDefined(transactionById(withdrawTransactionId)))
150132 else false)
151- then if ((sumBetsNew == correctSumBets))
152- then true
153- else throw(("Wrong value for Sum of Bets. Must be " + toString(correctSumBets)))
133+ then isDtxSignedByPayer
154134 else false)
155- then if ((maxSumBet > sumBetsNew))
156- then true
157- else throw(((("Maximum amount of bets for round " + toString(maxSumBet)) + ". With your bet it's ") + toString(sumBetsNew)))
135+ then isFeeCorrect
158136 else false)
159- then if ((dtx.fee == registerBetTxFee))
160- then true
161- else throw(("Fee of bet registration data transaction must be " + toString(registerBetTxFee)))
137+ then isDataCountOk
138+ else false)
139+ then {
140+ let guess = extract(getBinary(me, paymentTxIdStr))
141+ let type = take(guess, 1)
142+ let key = extract(getString(me, (paymentTxIdStr + "_round")))
143+ let valComplex = extract(getBinary(oracle, key))
144+ let koeff = if ((type == drop(toBytes(0), 7)))
145+ then 35
146+ else if ((type == drop(toBytes(1), 7)))
147+ then 2
148+ else if ((type == drop(toBytes(2), 7)))
149+ then 2
150+ else if ((type == drop(toBytes(3), 7)))
151+ then 2
152+ else if ((type == drop(toBytes(4), 7)))
153+ then 3
154+ else if ((type == drop(toBytes(5), 7)))
155+ then 3
156+ else 0
157+ let valReal = if ((type == drop(toBytes(0), 7)))
158+ then drop(take(valComplex, 2), 1)
159+ else if ((type == drop(toBytes(1), 7)))
160+ then drop(take(valComplex, 3), 2)
161+ else if ((type == drop(toBytes(2), 7)))
162+ then drop(take(valComplex, 4), 3)
163+ else if ((type == drop(toBytes(3), 7)))
164+ then drop(take(valComplex, 5), 4)
165+ else if ((type == drop(toBytes(4), 7)))
166+ then drop(take(valComplex, 6), 5)
167+ else if ((type == drop(toBytes(5), 7)))
168+ then drop(take(valComplex, 7), 6)
169+ else throw("Incorrect type of guess provided")
170+ let isWin = (drop(guess, 1) == valReal)
171+ let isMoneyStillEnough = ((((paymentTx.amount - registerBetTxFee) * koeff) + minWithdrawFee) > newFees)
172+ if (isWin)
173+ then isMoneyStillEnough
174+ else false
175+ }
162176 else false
163177 case _ =>
164178 false
165179 }
166180 }
167181 else false
168182 case _ =>
169183 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
170184 }

github/deemru/w8io/169f3d6 
58.79 ms