tx · CyA88LXvvL7V7Z6igTx4qK4bBM1sq3vi2nAgmDmJ1DY9 3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun: -0.01400000 Waves 2019.09.08 11:42 [666870] smart account 3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun > SELF 0.00000000 Waves
{ "type": 13, "id": "CyA88LXvvL7V7Z6igTx4qK4bBM1sq3vi2nAgmDmJ1DY9", "fee": 1400000, "feeAssetId": null, "timestamp": 1567932166845, "version": 1, "sender": "3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun", "senderPublicKey": "7uRSDXQUkUS7719CDA4wXghhzsWrF22gb18FGDPZyA6P", "proofs": [ "2gSQbXaqntGKg2Kn9Jekd5jSuppZqKMJK1cMFvX56QpP8jp69HCDxszjy4k1ivhv8wC4pSmDbUg4wiAQnRNtFozb" ], "script": "base64:AAIDAAAAAAAAAAAAAAASAAAAAAlXaW5TZXJ2ZXIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM045WG55UHBXeFlvaEtIN3o1ZEV1cThycG5vYnB5elByekUAAAAAB1dBVkVMRVQJAABoAAAAAgkAAGgAAAACAAAAAAAAAABkAAAAAAAAAAPoAAAAAAAAAAPoAAAAAApDT01NSVNTSU9OCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAHV0FWRUxFVAAAAAAAAAAD6AAAAAAOVGlja2V0c1BlcldhdmUAAAAAAAAAAGQAAAAAC0NVUlJFTlRHQU1FAgAAAA0kQ1VSUkVOVF9HQU1FAAAAAA9HQU1FU0NPVU5URVJLRVkCAAAACSRHQU1FX05VTQAAAAAKTEFTVFRJQ0tFVAIAAAAMJExBU1RfVElDS0VUAAAAAARCQU5LAgAAAAokR0FNRV9CQU5LAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIAAAAGZ2FtZUlkAAAADWN1cnJlbnRQbGF5ZXIEAAAAEHBsYXllcnNQcmVzZW50ZWQJA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GVTZXQAAAABBQAAAAdiZXREYXRhCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAAt0b1dpblNlcnZlcgAAAACi7dRE", "chainId": 84, "height": 666870, "spentComplexity": 0 } View: original | compacted Prev: 32qsTgxx1aTMzvupms8e8DT2nUht88BvHGKzJrqh3Vd5 Next: EnpE8ac45xwM9iADdDzuBhnJ43evyfjgEGNhXn36d7bH Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | ||
16 | 16 | let g = "$LAST_TICKET" | |
17 | 17 | ||
18 | - | func h (i,j) = { | |
19 | - | let k = isDefined(getString(this, (i + "_players"))) | |
20 | - | if (!(k)) | |
21 | - | then j | |
22 | - | else if (isDefined(getString(this, (((i + "_") + j) + "_tickets")))) | |
23 | - | then getStringValue(this, (i + "_players")) | |
24 | - | else ((getStringValue(this, (i + "_players")) + "_") + j) | |
18 | + | let h = "$GAME_BANK" | |
19 | + | ||
20 | + | func i (j,k) = { | |
21 | + | let l = isDefined(getString(this, (j + "_players"))) | |
22 | + | if (!(l)) | |
23 | + | then k | |
24 | + | else if (isDefined(getString(this, (((j + "_") + k) + "_tickets")))) | |
25 | + | then getStringValue(this, (j + "_players")) | |
26 | + | else ((getStringValue(this, (j + "_players")) + "_") + k) | |
25 | 27 | } | |
26 | 28 | ||
27 | 29 | ||
28 | - | func | |
29 | - | let | |
30 | - | if (( | |
30 | + | func m (n) = { | |
31 | + | let o = size(n) | |
32 | + | if ((o == 0)) | |
31 | 33 | then throw("Parameter size must be greater then 0") | |
32 | - | else if (( | |
34 | + | else if ((o > 99)) | |
33 | 35 | then throw("Parameter size must be less then 100") | |
34 | - | else if ((10 > | |
35 | - | then (("0" + toString( | |
36 | - | else (toString( | |
36 | + | else if ((10 > o)) | |
37 | + | then (("0" + toString(o)) + n) | |
38 | + | else (toString(o) + n) | |
37 | 39 | } | |
38 | 40 | ||
39 | 41 | ||
40 | - | func | |
41 | - | let | |
42 | - | if (!( | |
42 | + | func p () = { | |
43 | + | let q = isDefined(getInteger(this, g)) | |
44 | + | if (!(q)) | |
43 | 45 | then 0 | |
44 | 46 | else getIntegerValue(this, g) | |
45 | 47 | } | |
46 | 48 | ||
47 | 49 | ||
48 | - | func | |
49 | - | let | |
50 | - | let | |
51 | - | let | |
52 | - | let | |
53 | - | let | |
54 | - | let | |
55 | - | if ( | |
50 | + | func r (j,s,t) = { | |
51 | + | let u = p() | |
52 | + | let v = (t / b) | |
53 | + | let w = (u + 1) | |
54 | + | let x = ((w + (v * d)) - 1) | |
55 | + | let y = ((m(toString(w)) + "_") + m(toString(x))) | |
56 | + | let z = isDefined(getString(this, (((j + "_") + s) + "_tickets"))) | |
57 | + | if (z) | |
56 | 58 | then { | |
57 | - | let | |
58 | - | (( | |
59 | + | let A = getStringValue(this, (((j + "_") + s) + "_tickets")) | |
60 | + | ((A + " ") + y) | |
59 | 61 | } | |
60 | - | else | |
62 | + | else y | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 | ||
64 | - | func | |
65 | - | let | |
66 | - | let | |
67 | - | ( | |
66 | + | func B (t) = { | |
67 | + | let u = p() | |
68 | + | let v = (t / b) | |
69 | + | (u + (v * d)) | |
68 | 70 | } | |
69 | 71 | ||
70 | 72 | ||
71 | - | func | |
72 | - | let | |
73 | - | let | |
74 | - | if ($isInstanceOf( | |
73 | + | func C (j,D) = { | |
74 | + | let E = { | |
75 | + | let F = getInteger(this, f) | |
76 | + | if ($isInstanceOf(F, "Int")) | |
75 | 77 | then { | |
76 | - | let | |
77 | - | | |
78 | + | let G = F | |
79 | + | G | |
78 | 80 | } | |
79 | 81 | else 0 | |
80 | 82 | } | |
81 | - | if (( | |
82 | - | then ( | |
83 | - | else | |
83 | + | if ((j == D)) | |
84 | + | then (E + 1) | |
85 | + | else E | |
84 | 86 | } | |
85 | 87 | ||
86 | 88 | ||
87 | - | func | |
88 | - | let | |
89 | - | if (!( | |
90 | - | then | |
89 | + | func H (D) = { | |
90 | + | let I = isDefined(getString(this, e)) | |
91 | + | if (!(I)) | |
92 | + | then D | |
91 | 93 | else if ((getStringValue(this, e) == "")) | |
92 | - | then | |
94 | + | then D | |
93 | 95 | else getStringValue(this, e) | |
94 | 96 | } | |
95 | 97 | ||
96 | 98 | ||
97 | - | func | |
98 | - | let | |
99 | - | let | |
100 | - | if ( | |
101 | - | then | |
102 | - | else | |
99 | + | func J (D) = { | |
100 | + | let j = H(D) | |
101 | + | let K = isDefined(getString(this, (j + "_result"))) | |
102 | + | if (K) | |
103 | + | then D | |
104 | + | else j | |
103 | 105 | } | |
104 | 106 | ||
105 | 107 | ||
106 | - | @Callable(K) | |
107 | - | func resetGameData (i) = { | |
108 | - | let L = toBase58String(K.callerPublicKey) | |
109 | - | let M = addressFromPublicKey(fromBase58String(L)) | |
110 | - | let r = toString(M) | |
111 | - | let N = [DataEntry(e, ""), DataEntry(f, 0), DataEntry((((i + "_") + r) + "_tickets"), ""), DataEntry((i + "_players"), ""), DataEntry(g, 0)] | |
112 | - | WriteSet(N) | |
108 | + | func L (j,t) = { | |
109 | + | let M = { | |
110 | + | let F = getInteger(this, ((j + "_") + h)) | |
111 | + | if ($isInstanceOf(F, "Int")) | |
112 | + | then { | |
113 | + | let G = F | |
114 | + | G | |
115 | + | } | |
116 | + | else 0 | |
117 | + | } | |
118 | + | (M + t) | |
119 | + | } | |
120 | + | ||
121 | + | ||
122 | + | func N (j,s,t) = { | |
123 | + | let O = { | |
124 | + | let F = getInteger(this, (((j + "_") + s) + "_totalBetsAmt")) | |
125 | + | if ($isInstanceOf(F, "Int")) | |
126 | + | then { | |
127 | + | let G = F | |
128 | + | G | |
129 | + | } | |
130 | + | else 0 | |
131 | + | } | |
132 | + | (O + t) | |
133 | + | } | |
134 | + | ||
135 | + | ||
136 | + | @Callable(P) | |
137 | + | func resetGameData (j) = { | |
138 | + | let Q = toBase58String(P.callerPublicKey) | |
139 | + | let R = addressFromPublicKey(fromBase58String(Q)) | |
140 | + | let s = toString(R) | |
141 | + | let S = [DataEntry(e, ""), DataEntry(f, 0), DataEntry((((j + "_") + s) + "_tickets"), ""), DataEntry((j + "_players"), ""), DataEntry(g, 0)] | |
142 | + | WriteSet(S) | |
113 | 143 | } | |
114 | 144 | ||
115 | 145 | ||
116 | 146 | ||
117 | - | @Callable( | |
147 | + | @Callable(P) | |
118 | 148 | func bet () = { | |
119 | - | let | |
120 | - | let | |
121 | - | let | |
122 | - | let | |
123 | - | let | |
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | if ( | |
149 | + | let D = toBase58String(P.transactionId) | |
150 | + | let j = J(D) | |
151 | + | let E = C(j, D) | |
152 | + | let T = extract(P.payment) | |
153 | + | let t = T.amount | |
154 | + | let U = isDefined(T.assetId) | |
155 | + | let V = isDefined(T.assetId) | |
156 | + | let Q = toBase58String(P.callerPublicKey) | |
157 | + | let R = addressFromPublicKey(fromBase58String(Q)) | |
158 | + | if (U) | |
129 | 159 | then throw("Bet amount must be in Waves") | |
130 | - | else if ( | |
160 | + | else if (V) | |
131 | 161 | then throw("Transaction's fee must be in Waves") | |
132 | 162 | else { | |
133 | - | let r = toString(M) | |
134 | - | let R = [DataEntry(e, i), DataEntry(f, D), DataEntry((((i + "_") + r) + "_tickets"), q(i, r, s)), DataEntry((i + "_players"), h(i, r)), DataEntry(g, A(s))] | |
135 | - | let S = [ScriptTransfer(a, s, unit)] | |
136 | - | ScriptResult(WriteSet(R), TransferSet(S)) | |
163 | + | let s = toString(R) | |
164 | + | let W = L(j, t) | |
165 | + | let X = N(j, s, t) | |
166 | + | let Y = ((X * 90) / 100) | |
167 | + | let Z = [DataEntry(e, j), DataEntry(f, E), DataEntry((((j + "_") + s) + "_tickets"), r(j, s, t)), DataEntry((((j + "_") + s) + "_IfWinsGet"), Y), DataEntry((((j + "_") + s) + "_totalBetsAmt"), X), DataEntry((j + "_players"), i(j, s)), DataEntry(g, B(t)), DataEntry(((j + "_") + h), W)] | |
168 | + | let aa = [ScriptTransfer(a, t, unit)] | |
169 | + | ScriptResult(WriteSet(Z), TransferSet(aa)) | |
137 | 170 | } | |
138 | 171 | } | |
139 | 172 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = addressFromStringValue("3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE") | |
5 | 5 | ||
6 | 6 | let b = ((100 * 1000) * 1000) | |
7 | 7 | ||
8 | 8 | let c = ((5 * b) / 1000) | |
9 | 9 | ||
10 | 10 | let d = 100 | |
11 | 11 | ||
12 | 12 | let e = "$CURRENT_GAME" | |
13 | 13 | ||
14 | 14 | let f = "$GAME_NUM" | |
15 | 15 | ||
16 | 16 | let g = "$LAST_TICKET" | |
17 | 17 | ||
18 | - | func h (i,j) = { | |
19 | - | let k = isDefined(getString(this, (i + "_players"))) | |
20 | - | if (!(k)) | |
21 | - | then j | |
22 | - | else if (isDefined(getString(this, (((i + "_") + j) + "_tickets")))) | |
23 | - | then getStringValue(this, (i + "_players")) | |
24 | - | else ((getStringValue(this, (i + "_players")) + "_") + j) | |
18 | + | let h = "$GAME_BANK" | |
19 | + | ||
20 | + | func i (j,k) = { | |
21 | + | let l = isDefined(getString(this, (j + "_players"))) | |
22 | + | if (!(l)) | |
23 | + | then k | |
24 | + | else if (isDefined(getString(this, (((j + "_") + k) + "_tickets")))) | |
25 | + | then getStringValue(this, (j + "_players")) | |
26 | + | else ((getStringValue(this, (j + "_players")) + "_") + k) | |
25 | 27 | } | |
26 | 28 | ||
27 | 29 | ||
28 | - | func | |
29 | - | let | |
30 | - | if (( | |
30 | + | func m (n) = { | |
31 | + | let o = size(n) | |
32 | + | if ((o == 0)) | |
31 | 33 | then throw("Parameter size must be greater then 0") | |
32 | - | else if (( | |
34 | + | else if ((o > 99)) | |
33 | 35 | then throw("Parameter size must be less then 100") | |
34 | - | else if ((10 > | |
35 | - | then (("0" + toString( | |
36 | - | else (toString( | |
36 | + | else if ((10 > o)) | |
37 | + | then (("0" + toString(o)) + n) | |
38 | + | else (toString(o) + n) | |
37 | 39 | } | |
38 | 40 | ||
39 | 41 | ||
40 | - | func | |
41 | - | let | |
42 | - | if (!( | |
42 | + | func p () = { | |
43 | + | let q = isDefined(getInteger(this, g)) | |
44 | + | if (!(q)) | |
43 | 45 | then 0 | |
44 | 46 | else getIntegerValue(this, g) | |
45 | 47 | } | |
46 | 48 | ||
47 | 49 | ||
48 | - | func | |
49 | - | let | |
50 | - | let | |
51 | - | let | |
52 | - | let | |
53 | - | let | |
54 | - | let | |
55 | - | if ( | |
50 | + | func r (j,s,t) = { | |
51 | + | let u = p() | |
52 | + | let v = (t / b) | |
53 | + | let w = (u + 1) | |
54 | + | let x = ((w + (v * d)) - 1) | |
55 | + | let y = ((m(toString(w)) + "_") + m(toString(x))) | |
56 | + | let z = isDefined(getString(this, (((j + "_") + s) + "_tickets"))) | |
57 | + | if (z) | |
56 | 58 | then { | |
57 | - | let | |
58 | - | (( | |
59 | + | let A = getStringValue(this, (((j + "_") + s) + "_tickets")) | |
60 | + | ((A + " ") + y) | |
59 | 61 | } | |
60 | - | else | |
62 | + | else y | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 | ||
64 | - | func | |
65 | - | let | |
66 | - | let | |
67 | - | ( | |
66 | + | func B (t) = { | |
67 | + | let u = p() | |
68 | + | let v = (t / b) | |
69 | + | (u + (v * d)) | |
68 | 70 | } | |
69 | 71 | ||
70 | 72 | ||
71 | - | func | |
72 | - | let | |
73 | - | let | |
74 | - | if ($isInstanceOf( | |
73 | + | func C (j,D) = { | |
74 | + | let E = { | |
75 | + | let F = getInteger(this, f) | |
76 | + | if ($isInstanceOf(F, "Int")) | |
75 | 77 | then { | |
76 | - | let | |
77 | - | | |
78 | + | let G = F | |
79 | + | G | |
78 | 80 | } | |
79 | 81 | else 0 | |
80 | 82 | } | |
81 | - | if (( | |
82 | - | then ( | |
83 | - | else | |
83 | + | if ((j == D)) | |
84 | + | then (E + 1) | |
85 | + | else E | |
84 | 86 | } | |
85 | 87 | ||
86 | 88 | ||
87 | - | func | |
88 | - | let | |
89 | - | if (!( | |
90 | - | then | |
89 | + | func H (D) = { | |
90 | + | let I = isDefined(getString(this, e)) | |
91 | + | if (!(I)) | |
92 | + | then D | |
91 | 93 | else if ((getStringValue(this, e) == "")) | |
92 | - | then | |
94 | + | then D | |
93 | 95 | else getStringValue(this, e) | |
94 | 96 | } | |
95 | 97 | ||
96 | 98 | ||
97 | - | func | |
98 | - | let | |
99 | - | let | |
100 | - | if ( | |
101 | - | then | |
102 | - | else | |
99 | + | func J (D) = { | |
100 | + | let j = H(D) | |
101 | + | let K = isDefined(getString(this, (j + "_result"))) | |
102 | + | if (K) | |
103 | + | then D | |
104 | + | else j | |
103 | 105 | } | |
104 | 106 | ||
105 | 107 | ||
106 | - | @Callable(K) | |
107 | - | func resetGameData (i) = { | |
108 | - | let L = toBase58String(K.callerPublicKey) | |
109 | - | let M = addressFromPublicKey(fromBase58String(L)) | |
110 | - | let r = toString(M) | |
111 | - | let N = [DataEntry(e, ""), DataEntry(f, 0), DataEntry((((i + "_") + r) + "_tickets"), ""), DataEntry((i + "_players"), ""), DataEntry(g, 0)] | |
112 | - | WriteSet(N) | |
108 | + | func L (j,t) = { | |
109 | + | let M = { | |
110 | + | let F = getInteger(this, ((j + "_") + h)) | |
111 | + | if ($isInstanceOf(F, "Int")) | |
112 | + | then { | |
113 | + | let G = F | |
114 | + | G | |
115 | + | } | |
116 | + | else 0 | |
117 | + | } | |
118 | + | (M + t) | |
119 | + | } | |
120 | + | ||
121 | + | ||
122 | + | func N (j,s,t) = { | |
123 | + | let O = { | |
124 | + | let F = getInteger(this, (((j + "_") + s) + "_totalBetsAmt")) | |
125 | + | if ($isInstanceOf(F, "Int")) | |
126 | + | then { | |
127 | + | let G = F | |
128 | + | G | |
129 | + | } | |
130 | + | else 0 | |
131 | + | } | |
132 | + | (O + t) | |
133 | + | } | |
134 | + | ||
135 | + | ||
136 | + | @Callable(P) | |
137 | + | func resetGameData (j) = { | |
138 | + | let Q = toBase58String(P.callerPublicKey) | |
139 | + | let R = addressFromPublicKey(fromBase58String(Q)) | |
140 | + | let s = toString(R) | |
141 | + | let S = [DataEntry(e, ""), DataEntry(f, 0), DataEntry((((j + "_") + s) + "_tickets"), ""), DataEntry((j + "_players"), ""), DataEntry(g, 0)] | |
142 | + | WriteSet(S) | |
113 | 143 | } | |
114 | 144 | ||
115 | 145 | ||
116 | 146 | ||
117 | - | @Callable( | |
147 | + | @Callable(P) | |
118 | 148 | func bet () = { | |
119 | - | let | |
120 | - | let | |
121 | - | let | |
122 | - | let | |
123 | - | let | |
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | if ( | |
149 | + | let D = toBase58String(P.transactionId) | |
150 | + | let j = J(D) | |
151 | + | let E = C(j, D) | |
152 | + | let T = extract(P.payment) | |
153 | + | let t = T.amount | |
154 | + | let U = isDefined(T.assetId) | |
155 | + | let V = isDefined(T.assetId) | |
156 | + | let Q = toBase58String(P.callerPublicKey) | |
157 | + | let R = addressFromPublicKey(fromBase58String(Q)) | |
158 | + | if (U) | |
129 | 159 | then throw("Bet amount must be in Waves") | |
130 | - | else if ( | |
160 | + | else if (V) | |
131 | 161 | then throw("Transaction's fee must be in Waves") | |
132 | 162 | else { | |
133 | - | let r = toString(M) | |
134 | - | let R = [DataEntry(e, i), DataEntry(f, D), DataEntry((((i + "_") + r) + "_tickets"), q(i, r, s)), DataEntry((i + "_players"), h(i, r)), DataEntry(g, A(s))] | |
135 | - | let S = [ScriptTransfer(a, s, unit)] | |
136 | - | ScriptResult(WriteSet(R), TransferSet(S)) | |
163 | + | let s = toString(R) | |
164 | + | let W = L(j, t) | |
165 | + | let X = N(j, s, t) | |
166 | + | let Y = ((X * 90) / 100) | |
167 | + | let Z = [DataEntry(e, j), DataEntry(f, E), DataEntry((((j + "_") + s) + "_tickets"), r(j, s, t)), DataEntry((((j + "_") + s) + "_IfWinsGet"), Y), DataEntry((((j + "_") + s) + "_totalBetsAmt"), X), DataEntry((j + "_players"), i(j, s)), DataEntry(g, B(t)), DataEntry(((j + "_") + h), W)] | |
168 | + | let aa = [ScriptTransfer(a, t, unit)] | |
169 | + | ScriptResult(WriteSet(Z), TransferSet(aa)) | |
137 | 170 | } | |
138 | 171 | } | |
139 | 172 | ||
140 | 173 |
github/deemru/w8io/169f3d6 94.81 ms ◑