tx · 2czEBKTtMuub4QwDAHRCcsaiBPthXX4RRisAKGqWYsUA 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs: -0.01400000 Waves 2019.09.08 04:32 [666452] smart account 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs > SELF 0.00000000 Waves
{ "type": 13, "id": "2czEBKTtMuub4QwDAHRCcsaiBPthXX4RRisAKGqWYsUA", "fee": 1400000, "feeAssetId": null, "timestamp": 1567906350258, "version": 1, "sender": "3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs", "senderPublicKey": "HSTmdhPrJF81ozDBaqVn8QVtV76oD7gzDfcHPQRdxdwW", "proofs": [ "59o2cSz1UXP1aTpG7vur2VHUcLQbFjr5we2W7nJCUEmXvy3f7XFXJcQwPGt4LCoZRonzmNcRbxvYVwpEiyTDmhEU" ], "script": "base64:AAIDAAAAAAAAAAAAAAAOAAAAAAlXaW5TZXJ2ZXIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM045WG55UHBXeFlvaEtIN3o1ZEV1cThycG5vYnB5elByekUAAAAAB1dBVkVMRVQJAABoAAAAAgkAAGgAAAACAAAAAAAAAABkAAAAAAAAAAPoAAAAAAAAAAPoAAAAAApDT01NSVNTSU9OCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAHV0FWRUxFVAAAAAAAAAAD6AAAAAAOVGlja2V0c1BlcldhdmUAAAAAAAAAAGQAAAAAC0NVUlJFTlRHQU1FAgAAAA0kQ1VSUkVOVF9HQU1FAAAAAA9HQU1FU0NPVU5URVJLRVkCAAAACSRHQU1FX05VTQAAAAAKTEFTVFRJQ0tFVAIAAAAMJExBU1RfVElDS0VUAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIAAAAGZ2FtZUlkAAAADWN1cnJlbnRQbGF5ZXIEAAAAEHBsYXllcnNQcmVzZW50ZWQJAQAAAAlpc0RlZmluZWQAAAABCQAEH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X3BsYXllcnMJAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIFAAAABmdhbWVJZAUAAAAQcGxheWVyQWRkcmVzc1N0cgkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKTEFTVFRJQ0tFVAkBAAAADWdldExhc3RUaWNrZXQAAAABBQAAAApwYXltZW50QW10BQAAAANuaWwEAAAAC3RvV2luU2VydmVyCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACVdpblNlcnZlcgUAAAAKcGF5bWVudEFtdAUAAAAEdW5pdAUAAAADbmlsCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQUAAAAHYmV0RGF0YQkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAALdG9XaW5TZXJ2ZXIAAAAAhY3Lgg==", "chainId": 84, "height": 666452, "spentComplexity": 0 } View: original | compacted Prev: DDSQWoYuEzcbQ2WZqy2SiQ7u2DV8RRYjDZdchZUxCMz4 Next: Ecsur6jBzNHdsPLssBFXTxAxxPTJpBu28rZvq9fys884 Diff:
Old | New | Differences | |
---|---|---|---|
110 | 110 | then throw("Transaction's fee must be in Waves") | |
111 | 111 | else { | |
112 | 112 | let p = toString(N) | |
113 | - | let O = [DataEntry(e, i), DataEntry(f, D), DataEntry(g, A(q))] | |
113 | + | let O = [DataEntry(e, i), DataEntry(f, D), DataEntry((i + "_players"), h(i, p)), DataEntry(g, A(q))] | |
114 | 114 | let P = [ScriptTransfer(a, q, unit)] | |
115 | 115 | ScriptResult(WriteSet(O), TransferSet(P)) | |
116 | 116 | } |
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 (i,p,q) = { | |
41 | 41 | let r = getIntegerValue(this, g) | |
42 | 42 | let s = (q / b) | |
43 | 43 | let t = (r + 1) | |
44 | 44 | let u = (t + (s * d)) | |
45 | 45 | let v = ((l(toString(t)) + "_") + l(toString(u))) | |
46 | 46 | let w = isDefined(getString(this, (((i + "_") + p) + "_tickets"))) | |
47 | 47 | if (w) | |
48 | 48 | then { | |
49 | 49 | let x = getStringValue(this, (((i + "_") + p) + "_tickets")) | |
50 | 50 | ((x + " ") + v) | |
51 | 51 | } | |
52 | 52 | else v | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func y () = { | |
57 | 57 | let z = isDefined(getString(this, g)) | |
58 | 58 | if (!(z)) | |
59 | 59 | then 0 | |
60 | 60 | else getIntegerValue(this, g) | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func A (q) = { | |
65 | 65 | let r = y() | |
66 | 66 | let s = (q / b) | |
67 | 67 | (r + (s * d)) | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func B (i,C) = if ((i == C)) | |
72 | 72 | then { | |
73 | 73 | let D = { | |
74 | 74 | let E = getInteger(this, f) | |
75 | 75 | if ($isInstanceOf(E, "Int")) | |
76 | 76 | then { | |
77 | 77 | let F = E | |
78 | 78 | F | |
79 | 79 | } | |
80 | 80 | else 0 | |
81 | 81 | } | |
82 | 82 | toString((D + 1)) | |
83 | 83 | } | |
84 | 84 | else toString(getIntegerValue(this, f)) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func G (C) = { | |
88 | 88 | let i = getStringValue(this, e) | |
89 | 89 | let H = isDefined(getString(this, (i + "_result"))) | |
90 | 90 | if (H) | |
91 | 91 | then i | |
92 | 92 | else C | |
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(I) | |
97 | 97 | func bet () = { | |
98 | 98 | let C = toBase58String(I.transactionId) | |
99 | 99 | let i = G(C) | |
100 | 100 | let D = B(i, C) | |
101 | 101 | let J = extract(I.payment) | |
102 | 102 | let q = J.amount | |
103 | 103 | let K = isDefined(J.assetId) | |
104 | 104 | let L = isDefined(J.assetId) | |
105 | 105 | let M = toBase58String(I.callerPublicKey) | |
106 | 106 | let N = addressFromPublicKey(fromBase58String(M)) | |
107 | 107 | if (K) | |
108 | 108 | then throw("Bet amount must be in Waves") | |
109 | 109 | else if (L) | |
110 | 110 | then throw("Transaction's fee must be in Waves") | |
111 | 111 | else { | |
112 | 112 | let p = toString(N) | |
113 | - | let O = [DataEntry(e, i), DataEntry(f, D), DataEntry(g, A(q))] | |
113 | + | let O = [DataEntry(e, i), DataEntry(f, D), DataEntry((i + "_players"), h(i, p)), DataEntry(g, A(q))] | |
114 | 114 | let P = [ScriptTransfer(a, q, unit)] | |
115 | 115 | ScriptResult(WriteSet(O), TransferSet(P)) | |
116 | 116 | } | |
117 | 117 | } | |
118 | 118 | ||
119 | 119 |
github/deemru/w8io/026f985 43.15 ms ◑