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:AAIDAAAAAAAAAAAAAAASAAAAAAlXaW5TZXJ2ZXIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM045WG55UHBXeFlvaEtIN3o1ZEV1cThycG5vYnB5elByekUAAAAAB1dBVkVMRVQJAABoAAAAAgkAAGgAAAACAAAAAAAAAABkAAAAAAAAAAPoAAAAAAAAAAPoAAAAAApDT01NSVNTSU9OCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAHV0FWRUxFVAAAAAAAAAAD6AAAAAAOVGlja2V0c1BlcldhdmUAAAAAAAAAAGQAAAAAC0NVUlJFTlRHQU1FAgAAAA0kQ1VSUkVOVF9HQU1FAAAAAA9HQU1FU0NPVU5URVJLRVkCAAAACSRHQU1FX05VTQAAAAAKTEFTVFRJQ0tFVAIAAAAMJExBU1RfVElDS0VUAAAAAARCQU5LAgAAAAokR0FNRV9CQU5LAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIAAAAGZ2FtZUlkAAAADWN1cnJlbnRQbGF5ZXIEAAAAEHBsYXllcnNQcmVzZW50ZWQJ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dGVTZXQAAAABBQAAAAdiZXREYXRhCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAAt0b1dpblNlcnZlcgAAAACi7dRE", "chainId": 84, "height": 666870, "spentComplexity": 0 } View: original | compacted Prev: 32qsTgxx1aTMzvupms8e8DT2nUht88BvHGKzJrqh3Vd5 Next: EnpE8ac45xwM9iADdDzuBhnJ43evyfjgEGNhXn36d7bH Diff:
OldNewDifferences
1515
1616 let g = "$LAST_TICKET"
1717
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)
2527 }
2628
2729
28-func l (m) = {
29- let n = size(m)
30- if ((n == 0))
30+func m (n) = {
31+ let o = size(n)
32+ if ((o == 0))
3133 then throw("Parameter size must be greater then 0")
32- else if ((n > 99))
34+ else if ((o > 99))
3335 then throw("Parameter size must be less then 100")
34- else if ((10 > n))
35- then (("0" + toString(n)) + m)
36- else (toString(n) + m)
36+ else if ((10 > o))
37+ then (("0" + toString(o)) + n)
38+ else (toString(o) + n)
3739 }
3840
3941
40-func o () = {
41- let p = isDefined(getInteger(this, g))
42- if (!(p))
42+func p () = {
43+ let q = isDefined(getInteger(this, g))
44+ if (!(q))
4345 then 0
4446 else getIntegerValue(this, g)
4547 }
4648
4749
48-func q (i,r,s) = {
49- let t = o()
50- let u = (s / b)
51- let v = (t + 1)
52- let w = ((v + (u * d)) - 1)
53- let x = ((l(toString(v)) + "_") + l(toString(w)))
54- let y = isDefined(getString(this, (((i + "_") + r) + "_tickets")))
55- if (y)
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)
5658 then {
57- let z = getStringValue(this, (((i + "_") + r) + "_tickets"))
58- ((z + " ") + x)
59+ let A = getStringValue(this, (((j + "_") + s) + "_tickets"))
60+ ((A + " ") + y)
5961 }
60- else x
62+ else y
6163 }
6264
6365
64-func A (s) = {
65- let t = o()
66- let u = (s / b)
67- (t + (u * d))
66+func B (t) = {
67+ let u = p()
68+ let v = (t / b)
69+ (u + (v * d))
6870 }
6971
7072
71-func B (i,C) = {
72- let D = {
73- let E = getInteger(this, f)
74- if ($isInstanceOf(E, "Int"))
73+func C (j,D) = {
74+ let E = {
75+ let F = getInteger(this, f)
76+ if ($isInstanceOf(F, "Int"))
7577 then {
76- let F = E
77- F
78+ let G = F
79+ G
7880 }
7981 else 0
8082 }
81- if ((i == C))
82- then (D + 1)
83- else D
83+ if ((j == D))
84+ then (E + 1)
85+ else E
8486 }
8587
8688
87-func G (C) = {
88- let H = isDefined(getString(this, e))
89- if (!(H))
90- then C
89+func H (D) = {
90+ let I = isDefined(getString(this, e))
91+ if (!(I))
92+ then D
9193 else if ((getStringValue(this, e) == ""))
92- then C
94+ then D
9395 else getStringValue(this, e)
9496 }
9597
9698
97-func I (C) = {
98- let i = G(C)
99- let J = isDefined(getString(this, (i + "_result")))
100- if (J)
101- then C
102- else i
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
103105 }
104106
105107
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)
113143 }
114144
115145
116146
117-@Callable(K)
147+@Callable(P)
118148 func bet () = {
119- let C = toBase58String(K.transactionId)
120- let i = I(C)
121- let D = B(i, C)
122- let O = extract(K.payment)
123- let s = O.amount
124- let P = isDefined(O.assetId)
125- let Q = isDefined(O.assetId)
126- let L = toBase58String(K.callerPublicKey)
127- let M = addressFromPublicKey(fromBase58String(L))
128- if (P)
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)
129159 then throw("Bet amount must be in Waves")
130- else if (Q)
160+ else if (V)
131161 then throw("Transaction's fee must be in Waves")
132162 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))
137170 }
138171 }
139172
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = addressFromStringValue("3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE")
55
66 let b = ((100 * 1000) * 1000)
77
88 let c = ((5 * b) / 1000)
99
1010 let d = 100
1111
1212 let e = "$CURRENT_GAME"
1313
1414 let f = "$GAME_NUM"
1515
1616 let g = "$LAST_TICKET"
1717
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)
2527 }
2628
2729
28-func l (m) = {
29- let n = size(m)
30- if ((n == 0))
30+func m (n) = {
31+ let o = size(n)
32+ if ((o == 0))
3133 then throw("Parameter size must be greater then 0")
32- else if ((n > 99))
34+ else if ((o > 99))
3335 then throw("Parameter size must be less then 100")
34- else if ((10 > n))
35- then (("0" + toString(n)) + m)
36- else (toString(n) + m)
36+ else if ((10 > o))
37+ then (("0" + toString(o)) + n)
38+ else (toString(o) + n)
3739 }
3840
3941
40-func o () = {
41- let p = isDefined(getInteger(this, g))
42- if (!(p))
42+func p () = {
43+ let q = isDefined(getInteger(this, g))
44+ if (!(q))
4345 then 0
4446 else getIntegerValue(this, g)
4547 }
4648
4749
48-func q (i,r,s) = {
49- let t = o()
50- let u = (s / b)
51- let v = (t + 1)
52- let w = ((v + (u * d)) - 1)
53- let x = ((l(toString(v)) + "_") + l(toString(w)))
54- let y = isDefined(getString(this, (((i + "_") + r) + "_tickets")))
55- if (y)
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)
5658 then {
57- let z = getStringValue(this, (((i + "_") + r) + "_tickets"))
58- ((z + " ") + x)
59+ let A = getStringValue(this, (((j + "_") + s) + "_tickets"))
60+ ((A + " ") + y)
5961 }
60- else x
62+ else y
6163 }
6264
6365
64-func A (s) = {
65- let t = o()
66- let u = (s / b)
67- (t + (u * d))
66+func B (t) = {
67+ let u = p()
68+ let v = (t / b)
69+ (u + (v * d))
6870 }
6971
7072
71-func B (i,C) = {
72- let D = {
73- let E = getInteger(this, f)
74- if ($isInstanceOf(E, "Int"))
73+func C (j,D) = {
74+ let E = {
75+ let F = getInteger(this, f)
76+ if ($isInstanceOf(F, "Int"))
7577 then {
76- let F = E
77- F
78+ let G = F
79+ G
7880 }
7981 else 0
8082 }
81- if ((i == C))
82- then (D + 1)
83- else D
83+ if ((j == D))
84+ then (E + 1)
85+ else E
8486 }
8587
8688
87-func G (C) = {
88- let H = isDefined(getString(this, e))
89- if (!(H))
90- then C
89+func H (D) = {
90+ let I = isDefined(getString(this, e))
91+ if (!(I))
92+ then D
9193 else if ((getStringValue(this, e) == ""))
92- then C
94+ then D
9395 else getStringValue(this, e)
9496 }
9597
9698
97-func I (C) = {
98- let i = G(C)
99- let J = isDefined(getString(this, (i + "_result")))
100- if (J)
101- then C
102- else i
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
103105 }
104106
105107
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)
113143 }
114144
115145
116146
117-@Callable(K)
147+@Callable(P)
118148 func bet () = {
119- let C = toBase58String(K.transactionId)
120- let i = I(C)
121- let D = B(i, C)
122- let O = extract(K.payment)
123- let s = O.amount
124- let P = isDefined(O.assetId)
125- let Q = isDefined(O.assetId)
126- let L = toBase58String(K.callerPublicKey)
127- let M = addressFromPublicKey(fromBase58String(L))
128- if (P)
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)
129159 then throw("Bet amount must be in Waves")
130- else if (Q)
160+ else if (V)
131161 then throw("Transaction's fee must be in Waves")
132162 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))
137170 }
138171 }
139172
140173

github/deemru/w8io/169f3d6 
94.81 ms