tx · AdatC7QK1mHr3CbVVKfeAjbewyn7keqJ1U1JZs1ikHrH

3N3AeA5FWm7EHheHoik8BBEA3GXXJosnVY8:  -0.01400000 Waves

2019.11.07 16:44 [754589] smart account 3N3AeA5FWm7EHheHoik8BBEA3GXXJosnVY8 > SELF 0.00000000 Waves

{ "type": 13, "id": "AdatC7QK1mHr3CbVVKfeAjbewyn7keqJ1U1JZs1ikHrH", "fee": 1400000, "feeAssetId": null, "timestamp": 1573134350833, "version": 1, "sender": "3N3AeA5FWm7EHheHoik8BBEA3GXXJosnVY8", "senderPublicKey": "87US7E5SdpUB7rbkzLmEUKfYg7uihzCvRzEKy1mCNNjq", "proofs": [ "4PR6tNSWi5UMe8VXBuN7UDLDZ4eQnCkEUDbcBmy5wCNojYEpyNTztEyoAgPApQdRnmXWinDzd5FyQnpsTHy8Enhh" ], "script": "base64:AAIDAAAAAAAAAAkIARIDCgEBEgAAAAAGAAAAAAdxMXN0YXJ0AAAAAAAAAAC+AAAAAAdxMnN0YXJ0AAAAAAAAAAC+AAAAAAN2aWcAAAAAAAAAADQAAAAAAXMAAAAAAAAAAAoBAAAABGNvZWYAAAACAAAAAXEAAAADZGlmBAAAAARjb2VmCQAAaQAAAAIJAABoAAAAAgUAAAABcQkAAGQAAAACCQAAaAAAAAIJAABoAAAAAgD/////////0QUAAAADZGlmBQAAAANkaWYAAAAAAAAAJxAAAAAAAAAAJxAFAAAABGNvZWYBAAAAC2Fub3RoZXJjb2VmAAAAAgAAAAFxAAAAA2RpZgQAAAAJYWN0dWFsdmlnCQAAaQAAAAIJAABoAAAAAgUAAAADdmlnCQAAZAAAAAIJAABkAAAAAgkAAGgAAAACCQAAaAAAAAIA/////////6EFAAAAA2RpZgUAAAADZGlmCQAAaAAAAAIAAAAAAAAAB1UFAAAAA2RpZgAAAAAAAAAnEAAAAAAAAAAnEAQAAAALYW5vdGhlcmNvZWYJAABsAAAABgkAAGUAAAACCQAAZAAAAAIFAAAACWFjdHVhbHZpZwAAAAAAA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50MWFtb3VudAAAAAAAAA9CQAUAAAAEdW5pdAUAAAADbmlsAwUAAAAGZXZlbnQyCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQAEJQAAAAEIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgIAAAANX2V2ZW50MmFtb3VudAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgkAAGgAAAACBQAAAAxldmVudDJhbW91bnQAAAAAAAAPQkAFAAAABHVuaXQFAAAAA25pbAkAAAIAAAABAgAAAClldmVudCBkaWQgbm90IGhhcHBlbiBvciB5b3UgaGF2ZSB6ZXJvIHdpbgAAAABdFnvA", "chainId": 84, "height": 754589, "spentComplexity": 0 } View: original | compacted Prev: EEpGX8hqMZPANk91BgqiirocZgPumkJbQvD3GWkuAx7Q Next: HaFEZJKiX6ZjEPFGKkLmiCVGtCy4csMCPucNsL5oQsLo Diff:
OldNewDifferences
5454 case _ =>
5555 throw()
5656 }
57+ let kosylForCoef1 = match getInteger(this, "q1_next") {
58+ case u: Unit =>
59+ 0
60+ case i: Int =>
61+ i
62+ case _ =>
63+ throw()
64+ }
65+ let kosylforcoef2 = match getInteger(this, "q2_next") {
66+ case u: Unit =>
67+ 0
68+ case i: Int =>
69+ i
70+ case _ =>
71+ throw()
72+ }
5773 let dif = if ((event == 1))
5874 then (difold + 1)
5975 else (difold - 1)
7591 then throw(("to low coef q1 = " + toString(q1)))
7692 else {
7793 let nNew = (n + 1)
78- WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), (event1amount + q1)), 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("n", nNew), DataEntry("count", countNew)])
94+ WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), (event1amount + q1)), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), kosylforcoef2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1next), DataEntry("q2_next", q2next), DataEntry("n", nNew), DataEntry("count", countNew)])
7995 }
8096 else if ((100 > q2))
8197 then throw(("to low coef q2 = " + toString(q2)))
8298 else {
8399 let mNew = (m + 1)
84- WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), (event2amount + q2)), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1next), DataEntry("q2_next", q2next), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry("m", mNew), DataEntry("count", countNew)])
100+ WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), (event2amount + q2)), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), kosylForCoef1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1next), DataEntry("q2_next", q2next), DataEntry("m", mNew), DataEntry("count", countNew)])
85101 }
86102 }
87103
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 s = 10
1111
1212 func coef (q,dif) = {
1313 let coef = ((q * (((-47 * dif) * dif) + 10000)) / 10000)
1414 coef
1515 }
1616
1717
1818 func anothercoef (q,dif) = {
1919 let actualvig = ((vig * ((((-95 * dif) * dif) + (1877 * dif)) + 10000)) / 10000)
2020 let anothercoef = pow(((actualvig + 1000) - (100000 / q)), 0, -1, 0, 5, DOWN)
2121 if ((anothercoef > 270))
2222 then 270
2323 else anothercoef
2424 }
2525
2626
2727 @Callable(contextObj)
2828 func bet (event) = {
2929 let payment = match contextObj.payment {
3030 case p: AttachedPayment =>
3131 if ((100000000 > p.amount))
3232 then throw("low payment")
3333 else p
3434 case _ =>
3535 throw("Paymx`ent not attached")
3636 }
3737 let n = getIntegerValue(this, "n")
3838 let m = getIntegerValue(this, "m")
3939 let count = getIntegerValue(this, "count")
4040 let difold = (n - m)
4141 let event1amount = match getInteger(this, (toString(contextObj.caller) + "_event1amount")) {
4242 case u: Unit =>
4343 0
4444 case i: Int =>
4545 i
4646 case _ =>
4747 throw()
4848 }
4949 let event2amount = match getInteger(this, (toString(contextObj.caller) + "_event2amount")) {
5050 case u: Unit =>
5151 0
5252 case i: Int =>
5353 i
5454 case _ =>
5555 throw()
5656 }
57+ let kosylForCoef1 = match getInteger(this, "q1_next") {
58+ case u: Unit =>
59+ 0
60+ case i: Int =>
61+ i
62+ case _ =>
63+ throw()
64+ }
65+ let kosylforcoef2 = match getInteger(this, "q2_next") {
66+ case u: Unit =>
67+ 0
68+ case i: Int =>
69+ i
70+ case _ =>
71+ throw()
72+ }
5773 let dif = if ((event == 1))
5874 then (difold + 1)
5975 else (difold - 1)
6076 let q1 = if ((dif >= 0))
6177 then coef(q1start, dif)
6278 else anothercoef(coef(q2start, dif), dif)
6379 let q2 = if ((dif >= 0))
6480 then anothercoef(coef(q1start, dif), dif)
6581 else coef(q2start, dif)
6682 let q1next = if (((dif + 1) >= 0))
6783 then coef(q1start, (dif + 1))
6884 else anothercoef(coef(q2start, (dif + 1)), (dif + 1))
6985 let q2next = if (((dif - 1) >= 0))
7086 then anothercoef(coef(q1start, (dif - 1)), (dif - 1))
7187 else coef(q2start, (dif - 1))
7288 let countNew = (count + 1)
7389 if ((event == 1))
7490 then if ((100 > q1))
7591 then throw(("to low coef q1 = " + toString(q1)))
7692 else {
7793 let nNew = (n + 1)
78- WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), (event1amount + q1)), 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("n", nNew), DataEntry("count", countNew)])
94+ WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), (event1amount + q1)), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry((toString(countNew) + "_qoef2"), kosylforcoef2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1next), DataEntry("q2_next", q2next), DataEntry("n", nNew), DataEntry("count", countNew)])
7995 }
8096 else if ((100 > q2))
8197 then throw(("to low coef q2 = " + toString(q2)))
8298 else {
8399 let mNew = (m + 1)
84- WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), (event2amount + q2)), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1next), DataEntry("q2_next", q2next), DataEntry((toString(countNew) + "_qoef1"), q1), DataEntry("m", mNew), DataEntry("count", countNew)])
100+ WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), (event2amount + q2)), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), kosylForCoef1), DataEntry((toString(countNew) + "_qoef2"), q2), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1next), DataEntry("q2_next", q2next), DataEntry("m", mNew), DataEntry("count", countNew)])
85101 }
86102 }
87103
88104
89105
90106 @Callable(contextObj)
91107 func withdraw () = {
92108 let event1amount = match getInteger(this, (toString(contextObj.caller) + "_event1amount")) {
93109 case u: Unit =>
94110 0
95111 case i: Int =>
96112 i
97113 case _ =>
98114 throw()
99115 }
100116 let event2amount = match getInteger(this, (toString(contextObj.caller) + "_event2amount")) {
101117 case u: Unit =>
102118 0
103119 case i: Int =>
104120 i
105121 case _ =>
106122 throw()
107123 }
108124 let event1 = match getBoolean(this, "result_event_1") {
109125 case u: Unit =>
110126 false
111127 case b: Boolean =>
112128 b
113129 case _ =>
114130 throw()
115131 }
116132 let event2 = match getBoolean(this, "result_event_2") {
117133 case u: Unit =>
118134 false
119135 case b: Boolean =>
120136 b
121137 case _ =>
122138 throw()
123139 }
124140 if (event1)
125141 then ScriptResult(WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), 0)]), TransferSet([ScriptTransfer(contextObj.caller, (event1amount * 1000000), unit)]))
126142 else if (event2)
127143 then ScriptResult(WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), 0)]), TransferSet([ScriptTransfer(contextObj.caller, (event2amount * 1000000), unit)]))
128144 else throw("event did not happen or you have zero win")
129145 }
130146
131147

github/deemru/w8io/169f3d6 
60.39 ms