tx · 7jgSdEE1AWDQrBxi6KrsYNRvHPtd9qx7ratvUZLmff8p 3N3AeA5FWm7EHheHoik8BBEA3GXXJosnVY8: -0.01000000 Waves 2019.10.07 13:40 [709248] smart account 3N3AeA5FWm7EHheHoik8BBEA3GXXJosnVY8 > SELF 0.00000000 Waves
{ "type": 13, "id": "7jgSdEE1AWDQrBxi6KrsYNRvHPtd9qx7ratvUZLmff8p", "fee": 1000000, "feeAssetId": null, "timestamp": 1570444763927, "version": 1, "sender": "3N3AeA5FWm7EHheHoik8BBEA3GXXJosnVY8", "senderPublicKey": "87US7E5SdpUB7rbkzLmEUKfYg7uihzCvRzEKy1mCNNjq", "proofs": [ "4jugSpKC2zw8CjV5cvJqJkk6fayAQ9JPMJQiLYhoLKKoZAi8mMNFbfs69QwwbF3sZGur6kxMmF5vMXDjJh9Acsx9" ], "script": "base64:AAIDAAAAAAAAAAkIARIDCgEBEgAAAAAGAAAAAAdxMXN0YXJ0AAAAAAAAAAC+AAAAAAdxMnN0YXJ0AAAAAAAAAAC+AAAAAAN2aWcAAAAAAAAAAAUAAAAAAXMAAAAAAAAAAAoBAAAABGNvZWYAAAACAAAAAXEAAAADZGlmBAAAAARjb2VmCQAAaQAAAAIJAABoAAAAAgUAAAABcQkAAGQAAAACCQAAaAAAAAIJAABoAAAAAgD/////////0QUAAAADZGlmBQAAAANkaWYAAAAAAAAAJxAAAAAAAAAAJxAFAAAABGNvZWYBAAAAC2Fub3RoZXJjb2VmAAAAAgAAAAFxAAAAA2RpZgQAAAAJYWN0dWFsdmlnCQAAaQAAAAIJAABoAAAAAgUAAAADdmlnCQAAZAAAAAIJAABkAAAAAgkAAGgAAAACCQAAaAAAAAIA/////////6EFAAAAA2RpZgUAAAADZGlmCQAAaAAAAAIAAAAAAAAAB1UFAAAAA2RpZgAAAAAAAAAnEAAAAAAAAAAnEAQAAAALYW5vdGhlcmNvZWYJAABsAAAABgkAAGUAAAACCQAAZAAAAAIFAAAAA3ZpZwAAAAAAAAAD6A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AAAFdGhyb3cAAAAAAwUAAAAGZXZlbnQxCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQAEJQAAAAEIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgIAAAANX2V2ZW50MWFtb3VudAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgkAAGgAAAACBQAAAAxldmVudDFhbW91bnQAAAAAAAAPQkAFAAAABHVuaXQFAAAAA25pbAMFAAAABmV2ZW50MgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkABCUAAAABCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXICAAAADV9ldmVudDJhbW91bnQAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIJAABoAAAAAgUAAAAMZXZlbnQyYW1vdW50AAAAAAAAD0JABQAAAAR1bml0BQAAAANuaWwJAAACAAAAAQIAAAApZXZlbnQgZGlkIG5vdCBoYXBwZW4gb3IgeW91IGhhdmUgemVybyB3aW4AAAAAS7kJag==", "chainId": 84, "height": 709248, "spentComplexity": 0 } View: original | compacted Prev: none Next: 2Ux5thrhHBmcJP51GNeJjJo1zUtjESf47BBrk15fSgVV Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = 190 | |
5 | + | ||
6 | + | let b = 190 | |
7 | + | ||
8 | + | let c = 5 | |
9 | + | ||
10 | + | let d = 10 | |
11 | + | ||
12 | + | func e (f,g) = { | |
13 | + | let e = ((f * (((-47 * g) * g) + 10000)) / 10000) | |
14 | + | e | |
15 | + | } | |
16 | + | ||
17 | + | ||
18 | + | func h (f,g) = { | |
19 | + | let i = ((c * ((((-95 * g) * g) + (1877 * g)) + 10000)) / 10000) | |
20 | + | let h = pow(((c + 1000) - (100000 / f)), 0, -1, 0, 5, DOWN) | |
21 | + | if ((h > 270)) | |
22 | + | then 270 | |
23 | + | else h | |
24 | + | } | |
25 | + | ||
26 | + | ||
27 | + | @Callable(j) | |
28 | + | func bet (k) = { | |
29 | + | let l = { | |
30 | + | let m = j.payment | |
31 | + | if ($isInstanceOf(m, "AttachedPayment")) | |
32 | + | then { | |
33 | + | let n = m | |
34 | + | if ((100000000 > n.amount)) | |
35 | + | then throw("low payment") | |
36 | + | else n | |
37 | + | } | |
38 | + | else throw("Payment not attached") | |
39 | + | } | |
40 | + | let o = getIntegerValue(this, "n") | |
41 | + | let p = getIntegerValue(this, "m") | |
42 | + | let q = getIntegerValue(this, "count") | |
43 | + | let r = (o - p) | |
44 | + | let s = { | |
45 | + | let m = getInteger(this, (toString(j.caller) + "_event1amount")) | |
46 | + | if ($isInstanceOf(m, "Unit")) | |
47 | + | then { | |
48 | + | let t = m | |
49 | + | 0 | |
50 | + | } | |
51 | + | else if ($isInstanceOf(m, "Int")) | |
52 | + | then { | |
53 | + | let u = m | |
54 | + | u | |
55 | + | } | |
56 | + | else throw() | |
57 | + | } | |
58 | + | let v = { | |
59 | + | let m = getInteger(this, (toString(j.caller) + "_event2amount")) | |
60 | + | if ($isInstanceOf(m, "Unit")) | |
61 | + | then { | |
62 | + | let t = m | |
63 | + | 0 | |
64 | + | } | |
65 | + | else if ($isInstanceOf(m, "Int")) | |
66 | + | then { | |
67 | + | let u = m | |
68 | + | u | |
69 | + | } | |
70 | + | else throw() | |
71 | + | } | |
72 | + | let g = if ((k == 1)) | |
73 | + | then (r + 1) | |
74 | + | else (r - 1) | |
75 | + | let w = if ((g >= 0)) | |
76 | + | then e(a, g) | |
77 | + | else h(a, g) | |
78 | + | let x = if ((g >= 0)) | |
79 | + | then e(b, g) | |
80 | + | else h(b, g) | |
81 | + | let y = if (((g + 1) >= 0)) | |
82 | + | then e(a, (g + 1)) | |
83 | + | else h(a, (g + 1)) | |
84 | + | let z = if (((g - 1) >= 0)) | |
85 | + | then e(b, (g - 1)) | |
86 | + | else h(b, (g - 1)) | |
87 | + | let A = (o + 1) | |
88 | + | let B = (q + 1) | |
89 | + | WriteSet([DataEntry((toString(j.caller) + "_event1amount"), (s + e(a, (o - p)))), DataEntry((toString(B) + "_event"), k), DataEntry((toString(B) + "_qoef1"), w), DataEntry((toString(B) + "_qoef2"), x), DataEntry((toString(B) + "_bettor"), toString(j.caller)), DataEntry("q1_next", y), DataEntry("q2_next", z), DataEntry("n", A), DataEntry("count", B)]) | |
90 | + | } | |
91 | + | ||
92 | + | ||
93 | + | ||
94 | + | @Callable(j) | |
95 | + | func withdraw () = { | |
96 | + | let s = { | |
97 | + | let m = getInteger(this, (toString(j.caller) + "_event1amount")) | |
98 | + | if ($isInstanceOf(m, "Unit")) | |
99 | + | then { | |
100 | + | let t = m | |
101 | + | 0 | |
102 | + | } | |
103 | + | else if ($isInstanceOf(m, "Int")) | |
104 | + | then { | |
105 | + | let u = m | |
106 | + | u | |
107 | + | } | |
108 | + | else throw() | |
109 | + | } | |
110 | + | let v = { | |
111 | + | let m = getInteger(this, (toString(j.caller) + "_event2amount")) | |
112 | + | if ($isInstanceOf(m, "Unit")) | |
113 | + | then { | |
114 | + | let t = m | |
115 | + | 0 | |
116 | + | } | |
117 | + | else if ($isInstanceOf(m, "Int")) | |
118 | + | then { | |
119 | + | let u = m | |
120 | + | u | |
121 | + | } | |
122 | + | else throw() | |
123 | + | } | |
124 | + | let C = { | |
125 | + | let m = getBoolean(this, "result_event_1") | |
126 | + | if ($isInstanceOf(m, "Unit")) | |
127 | + | then { | |
128 | + | let t = m | |
129 | + | false | |
130 | + | } | |
131 | + | else if ($isInstanceOf(m, "Boolean")) | |
132 | + | then { | |
133 | + | let D = m | |
134 | + | D | |
135 | + | } | |
136 | + | else throw() | |
137 | + | } | |
138 | + | let E = { | |
139 | + | let m = getBoolean(this, "result_event_2") | |
140 | + | if ($isInstanceOf(m, "Unit")) | |
141 | + | then { | |
142 | + | let t = m | |
143 | + | false | |
144 | + | } | |
145 | + | else if ($isInstanceOf(m, "Boolean")) | |
146 | + | then { | |
147 | + | let D = m | |
148 | + | D | |
149 | + | } | |
150 | + | else throw() | |
151 | + | } | |
152 | + | if (C) | |
153 | + | then ScriptResult(WriteSet([DataEntry((toString(j.caller) + "_event1amount"), 0)]), TransferSet([ScriptTransfer(j.caller, (s * 1000000), unit)])) | |
154 | + | else if (E) | |
155 | + | then ScriptResult(WriteSet([DataEntry((toString(j.caller) + "_event2amount"), 0)]), TransferSet([ScriptTransfer(j.caller, (v * 1000000), unit)])) | |
156 | + | else throw("event did not happen or you have zero win") | |
157 | + | } | |
158 | + | ||
159 | + |
github/deemru/w8io/169f3d6 20.69 ms ◑