tx · GPMEoeDGzmpAZ4cCpxx3DAVdRYRx4mEmVSRTUbfw3A3a 3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE: -0.01400000 Waves 2019.09.08 11:11 [666843] smart account 3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE > SELF 0.00000000 Waves
{ "type": 13, "id": "GPMEoeDGzmpAZ4cCpxx3DAVdRYRx4mEmVSRTUbfw3A3a", "fee": 1400000, "feeAssetId": null, "timestamp": 1567930268717, "version": 1, "sender": "3N9XnyPpWxYohKH7z5dEuq8rpnobpyzPrzE", "senderPublicKey": "ESNVczQiY4oxY2hoRSZcruKNBwsPdXVu1nSCbpprDGJB", "proofs": [ "5aLHTjPRghJKnkQhUa92NXQcoqSi3VpfPL3UJTj3w9VSFS5jWs6j5n7nwrJbcbZkCBLLfnjyuXRp5RSGiMS9YNvP" ], "script": "base64:AAIDAAAAAAAAAAAAAAAKAAAAAA9TZXJ2ZXJQdWJsaWNLZXkJAAJZAAAAAQIAAAAsN2ltOWNhaUNtRTRTTDZqVG00S1RpY0hINGJHUGY1djU5cm5mVUEzY0NSRGoAAAAACUJldFNlcnZlcgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTjZ5Rko1WjhOVVVRdmZHR01McDVlZm1ldlJSdFRnUXV1bgAAAAAHV0FWRUxFVAkAAGgAAAACCQAAaAAAAAIAAAAAAAAAAGQAAAAAAAAAA+gAAAAAAAAAA+gAAAAACkNPTU1JU1NJT04JAABpAAAAAgkAAGgAAAACAAAAAAAAAAAFBQAAAAdXQVZFTEVUAAAAAAAAAAPoAAAAAA5UaWNrZXRzUGVyV2F2ZQAAAAAAAAAAZAAAAAALQ1VSUkVOVEdBTUUCAAAADSRDVVJSRU5UX0dBTUUAAAAACkxBU1RUSUNLRVQCAAAADCRMQVNUX1RJQ0tFVAEAAAAPR2VuZXJhdGVSYW5kSW50AAAAAgAAAAZnYW1lSWQAAAAHcnNhU2lnbgQAA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AkAAAIAAAABAgAAAAVFcnJvcgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABBDdXJyZW50IEdhbWUgaXMgBQAAAAtjdXJyZW50R2FtZQIAAAAKLCBidXQgbm90IAUAAAAGZ2FtZUlkAAAAAHno5F8=", "chainId": 84, "height": 666843, "spentComplexity": 0 } View: original | compacted Prev: Gb1METas8sCSMMZjfEWKYCAEMhmCLotbQmPmcWTT9jZB Next: 4j8FQcv5Vib3a7s3y8M1L3pjMA85ULsFqCtSCfCbspnS Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | - | func n (i,o) = { | |
33 | - | let p = (((i + "_") + o) + "_tickets") | |
34 | - | getStringValue(b, p) | |
35 | - | } | |
36 | - | ||
37 | - | ||
38 | - | func q (r) = { | |
39 | - | let s = size(r) | |
40 | - | if ((s > 0)) | |
41 | - | then { | |
42 | - | let t = parseIntValue(take(r, 2)) | |
43 | - | let u = take(drop(r, 2), t) | |
44 | - | let v = drop(r, (t + 2)) | |
45 | - | let w = v | |
46 | - | [u, w] | |
47 | - | } | |
48 | - | else throw("Empty string was passed into parseNextAttribute func") | |
49 | - | } | |
50 | - | ||
51 | - | ||
52 | - | func x (p) = ["1", "100", "101", "300", "0", "0", "0", "0"] | |
53 | - | ||
54 | - | ||
55 | - | func y (o) = if ((o == "3MsD5LWNJmQkkWpj3RtaeRVrKGLgoCE7kpB")) | |
56 | - | then ["1", "100", "0", "0", "0", "0", "0", "0"] | |
57 | - | else if ((o == "3N8bMv9V4spvb9bAeRtGve5RLkVN8swFDWc")) | |
58 | - | then ["101", "300", "0", "0", "0", "0", "0", "0"] | |
59 | - | else throw("Победитель не учавствовал епт") | |
60 | - | ||
61 | - | ||
62 | - | func z (i,o,A) = { | |
63 | - | let B = y(o) | |
64 | - | if (if ((A >= parseIntValue(B[0]))) | |
65 | - | then (parseIntValue(B[1]) >= A) | |
32 | + | func n (o,p) = { | |
33 | + | let q = split(o, "_") | |
34 | + | if (if ((p >= parseIntValue(q[0]))) | |
35 | + | then (parseIntValue(q[1]) >= p) | |
66 | 36 | else false) | |
67 | 37 | then true | |
68 | - | else if (if (( | |
69 | - | then (parseIntValue( | |
38 | + | else if (if ((p >= parseIntValue(q[2]))) | |
39 | + | then (parseIntValue(q[3]) >= p) | |
70 | 40 | else false) | |
71 | 41 | then true | |
72 | - | else if (if (( | |
73 | - | then (parseIntValue( | |
42 | + | else if (if ((p >= parseIntValue(q[4]))) | |
43 | + | then (parseIntValue(q[5]) >= p) | |
74 | 44 | else false) | |
75 | 45 | then true | |
76 | - | else if (if (( | |
77 | - | then (parseIntValue( | |
46 | + | else if (if ((p >= parseIntValue(q[6]))) | |
47 | + | then (parseIntValue(q[7]) >= p) | |
78 | 48 | else false) | |
79 | 49 | then true | |
80 | 50 | else false | |
81 | 51 | } | |
82 | 52 | ||
83 | 53 | ||
84 | - | func C (i,A) = { | |
85 | - | let D = getStringValue(b, (i + "_players")) | |
86 | - | let E = split(D, "_") | |
87 | - | if (z(i, E[0], A)) | |
88 | - | then E[0] | |
89 | - | else if (z(i, E[1], A)) | |
90 | - | then E[1] | |
91 | - | else if (z(i, E[2], A)) | |
92 | - | then E[2] | |
93 | - | else if (z(i, E[3], A)) | |
94 | - | then E[3] | |
95 | - | else throw("Error with defining winner") | |
54 | + | func r (i,p,s) = { | |
55 | + | let t = getIntegerValue(b, (((i + "_") + s) + "_bank")) | |
56 | + | let u = [ScriptTransfer(addressFromStringValue(s), t, unit)] | |
57 | + | let v = [DataEntry((i + "_result"), toString(p)), DataEntry((i + "_winner"), s), DataEntry((i + "_winAmt"), t)] | |
58 | + | ScriptResult(WriteSet(v), TransferSet(u)) | |
96 | 59 | } | |
97 | 60 | ||
98 | 61 | ||
99 | - | func F (G) = (1 * c) | |
100 | - | ||
101 | - | ||
102 | - | @Callable(H) | |
103 | - | func generateResult (i,I) = { | |
104 | - | let J = getStringValue(b, f) | |
105 | - | if ((J == i)) | |
62 | + | @Callable(w) | |
63 | + | func generateResult (i,x) = { | |
64 | + | let y = getStringValue(b, f) | |
65 | + | if ((y == i)) | |
106 | 66 | then { | |
107 | - | let j = fromBase58String(I) | |
108 | - | let A = h(i, j) | |
109 | - | let G = C(i, A) | |
110 | - | let K = F(G) | |
111 | - | let L = [ScriptTransfer(addressFromStringValue(G), K, unit)] | |
112 | - | let M = [DataEntry((i + "_result"), toString(A)), DataEntry((i + "_winner"), G), DataEntry((i + "_winAmt"), K)] | |
113 | - | ScriptResult(WriteSet(M), TransferSet(L)) | |
67 | + | let j = fromBase58String(x) | |
68 | + | let p = h(i, j) | |
69 | + | let z = getStringValue(b, (i + "_players")) | |
70 | + | let A = split(z, "_") | |
71 | + | if (n(getStringValue(b, (((i + "_") + A[0]) + "_tickets")), p)) | |
72 | + | then r(i, p, A[0]) | |
73 | + | else if (n(getStringValue(b, (((i + "_") + A[1]) + "_tickets")), p)) | |
74 | + | then r(i, p, A[1]) | |
75 | + | else if (n(getStringValue(b, (((i + "_") + A[2]) + "_tickets")), p)) | |
76 | + | then r(i, p, A[2]) | |
77 | + | else if (n(getStringValue(b, (((i + "_") + A[3]) + "_tickets")), p)) | |
78 | + | then r(i, p, A[3]) | |
79 | + | else if (n(getStringValue(b, (((i + "_") + A[4]) + "_tickets")), p)) | |
80 | + | then r(i, p, A[4]) | |
81 | + | else throw("Error") | |
114 | 82 | } | |
115 | - | else throw(((("Current Game is " + | |
83 | + | else throw(((("Current Game is " + y) + ", but not ") + i)) | |
116 | 84 | } | |
117 | 85 | ||
118 | 86 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = fromBase58String("7im9caiCmE4SL6jTm4KTicHH4bGPf5v59rnfUA3cCRDj") | |
5 | 5 | ||
6 | 6 | let b = addressFromStringValue("3N6yFJ5Z8NUUQvfGGMLp5efmevRRtTgQuun") | |
7 | 7 | ||
8 | 8 | let c = ((100 * 1000) * 1000) | |
9 | 9 | ||
10 | 10 | let d = ((5 * c) / 1000) | |
11 | 11 | ||
12 | 12 | let e = 100 | |
13 | 13 | ||
14 | 14 | let f = "$CURRENT_GAME" | |
15 | 15 | ||
16 | 16 | let g = "$LAST_TICKET" | |
17 | 17 | ||
18 | 18 | func h (i,j) = { | |
19 | 19 | let k = getIntegerValue(b, g) | |
20 | 20 | let l = sigVerify(toBytes(i), j, a) | |
21 | 21 | if (l) | |
22 | 22 | then { | |
23 | 23 | let m = (toInt(sha256(j)) % k) | |
24 | 24 | if ((0 > m)) | |
25 | 25 | then ((-1 * m) + 1) | |
26 | 26 | else (m + 1) | |
27 | 27 | } | |
28 | 28 | else throw("Invalid RSA signature") | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | - | func n (i,o) = { | |
33 | - | let p = (((i + "_") + o) + "_tickets") | |
34 | - | getStringValue(b, p) | |
35 | - | } | |
36 | - | ||
37 | - | ||
38 | - | func q (r) = { | |
39 | - | let s = size(r) | |
40 | - | if ((s > 0)) | |
41 | - | then { | |
42 | - | let t = parseIntValue(take(r, 2)) | |
43 | - | let u = take(drop(r, 2), t) | |
44 | - | let v = drop(r, (t + 2)) | |
45 | - | let w = v | |
46 | - | [u, w] | |
47 | - | } | |
48 | - | else throw("Empty string was passed into parseNextAttribute func") | |
49 | - | } | |
50 | - | ||
51 | - | ||
52 | - | func x (p) = ["1", "100", "101", "300", "0", "0", "0", "0"] | |
53 | - | ||
54 | - | ||
55 | - | func y (o) = if ((o == "3MsD5LWNJmQkkWpj3RtaeRVrKGLgoCE7kpB")) | |
56 | - | then ["1", "100", "0", "0", "0", "0", "0", "0"] | |
57 | - | else if ((o == "3N8bMv9V4spvb9bAeRtGve5RLkVN8swFDWc")) | |
58 | - | then ["101", "300", "0", "0", "0", "0", "0", "0"] | |
59 | - | else throw("Победитель не учавствовал епт") | |
60 | - | ||
61 | - | ||
62 | - | func z (i,o,A) = { | |
63 | - | let B = y(o) | |
64 | - | if (if ((A >= parseIntValue(B[0]))) | |
65 | - | then (parseIntValue(B[1]) >= A) | |
32 | + | func n (o,p) = { | |
33 | + | let q = split(o, "_") | |
34 | + | if (if ((p >= parseIntValue(q[0]))) | |
35 | + | then (parseIntValue(q[1]) >= p) | |
66 | 36 | else false) | |
67 | 37 | then true | |
68 | - | else if (if (( | |
69 | - | then (parseIntValue( | |
38 | + | else if (if ((p >= parseIntValue(q[2]))) | |
39 | + | then (parseIntValue(q[3]) >= p) | |
70 | 40 | else false) | |
71 | 41 | then true | |
72 | - | else if (if (( | |
73 | - | then (parseIntValue( | |
42 | + | else if (if ((p >= parseIntValue(q[4]))) | |
43 | + | then (parseIntValue(q[5]) >= p) | |
74 | 44 | else false) | |
75 | 45 | then true | |
76 | - | else if (if (( | |
77 | - | then (parseIntValue( | |
46 | + | else if (if ((p >= parseIntValue(q[6]))) | |
47 | + | then (parseIntValue(q[7]) >= p) | |
78 | 48 | else false) | |
79 | 49 | then true | |
80 | 50 | else false | |
81 | 51 | } | |
82 | 52 | ||
83 | 53 | ||
84 | - | func C (i,A) = { | |
85 | - | let D = getStringValue(b, (i + "_players")) | |
86 | - | let E = split(D, "_") | |
87 | - | if (z(i, E[0], A)) | |
88 | - | then E[0] | |
89 | - | else if (z(i, E[1], A)) | |
90 | - | then E[1] | |
91 | - | else if (z(i, E[2], A)) | |
92 | - | then E[2] | |
93 | - | else if (z(i, E[3], A)) | |
94 | - | then E[3] | |
95 | - | else throw("Error with defining winner") | |
54 | + | func r (i,p,s) = { | |
55 | + | let t = getIntegerValue(b, (((i + "_") + s) + "_bank")) | |
56 | + | let u = [ScriptTransfer(addressFromStringValue(s), t, unit)] | |
57 | + | let v = [DataEntry((i + "_result"), toString(p)), DataEntry((i + "_winner"), s), DataEntry((i + "_winAmt"), t)] | |
58 | + | ScriptResult(WriteSet(v), TransferSet(u)) | |
96 | 59 | } | |
97 | 60 | ||
98 | 61 | ||
99 | - | func F (G) = (1 * c) | |
100 | - | ||
101 | - | ||
102 | - | @Callable(H) | |
103 | - | func generateResult (i,I) = { | |
104 | - | let J = getStringValue(b, f) | |
105 | - | if ((J == i)) | |
62 | + | @Callable(w) | |
63 | + | func generateResult (i,x) = { | |
64 | + | let y = getStringValue(b, f) | |
65 | + | if ((y == i)) | |
106 | 66 | then { | |
107 | - | let j = fromBase58String(I) | |
108 | - | let A = h(i, j) | |
109 | - | let G = C(i, A) | |
110 | - | let K = F(G) | |
111 | - | let L = [ScriptTransfer(addressFromStringValue(G), K, unit)] | |
112 | - | let M = [DataEntry((i + "_result"), toString(A)), DataEntry((i + "_winner"), G), DataEntry((i + "_winAmt"), K)] | |
113 | - | ScriptResult(WriteSet(M), TransferSet(L)) | |
67 | + | let j = fromBase58String(x) | |
68 | + | let p = h(i, j) | |
69 | + | let z = getStringValue(b, (i + "_players")) | |
70 | + | let A = split(z, "_") | |
71 | + | if (n(getStringValue(b, (((i + "_") + A[0]) + "_tickets")), p)) | |
72 | + | then r(i, p, A[0]) | |
73 | + | else if (n(getStringValue(b, (((i + "_") + A[1]) + "_tickets")), p)) | |
74 | + | then r(i, p, A[1]) | |
75 | + | else if (n(getStringValue(b, (((i + "_") + A[2]) + "_tickets")), p)) | |
76 | + | then r(i, p, A[2]) | |
77 | + | else if (n(getStringValue(b, (((i + "_") + A[3]) + "_tickets")), p)) | |
78 | + | then r(i, p, A[3]) | |
79 | + | else if (n(getStringValue(b, (((i + "_") + A[4]) + "_tickets")), p)) | |
80 | + | then r(i, p, A[4]) | |
81 | + | else throw("Error") | |
114 | 82 | } | |
115 | - | else throw(((("Current Game is " + | |
83 | + | else throw(((("Current Game is " + y) + ", but not ") + i)) | |
116 | 84 | } | |
117 | 85 | ||
118 | 86 |
github/deemru/w8io/169f3d6 33.50 ms ◑