tx · DBt6aQVBVzqazoob4VYJCS3GUVG6RNpv5CFFkpdTkTXa

3MyPxvC5pvRWe8KtXn35Vjcw8b1DLLXpDxu:  -0.01400000 Waves

2019.09.20 16:13 [684684] smart account 3MyPxvC5pvRWe8KtXn35Vjcw8b1DLLXpDxu > SELF 0.00000000 Waves

{ "type": 13, "id": "DBt6aQVBVzqazoob4VYJCS3GUVG6RNpv5CFFkpdTkTXa", "fee": 1400000, "feeAssetId": null, "timestamp": 1568985210604, "version": 1, "sender": "3MyPxvC5pvRWe8KtXn35Vjcw8b1DLLXpDxu", "senderPublicKey": "58gE6BwC4kdEuM8Q5jAP95JTzWwtCqAm352WZe4bHcDE", "proofs": [ "3gEYD7SUDZdtJ6pMyenSjiq6zYGMEzpf5F3Dod2uUU6K8GhygWMCTinsJ25UJrffz3j4CwV5oneCu1bVaHQua9KG" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAAAdxMXN0YXJ0AAAAAAAAAAC+AAAAAAdxMnN0YXJ0AAAAAAAAAAC+AAAAAAFzAAAAAAAAAAAKAQAAAARjb2VmAAAAAgAAAAFxAAAAA2RpZgQAAAAGcmVzdWx0CQAAaQAAAAIJAABoAAAAAgUAAAABcQkAAGQAAAACCQAAaAAAAAIJAABoAAAAAgD/////////0QUAAAADZGlmBQAAAANkaWYAAAAAAAAAJxAAAAAAAAAAJxADCQAAZgAAAAIAAAAAAAAAArwFAAAABnJlc3VsdAUAAAAGcmVzdWx0AAAAAAAAAAK8AQAAAAthbm90aGVyY29lZgAAAAEAAAABcQQAAAADdmlnAAAAAAAAAAA0BAAAAAZyZXN1bHQJAABsAAAABgkAAGUAAAACCQAAZAAAAAIFAAAAA3ZpZwAAAAAAAAAD6AkAAGkAAAACAAAAAAAAAYagBQAAAAFxAAAAAAAAAAAAAP//////////AAAAAAAAAAAAAAAAAAAAAAAFBQAAAARET1dOAwkAAGYAAAACAAAAAAAAAAK8BQAAAAZyZXN1bHQFAAAABnJlc3VsdAAAAAAAAAACv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2gwAgAAAAdCb29sZWFuBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiCQEAAAAFdGhyb3cAAAAAAwUAAAAGZXZlbnQxCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQAEJQAAAAEIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgIAAAANX2V2ZW50MWFtb3VudAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgkAAGgAAAACBQAAAAxldmVudDFhbW91bnQAAAAAAAAPQkAFAAAABHVuaXQFAAAAA25pbAMFAAAABmV2ZW50MgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkABCUAAAABCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXICAAAADV9ldmVudDJhbW91bnQAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIJAABoAAAAAgUAAAAMZXZlbnQyYW1vdW50AAAAAAAAD0JABQAAAAR1bml0BQAAAANuaWwJAAACAAAAAQIAAAApZXZlbnQgZGlkIG5vdCBoYXBwZW4gb3IgeW91IGhhdmUgemVybyB3aW4AAAAACcd20A==", "chainId": 84, "height": 684684, "spentComplexity": 0 } View: original | compacted Prev: CXKxmAD58gd2EsciJZG73Dmke4dve3UwcegaiRuKS8sz Next: none Diff:
OldNewDifferences
99
1010 func coef (q,dif) = {
1111 let result = ((q * (((-47 * dif) * dif) + 10000)) / 10000)
12- if ((500 > result))
12+ if ((700 > result))
1313 then result
14- else 500
14+ else 700
1515 }
1616
1717
1818 func anothercoef (q) = {
1919 let vig = 52
2020 let result = pow(((vig + 1000) - (100000 / q)), 0, -1, 0, 5, DOWN)
21- if ((500 > result))
21+ if ((700 > result))
2222 then result
23- else 500
23+ else 700
2424 }
2525
2626
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 s = 10
99
1010 func coef (q,dif) = {
1111 let result = ((q * (((-47 * dif) * dif) + 10000)) / 10000)
12- if ((500 > result))
12+ if ((700 > result))
1313 then result
14- else 500
14+ else 700
1515 }
1616
1717
1818 func anothercoef (q) = {
1919 let vig = 52
2020 let result = pow(((vig + 1000) - (100000 / q)), 0, -1, 0, 5, DOWN)
21- if ((500 > result))
21+ if ((700 > result))
2222 then result
23- else 500
23+ else 700
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("Payment not attached")
3636 }
3737 let n = getIntegerValue(this, "n")
3838 let m = getIntegerValue(this, "m")
3939 let count = getIntegerValue(this, "count")
4040 let dif = (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 }
5757 if ((event == 1))
5858 then {
5959 let q1next = coef(q1start, ((n + 1) - m))
6060 let q2next = anothercoef(q1next)
6161 if (if ((100 > q1next))
6262 then true
6363 else (100 > q2next))
6464 then throw(("to low coef q1 = " + toString(coef(q1start, ((n + 1) - m)))))
6565 else {
6666 let nNew = (n + 1)
6767 let countNew = (count + 1)
6868 WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), (event1amount + coef(q1start, (n - m)))), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef1"), coef(q1start, (n - m))), DataEntry((toString(countNew) + "_qoef2"), anothercoef(coef(q1start, (n - m)))), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1next), DataEntry("q2_next", q2next), DataEntry("n", nNew), DataEntry("count", countNew)])
6969 }
7070 }
7171 else {
7272 let q1next = coef(q1start, ((n - 1) - m))
7373 let q2next = anothercoef(q1next)
7474 if (if ((100 > q1next))
7575 then true
7676 else (100 > q2next))
7777 then throw(("to low coef q2 = " + toString(anothercoef(coef(q1start, ((n - m) - 1))))))
7878 else {
7979 let mNew = (m + 1)
8080 let countNew = (count + 1)
8181 WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), (event2amount + anothercoef(coef(q1start, (n - m))))), DataEntry((toString(countNew) + "_event"), event), DataEntry((toString(countNew) + "_qoef2"), anothercoef(coef(q1start, (n - m)))), DataEntry((toString(countNew) + "_bettor"), toString(contextObj.caller)), DataEntry("q1_next", q1next), DataEntry("q2_next", q2next), DataEntry((toString(countNew) + "_qoef1"), coef(q1start, (n - m))), DataEntry("m", mNew), DataEntry("count", countNew)])
8282 }
8383 }
8484 }
8585
8686
8787
8888 @Callable(contextObj)
8989 func withdraw () = {
9090 let event1amount = match getInteger(this, (toString(contextObj.caller) + "_event1amount")) {
9191 case u: Unit =>
9292 0
9393 case i: Int =>
9494 i
9595 case _ =>
9696 throw()
9797 }
9898 let event2amount = match getInteger(this, (toString(contextObj.caller) + "_event2amount")) {
9999 case u: Unit =>
100100 0
101101 case i: Int =>
102102 i
103103 case _ =>
104104 throw()
105105 }
106106 let event1 = match getBoolean(this, "result_event_1") {
107107 case u: Unit =>
108108 false
109109 case b: Boolean =>
110110 b
111111 case _ =>
112112 throw()
113113 }
114114 let event2 = match getBoolean(this, "result_event_2") {
115115 case u: Unit =>
116116 false
117117 case b: Boolean =>
118118 b
119119 case _ =>
120120 throw()
121121 }
122122 if (event1)
123123 then ScriptResult(WriteSet([DataEntry((toString(contextObj.caller) + "_event1amount"), 0)]), TransferSet([ScriptTransfer(contextObj.caller, (event1amount * 1000000), unit)]))
124124 else if (event2)
125125 then ScriptResult(WriteSet([DataEntry((toString(contextObj.caller) + "_event2amount"), 0)]), TransferSet([ScriptTransfer(contextObj.caller, (event2amount * 1000000), unit)]))
126126 else throw("event did not happen or you have zero win")
127127 }
128128
129129

github/deemru/w8io/169f3d6 
45.14 ms