tx · 2m8wDJ2sCNbyeicSsCjaP4DxZu7aPJpwwVDnUhvdjKUM 3N6UbaxTBjMS5jZmJ9cxqX3YGfe7bsQAzyn: -0.01400000 Waves 2020.01.04 16:53 [839220] smart account 3N6UbaxTBjMS5jZmJ9cxqX3YGfe7bsQAzyn > SELF 0.00000000 Waves
{ "type": 13, "id": "2m8wDJ2sCNbyeicSsCjaP4DxZu7aPJpwwVDnUhvdjKUM", "fee": 1400000, "feeAssetId": null, "timestamp": 1578146029324, "version": 1, "sender": "3N6UbaxTBjMS5jZmJ9cxqX3YGfe7bsQAzyn", "senderPublicKey": "6ZjaNmnAvx6D1PtkZEHppdJPoEJ9mhBhRTq8fcTT59Xd", "proofs": [ "44HWgKMv7AHRD8rEHmoWRp3wmi2kBTpuHjJ6uKGRz5GnqE3F11xgzpzfpjZH67K57ag4Y3LJvYfG8LoZcXWwXQTz" ], "script": "base64:AAIDAAAAAAAAAAkIARIDCgEBEgAAAAAOAAAAAAdxMXN0YXJ0AAAAAAAAAAC+AAAAAAdxMnN0YXJ0AAAAAAAAAAC+AAAAAAN2aWcAAAAAAAAAADQAAAAACnJpc2tBbW91bnQAAAAAAAAAA+gAAAAADGJldFRocmVzaG9sZAAAAAAAAAAACgAAAAAGYmV0TWluAAAAAAAAAAACAAAAAAZiZXRNYXgAAAAAAAAAAGQBAAAACXExRXh0cmFjdAAAAAAEAAAAAnExAwkBAAAACWlzRGVmaW5lZAAAAAEJAAQaAAAAAgUAAAAEdGhpcwIAAAAHcTFfbmV4dAUAAAAHcTFzdGFydAUAAAAHcTFzdGFydAUAAAACcTEBAAAACXEyRXh0cmFjdAAAAAAEAAAAAnEyAwkBAAAACWlzRGVmaW5lZAAAAAEJAAQaAAAAAgUAAAAEdGhpcwIAAAAHcTJfbmV4dAUAAAAHcTJzdGFydAUAAAAHcTJzdGFydAUAAAACcTIBAAAAEmRlYnRBbW91bnQxRXh0cmFjdAAAAAAEAAAAC2RlYnRBbW91bnQxAwkBAAAACWlzRGV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zIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQEAAAAAXUFAAAAByRtYXRjaDAHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiCQEAAAAFdGhyb3cAAAAAAwUAAAAGZXZlbnQxCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQAEJQAAAAEIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgIAAAANX2V2ZW50MWFtb3VudAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgkAAGgAAAACBQAAAAxldmVudDFhbW91bnQAAAAAAAAPQkAFAAAABHVuaXQFAAAAA25pbAMFAAAABmV2ZW50MgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkABCUAAAABCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXICAAAADV9ldmVudDJhbW91bnQAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIJAABoAAAAAgUAAAAMZXZlbnQyYW1vdW50AAAAAAAAD0JABQAAAAR1bml0BQAAAANuaWwJAAACAAAAAQIAAAApZXZlbnQgZGlkIG5vdCBoYXBwZW4gb3IgeW91IGhhdmUgemVybyB3aW4AAAAAvsc+Tg==", "chainId": 84, "height": 839220, "spentComplexity": 0 } View: original | compacted Prev: CyJeQeS9BdMEq4kFj1jMji1RJquPsCkuUTdCNnvBHT4N Next: GiFC5HqdAjRkDAN2Hvi5GrF2nkQaEEvzTMRyDiMdmXof Diff:
Old | New | Differences | |
---|---|---|---|
107 | 107 | let debtAmount1 = debtAmount1Extract() | |
108 | 108 | let debtAmount2 = debtAmount2Extract() | |
109 | 109 | let q1 = q1Extract() | |
110 | - | let q2 = q2Extract() | |
111 | - | let countNew = (count + 1) | |
112 | - | if ((event == 1)) | |
113 | - | then if ((betThreshold >= betAmount)) | |
114 | - | then { | |
115 | - | let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1 * betAmount)) | |
116 | - | let debtAmount1New = (debtAmount1 - (q1 * betAmount)) | |
117 | - | let debtAmount2New = (debtAmount2 + betAmount) | |
118 | - | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
119 | - | let q1Next = q1Nextq2Next[0] | |
120 | - | let q2Next = q1Nextq2Next[1] | |
121 | - | 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) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
122 | - | } | |
123 | - | else if (if ((betAmount > betThreshold)) | |
124 | - | then (betMax > betAmount) | |
125 | - | else false) | |
126 | - | then { | |
127 | - | let q1Corrected = calcCoefIfBigBet("q1_next", betAmount) | |
128 | - | let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1Corrected * betAmount)) | |
129 | - | let debtAmount1New = (debtAmount1 - (q1Corrected * betAmount)) | |
130 | - | let debtAmount2New = (debtAmount2 + betAmount) | |
131 | - | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
132 | - | let q1Next = q1Nextq2Next[0] | |
133 | - | let q2Next = q1Nextq2Next[1] | |
134 | - | 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) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
135 | - | } | |
136 | - | else throw("incorrect bet amount") | |
137 | - | else if ((betThreshold >= betAmount)) | |
138 | - | then { | |
139 | - | let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2 * betAmount)) | |
140 | - | let debtAmount2New = (debtAmount2 - (q2 * betAmount)) | |
141 | - | let debtAmount1New = (debtAmount1 + betAmount) | |
142 | - | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
143 | - | let q1Next = q1Nextq2Next[0] | |
144 | - | 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("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
146 | - | } | |
147 | - | else if (if ((betAmount > betThreshold)) | |
148 | - | then (betMin > betAmount) | |
149 | - | else false) | |
150 | - | then { | |
151 | - | let q2Corrected = calcCoefIfBigBet("q2_next", betAmount) | |
152 | - | let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2Corrected * betAmount)) | |
153 | - | let debtAmount2New = (debtAmount2 - (q2Corrected * betAmount)) | |
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) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
159 | - | } | |
160 | - | else throw("incorrect bet amount") | |
110 | + | if (true) | |
111 | + | then throw(toString(q1)) | |
112 | + | else { | |
113 | + | let q2 = q2Extract() | |
114 | + | let countNew = (count + 1) | |
115 | + | if ((event == 1)) | |
116 | + | then if ((betThreshold >= betAmount)) | |
117 | + | then { | |
118 | + | let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1 * betAmount)) | |
119 | + | let debtAmount1New = (debtAmount1 - (q1 * betAmount)) | |
120 | + | let debtAmount2New = (debtAmount2 + betAmount) | |
121 | + | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
122 | + | let q1Next = q1Nextq2Next[0] | |
123 | + | let q2Next = q1Nextq2Next[1] | |
124 | + | 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) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
125 | + | } | |
126 | + | else if (if ((betAmount > betThreshold)) | |
127 | + | then (betMax > betAmount) | |
128 | + | else false) | |
129 | + | then { | |
130 | + | let q1Corrected = calcCoefIfBigBet("q1_next", betAmount) | |
131 | + | let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1Corrected * betAmount)) | |
132 | + | let debtAmount1New = (debtAmount1 - (q1Corrected * betAmount)) | |
133 | + | let debtAmount2New = (debtAmount2 + betAmount) | |
134 | + | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
135 | + | let q1Next = q1Nextq2Next[0] | |
136 | + | let q2Next = q1Nextq2Next[1] | |
137 | + | 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) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
138 | + | } | |
139 | + | else throw("incorrect bet amount") | |
140 | + | else if ((betThreshold >= betAmount)) | |
141 | + | then { | |
142 | + | let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2 * betAmount)) | |
143 | + | let debtAmount2New = (debtAmount2 - (q2 * betAmount)) | |
144 | + | let debtAmount1New = (debtAmount1 + betAmount) | |
145 | + | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
146 | + | let q1Next = q1Nextq2Next[0] | |
147 | + | let q2Next = q1Nextq2Next[1] | |
148 | + | 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("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
149 | + | } | |
150 | + | else if (if ((betAmount > betThreshold)) | |
151 | + | then (betMin > betAmount) | |
152 | + | else false) | |
153 | + | then { | |
154 | + | let q2Corrected = calcCoefIfBigBet("q2_next", betAmount) | |
155 | + | let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2Corrected * betAmount)) | |
156 | + | let debtAmount2New = (debtAmount2 - (q2Corrected * betAmount)) | |
157 | + | let debtAmount1New = (debtAmount1 + betAmount) | |
158 | + | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
159 | + | let q1Next = q1Nextq2Next[0] | |
160 | + | let q2Next = q1Nextq2Next[1] | |
161 | + | 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("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
162 | + | } | |
163 | + | else throw("incorrect bet amount") | |
164 | + | } | |
161 | 165 | } | |
162 | 166 | ||
163 | 167 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let q1start = 190 | |
5 | 5 | ||
6 | 6 | let q2start = 190 | |
7 | 7 | ||
8 | 8 | let vig = 52 | |
9 | 9 | ||
10 | 10 | let riskAmount = 1000 | |
11 | 11 | ||
12 | 12 | let betThreshold = 10 | |
13 | 13 | ||
14 | 14 | let betMin = 2 | |
15 | 15 | ||
16 | 16 | let betMax = 100 | |
17 | 17 | ||
18 | 18 | func q1Extract () = { | |
19 | 19 | let q1 = if (isDefined(getInteger(this, "q1_next"))) | |
20 | 20 | then q1start | |
21 | 21 | else q1start | |
22 | 22 | q1 | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func q2Extract () = { | |
27 | 27 | let q2 = if (isDefined(getInteger(this, "q2_next"))) | |
28 | 28 | then q2start | |
29 | 29 | else q2start | |
30 | 30 | q2 | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func debtAmount1Extract () = { | |
35 | 35 | let debtAmount1 = if (isDefined(getInteger(this, "debtAmount1"))) | |
36 | 36 | then getIntegerValue(this, "debtAmount1") | |
37 | 37 | else 0 | |
38 | 38 | debtAmount1 | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func debtAmount2Extract () = { | |
43 | 43 | let debtAmount2 = if (isDefined(getInteger(this, "debtAmount2"))) | |
44 | 44 | then getIntegerValue(this, "debtAmount2") | |
45 | 45 | else 0 | |
46 | 46 | debtAmount2 | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func calcCoefIfBigBet (event,betAmount) = { | |
51 | 51 | let q = getIntegerValue(this, event) | |
52 | 52 | let k = (((1 * 100000) - (q * 1000)) / (betMax - betThreshold)) | |
53 | 53 | let b = ((1 * 100000) - (k * betMax)) | |
54 | 54 | let qCorrected = (((betAmount * k) + b) / 1000) | |
55 | 55 | qCorrected | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func anothercoef (q,vig) = { | |
60 | 60 | let anothercoef = pow(((vig + 1000) - (100000 / q)), 0, -1, 0, 5, DOWN) | |
61 | 61 | anothercoef | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func actualNewCoefs (betAmount,debtAmount1,debtAmount2) = if ((0 > debtAmount1)) | |
66 | 66 | then { | |
67 | 67 | let k = (((1 * 1000000) - (q1start * 10000)) / riskAmount) | |
68 | 68 | let b = ((1 * 1000000) - (k * riskAmount)) | |
69 | 69 | let q1 = ((-(k) * debtAmount1) + (b / 1000)) | |
70 | 70 | let q2 = anothercoef(q1, vig) | |
71 | 71 | [q1, q2] | |
72 | 72 | } | |
73 | 73 | else if ((debtAmount1 > 0)) | |
74 | 74 | then { | |
75 | 75 | let k = (((1 * 1000000) - (q1start * 10000)) / riskAmount) | |
76 | 76 | let b = ((1 * 1000000) - (k * riskAmount)) | |
77 | 77 | let q2 = ((-(k) * debtAmount2) + (b / 1000)) | |
78 | 78 | let q1 = anothercoef(q2, vig) | |
79 | 79 | [q1, q2] | |
80 | 80 | } | |
81 | 81 | else { | |
82 | 82 | let q1 = q1start | |
83 | 83 | let q2 = q2start | |
84 | 84 | [q1, q2] | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | @Callable(contextObj) | |
89 | 89 | func bet (event) = { | |
90 | 90 | let betAmount = match contextObj.payment { | |
91 | 91 | case p: AttachedPayment => | |
92 | 92 | if ((betMin > p.amount)) | |
93 | 93 | then throw("low payment") | |
94 | 94 | else p.amount | |
95 | 95 | case _ => | |
96 | 96 | throw("Payment not attached") | |
97 | 97 | } | |
98 | 98 | let count = if (isDefined(getInteger(this, "count"))) | |
99 | 99 | then getIntegerValue(this, "count") | |
100 | 100 | else 0 | |
101 | 101 | let event1DebtForThisPlayer = if (isDefined(getInteger(this, (toString(contextObj.caller) + "_event1DebtForThisPlayer")))) | |
102 | 102 | then getIntegerValue(this, (toString(contextObj.caller) + "_event1DebtForThisPlayer")) | |
103 | 103 | else 0 | |
104 | 104 | let event2DebtForThisPlayer = if (isDefined(getInteger(this, (toString(contextObj.caller) + "_event2DebtForThisPlayer")))) | |
105 | 105 | then getIntegerValue(this, (toString(contextObj.caller) + "_event2DebtForThisPlayer")) | |
106 | 106 | else 0 | |
107 | 107 | let debtAmount1 = debtAmount1Extract() | |
108 | 108 | let debtAmount2 = debtAmount2Extract() | |
109 | 109 | let q1 = q1Extract() | |
110 | - | let q2 = q2Extract() | |
111 | - | let countNew = (count + 1) | |
112 | - | if ((event == 1)) | |
113 | - | then if ((betThreshold >= betAmount)) | |
114 | - | then { | |
115 | - | let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1 * betAmount)) | |
116 | - | let debtAmount1New = (debtAmount1 - (q1 * betAmount)) | |
117 | - | let debtAmount2New = (debtAmount2 + betAmount) | |
118 | - | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
119 | - | let q1Next = q1Nextq2Next[0] | |
120 | - | let q2Next = q1Nextq2Next[1] | |
121 | - | 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) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
122 | - | } | |
123 | - | else if (if ((betAmount > betThreshold)) | |
124 | - | then (betMax > betAmount) | |
125 | - | else false) | |
126 | - | then { | |
127 | - | let q1Corrected = calcCoefIfBigBet("q1_next", betAmount) | |
128 | - | let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1Corrected * betAmount)) | |
129 | - | let debtAmount1New = (debtAmount1 - (q1Corrected * betAmount)) | |
130 | - | let debtAmount2New = (debtAmount2 + betAmount) | |
131 | - | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
132 | - | let q1Next = q1Nextq2Next[0] | |
133 | - | let q2Next = q1Nextq2Next[1] | |
134 | - | 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) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
135 | - | } | |
136 | - | else throw("incorrect bet amount") | |
137 | - | else if ((betThreshold >= betAmount)) | |
138 | - | then { | |
139 | - | let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2 * betAmount)) | |
140 | - | let debtAmount2New = (debtAmount2 - (q2 * betAmount)) | |
141 | - | let debtAmount1New = (debtAmount1 + betAmount) | |
142 | - | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
143 | - | let q1Next = q1Nextq2Next[0] | |
144 | - | 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("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
146 | - | } | |
147 | - | else if (if ((betAmount > betThreshold)) | |
148 | - | then (betMin > betAmount) | |
149 | - | else false) | |
150 | - | then { | |
151 | - | let q2Corrected = calcCoefIfBigBet("q2_next", betAmount) | |
152 | - | let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2Corrected * betAmount)) | |
153 | - | let debtAmount2New = (debtAmount2 - (q2Corrected * betAmount)) | |
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) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
159 | - | } | |
160 | - | else throw("incorrect bet amount") | |
110 | + | if (true) | |
111 | + | then throw(toString(q1)) | |
112 | + | else { | |
113 | + | let q2 = q2Extract() | |
114 | + | let countNew = (count + 1) | |
115 | + | if ((event == 1)) | |
116 | + | then if ((betThreshold >= betAmount)) | |
117 | + | then { | |
118 | + | let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1 * betAmount)) | |
119 | + | let debtAmount1New = (debtAmount1 - (q1 * betAmount)) | |
120 | + | let debtAmount2New = (debtAmount2 + betAmount) | |
121 | + | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
122 | + | let q1Next = q1Nextq2Next[0] | |
123 | + | let q2Next = q1Nextq2Next[1] | |
124 | + | 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) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
125 | + | } | |
126 | + | else if (if ((betAmount > betThreshold)) | |
127 | + | then (betMax > betAmount) | |
128 | + | else false) | |
129 | + | then { | |
130 | + | let q1Corrected = calcCoefIfBigBet("q1_next", betAmount) | |
131 | + | let event1DebtForThisPlayerNew = (event1DebtForThisPlayer + (q1Corrected * betAmount)) | |
132 | + | let debtAmount1New = (debtAmount1 - (q1Corrected * betAmount)) | |
133 | + | let debtAmount2New = (debtAmount2 + betAmount) | |
134 | + | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
135 | + | let q1Next = q1Nextq2Next[0] | |
136 | + | let q2Next = q1Nextq2Next[1] | |
137 | + | 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) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
138 | + | } | |
139 | + | else throw("incorrect bet amount") | |
140 | + | else if ((betThreshold >= betAmount)) | |
141 | + | then { | |
142 | + | let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2 * betAmount)) | |
143 | + | let debtAmount2New = (debtAmount2 - (q2 * betAmount)) | |
144 | + | let debtAmount1New = (debtAmount1 + betAmount) | |
145 | + | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
146 | + | let q1Next = q1Nextq2Next[0] | |
147 | + | let q2Next = q1Nextq2Next[1] | |
148 | + | 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("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
149 | + | } | |
150 | + | else if (if ((betAmount > betThreshold)) | |
151 | + | then (betMin > betAmount) | |
152 | + | else false) | |
153 | + | then { | |
154 | + | let q2Corrected = calcCoefIfBigBet("q2_next", betAmount) | |
155 | + | let event2DebtForThisPlayerNew = (event2DebtForThisPlayer + (q2Corrected * betAmount)) | |
156 | + | let debtAmount2New = (debtAmount2 - (q2Corrected * betAmount)) | |
157 | + | let debtAmount1New = (debtAmount1 + betAmount) | |
158 | + | let q1Nextq2Next = actualNewCoefs(betAmount, debtAmount1New, debtAmount2New) | |
159 | + | let q1Next = q1Nextq2Next[0] | |
160 | + | let q2Next = q1Nextq2Next[1] | |
161 | + | 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("q1_next", q1Next), DataEntry("q2_next", q2Next), DataEntry("count", countNew)]) | |
162 | + | } | |
163 | + | else throw("incorrect bet amount") | |
164 | + | } | |
161 | 165 | } | |
162 | 166 | ||
163 | 167 | ||
164 | 168 | ||
165 | 169 | @Callable(contextObj) | |
166 | 170 | func withdraw () = { | |
167 | 171 | let event1amount = match getInteger(this, (toString(contextObj.caller) + "__event1DebtForThisPlayer")) { | |
168 | 172 | case u: Unit => | |
169 | 173 | 0 | |
170 | 174 | case i: Int => | |
171 | 175 | i | |
172 | 176 | case _ => | |
173 | 177 | throw() | |
174 | 178 | } | |
175 | 179 | let event2amount = match getInteger(this, (toString(contextObj.caller) + "__event2DebtForThisPlayer")) { | |
176 | 180 | case u: Unit => | |
177 | 181 | 0 | |
178 | 182 | case i: Int => | |
179 | 183 | i | |
180 | 184 | case _ => | |
181 | 185 | throw() | |
182 | 186 | } | |
183 | 187 | let event1 = match getBoolean(this, "result_event_1") { | |
184 | 188 | case u: Unit => | |
185 | 189 | false | |
186 | 190 | case b: Boolean => | |
187 | 191 | b | |
188 | 192 | case _ => | |
189 | 193 | throw() | |
190 | 194 | } | |
191 | 195 | let event2 = match getBoolean(this, "result_event_2") { | |
192 | 196 | case u: Unit => | |
193 | 197 | false | |
194 | 198 | case b: Boolean => | |
195 | 199 | b | |
196 | 200 | case _ => | |
197 | 201 | throw() | |
198 | 202 | } | |
199 | 203 | if (event1) | |
200 | 204 | then ScriptResult(WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), 0)]), TransferSet([ScriptTransfer(contextObj.caller, (event1amount * 1000000), unit)])) | |
201 | 205 | else if (event2) | |
202 | 206 | then ScriptResult(WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), 0)]), TransferSet([ScriptTransfer(contextObj.caller, (event2amount * 1000000), unit)])) | |
203 | 207 | else throw("event did not happen or you have zero win") | |
204 | 208 | } | |
205 | 209 | ||
206 | 210 |
github/deemru/w8io/169f3d6 55.12 ms ◑