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
6969 }
7070 else throw()
7171 }
72+ let w = {
73+ let m = getInteger(this, "q1_next")
74+ if ($isInstanceOf(m, "Unit"))
75+ then {
76+ let t = m
77+ 0
78+ }
79+ else if ($isInstanceOf(m, "Int"))
80+ then {
81+ let u = m
82+ u
83+ }
84+ else throw()
85+ }
86+ let x = {
87+ let m = getInteger(this, "q2_next")
88+ if ($isInstanceOf(m, "Unit"))
89+ then {
90+ let t = m
91+ 0
92+ }
93+ else if ($isInstanceOf(m, "Int"))
94+ then {
95+ let u = m
96+ u
97+ }
98+ else throw()
99+ }
72100 let g = if ((k == 1))
73101 then (r + 1)
74102 else (r - 1)
75- let w = if ((g >= 0))
103+ let y = if ((g >= 0))
76104 then e(a, g)
77105 else h(e(b, g), g)
78- let x = if ((g >= 0))
106+ let z = if ((g >= 0))
79107 then h(e(a, g), g)
80108 else e(b, g)
81- let y = if (((g + 1) >= 0))
109+ let A = if (((g + 1) >= 0))
82110 then e(a, (g + 1))
83111 else h(e(b, (g + 1)), (g + 1))
84- let z = if (((g - 1) >= 0))
112+ let B = if (((g - 1) >= 0))
85113 then h(e(a, (g - 1)), (g - 1))
86114 else e(b, (g - 1))
87- let A = (q + 1)
115+ let C = (q + 1)
88116 if ((k == 1))
89- then if ((100 > w))
90- then throw(("to low coef q1 = " + toString(w)))
117+ then if ((100 > y))
118+ then throw(("to low coef q1 = " + toString(y)))
91119 else {
92- let B = (o + 1)
93- WriteSet([DataEntry((toString(j.caller) + "_event1amount"), (s + w)), DataEntry((toString(A) + "_event"), k), DataEntry((toString(A) + "_qoef1"), w), DataEntry((toString(A) + "_qoef2"), x), DataEntry((toString(A) + "_bettor"), toString(j.caller)), DataEntry("q1_next", y), DataEntry("q2_next", z), DataEntry("n", B), DataEntry("count", A)])
120+ let D = (o + 1)
121+ WriteSet([DataEntry((toString(j.caller) + "_event1amount"), (s + y)), DataEntry((toString(C) + "_event"), k), DataEntry((toString(C) + "_qoef1"), y), DataEntry((toString(C) + "_qoef2"), x), DataEntry((toString(C) + "_bettor"), toString(j.caller)), DataEntry("q1_next", A), DataEntry("q2_next", B), DataEntry("n", D), DataEntry("count", C)])
94122 }
95- else if ((100 > x))
96- then throw(("to low coef q2 = " + toString(x)))
123+ else if ((100 > z))
124+ then throw(("to low coef q2 = " + toString(z)))
97125 else {
98- let C = (p + 1)
99- WriteSet([DataEntry((toString(j.caller) + "_event2amount"), (v + x)), DataEntry((toString(A) + "_event"), k), DataEntry((toString(A) + "_qoef2"), x), DataEntry((toString(A) + "_bettor"), toString(j.caller)), DataEntry("q1_next", y), DataEntry("q2_next", z), DataEntry((toString(A) + "_qoef1"), w), DataEntry("m", C), DataEntry("count", A)])
126+ let E = (p + 1)
127+ WriteSet([DataEntry((toString(j.caller) + "_event2amount"), (v + z)), DataEntry((toString(C) + "_event"), k), DataEntry((toString(C) + "_qoef1"), w), DataEntry((toString(C) + "_qoef2"), z), DataEntry((toString(C) + "_bettor"), toString(j.caller)), DataEntry("q1_next", A), DataEntry("q2_next", B), DataEntry("m", E), DataEntry("count", C)])
100128 }
101129 }
102130
132160 }
133161 else throw()
134162 }
135- let D = {
163+ let F = {
136164 let m = getBoolean(this, "result_event_1")
137165 if ($isInstanceOf(m, "Unit"))
138166 then {
141169 }
142170 else if ($isInstanceOf(m, "Boolean"))
143171 then {
144- let E = m
145- E
172+ let G = m
173+ G
146174 }
147175 else throw()
148176 }
149- let F = {
177+ let H = {
150178 let m = getBoolean(this, "result_event_2")
151179 if ($isInstanceOf(m, "Unit"))
152180 then {
155183 }
156184 else if ($isInstanceOf(m, "Boolean"))
157185 then {
158- let E = m
159- E
186+ let G = m
187+ G
160188 }
161189 else throw()
162190 }
163- if (D)
191+ if (F)
164192 then ScriptResult(WriteSet([DataEntry((toString(j.caller) + "_event1amount"), 0)]), TransferSet([ScriptTransfer(j.caller, (s * 1000000), unit)]))
165- else if (F)
193+ else if (H)
166194 then ScriptResult(WriteSet([DataEntry((toString(j.caller) + "_event2amount"), 0)]), TransferSet([ScriptTransfer(j.caller, (v * 1000000), unit)]))
167195 else throw("event did not happen or you have zero win")
168196 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 190
55
66 let b = 190
77
88 let c = 52
99
1010 let d = 10
1111
1212 func e (f,g) = {
1313 let e = ((f * (((-47 * g) * g) + 10000)) / 10000)
1414 e
1515 }
1616
1717
1818 func h (f,g) = {
1919 let i = ((c * ((((-95 * g) * g) + (1877 * g)) + 10000)) / 10000)
2020 let h = pow(((i + 1000) - (100000 / f)), 0, -1, 0, 5, DOWN)
2121 if ((h > 270))
2222 then 270
2323 else h
2424 }
2525
2626
2727 @Callable(j)
2828 func bet (k) = {
2929 let l = {
3030 let m = j.payment
3131 if ($isInstanceOf(m, "AttachedPayment"))
3232 then {
3333 let n = m
3434 if ((100000000 > n.amount))
3535 then throw("low payment")
3636 else n
3737 }
3838 else throw("Paymx`ent not attached")
3939 }
4040 let o = getIntegerValue(this, "n")
4141 let p = getIntegerValue(this, "m")
4242 let q = getIntegerValue(this, "count")
4343 let r = (o - p)
4444 let s = {
4545 let m = getInteger(this, (toString(j.caller) + "_event1amount"))
4646 if ($isInstanceOf(m, "Unit"))
4747 then {
4848 let t = m
4949 0
5050 }
5151 else if ($isInstanceOf(m, "Int"))
5252 then {
5353 let u = m
5454 u
5555 }
5656 else throw()
5757 }
5858 let v = {
5959 let m = getInteger(this, (toString(j.caller) + "_event2amount"))
6060 if ($isInstanceOf(m, "Unit"))
6161 then {
6262 let t = m
6363 0
6464 }
6565 else if ($isInstanceOf(m, "Int"))
6666 then {
6767 let u = m
6868 u
6969 }
7070 else throw()
7171 }
72+ let w = {
73+ let m = getInteger(this, "q1_next")
74+ if ($isInstanceOf(m, "Unit"))
75+ then {
76+ let t = m
77+ 0
78+ }
79+ else if ($isInstanceOf(m, "Int"))
80+ then {
81+ let u = m
82+ u
83+ }
84+ else throw()
85+ }
86+ let x = {
87+ let m = getInteger(this, "q2_next")
88+ if ($isInstanceOf(m, "Unit"))
89+ then {
90+ let t = m
91+ 0
92+ }
93+ else if ($isInstanceOf(m, "Int"))
94+ then {
95+ let u = m
96+ u
97+ }
98+ else throw()
99+ }
72100 let g = if ((k == 1))
73101 then (r + 1)
74102 else (r - 1)
75- let w = if ((g >= 0))
103+ let y = if ((g >= 0))
76104 then e(a, g)
77105 else h(e(b, g), g)
78- let x = if ((g >= 0))
106+ let z = if ((g >= 0))
79107 then h(e(a, g), g)
80108 else e(b, g)
81- let y = if (((g + 1) >= 0))
109+ let A = if (((g + 1) >= 0))
82110 then e(a, (g + 1))
83111 else h(e(b, (g + 1)), (g + 1))
84- let z = if (((g - 1) >= 0))
112+ let B = if (((g - 1) >= 0))
85113 then h(e(a, (g - 1)), (g - 1))
86114 else e(b, (g - 1))
87- let A = (q + 1)
115+ let C = (q + 1)
88116 if ((k == 1))
89- then if ((100 > w))
90- then throw(("to low coef q1 = " + toString(w)))
117+ then if ((100 > y))
118+ then throw(("to low coef q1 = " + toString(y)))
91119 else {
92- let B = (o + 1)
93- WriteSet([DataEntry((toString(j.caller) + "_event1amount"), (s + w)), DataEntry((toString(A) + "_event"), k), DataEntry((toString(A) + "_qoef1"), w), DataEntry((toString(A) + "_qoef2"), x), DataEntry((toString(A) + "_bettor"), toString(j.caller)), DataEntry("q1_next", y), DataEntry("q2_next", z), DataEntry("n", B), DataEntry("count", A)])
120+ let D = (o + 1)
121+ WriteSet([DataEntry((toString(j.caller) + "_event1amount"), (s + y)), DataEntry((toString(C) + "_event"), k), DataEntry((toString(C) + "_qoef1"), y), DataEntry((toString(C) + "_qoef2"), x), DataEntry((toString(C) + "_bettor"), toString(j.caller)), DataEntry("q1_next", A), DataEntry("q2_next", B), DataEntry("n", D), DataEntry("count", C)])
94122 }
95- else if ((100 > x))
96- then throw(("to low coef q2 = " + toString(x)))
123+ else if ((100 > z))
124+ then throw(("to low coef q2 = " + toString(z)))
97125 else {
98- let C = (p + 1)
99- WriteSet([DataEntry((toString(j.caller) + "_event2amount"), (v + x)), DataEntry((toString(A) + "_event"), k), DataEntry((toString(A) + "_qoef2"), x), DataEntry((toString(A) + "_bettor"), toString(j.caller)), DataEntry("q1_next", y), DataEntry("q2_next", z), DataEntry((toString(A) + "_qoef1"), w), DataEntry("m", C), DataEntry("count", A)])
126+ let E = (p + 1)
127+ WriteSet([DataEntry((toString(j.caller) + "_event2amount"), (v + z)), DataEntry((toString(C) + "_event"), k), DataEntry((toString(C) + "_qoef1"), w), DataEntry((toString(C) + "_qoef2"), z), DataEntry((toString(C) + "_bettor"), toString(j.caller)), DataEntry("q1_next", A), DataEntry("q2_next", B), DataEntry("m", E), DataEntry("count", C)])
100128 }
101129 }
102130
103131
104132
105133 @Callable(j)
106134 func withdraw () = {
107135 let s = {
108136 let m = getInteger(this, (toString(j.caller) + "_event1amount"))
109137 if ($isInstanceOf(m, "Unit"))
110138 then {
111139 let t = m
112140 0
113141 }
114142 else if ($isInstanceOf(m, "Int"))
115143 then {
116144 let u = m
117145 u
118146 }
119147 else throw()
120148 }
121149 let v = {
122150 let m = getInteger(this, (toString(j.caller) + "_event2amount"))
123151 if ($isInstanceOf(m, "Unit"))
124152 then {
125153 let t = m
126154 0
127155 }
128156 else if ($isInstanceOf(m, "Int"))
129157 then {
130158 let u = m
131159 u
132160 }
133161 else throw()
134162 }
135- let D = {
163+ let F = {
136164 let m = getBoolean(this, "result_event_1")
137165 if ($isInstanceOf(m, "Unit"))
138166 then {
139167 let t = m
140168 false
141169 }
142170 else if ($isInstanceOf(m, "Boolean"))
143171 then {
144- let E = m
145- E
172+ let G = m
173+ G
146174 }
147175 else throw()
148176 }
149- let F = {
177+ let H = {
150178 let m = getBoolean(this, "result_event_2")
151179 if ($isInstanceOf(m, "Unit"))
152180 then {
153181 let t = m
154182 false
155183 }
156184 else if ($isInstanceOf(m, "Boolean"))
157185 then {
158- let E = m
159- E
186+ let G = m
187+ G
160188 }
161189 else throw()
162190 }
163- if (D)
191+ if (F)
164192 then ScriptResult(WriteSet([DataEntry((toString(j.caller) + "_event1amount"), 0)]), TransferSet([ScriptTransfer(j.caller, (s * 1000000), unit)]))
165- else if (F)
193+ else if (H)
166194 then ScriptResult(WriteSet([DataEntry((toString(j.caller) + "_event2amount"), 0)]), TransferSet([ScriptTransfer(j.caller, (v * 1000000), unit)]))
167195 else throw("event did not happen or you have zero win")
168196 }
169197
170198

github/deemru/w8io/169f3d6 
53.00 ms