tx · 3m7SWYnhkVmxn9mJE8bLEhPCsWyVwBsnQhx7w74eg4dE

3Mu7V7BTQdkPGTNfLjVQzj96V32k7bsJWE1:  -0.01400000 Waves

2020.02.07 11:25 [888567] smart account 3Mu7V7BTQdkPGTNfLjVQzj96V32k7bsJWE1 > SELF 0.00000000 Waves

{ "type": 13, "id": "3m7SWYnhkVmxn9mJE8bLEhPCsWyVwBsnQhx7w74eg4dE", "fee": 1400000, "feeAssetId": null, "timestamp": 1581063960678, "version": 1, "sender": "3Mu7V7BTQdkPGTNfLjVQzj96V32k7bsJWE1", "senderPublicKey": "3dwgGQS5icXGDzAzjN4gyi1tkZBNjGZz4HaTJwbZkzGG", "proofs": [ "ZrWSKNrtrAtqfmzxSWxwCkubVUmqariRLoQpg58DWEDzxbZt6ncRCtPQWMLx56HcfTBYWpnFmuUYCHG4Rg61WD5" ], "script": "base64:AAIDAAAAAAAAAAkIARIDCgEBEgAAAAAOAAAAAAdxMXN0YXJ0AAAAAAAAAAC+AAAAAAdxMnN0YXJ0AAAAAAAAAAC+AAAAAAN2aWcAAAAAAAAAADQAAAAACnJpc2tBbW91bnQAAAAAAAAAA+gAAAAADGJldFRocmVzaG9sZAAAAAAAAAAACgAAAAAGYmV0TWluAAAAAAAAAAABAAAAAAZiZXRNYXgAAAAAAAAAAGQBAAAACXExRXh0cmFjdAAAAAAEAAAAAnExAwkBAAAACWlzRGVmaW5lZAAAAAECAAAAB3ExX25leHQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAB3ExX25leHQFAAAAB3Exc3RhcnQFAAAAAnExAQAAAAlxMkV4dHJhY3QAAAAABAAAAAJxMgMJAQAAAAlpc0RlZmluZWQAAAABAgAAAAdxMl9uZXh0CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAAdxMl9uZXh0BQAAAAdxMnN0YXJ0BQAAAAJxMgEAAAASZGVidEFtb3VudDFFeHRyYWN0AAAAA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fMgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAQAAAABdQUAAAAHJG1hdGNoMAcDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAB0Jvb2xlYW4EAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIJAQAAAAV0aHJvdwAAAAADBQAAAAZldmVudDEJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAQlAAAAAQgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyAgAAAA1fZXZlbnQxYW1vdW50AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyCQAAaAAAAAIFAAAADGV2ZW50MWFtb3VudAAAAAAAAA9CQAUAAAAEdW5pdAUAAAADbmlsAwUAAAAGZXZlbnQyCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQAEJQAAAAEIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgIAAAANX2V2ZW50MmFtb3VudAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgkAAGgAAAACBQAAAAxldmVudDJhbW91bnQAAAAAAAAPQkAFAAAABHVuaXQFAAAAA25pbAkAAAIAAAABAgAAAClldmVudCBkaWQgbm90IGhhcHBlbiBvciB5b3UgaGF2ZSB6ZXJvIHdpbgAAAACsblf4", "chainId": 84, "height": 888567, "spentComplexity": 0 } View: original | compacted Prev: HgP5tDGtrWJZqTU2FvrXHNUEDPPWRYvBUzDdN22dQNAM Next: 8dDtSLqzqaodeYCfNcQXT2T7cCZ63j3xLPByAz8i3cGF Diff:
OldNewDifferences
1616 let betMax = 100
1717
1818 func q1Extract () = {
19- let q1 = if (isDefined(getInteger(this, "q1_next")))
19+ let q1 = if (isDefined("q1_next"))
2020 then getIntegerValue(this, "q1_next")
2121 else q1start
2222 q1
2424
2525
2626 func q2Extract () = {
27- let q2 = if (isDefined(getInteger(this, "q2_next")))
27+ let q2 = if (isDefined("q2_next"))
2828 then getIntegerValue(this, "q2_next")
2929 else q2start
3030 q2
3232
3333
3434 func debtAmount1Extract () = {
35- let debtAmount1 = if (isDefined(getInteger(this, "debtAmount1")))
35+ let debtAmount1 = if (isDefined("debtAmount1"))
3636 then getIntegerValue(this, "debtAmount1")
3737 else 0
3838 debtAmount1
4040
4141
4242 func debtAmount2Extract () = {
43- let debtAmount2 = if (isDefined(getInteger(this, "debtAmount2")))
43+ let debtAmount2 = if (isDefined("debtAmount2"))
4444 then getIntegerValue(this, "debtAmount2")
4545 else 0
4646 debtAmount2
4747 }
4848
4949
50-func calcCoefIfBigBet (event,betAmount,q) = {
50+func calcCoefIfBigBet (event,betAmount) = {
51+ let q = getIntegerValue(this, event)
5152 let k = (((1 * 100000) - (q * 1000)) / (betMax - betThreshold))
5253 let b = ((1 * 100000) - (k * betMax))
5354 let qCorrected = (((betAmount * k) + b) / 1000)
6566 then {
6667 let k = (((1 * 1000000) - (q1start * 10000)) / riskAmount)
6768 let b = ((1 * 1000000) - (k * riskAmount))
68- let q1 = (((-(k) * debtAmount1) + b) / 10000)
69+ let q1 = ((-(k) * debtAmount1) + (b / 1000))
6970 let q2 = anothercoef(q1, vig)
7071 [q1, q2]
7172 }
7273 else if ((debtAmount1 > 0))
7374 then {
74- let k = (((1 * 1000000) - (q2start * 10000)) / riskAmount)
75+ let k = (((1 * 1000000) - (q1start * 10000)) / riskAmount)
7576 let b = ((1 * 1000000) - (k * riskAmount))
76- let q2 = (((-(k) * debtAmount2) + b) / 10000)
77+ let q2 = ((-(k) * debtAmount2) + (b / 1000))
7778 let q1 = anothercoef(q2, vig)
7879 [q1, q2]
7980 }
9495 case _ =>
9596 throw("Payment not attached")
9697 }
97- let count = if (isDefined(getInteger(this, "count")))
98+ let count = if (isDefined("count"))
9899 then getIntegerValue(this, "count")
99100 else 0
100- let event1DebtForThisPlayer = if (isDefined(getInteger(this, (toString(contextObj.caller) + "_event1DebtForThisPlayer"))))
101- then getIntegerValue(this, (toString(contextObj.caller) + "_event1DebtForThisPlayer"))
102- else 0
103- let event2DebtForThisPlayer = if (isDefined(getInteger(this, (toString(contextObj.caller) + "_event2DebtForThisPlayer"))))
104- then getIntegerValue(this, (toString(contextObj.caller) + "_event2DebtForThisPlayer"))
105- else 0
101+ let event1DebtForThisPlayer = getIntegerValue(this, (toString(contextObj.caller) + "_event1DebtForThisPlayer"))
102+ let event2DebtForThisPlayer = getIntegerValue(this, (toString(contextObj.caller) + "_event2DebtForThisPlayer"))
106103 let debtAmount1 = debtAmount1Extract()
107104 let debtAmount2 = debtAmount2Extract()
108105 let q1 = q1Extract()
109106 let q2 = q2Extract()
110107 let countNew = (count + 1)
111108 if ((event == 1))
112- then if ((betThreshold >= betAmount))
109+ then if ((betThreshold > betAmount))
113110 then {
114- let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + ((q1 * betAmount) / 100))
115- let debtAmount1New = ((debtAmount1 + betAmount) - ((q1 * betAmount) / 100))
111+ let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1 * betAmount))
112+ let debtAmount1New = (debtAmount1 - (q1 * betAmount))
116113 let debtAmount2New = (debtAmount2 + betAmount)
117114 let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
118115 let q1Next = q1Nextq2Next[0]
119116 let q2Next = q1Nextq2Next[1]
120- WriteSet([DataEntry((toString(contextObj.caller) + "_event1DebtForThisPlayer"), event1DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry("debtAmount1", debtAmount1New), DataEntry("debtAmount2", debtAmount2New), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
117+ WriteSet([DataEntry((toString(contextObj.caller) + "_event1DebtForThisPlayer"), event1DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_amount"), betAmount), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
121118 }
122119 else if (if ((betAmount > betThreshold))
123120 then (betMax > betAmount)
124121 else false)
125122 then {
126- let q1Corrected = calcCoefIfBigBet("q1_next", betAmount, q1)
127- let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + ((q1Corrected * betAmount) / 100))
128- let debtAmount1New = ((debtAmount1 + betAmount) - ((q1Corrected * betAmount) / 100))
123+ let q1Corrected = calcCoefIfBigBet("q1_next", betAmount)
124+ let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1Corrected * betAmount))
125+ let debtAmount1New = (debtAmount1 - (q1Corrected * betAmount))
129126 let debtAmount2New = (debtAmount2 + betAmount)
130127 let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
131128 let q1Next = q1Nextq2Next[0]
132129 let q2Next = q1Nextq2Next[1]
133- WriteSet([DataEntry((toString(contextObj.caller) + "_event1DebtForThisPlayer"), event1DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_Correctedqoef1"), q1Corrected), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("debtAmount1", debtAmount1New), DataEntry("debtAmount2", debtAmount2New), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
130+ WriteSet([DataEntry((toString(contextObj.caller) + "_event1DebtForThisPlayer"), event1DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_amount"), betAmount), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
134131 }
135132 else throw("incorrect bet amount")
136- else if ((event == 2))
137- then if ((betThreshold >= betAmount))
133+ else if ((betThreshold > betAmount))
134+ then {
135+ let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2 * betAmount))
136+ let debtAmount2New = (debtAmount2 - (q2 * betAmount))
137+ let debtAmount1New = (debtAmount1 + betAmount)
138+ let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
139+ let q1Next = q1Nextq2Next[0]
140+ let q2Next = q1Nextq2Next[1]
141+ WriteSet([DataEntry((toString(contextObj.caller) + "_event2DebtForThisPlayer"), event2DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_amount"), betAmount), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
142+ }
143+ else if (if ((betAmount > betThreshold))
144+ then (betMin > betAmount)
145+ else false)
138146 then {
139- let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + ((q2 * betAmount) / 100))
140- let debtAmount2New = ((debtAmount2 + betAmount) - ((q2 * betAmount) / 100))
147+ let q2Corrected = calcCoefIfBigBet("q2_next", betAmount)
148+ let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2Corrected * betAmount))
149+ let debtAmount2New = (debtAmount2 - (q2Corrected * betAmount))
141150 let debtAmount1New = (debtAmount1 + betAmount)
142151 let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
143152 let q1Next = q1Nextq2Next[0]
144153 let q2Next = q1Nextq2Next[1]
145- WriteSet([DataEntry((toString(contextObj.caller) + "_event2DebtForThisPlayer"), event2DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("debtAmount1", debtAmount1New), DataEntry("debtAmount2", debtAmount2New), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
154+ WriteSet([DataEntry((toString(contextObj.caller) + "_event2DebtForThisPlayer"), event2DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_amount"), betAmount), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
146155 }
147- else if (if ((betAmount > betThreshold))
148- then (betMax > betAmount)
149- else false)
150- then {
151- let q2Corrected = calcCoefIfBigBet("q2_next", betAmount, q2)
152- let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + ((q2Corrected * betAmount) / 100))
153- let debtAmount2New = ((debtAmount2 + betAmount) - ((q2Corrected * betAmount) / 100))
154- let debtAmount1New = (debtAmount1 + betAmount)
155- let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
156- let q1Next = q1Nextq2Next[0]
157- let q2Next = q1Nextq2Next[1]
158- WriteSet([DataEntry((toString(contextObj.caller) + "_event2DebtForThisPlayer"), event2DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry((toString(countNew) + "_Correctedqoef2"), q2Corrected), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry("debtAmount1", debtAmount1New), DataEntry("debtAmount2", debtAmount2New), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
159- }
160- else throw("incorrect bet amount")
161- else throw("incorrect event id")
156+ else throw("incorrect bet amount")
162157 }
163158
164159
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let q1start = 190
55
66 let q2start = 190
77
88 let vig = 52
99
1010 let riskAmount = 1000
1111
1212 let betThreshold = 10
1313
1414 let betMin = 1
1515
1616 let betMax = 100
1717
1818 func q1Extract () = {
19- let q1 = if (isDefined(getInteger(this, "q1_next")))
19+ let q1 = if (isDefined("q1_next"))
2020 then getIntegerValue(this, "q1_next")
2121 else q1start
2222 q1
2323 }
2424
2525
2626 func q2Extract () = {
27- let q2 = if (isDefined(getInteger(this, "q2_next")))
27+ let q2 = if (isDefined("q2_next"))
2828 then getIntegerValue(this, "q2_next")
2929 else q2start
3030 q2
3131 }
3232
3333
3434 func debtAmount1Extract () = {
35- let debtAmount1 = if (isDefined(getInteger(this, "debtAmount1")))
35+ let debtAmount1 = if (isDefined("debtAmount1"))
3636 then getIntegerValue(this, "debtAmount1")
3737 else 0
3838 debtAmount1
3939 }
4040
4141
4242 func debtAmount2Extract () = {
43- let debtAmount2 = if (isDefined(getInteger(this, "debtAmount2")))
43+ let debtAmount2 = if (isDefined("debtAmount2"))
4444 then getIntegerValue(this, "debtAmount2")
4545 else 0
4646 debtAmount2
4747 }
4848
4949
50-func calcCoefIfBigBet (event,betAmount,q) = {
50+func calcCoefIfBigBet (event,betAmount) = {
51+ let q = getIntegerValue(this, event)
5152 let k = (((1 * 100000) - (q * 1000)) / (betMax - betThreshold))
5253 let b = ((1 * 100000) - (k * betMax))
5354 let qCorrected = (((betAmount * k) + b) / 1000)
5455 qCorrected
5556 }
5657
5758
5859 func anothercoef (q,vig) = {
5960 let anothercoef = pow(((vig + 1000) - (100000 / q)), 0, -1, 0, 5, DOWN)
6061 anothercoef
6162 }
6263
6364
6465 func actualNewCoefs (betAmount,debtAmount1,debtAmount2) = if ((0 > debtAmount1))
6566 then {
6667 let k = (((1 * 1000000) - (q1start * 10000)) / riskAmount)
6768 let b = ((1 * 1000000) - (k * riskAmount))
68- let q1 = (((-(k) * debtAmount1) + b) / 10000)
69+ let q1 = ((-(k) * debtAmount1) + (b / 1000))
6970 let q2 = anothercoef(q1, vig)
7071 [q1, q2]
7172 }
7273 else if ((debtAmount1 > 0))
7374 then {
74- let k = (((1 * 1000000) - (q2start * 10000)) / riskAmount)
75+ let k = (((1 * 1000000) - (q1start * 10000)) / riskAmount)
7576 let b = ((1 * 1000000) - (k * riskAmount))
76- let q2 = (((-(k) * debtAmount2) + b) / 10000)
77+ let q2 = ((-(k) * debtAmount2) + (b / 1000))
7778 let q1 = anothercoef(q2, vig)
7879 [q1, q2]
7980 }
8081 else {
8182 let q1 = q1start
8283 let q2 = q2start
8384 [q1, q2]
8485 }
8586
8687
8788 @Callable(contextObj)
8889 func bet (event) = {
8990 let betAmount = match contextObj.payment {
9091 case p: AttachedPayment =>
9192 if ((betMin > p.amount))
9293 then throw("low payment")
9394 else p.amount
9495 case _ =>
9596 throw("Payment not attached")
9697 }
97- let count = if (isDefined(getInteger(this, "count")))
98+ let count = if (isDefined("count"))
9899 then getIntegerValue(this, "count")
99100 else 0
100- let event1DebtForThisPlayer = if (isDefined(getInteger(this, (toString(contextObj.caller) + "_event1DebtForThisPlayer"))))
101- then getIntegerValue(this, (toString(contextObj.caller) + "_event1DebtForThisPlayer"))
102- else 0
103- let event2DebtForThisPlayer = if (isDefined(getInteger(this, (toString(contextObj.caller) + "_event2DebtForThisPlayer"))))
104- then getIntegerValue(this, (toString(contextObj.caller) + "_event2DebtForThisPlayer"))
105- else 0
101+ let event1DebtForThisPlayer = getIntegerValue(this, (toString(contextObj.caller) + "_event1DebtForThisPlayer"))
102+ let event2DebtForThisPlayer = getIntegerValue(this, (toString(contextObj.caller) + "_event2DebtForThisPlayer"))
106103 let debtAmount1 = debtAmount1Extract()
107104 let debtAmount2 = debtAmount2Extract()
108105 let q1 = q1Extract()
109106 let q2 = q2Extract()
110107 let countNew = (count + 1)
111108 if ((event == 1))
112- then if ((betThreshold >= betAmount))
109+ then if ((betThreshold > betAmount))
113110 then {
114- let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + ((q1 * betAmount) / 100))
115- let debtAmount1New = ((debtAmount1 + betAmount) - ((q1 * betAmount) / 100))
111+ let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1 * betAmount))
112+ let debtAmount1New = (debtAmount1 - (q1 * betAmount))
116113 let debtAmount2New = (debtAmount2 + betAmount)
117114 let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
118115 let q1Next = q1Nextq2Next[0]
119116 let q2Next = q1Nextq2Next[1]
120- WriteSet([DataEntry((toString(contextObj.caller) + "_event1DebtForThisPlayer"), event1DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry("debtAmount1", debtAmount1New), DataEntry("debtAmount2", debtAmount2New), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
117+ WriteSet([DataEntry((toString(contextObj.caller) + "_event1DebtForThisPlayer"), event1DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_amount"), betAmount), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
121118 }
122119 else if (if ((betAmount > betThreshold))
123120 then (betMax > betAmount)
124121 else false)
125122 then {
126- let q1Corrected = calcCoefIfBigBet("q1_next", betAmount, q1)
127- let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + ((q1Corrected * betAmount) / 100))
128- let debtAmount1New = ((debtAmount1 + betAmount) - ((q1Corrected * betAmount) / 100))
123+ let q1Corrected = calcCoefIfBigBet("q1_next", betAmount)
124+ let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1Corrected * betAmount))
125+ let debtAmount1New = (debtAmount1 - (q1Corrected * betAmount))
129126 let debtAmount2New = (debtAmount2 + betAmount)
130127 let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
131128 let q1Next = q1Nextq2Next[0]
132129 let q2Next = q1Nextq2Next[1]
133- WriteSet([DataEntry((toString(contextObj.caller) + "_event1DebtForThisPlayer"), event1DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_Correctedqoef1"), q1Corrected), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("debtAmount1", debtAmount1New), DataEntry("debtAmount2", debtAmount2New), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
130+ WriteSet([DataEntry((toString(contextObj.caller) + "_event1DebtForThisPlayer"), event1DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_amount"), betAmount), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
134131 }
135132 else throw("incorrect bet amount")
136- else if ((event == 2))
137- then if ((betThreshold >= betAmount))
133+ else if ((betThreshold > betAmount))
134+ then {
135+ let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2 * betAmount))
136+ let debtAmount2New = (debtAmount2 - (q2 * betAmount))
137+ let debtAmount1New = (debtAmount1 + betAmount)
138+ let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
139+ let q1Next = q1Nextq2Next[0]
140+ let q2Next = q1Nextq2Next[1]
141+ WriteSet([DataEntry((toString(contextObj.caller) + "_event2DebtForThisPlayer"), event2DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_amount"), betAmount), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
142+ }
143+ else if (if ((betAmount > betThreshold))
144+ then (betMin > betAmount)
145+ else false)
138146 then {
139- let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + ((q2 * betAmount) / 100))
140- let debtAmount2New = ((debtAmount2 + betAmount) - ((q2 * betAmount) / 100))
147+ let q2Corrected = calcCoefIfBigBet("q2_next", betAmount)
148+ let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2Corrected * betAmount))
149+ let debtAmount2New = (debtAmount2 - (q2Corrected * betAmount))
141150 let debtAmount1New = (debtAmount1 + betAmount)
142151 let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
143152 let q1Next = q1Nextq2Next[0]
144153 let q2Next = q1Nextq2Next[1]
145- WriteSet([DataEntry((toString(contextObj.caller) + "_event2DebtForThisPlayer"), event2DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("debtAmount1", debtAmount1New), DataEntry("debtAmount2", debtAmount2New), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
154+ WriteSet([DataEntry((toString(contextObj.caller) + "_event2DebtForThisPlayer"), event2DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_amount"), betAmount), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
146155 }
147- else if (if ((betAmount > betThreshold))
148- then (betMax > betAmount)
149- else false)
150- then {
151- let q2Corrected = calcCoefIfBigBet("q2_next", betAmount, q2)
152- let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + ((q2Corrected * betAmount) / 100))
153- let debtAmount2New = ((debtAmount2 + betAmount) - ((q2Corrected * betAmount) / 100))
154- let debtAmount1New = (debtAmount1 + betAmount)
155- let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New)
156- let q1Next = q1Nextq2Next[0]
157- let q2Next = q1Nextq2Next[1]
158- WriteSet([DataEntry((toString(contextObj.caller) + "_event2DebtForThisPlayer"), event2DebtForThisPlayerNew), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry((toString(countNew) + "_Correctedqoef2"), q2Corrected), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry("debtAmount1", debtAmount1New), DataEntry("debtAmount2", debtAmount2New), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)])
159- }
160- else throw("incorrect bet amount")
161- else throw("incorrect event id")
156+ else throw("incorrect bet amount")
162157 }
163158
164159
165160
166161 @Callable(contextObj)
167162 func withdraw () = {
168163 let event1amount = match getInteger(this, (toString(contextObj.caller) + "__event1DebtForThisPlayer")) {
169164 case u: Unit =>
170165 0
171166 case i: Int =>
172167 i
173168 case _ =>
174169 throw()
175170 }
176171 let event2amount = match getInteger(this, (toString(contextObj.caller) + "__event2DebtForThisPlayer")) {
177172 case u: Unit =>
178173 0
179174 case i: Int =>
180175 i
181176 case _ =>
182177 throw()
183178 }
184179 let event1 = match getBoolean(this, "result_event_1") {
185180 case u: Unit =>
186181 false
187182 case b: Boolean =>
188183 b
189184 case _ =>
190185 throw()
191186 }
192187 let event2 = match getBoolean(this, "result_event_2") {
193188 case u: Unit =>
194189 false
195190 case b: Boolean =>
196191 b
197192 case _ =>
198193 throw()
199194 }
200195 if (event1)
201196 then ScriptResult(WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), 0)]), TransferSet([ScriptTransfer(contextObj.caller, (event1amount * 1000000), unit)]))
202197 else if (event2)
203198 then ScriptResult(WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), 0)]), TransferSet([ScriptTransfer(contextObj.caller, (event2amount * 1000000), unit)]))
204199 else throw("event did not happen or you have zero win")
205200 }
206201
207202

github/deemru/w8io/169f3d6 
55.54 ms