tx · MVUGPZee1RjcpRG2xhWt1aemYQJ6jp5AQ43ksEuGa4z 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs: -0.01400000 Waves 2019.09.08 04:26 [666444] smart account 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs > SELF 0.00000000 Waves
{ "type": 13, "id": "MVUGPZee1RjcpRG2xhWt1aemYQJ6jp5AQ43ksEuGa4z", "fee": 1400000, "feeAssetId": null, "timestamp": 1567905986157, "version": 1, "sender": "3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs", "senderPublicKey": "HSTmdhPrJF81ozDBaqVn8QVtV76oD7gzDfcHPQRdxdwW", "proofs": [ "4djcKaNXEWrfZx8xTFFo82AvvWeFbvFCPVZof7bCcCGKFRfBPjhPxuudQxwWna3Pr7MLv3dYpU4iSQTPtSAiGnws" ], "script": "base64:AAIDAAAAAAAAAAAAAAANAAAAAAlXaW5TZXJ2ZXIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM045WG55UHBXeFlvaEtIN3o1ZEV1cThycG5vYnB5elByekUAAAAAB1dBVkVMRVQJAABoAAAAAgkAAGgAAAACAAAAAAAAAABkAAAAAAAAAAPoAAAAAAAAAAPoAAAAAApDT01NSVNTSU9OCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAHV0FWRUxFVAAAAAAAAAAD6AAAAAAOVGlja2V0c1BlcldhdmUAAAAAAAAAAGQAAAAAC0NVUlJFTlRHQU1FAgAAAA0kQ1VSUkVOVF9HQU1FAAAAAA9HQU1FU0NPVU5URVJLRVkCAAAACSRHQU1FX05VTQAAAAAKTEFTVFRJQ0tFVAIAAAAMJExBU1RfVElDS0VUAQAAAA5nZXRQbGF5ZXJzTGlzdAAAAAIAAAAGZ2FtZUlkAAAADWN1cnJlbnRQbGF5ZXIEAAAAEHBsYXllcnNQcmVzZW50ZWQJAQAAAAlpc0RlZmluZWQAAAABCQAE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HcGF5bWVudAQAAAAKcGF5bWVudEFtdAgFAAAAA3BtdAAAAAZhbW91bnQEAAAADWJldE5vdEluV2F2ZXMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQEAAAADWZlZU5vdEluV2F2ZXMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQEAAAADnBsYXllclB1YktleTU4CQACWAAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQQAAAANcGxheWVyQWRkcmVzcwkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQkAAlkAAAABBQAAAA5wbGF5ZXJQdWJLZXk1OAMFAAAADWJldE5vdEluV2F2ZXMJAAACAAAAAQIAAAAbQmV0IGFtb3VudCBtdXN0IGJlIGluIFdhdmVzAwUAAAANZmVlTm90SW5XYXZlcwkAAAIAAAABAgAAACJUcmFuc2FjdGlvbidzIGZlZSBtdXN0IGJlIGluIFdhdmVzBAAAABBwbGF5ZXJBZGRyZXNzU3RyCQAEJQAAAAEFAAAADXBsYXllckFkZHJlc3MEAAAABmRiRGF0YQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAPJFBsYXllcl9BZGRyZXNzBQAAABBwbGF5ZXJBZGRyZXNzU3RyBQAAAANuaWwJAQAAAAhXcml0ZVNldAAAAAEFAAAABmRiRGF0YQAAAADBL8Eo", "chainId": 84, "height": 666444, "spentComplexity": 0 } View: original | compacted Prev: Sz8cJTniKoJULb3CiNbYHLhXxP46wyxqvXKxzRKwdjL Next: DgwParyWMXzWJmSQxmDSPSYto3bfbotMZMz3zgBdWmKd Diff:
Old | New | Differences | |
---|---|---|---|
92 | 92 | let B = z(i, A) | |
93 | 93 | let H = extract(G.payment) | |
94 | 94 | let q = H.amount | |
95 | - | let I = [DataEntry("$Player_Pay", q)] | |
96 | - | WriteSet(I) | |
95 | + | let I = isDefined(H.assetId) | |
96 | + | let J = isDefined(H.assetId) | |
97 | + | let K = toBase58String(G.callerPublicKey) | |
98 | + | let L = addressFromPublicKey(fromBase58String(K)) | |
99 | + | if (I) | |
100 | + | then throw("Bet amount must be in Waves") | |
101 | + | else if (J) | |
102 | + | then throw("Transaction's fee must be in Waves") | |
103 | + | else { | |
104 | + | let p = toString(L) | |
105 | + | let M = [DataEntry("$Player_Address", p)] | |
106 | + | WriteSet(M) | |
107 | + | } | |
97 | 108 | } | |
98 | 109 | ||
99 | 110 |
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 (q) = { | |
57 | 57 | let r = getIntegerValue(this, g) | |
58 | 58 | let s = (q / b) | |
59 | 59 | (r + (s * d)) | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func z (i,A) = if ((i == A)) | |
64 | 64 | then { | |
65 | 65 | let B = { | |
66 | 66 | let C = getInteger(this, f) | |
67 | 67 | if ($isInstanceOf(C, "Int")) | |
68 | 68 | then { | |
69 | 69 | let D = C | |
70 | 70 | D | |
71 | 71 | } | |
72 | 72 | else 0 | |
73 | 73 | } | |
74 | 74 | toString((B + 1)) | |
75 | 75 | } | |
76 | 76 | else toString(getIntegerValue(this, f)) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func E (A) = { | |
80 | 80 | let i = getStringValue(this, e) | |
81 | 81 | let F = isDefined(getString(this, (i + "_result"))) | |
82 | 82 | if (F) | |
83 | 83 | then i | |
84 | 84 | else A | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | @Callable(G) | |
89 | 89 | func bet () = { | |
90 | 90 | let A = toBase58String(G.transactionId) | |
91 | 91 | let i = E(A) | |
92 | 92 | let B = z(i, A) | |
93 | 93 | let H = extract(G.payment) | |
94 | 94 | let q = H.amount | |
95 | - | let I = [DataEntry("$Player_Pay", q)] | |
96 | - | WriteSet(I) | |
95 | + | let I = isDefined(H.assetId) | |
96 | + | let J = isDefined(H.assetId) | |
97 | + | let K = toBase58String(G.callerPublicKey) | |
98 | + | let L = addressFromPublicKey(fromBase58String(K)) | |
99 | + | if (I) | |
100 | + | then throw("Bet amount must be in Waves") | |
101 | + | else if (J) | |
102 | + | then throw("Transaction's fee must be in Waves") | |
103 | + | else { | |
104 | + | let p = toString(L) | |
105 | + | let M = [DataEntry("$Player_Address", p)] | |
106 | + | WriteSet(M) | |
107 | + | } | |
97 | 108 | } | |
98 | 109 | ||
99 | 110 |
github/deemru/w8io/026f985 32.91 ms ◑