tx · 81e8LDeP4zHvSMfPz2y4Ara8wbSrBcCDyxJXjKmyZf5h 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs: -0.01400000 Waves 2019.08.28 00:33 [650150] smart account 3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs > SELF 0.00000000 Waves
{ "type": 13, "id": "81e8LDeP4zHvSMfPz2y4Ara8wbSrBcCDyxJXjKmyZf5h", "fee": 1400000, "feeAssetId": null, "timestamp": 1566941616994, "version": 1, "sender": "3N2Z6EjzrzaCpD8ypDYLWDKe2PPVU8y9dJs", "senderPublicKey": "HSTmdhPrJF81ozDBaqVn8QVtV76oD7gzDfcHPQRdxdwW", "proofs": [ "3zmgDeaPW1NeVpiJkQwpMc3R9z7WTACn9e9jy5UdCriV4MhNQ21MX9G7BEeB2RnCainopq54BCga6H9qETDW1djV" ], "script": "base64:AAIDAAAAAAAAAAAAAAARAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAKQ09NTUlTU0lPTgkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUFAAAAB1dBVkVMRVQAAAAAAAAAA+gAAAAAClRva2VuUHJpY2UAAAAAAAAAAAoAAAAAEERPTkFURUNPVU5URVJLRVkCAAAACyRET05BVEVfTlVNAAAAAAdCVVlJVEVNAgAAAAkkQlVZX0lURU0AAAAABEJhZzEJAABoAAAAAgAAAAAAAAAAAQUAAAAHV0FWRUxFVAAAAAAEQmFnNQkAAGgAAAACAAAAAAAAAAAFBQAAAAdXQVZFTEVUAAAAAAVCYWcxMAkAAGgAAAACAAAAAAAAAAAKBQAAAAdXQVZFTEVUAAAAAAVCYWcyMAkAAGgAAAACAAAAAAAAAAAUBQAAAAdXQVZFTEVUAAAAAAVCYWc1MAkAAGgAAAACAAAAAAAAAAAyBQAAAAdXQVZFTEVUAAAAAAZCYWcxMDAJAABoAAAAAgAAAAAAAAAAZAUAAAA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FuY2UAAAABBQAAAAtrZXkyQmFsYW5jZQkAAGgAAAACBQAAAAlkb25hdGVOdW0FAAAAClRva2VuUHJpY2UEAAAACmRvbmF0ZURhdGEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEERPTkFURUNPVU5URVJLRVkFAAAACm5ld0dhbWVOdW0JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAC2tleTJCYWxhbmNlBQAAAApuZXdCYWxhbmNlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAhkb25hdGVJZAUAAAAJZG9uYXRlTnVtBQAAAANuaWwJAQAAAAhXcml0ZVNldAAAAAEFAAAACmRvbmF0ZURhdGEJAAACAAAAAQIAAAAZWW91IHBhaWQgdGhlIHdyb25nIGFtb3VudAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAA3R0eAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDAGBwcxd4yr", "chainId": 84, "height": 650150, "spentComplexity": 0 } View: original | compacted Prev: DW9N6GzVT9dS6xnAENzXWCwFyU4p7TFkjpnRNNAvzQeQ Next: CFW7wT9GkPHJ6X8nhsJgpveGuRPdRZSz6Cv9B2Ss7qFe Diff:
Old | New | Differences | |
---|---|---|---|
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | - | @Callable(z) | |
72 | + | func z (s) = { | |
73 | + | let x = { | |
74 | + | let p = getInteger(this, s) | |
75 | + | if ($isInstanceOf(p, "Int")) | |
76 | + | then { | |
77 | + | let y = p | |
78 | + | y | |
79 | + | } | |
80 | + | else 0 | |
81 | + | } | |
82 | + | x | |
83 | + | } | |
84 | + | ||
85 | + | ||
86 | + | @Callable(A) | |
73 | 87 | func buyItem (w) = { | |
74 | - | let | |
75 | - | let | |
88 | + | let B = toBase58String(A.transactionId) | |
89 | + | let C = toString(A.caller) | |
76 | 90 | if (if ((w > 0)) | |
77 | 91 | then (l >= w) | |
78 | 92 | else false) | |
79 | 93 | then { | |
80 | - | let C = m[w] | |
81 | - | let D = (r((B + "_balance")) - C) | |
82 | - | let E = DataEntry((B + "_balance"), D) | |
83 | - | let F = ((B + "_itemID_") + toString(w)) | |
84 | - | WriteSet([DataEntry(F, 1), DataEntry(((e + "_") + A), w), E]) | |
94 | + | let D = m[w] | |
95 | + | let E = (r((C + "_balance")) - D) | |
96 | + | let F = DataEntry((C + "_balance"), E) | |
97 | + | let G = ((C + "_itemID_") + toString(w)) | |
98 | + | let H = z(G) | |
99 | + | WriteSet([DataEntry(G, (H + 1)), DataEntry(((e + "_") + B), w), F]) | |
85 | 100 | } | |
86 | 101 | else throw("Item has not found") | |
87 | 102 | } | |
88 | 103 | ||
89 | 104 | ||
90 | 105 | ||
91 | - | @Callable( | |
106 | + | @Callable(A) | |
92 | 107 | func reset () = { | |
93 | - | let | |
94 | - | let | |
95 | - | WriteSet( | |
108 | + | let C = toString(A.caller) | |
109 | + | let I = [DataEntry(d, 0), DataEntry((C + "_balance"), 0)] | |
110 | + | WriteSet(I) | |
96 | 111 | } | |
97 | 112 | ||
98 | 113 | ||
99 | 114 | ||
100 | - | @Callable( | |
115 | + | @Callable(A) | |
101 | 116 | func donate () = { | |
102 | - | let | |
103 | - | let | |
104 | - | let | |
105 | - | let | |
106 | - | let | |
107 | - | let | |
108 | - | let | |
109 | - | if ( | |
117 | + | let J = n() | |
118 | + | let K = toBase58String(A.transactionId) | |
119 | + | let L = extract(A.payment) | |
120 | + | let C = toString(A.caller) | |
121 | + | let M = isDefined(L.assetId) | |
122 | + | let N = isDefined(L.assetId) | |
123 | + | let O = L.amount | |
124 | + | if (M) | |
110 | 125 | then throw("Bet amount must be in Waves") | |
111 | - | else if ( | |
126 | + | else if (N) | |
112 | 127 | then throw("Transaction's fee must be in Waves") | |
113 | 128 | else { | |
114 | - | let | |
129 | + | let P = if (if (if (if (if (if ((O == (f + b))) | |
115 | 130 | then true | |
116 | - | else ( | |
131 | + | else (O == (g + b))) | |
117 | 132 | then true | |
118 | - | else ( | |
133 | + | else (O == (h + b))) | |
119 | 134 | then true | |
120 | - | else ( | |
135 | + | else (O == (i + b))) | |
121 | 136 | then true | |
122 | - | else ( | |
137 | + | else (O == (j + b))) | |
123 | 138 | then true | |
124 | - | else ( | |
139 | + | else (O == (k + b))) | |
125 | 140 | then true | |
126 | 141 | else false | |
127 | - | if ( | |
142 | + | if (P) | |
128 | 143 | then { | |
129 | - | let | |
130 | - | let | |
131 | - | let | |
132 | - | let | |
133 | - | WriteSet( | |
144 | + | let Q = ((O - b) / a) | |
145 | + | let R = (C + "_balance") | |
146 | + | let S = (r(R) + (Q * c)) | |
147 | + | let I = [DataEntry(d, J), DataEntry(R, S), DataEntry(K, Q)] | |
148 | + | WriteSet(I) | |
134 | 149 | } | |
135 | 150 | else throw("You paid the wrong amount") | |
136 | 151 | } | |
137 | 152 | } | |
138 | 153 | ||
139 | 154 | ||
140 | - | @Verifier( | |
141 | - | func | |
155 | + | @Verifier(T) | |
156 | + | func U () = if (sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)) | |
142 | 157 | then { | |
143 | - | let p = | |
158 | + | let p = T | |
144 | 159 | if ($isInstanceOf(p, "TransferTransaction")) | |
145 | 160 | then { | |
146 | - | let | |
161 | + | let V = p | |
147 | 162 | true | |
148 | 163 | } | |
149 | 164 | else if ($isInstanceOf(p, "SetScriptTransaction")) | |
150 | 165 | then { | |
151 | - | let | |
166 | + | let W = p | |
152 | 167 | true | |
153 | 168 | } | |
154 | 169 | else false |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = ((100 * 1000) * 1000) | |
5 | 5 | ||
6 | 6 | let b = ((5 * a) / 1000) | |
7 | 7 | ||
8 | 8 | let c = 10 | |
9 | 9 | ||
10 | 10 | let d = "$DONATE_NUM" | |
11 | 11 | ||
12 | 12 | let e = "$BUY_ITEM" | |
13 | 13 | ||
14 | 14 | let f = (1 * a) | |
15 | 15 | ||
16 | 16 | let g = (5 * a) | |
17 | 17 | ||
18 | 18 | let h = (10 * a) | |
19 | 19 | ||
20 | 20 | let i = (20 * a) | |
21 | 21 | ||
22 | 22 | let j = (50 * a) | |
23 | 23 | ||
24 | 24 | let k = (100 * a) | |
25 | 25 | ||
26 | 26 | let l = 20 | |
27 | 27 | ||
28 | 28 | let m = [1, 3, 5, 6, 2, 2, 4, 9, 10, 12, 5, 1, 9, 12, 5, 4, 1, 11, 12, 9] | |
29 | 29 | ||
30 | 30 | func n () = { | |
31 | 31 | let o = { | |
32 | 32 | let p = getInteger(this, d) | |
33 | 33 | if ($isInstanceOf(p, "Int")) | |
34 | 34 | then { | |
35 | 35 | let q = p | |
36 | 36 | q | |
37 | 37 | } | |
38 | 38 | else 0 | |
39 | 39 | } | |
40 | 40 | (o + 1) | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func r (s) = { | |
45 | 45 | let t = { | |
46 | 46 | let p = getInteger(this, s) | |
47 | 47 | if ($isInstanceOf(p, "Int")) | |
48 | 48 | then { | |
49 | 49 | let t = p | |
50 | 50 | t | |
51 | 51 | } | |
52 | 52 | else 0 | |
53 | 53 | } | |
54 | 54 | t | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func u (v,w) = { | |
59 | 59 | let x = { | |
60 | 60 | let p = indexOf(v, (w + ":")) | |
61 | 61 | if ($isInstanceOf(p, "Int")) | |
62 | 62 | then { | |
63 | 63 | let y = p | |
64 | 64 | toString(y) | |
65 | 65 | } | |
66 | 66 | else "undefined" | |
67 | 67 | } | |
68 | 68 | x | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | - | @Callable(z) | |
72 | + | func z (s) = { | |
73 | + | let x = { | |
74 | + | let p = getInteger(this, s) | |
75 | + | if ($isInstanceOf(p, "Int")) | |
76 | + | then { | |
77 | + | let y = p | |
78 | + | y | |
79 | + | } | |
80 | + | else 0 | |
81 | + | } | |
82 | + | x | |
83 | + | } | |
84 | + | ||
85 | + | ||
86 | + | @Callable(A) | |
73 | 87 | func buyItem (w) = { | |
74 | - | let | |
75 | - | let | |
88 | + | let B = toBase58String(A.transactionId) | |
89 | + | let C = toString(A.caller) | |
76 | 90 | if (if ((w > 0)) | |
77 | 91 | then (l >= w) | |
78 | 92 | else false) | |
79 | 93 | then { | |
80 | - | let C = m[w] | |
81 | - | let D = (r((B + "_balance")) - C) | |
82 | - | let E = DataEntry((B + "_balance"), D) | |
83 | - | let F = ((B + "_itemID_") + toString(w)) | |
84 | - | WriteSet([DataEntry(F, 1), DataEntry(((e + "_") + A), w), E]) | |
94 | + | let D = m[w] | |
95 | + | let E = (r((C + "_balance")) - D) | |
96 | + | let F = DataEntry((C + "_balance"), E) | |
97 | + | let G = ((C + "_itemID_") + toString(w)) | |
98 | + | let H = z(G) | |
99 | + | WriteSet([DataEntry(G, (H + 1)), DataEntry(((e + "_") + B), w), F]) | |
85 | 100 | } | |
86 | 101 | else throw("Item has not found") | |
87 | 102 | } | |
88 | 103 | ||
89 | 104 | ||
90 | 105 | ||
91 | - | @Callable( | |
106 | + | @Callable(A) | |
92 | 107 | func reset () = { | |
93 | - | let | |
94 | - | let | |
95 | - | WriteSet( | |
108 | + | let C = toString(A.caller) | |
109 | + | let I = [DataEntry(d, 0), DataEntry((C + "_balance"), 0)] | |
110 | + | WriteSet(I) | |
96 | 111 | } | |
97 | 112 | ||
98 | 113 | ||
99 | 114 | ||
100 | - | @Callable( | |
115 | + | @Callable(A) | |
101 | 116 | func donate () = { | |
102 | - | let | |
103 | - | let | |
104 | - | let | |
105 | - | let | |
106 | - | let | |
107 | - | let | |
108 | - | let | |
109 | - | if ( | |
117 | + | let J = n() | |
118 | + | let K = toBase58String(A.transactionId) | |
119 | + | let L = extract(A.payment) | |
120 | + | let C = toString(A.caller) | |
121 | + | let M = isDefined(L.assetId) | |
122 | + | let N = isDefined(L.assetId) | |
123 | + | let O = L.amount | |
124 | + | if (M) | |
110 | 125 | then throw("Bet amount must be in Waves") | |
111 | - | else if ( | |
126 | + | else if (N) | |
112 | 127 | then throw("Transaction's fee must be in Waves") | |
113 | 128 | else { | |
114 | - | let | |
129 | + | let P = if (if (if (if (if (if ((O == (f + b))) | |
115 | 130 | then true | |
116 | - | else ( | |
131 | + | else (O == (g + b))) | |
117 | 132 | then true | |
118 | - | else ( | |
133 | + | else (O == (h + b))) | |
119 | 134 | then true | |
120 | - | else ( | |
135 | + | else (O == (i + b))) | |
121 | 136 | then true | |
122 | - | else ( | |
137 | + | else (O == (j + b))) | |
123 | 138 | then true | |
124 | - | else ( | |
139 | + | else (O == (k + b))) | |
125 | 140 | then true | |
126 | 141 | else false | |
127 | - | if ( | |
142 | + | if (P) | |
128 | 143 | then { | |
129 | - | let | |
130 | - | let | |
131 | - | let | |
132 | - | let | |
133 | - | WriteSet( | |
144 | + | let Q = ((O - b) / a) | |
145 | + | let R = (C + "_balance") | |
146 | + | let S = (r(R) + (Q * c)) | |
147 | + | let I = [DataEntry(d, J), DataEntry(R, S), DataEntry(K, Q)] | |
148 | + | WriteSet(I) | |
134 | 149 | } | |
135 | 150 | else throw("You paid the wrong amount") | |
136 | 151 | } | |
137 | 152 | } | |
138 | 153 | ||
139 | 154 | ||
140 | - | @Verifier( | |
141 | - | func | |
155 | + | @Verifier(T) | |
156 | + | func U () = if (sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)) | |
142 | 157 | then { | |
143 | - | let p = | |
158 | + | let p = T | |
144 | 159 | if ($isInstanceOf(p, "TransferTransaction")) | |
145 | 160 | then { | |
146 | - | let | |
161 | + | let V = p | |
147 | 162 | true | |
148 | 163 | } | |
149 | 164 | else if ($isInstanceOf(p, "SetScriptTransaction")) | |
150 | 165 | then { | |
151 | - | let | |
166 | + | let W = p | |
152 | 167 | true | |
153 | 168 | } | |
154 | 169 | else false | |
155 | 170 | } | |
156 | 171 | else false | |
157 | 172 |
github/deemru/w8io/169f3d6 57.97 ms ◑