tx · E4R8Z8aZ6BHTn1pFVdS4SxmzPuMM14zUS6zPVQGo6DXX 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd: -0.10000000 Waves 2021.11.13 03:33 [1788515] smart account 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd > SELF 0.00000000 Waves
{ "type": 13, "id": "E4R8Z8aZ6BHTn1pFVdS4SxmzPuMM14zUS6zPVQGo6DXX", "fee": 10000000, "feeAssetId": null, "timestamp": 1636763735295, "version": 2, "chainId": 84, "sender": "3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd", "senderPublicKey": "7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi", "proofs": [ "2rFLn4dqZms6oyKon6bw7vJw5e8r2spA7QAbbkWdFBh7EprRBZ5FFtCbYs4S7BCwuUTxAYZ34XEXbhegmubf7jRa" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAACAAAAAAJc2VwYXJhdG9yAgAAAAEsAAAAAAVXQVZFUwAAAAAAO5rKAAAAAAAGbWF4QmV0CQAAaAAAAAIAAAAAAAAAAGQFAAAABVdBVkVTAQAAAApnZXROZXdEZWNrAAAAAAkABEwAAAACAgAAAAMwMUMJAARMAAAAAgIAAAADMDJDCQAETAAAAAICAAAAAzAzQwkABEwAAAACAgAAAAMwNEMJAARMAAAAAgIAAAADMDVDCQAETAAAAAICAAAAAzA2QwkABEwAAAACAgAAAAMwN0MJAARMAAAAAgIAAAADMDhDCQAETAAAAAICAAAAAzA5QwkABEwAAAACAgAAAAMxMEMJAARMAAAAAgIAAAADMTFDCQAETAAAAAICAAAAAzEyQwkABEwAAAACAgAAAAMxM0MJAARMAAAAAgIAAAADMDFECQAETAAAAAICAAAAAzAyRAkABEwAAAACAgAAAAMwM0QJAARMAAAAAgIAAAADMDRECQAETAAAAAICAAAAAzA1RAkABEwAAAACAgAAAAMwNkQJAARMAAAAAgIAAAADMDdECQAETAAAAAICAAAAAzA4RAk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plexity": 0 } View: original | compacted Prev: 2bymUMbeiD31XfHwj4NbTPgDuJhbKgkhLkAbvbUrnjab Next: 8r6zEhmDQC5HyZvmCqe6vA8AB8WgkWQ54J8s65o4UPHY Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = " | |
4 | + | let a = "," | |
5 | 5 | ||
6 | 6 | let b = 1000000000 | |
7 | 7 | ||
8 | 8 | let c = (100 * b) | |
9 | 9 | ||
10 | - | let d = "," | |
11 | - | ||
12 | - | func e () = ["01C", "02C", "03C", "04C", "05C", "06C", "07C", "08C", "09C", "10C", "11C", "12C", "13C", "01D", "02D", "03D", "04D", "05D", "06D", "07D", "08D", "09D", "10D", "11D", "12D", "13D", "01H", "02H", "03H", "04H", "05H", "06H", "07H", "08H", "09H", "10H", "11H", "12H", "13H", "01S", "02S", "03S", "04S", "05S", "06S", "07S", "08S", "09S", "10S", "11S", "12S", "13S"] | |
10 | + | func d () = ["01C", "02C", "03C", "04C", "05C", "06C", "07C", "08C", "09C", "10C", "11C", "12C", "13C", "01D", "02D", "03D", "04D", "05D", "06D", "07D", "08D", "09D", "10D", "11D", "12D", "13D", "01H", "02H", "03H", "04H", "05H", "06H", "07H", "08H", "09H", "10H", "11H", "12H", "13H", "01S", "02S", "03S", "04S", "05S", "06S", "07S", "08S", "09S", "10S", "11S", "12S", "13S"] | |
13 | 11 | ||
14 | 12 | ||
15 | - | func | |
16 | - | then | |
17 | - | else | |
13 | + | func e (f) = if ((0 >= size(f))) | |
14 | + | then d() | |
15 | + | else f | |
18 | 16 | ||
19 | 17 | ||
20 | - | func h (i,j,k) = { | |
21 | - | let l = sha256(toBytes((i + j))) | |
22 | - | let m = toInt(l) | |
23 | - | let n = (m % k) | |
24 | - | if ((0 > n)) | |
25 | - | then ((-1 * n) + 1) | |
26 | - | else (n + 1) | |
27 | - | } | |
18 | + | func g (h,i) = if (isDefined(getString(h, i))) | |
19 | + | then { | |
20 | + | let j = getStringValue(h, i) | |
21 | + | let f = split(j, a) | |
22 | + | if ((size(f) == 0)) | |
23 | + | then d() | |
24 | + | else f | |
25 | + | } | |
26 | + | else d() | |
28 | 27 | ||
29 | 28 | ||
30 | - | func | |
31 | - | let | |
32 | - | if ($isInstanceOf( | |
29 | + | func k (h,l) = { | |
30 | + | let m = getInteger(h, l) | |
31 | + | if ($isInstanceOf(m, "Int")) | |
33 | 32 | then { | |
34 | - | let r = q | |
35 | - | toString(r) | |
36 | - | } | |
37 | - | else p | |
38 | - | } | |
39 | - | ||
40 | - | ||
41 | - | func s (t,u) = { | |
42 | - | let q = getInteger(t, u) | |
43 | - | if ($isInstanceOf(q, "Int")) | |
44 | - | then { | |
45 | - | let v = q | |
46 | - | v | |
33 | + | let n = m | |
34 | + | n | |
47 | 35 | } | |
48 | 36 | else 0 | |
49 | 37 | } | |
50 | 38 | ||
51 | 39 | ||
52 | - | func | |
40 | + | func o (p) = if ((size(p.payments) == 0)) | |
53 | 41 | then throw("Payment must be attached") | |
54 | 42 | else { | |
55 | - | let | |
56 | - | if (isDefined( | |
43 | + | let q = p.payments[0] | |
44 | + | if (isDefined(q.assetId)) | |
57 | 45 | then throw("This function accepts WAVES tokens only") | |
58 | - | else | |
46 | + | else q.amount | |
59 | 47 | } | |
60 | 48 | ||
61 | 49 | ||
62 | - | func z (A) = parseIntValue(take(A, 2)) | |
63 | - | ||
64 | - | ||
65 | - | func B (C,D,E,a) = { | |
66 | - | let F = z(C) | |
67 | - | let G = z(D) | |
68 | - | if ((F > G)) | |
69 | - | then E | |
70 | - | else a | |
71 | - | } | |
72 | - | ||
73 | - | ||
74 | - | func H (t,I) = if (isDefined(getString(t, I))) | |
75 | - | then { | |
76 | - | let J = getStringValue(t, I) | |
77 | - | let g = split(J, d) | |
78 | - | if ((size(g) == 0)) | |
79 | - | then e() | |
80 | - | else g | |
81 | - | } | |
82 | - | else e() | |
83 | - | ||
84 | - | ||
85 | - | @Callable(x) | |
86 | - | func bet (K) = { | |
87 | - | let E = toBase58String(x.caller.bytes) | |
88 | - | let L = ((K + "_") + E) | |
89 | - | let F = w(x) | |
90 | - | let M = (L + "_sumBets") | |
91 | - | let N = s(this, M) | |
92 | - | let O = { | |
93 | - | let q = getInteger(this, (L + "_drawSequence")) | |
94 | - | if ($isInstanceOf(q, "Int")) | |
50 | + | @Callable(p) | |
51 | + | func bet1 (r) = { | |
52 | + | let s = toBase58String(p.caller.bytes) | |
53 | + | let t = ((r + "_") + s) | |
54 | + | let u = o(p) | |
55 | + | let v = (t + "_sumBets") | |
56 | + | let w = k(this, v) | |
57 | + | let x = { | |
58 | + | let m = getInteger(this, (t + "_drawSequence")) | |
59 | + | if ($isInstanceOf(m, "Int")) | |
95 | 60 | then { | |
96 | - | let | |
97 | - | ( | |
61 | + | let n = m | |
62 | + | (n + 1) | |
98 | 63 | } | |
99 | 64 | else 0 | |
100 | 65 | } | |
101 | - | let | |
102 | - | let | |
103 | - | if (if (isDefined(getBoolean(this, ( | |
66 | + | let i = (t + "_available") | |
67 | + | let y = (w + u) | |
68 | + | if (if (isDefined(getBoolean(this, (r + "_stop")))) | |
104 | 69 | then true | |
105 | - | else isDefined(getString(this, | |
70 | + | else isDefined(getString(this, r))) | |
106 | 71 | then throw("This round is already played") | |
107 | - | else if (( | |
108 | - | then throw(((("Maximum amount of bets for round " + toString(c)) + ". With your bet it's ") + toString( | |
72 | + | else if ((y > c)) | |
73 | + | then throw(((("Maximum amount of bets for round " + toString(c)) + ". With your bet it's ") + toString(y))) | |
109 | 74 | else { | |
110 | - | let Q = H(this, I) | |
111 | - | let R = h((L + makeString(Q, d)), o(E), size(Q)) | |
112 | - | let C = Q[(R % size(Q))] | |
113 | - | let S = removeByIndex(Q, (R % size(Q))) | |
114 | - | let T = f(S) | |
115 | - | let U = h((L + makeString(T, d)), o(E), size(T)) | |
116 | - | let D = T[(U % size(T))] | |
117 | - | let V = removeByIndex(T, (R % size(T))) | |
118 | - | if ((z(C) == z(D))) | |
119 | - | then [IntegerEntry((L + "_drawSequence"), (O + 1))] | |
120 | - | else { | |
121 | - | let W = B(C, D, E, a) | |
122 | - | [StringEntry((L + "_winner"), W)] | |
123 | - | } | |
75 | + | let z = g(this, i) | |
76 | + | [StringEntry(i, makeString(z, a))] | |
124 | 77 | } | |
125 | 78 | } | |
126 | 79 | ||
127 | 80 | ||
128 | - | ||
129 | - | @Callable(x) | |
130 | - | func withdraw (K) = { | |
131 | - | let E = toBase58String(x.caller.bytes) | |
132 | - | let L = ((K + "_") + E) | |
133 | - | let X = (L + "_withdraw") | |
134 | - | if (isDefined(getString(this, X))) | |
135 | - | then throw("You have already got your prize") | |
136 | - | else if (isDefined(getInteger(this, (L + "_drawSequence")))) | |
137 | - | then throw("There is no winner, it was a draw") | |
138 | - | else if (!(isDefined(getString(this, (L + "_winner"))))) | |
139 | - | then throw("There is no winner") | |
140 | - | else { | |
141 | - | let W = getStringValue(this, (L + "_winner")) | |
142 | - | let Y = getIntegerValue(this, (L + "_sumBets")) | |
143 | - | if ((Y == 0)) | |
144 | - | then throw("You won nothing this round") | |
145 | - | else if ((W == E)) | |
146 | - | then [StringEntry(X, toString(Y)), ScriptTransfer(x.caller, Y, unit)] | |
147 | - | else throw("You are not the winner") | |
148 | - | } | |
149 | - | } | |
150 | - | ||
151 | - | ||
152 | - | @Verifier(Z) | |
153 | - | func aa () = sigVerify(Z.bodyBytes, Z.proofs[0], Z.senderPublicKey) | |
81 | + | @Verifier(A) | |
82 | + | func B () = sigVerify(A.bodyBytes, A.proofs[0], A.senderPublicKey) | |
154 | 83 |
github/deemru/w8io/026f985 32.72 ms ◑