tx · jHc41pMeYhYK4HCG9KxPcDyrTbCqJahQevxhC5rrNsg 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs: -0.01400000 Waves 2019.09.08 07:18 [666619] smart account 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs > SELF 0.00000000 Waves
{ "type": 13, "id": "jHc41pMeYhYK4HCG9KxPcDyrTbCqJahQevxhC5rrNsg", "fee": 1400000, "feeAssetId": null, "timestamp": 1567916299293, "version": 1, "sender": "3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs", "senderPublicKey": "HSTmdhPrJF81ozDBaqVn8QVtV76oD7gzDfcHPQRdxdwW", "proofs": [ "2xyBEeVNZTvRdrLUhoSf7aou7tmA6UFm4tqVb9w5xC1r1LU8rMZTu15fxpsuYHecY5sTuT6SJr7SGnt6ti7Hqjmk" ], "script": "base64:AAIDAAAAAAAAAAAAAAAPAAAAAAlXaW5TZXJ2ZXIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM045WG55UHBXeFlvaEtIN3o1ZEV1cThycG5vYnB5elByekUAAAAAB1dBVkVMRVQJAABoAAAAAgkAAGgAAAACAAAAAAAAAABkAAAAAAAAAAPoAAAAAAAAAAPoAAAAAApDT01NSVNTSU9OCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAHV0FWRUxFVAAAAAAAAAAD6AAAAAAOVGlja2V0c1BlcldhdmUAAAAAAAAAAGQAAAAAC0NVUlJFTlRHQU1FAgAAAA0kQ1VSUkVOVF9HQU1FAAAAAA9HQU1FU0NPVU5URVJLRVkCAAAACSRHQU1FX05VTQAAAAAKTEFTVFRJQ0tFVAIAAAAMJExBU1RfVElDS0VUAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIAAAAGZ2FtZUlkAAAADWN1cnJlbnRQbGF5ZXIEAAAAEHBsYXllcnNQcmVzZW50ZWQJAQAAAAlpc0RlZmluZWQAAAABCQAE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AAAIJAAEsAAAAAgUAAAAGZ2FtZUlkAgAAAAFfBQAAABBwbGF5ZXJBZGRyZXNzU3RyAgAAAAhfdGlja2V0cwkBAAAACmdldFRpY2tldHMAAAADBQAAAAZnYW1lSWQFAAAAEHBsYXllckFkZHJlc3NTdHIFAAAACnBheW1lbnRBbXQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAGZ2FtZUlkAgAAAAhfcGxheWVycwkBAAAADmdldFBsYXllcnNMaXN0AAAAAgUAAAAGZ2FtZUlkBQAAABBwbGF5ZXJBZGRyZXNzU3RyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAApMQVNUVElDS0VUCQEAAAANZ2V0TGFzdFRpY2tldAAAAAEFAAAACnBheW1lbnRBbXQFAAAAA25pbAQAAAALdG9XaW5TZXJ2ZXIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJV2luU2VydmVyBQAAAApwYXltZW50QW10BQAAAAR1bml0BQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABBQAAAAdiZXREYXRhCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAAt0b1dpblNlcnZlcgAAAACvT5MX", "chainId": 84, "height": 666619, "spentComplexity": 0 } View: original | compacted Prev: Fqan4pQadVAqBL4NajBhjfFenHHs5Ecu3C6BozbEjSJV Next: none Diff:
Old | New | Differences | |
---|---|---|---|
38 | 38 | ||
39 | 39 | ||
40 | 40 | func o () = { | |
41 | - | let p = isDefined( | |
41 | + | let p = isDefined(getInteger(this, g)) | |
42 | 42 | if (!(p)) | |
43 | 43 | then 0 | |
44 | 44 | else getIntegerValue(this, g) | |
79 | 79 | else 0 | |
80 | 80 | } | |
81 | 81 | if ((i == C)) | |
82 | - | then | |
83 | - | else | |
82 | + | then (D + 1) | |
83 | + | else D | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 |
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 | 18 | func h (i,j) = { | |
19 | 19 | let k = isDefined(getString(this, (i + "_players"))) | |
20 | 20 | if (!(k)) | |
21 | 21 | then j | |
22 | 22 | else if (isDefined(getString(this, (((i + "_") + j) + "_tickets")))) | |
23 | 23 | then getStringValue(this, (i + "_players")) | |
24 | 24 | else ((getStringValue(this, (i + "_players")) + "_") + j) | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func l (m) = { | |
29 | 29 | let n = size(m) | |
30 | 30 | if ((n == 0)) | |
31 | 31 | then throw("Parameter size must be greater then 0") | |
32 | 32 | else if ((n > 99)) | |
33 | 33 | then throw("Parameter size must be less then 100") | |
34 | 34 | else if ((10 > n)) | |
35 | 35 | then (("0" + toString(n)) + m) | |
36 | 36 | else (toString(n) + m) | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func o () = { | |
41 | - | let p = isDefined( | |
41 | + | let p = isDefined(getInteger(this, g)) | |
42 | 42 | if (!(p)) | |
43 | 43 | then 0 | |
44 | 44 | else getIntegerValue(this, g) | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func q (i,r,s) = { | |
49 | 49 | let t = o() | |
50 | 50 | let u = (s / b) | |
51 | 51 | let v = (t + 1) | |
52 | 52 | let w = ((v + (u * d)) - 1) | |
53 | 53 | let x = ((l(toString(v)) + "_") + l(toString(w))) | |
54 | 54 | let y = isDefined(getString(this, (((i + "_") + r) + "_tickets"))) | |
55 | 55 | if (y) | |
56 | 56 | then { | |
57 | 57 | let z = getStringValue(this, (((i + "_") + r) + "_tickets")) | |
58 | 58 | ((z + " ") + x) | |
59 | 59 | } | |
60 | 60 | else x | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func A (s) = { | |
65 | 65 | let t = o() | |
66 | 66 | let u = (s / b) | |
67 | 67 | (t + (u * d)) | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func B (i,C) = { | |
72 | 72 | let D = { | |
73 | 73 | let E = getInteger(this, f) | |
74 | 74 | if ($isInstanceOf(E, "Int")) | |
75 | 75 | then { | |
76 | 76 | let F = E | |
77 | 77 | F | |
78 | 78 | } | |
79 | 79 | else 0 | |
80 | 80 | } | |
81 | 81 | if ((i == C)) | |
82 | - | then | |
83 | - | else | |
82 | + | then (D + 1) | |
83 | + | else D | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func G (C) = { | |
88 | 88 | let H = isDefined(getString(this, e)) | |
89 | 89 | if (!(H)) | |
90 | 90 | then C | |
91 | 91 | else if ((getStringValue(this, e) == "")) | |
92 | 92 | then C | |
93 | 93 | else getStringValue(this, e) | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func I (C) = { | |
98 | 98 | let i = G(C) | |
99 | 99 | let J = isDefined(getString(this, (i + "_result"))) | |
100 | 100 | if (J) | |
101 | 101 | then C | |
102 | 102 | else i | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | @Callable(K) | |
107 | 107 | func resetGameData (i) = { | |
108 | 108 | let L = toBase58String(K.callerPublicKey) | |
109 | 109 | let M = addressFromPublicKey(fromBase58String(L)) | |
110 | 110 | let r = toString(M) | |
111 | 111 | let N = [DataEntry(e, ""), DataEntry(f, 0), DataEntry((((i + "_") + r) + "_tickets"), ""), DataEntry((i + "_players"), ""), DataEntry(g, 0)] | |
112 | 112 | WriteSet(N) | |
113 | 113 | } | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | ||
117 | 117 | @Callable(K) | |
118 | 118 | func bet () = { | |
119 | 119 | let C = toBase58String(K.transactionId) | |
120 | 120 | let i = I(C) | |
121 | 121 | let D = B(i, C) | |
122 | 122 | let O = extract(K.payment) | |
123 | 123 | let s = O.amount | |
124 | 124 | let P = isDefined(O.assetId) | |
125 | 125 | let Q = isDefined(O.assetId) | |
126 | 126 | let L = toBase58String(K.callerPublicKey) | |
127 | 127 | let M = addressFromPublicKey(fromBase58String(L)) | |
128 | 128 | if (P) | |
129 | 129 | then throw("Bet amount must be in Waves") | |
130 | 130 | else if (Q) | |
131 | 131 | then throw("Transaction's fee must be in Waves") | |
132 | 132 | else { | |
133 | 133 | let r = toString(M) | |
134 | 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 | 135 | let S = [ScriptTransfer(a, s, unit)] | |
136 | 136 | ScriptResult(WriteSet(R), TransferSet(S)) | |
137 | 137 | } | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 |
github/deemru/w8io/026f985 41.51 ms ◑