tx · AwPXVTnwBa6LetodXsdtp9SGyNvvcZnLiWTqhHd8wyDg
3Msughfkwji8uccY4RAxuKWvNpnEscWyhHK: -0.01400000 Waves
2019.07.02 16:31 [567836] smart account 3Msughfkwji8uccY4RAxuKWvNpnEscWyhHK > SELF 0.00000000 Waves
{
"type": 13,
"id": "AwPXVTnwBa6LetodXsdtp9SGyNvvcZnLiWTqhHd8wyDg",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1562074260764,
"version": 1,
"sender": "3Msughfkwji8uccY4RAxuKWvNpnEscWyhHK",
"senderPublicKey": "AzyC6W7iD5HYehj2xef6xWKogmxDC6RaX9N1ST8P39bn",
"proofs": [
"22ratUH3aKT54kzoAM2WnGKdB7dLr79MGM4rx6dWyNfsjxeSUfcGMtsRjWeJ5RdEN7aZ5wsDWJApjo6kh7SkcF4a"
],
"script": "base64:AAIDAAAAAAAAAAAAAAALAAAAAAZsZXZlbDEAAAAAAAAAAPoAAAAABmxldmVsMgAAAAAAAAAA+gAAAAAGbGV2ZWwzAAAAAAAAAAD6AAAAAAhjYXNoQmFjawAAAAAAAAAA+gAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAA5jaGFuZ2VPd25lcktleQIAAAAsQUQydmJ6cFIzWk1YaVkxWmhCZHE0aUgxd3o1dzZ0VUNIUHoxdnZOZnlDcUUBAAAAEGJhbGFuY2VJbmNyZW1lbnQAAAACAAAAB2FkZHJlc3MAAAADaW5jBAAAAApiYWxhbmNlS2V5CQABLAAAAAIFAAAAB2FkZHJlc3MCAAAACF9iYWxhbmNlCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKYmFsYW5jZUtleQkAAGQAAAACBQAAAANpbmMEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKYmFsYW5jZUtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAAAQAAABVpbmRleEJhbGFuY2VJ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AAAAAgIAAAABLAUAAAAIcmVmZXJlcjMCAAAAAAIAAAAACQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAAVvd25lcgIAAAAIX3JlZmVyZXIFAAAAB3JlZmVyZXIJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAC3JlZmVyYWxzS2V5BQAAAAhyZWZlcmFscwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAAVvd25lcgIAAAANX3JlZnN0cnVjdHVyZQUAAAAMcmVmU3RydWN0dXJlBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyCAUAAAABaQAAAANmZWUFAAAABHVuaXQFAAAAA25pbAAAAAD2xAJm",
"chainId": 84,
"height": 567836,
"spentComplexity": 0
}
View: original | compacted
Prev: CSi5Msk2ANvEZxvSeREWgmP4A9jYK5Gfqagv5GwfX47
Next: 8xuvB84GiyhToGqbiqnzneqWyWmbhQT437RH4nnoRDm6
Diff:
Old | New | | Differences |
---|
48 | 48 | | else true |
---|
49 | 49 | | |
---|
50 | 50 | | |
---|
| 51 | + | func w () = { |
---|
| 52 | + | let x = extract(blockInfoByHeight(height)) |
---|
| 53 | + | toString(x.timestamp) |
---|
| 54 | + | } |
---|
| 55 | + | |
---|
| 56 | + | |
---|
51 | 57 | | @Callable(v) |
---|
52 | 58 | | func fund () = { |
---|
53 | 59 | | let n = toBase58String(v.callerPublicKey) |
---|
54 | | - | let w = extract(blockInfoByHeight(height)) |
---|
55 | | - | let x = (((n + ":") + toString(w.timestamp)) + ":") |
---|
56 | | - | let y = extract(v.payment).amount |
---|
57 | | - | let z = u(v) |
---|
| 60 | + | let y = ((n + ":") + w()) |
---|
| 61 | + | let z = extract(v.payment).amount |
---|
| 62 | + | let A = u(v) |
---|
58 | 63 | | ScriptResult(WriteSet({ |
---|
59 | 64 | | let k = getString(this, (n + "_refstructure")) |
---|
60 | 65 | | if ($isInstanceOf(k, "String")) |
---|
61 | 66 | | then { |
---|
62 | | - | let A = k |
---|
63 | | - | let B = split(A, ",") |
---|
64 | | - | let C = size(B) |
---|
65 | | - | let D = ((y * a) / 1000) |
---|
66 | | - | let E = ((y * d) / 1000) |
---|
67 | | - | [g(n, E), m(n, x, E, "_txs_cashback"), g(B[0], D), m(B[0], x, D, "_txs_l1"), if ((C >= 2)) |
---|
| 67 | + | let B = k |
---|
| 68 | + | let C = split(B, ",") |
---|
| 69 | + | let D = size(C) |
---|
| 70 | + | let E = ((z * a) / 1000) |
---|
| 71 | + | let F = ((z * d) / 1000) |
---|
| 72 | + | [g(n, F), m(n, y, F, "_txs_cashback"), g(C[0], E), m(C[0], y, E, "_txs_l1"), if ((D >= 2)) |
---|
68 | 73 | | then { |
---|
69 | | - | let F = ((y * b) / 1000) |
---|
70 | | - | [g(B[1], F), m(B[1], x, F, "_txs_l2"), if ((C >= 3)) |
---|
| 74 | + | let G = ((z * b) / 1000) |
---|
| 75 | + | [g(C[1], G), m(C[1], y, G, "_txs_l2"), if ((D >= 3)) |
---|
71 | 76 | | then { |
---|
72 | | - | let G = ((y * c) / 1000) |
---|
73 | | - | [g(B[2], G), m(B[2], x, G, "_txs_l3"), g(f, (((y - D) - F) - G)), m(f, x, (((y - D) - F) - G), "_txs_change")] |
---|
| 77 | + | let H = ((z * c) / 1000) |
---|
| 78 | + | [g(C[2], H), m(C[2], y, H, "_txs_l3"), g(f, (((z - E) - G) - H)), m(f, y, (((z - E) - G) - H), "_txs_change")] |
---|
74 | 79 | | } |
---|
75 | | - | else [g(f, ((y - D) - F)), m(f, x, ((y - D) - F), "_txs_change")]] |
---|
| 80 | + | else [g(f, ((z - E) - G)), m(f, y, ((z - E) - G), "_txs_change")]] |
---|
76 | 81 | | } |
---|
77 | | - | else [g(f, (y - D)), m(f, x, (y - D), "_txs_change")]] |
---|
| 82 | + | else [g(f, (z - E)), m(f, y, (z - E), "_txs_change")]] |
---|
78 | 83 | | } |
---|
79 | | - | else [g(f, y), m(f, x, y, "_txs_change")] |
---|
| 84 | + | else [g(f, z), m(f, y, z, "_txs_change")] |
---|
80 | 85 | | }), TransferSet([ScriptTransfer(v.caller, v.fee, unit)])) |
---|
81 | 86 | | } |
---|
82 | 87 | | |
---|
|
84 | 89 | | |
---|
85 | 90 | | @Callable(v) |
---|
86 | 91 | | func withdraw () = { |
---|
87 | | - | let z = u(v) |
---|
| 92 | + | let A = u(v) |
---|
88 | 93 | | let n = toBase58String(v.callerPublicKey) |
---|
89 | | - | let y = { |
---|
90 | | - | let k = getInteger(this, (n + "_balance")) |
---|
| 94 | + | let j = (n + "_balance") |
---|
| 95 | + | let z = { |
---|
| 96 | + | let k = getInteger(this, j) |
---|
91 | 97 | | if ($isInstanceOf(k, "Int")) |
---|
92 | 98 | | then { |
---|
93 | 99 | | let l = k |
---|
|
95 | 101 | | } |
---|
96 | 102 | | else 0 |
---|
97 | 103 | | } |
---|
98 | | - | ScriptResult(WriteSet([DataEntry((n + "_balance"), 0)]), TransferSet([ScriptTransfer(v.caller, (y + v.fee), unit)])) |
---|
| 104 | + | let I = (n + "_withdraw_txs") |
---|
| 105 | + | let J = ((((toString(z) + ":") + toBase58String(v.transactionId)) + ":") + w()) |
---|
| 106 | + | let K = { |
---|
| 107 | + | let k = getString(this, I) |
---|
| 108 | + | if ($isInstanceOf(k, "String")) |
---|
| 109 | + | then { |
---|
| 110 | + | let L = k |
---|
| 111 | + | ((L + ",") + J) |
---|
| 112 | + | } |
---|
| 113 | + | else J |
---|
| 114 | + | } |
---|
| 115 | + | ScriptResult(WriteSet([DataEntry(j, 0), DataEntry(I, K)]), TransferSet([ScriptTransfer(v.caller, (z + v.fee), unit)])) |
---|
99 | 116 | | } |
---|
100 | 117 | | |
---|
101 | 118 | | |
---|
102 | 119 | | |
---|
103 | 120 | | @Callable(v) |
---|
104 | | - | func test () = WriteSet(nil) |
---|
105 | | - | |
---|
106 | | - | |
---|
107 | | - | |
---|
108 | | - | @Callable(v) |
---|
109 | | - | func register (H,I) = { |
---|
110 | | - | let z = u(v) |
---|
| 121 | + | func register (M,N) = { |
---|
| 122 | + | let A = u(v) |
---|
111 | 123 | | if ((take(toBase58String(v.transactionId), 3) != "123")) |
---|
112 | 124 | | then throw("proof of work failed") |
---|
113 | 125 | | else { |
---|
|
115 | 127 | | if (isDefined(s(n))) |
---|
116 | 128 | | then throw("Already registered") |
---|
117 | 129 | | else { |
---|
118 | | - | let J = (H + "_referrals") |
---|
119 | | - | let K = { |
---|
120 | | - | let k = getString(this, J) |
---|
| 130 | + | let O = (M + "_referrals") |
---|
| 131 | + | let P = { |
---|
| 132 | + | let k = getString(this, O) |
---|
121 | 133 | | if ($isInstanceOf(k, "String")) |
---|
122 | 134 | | then { |
---|
123 | | - | let L = k |
---|
124 | | - | ((L + ",") + n) |
---|
| 135 | + | let Q = k |
---|
| 136 | + | ((Q + ",") + n) |
---|
125 | 137 | | } |
---|
126 | 138 | | else n |
---|
127 | 139 | | } |
---|
128 | | - | let M = (H + { |
---|
129 | | - | let k = s(H) |
---|
| 140 | + | let R = (M + { |
---|
| 141 | + | let k = s(M) |
---|
130 | 142 | | if ($isInstanceOf(k, "String")) |
---|
131 | 143 | | then { |
---|
132 | | - | let N = k |
---|
133 | | - | (("," + N) + { |
---|
134 | | - | let O = s(N) |
---|
135 | | - | if ($isInstanceOf(O, "String")) |
---|
| 144 | + | let S = k |
---|
| 145 | + | (("," + S) + { |
---|
| 146 | + | let T = s(S) |
---|
| 147 | + | if ($isInstanceOf(T, "String")) |
---|
136 | 148 | | then { |
---|
137 | | - | let P = O |
---|
138 | | - | ("," + P) |
---|
| 149 | + | let U = T |
---|
| 150 | + | ("," + U) |
---|
139 | 151 | | } |
---|
140 | 152 | | else "" |
---|
141 | 153 | | }) |
---|
142 | 154 | | } |
---|
143 | 155 | | else "" |
---|
144 | 156 | | }) |
---|
145 | | - | ScriptResult(WriteSet([DataEntry((n + "_referer"), H), DataEntry(J, K), DataEntry((n + "_refstructure"), M)]), TransferSet([ScriptTransfer(v.caller, v.fee, unit)])) |
---|
| 157 | + | ScriptResult(WriteSet([DataEntry((n + "_referer"), M), DataEntry(O, P), DataEntry((n + "_refstructure"), R)]), TransferSet([ScriptTransfer(v.caller, v.fee, unit)])) |
---|
146 | 158 | | } |
---|
147 | 159 | | } |
---|
148 | 160 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = 250 |
---|
5 | 5 | | |
---|
6 | 6 | | let b = 250 |
---|
7 | 7 | | |
---|
8 | 8 | | let c = 250 |
---|
9 | 9 | | |
---|
10 | 10 | | let d = 250 |
---|
11 | 11 | | |
---|
12 | 12 | | let e = 5000000 |
---|
13 | 13 | | |
---|
14 | 14 | | let f = "AD2vbzpR3ZMXiY1ZhBdq4iH1wz5w6tUCHPz1vvNfyCqE" |
---|
15 | 15 | | |
---|
16 | 16 | | func g (h,i) = { |
---|
17 | 17 | | let j = (h + "_balance") |
---|
18 | 18 | | DataEntry(j, (i + { |
---|
19 | 19 | | let k = getInteger(this, j) |
---|
20 | 20 | | if ($isInstanceOf(k, "Int")) |
---|
21 | 21 | | then { |
---|
22 | 22 | | let l = k |
---|
23 | 23 | | l |
---|
24 | 24 | | } |
---|
25 | 25 | | else 0 |
---|
26 | 26 | | })) |
---|
27 | 27 | | } |
---|
28 | 28 | | |
---|
29 | 29 | | |
---|
30 | 30 | | func m (h,n,i,o) = { |
---|
31 | 31 | | let p = (h + o) |
---|
32 | 32 | | let q = (n + toString(i)) |
---|
33 | 33 | | let k = getString(this, p) |
---|
34 | 34 | | if ($isInstanceOf(k, "String")) |
---|
35 | 35 | | then { |
---|
36 | 36 | | let r = k |
---|
37 | 37 | | DataEntry(p, ((r + ",") + q)) |
---|
38 | 38 | | } |
---|
39 | 39 | | else DataEntry(p, q) |
---|
40 | 40 | | } |
---|
41 | 41 | | |
---|
42 | 42 | | |
---|
43 | 43 | | func s (t) = getString(this, (t + "_referer")) |
---|
44 | 44 | | |
---|
45 | 45 | | |
---|
46 | 46 | | func u (v) = if ((v.fee > e)) |
---|
47 | 47 | | then throw("unreasonable large fee") |
---|
48 | 48 | | else true |
---|
49 | 49 | | |
---|
50 | 50 | | |
---|
| 51 | + | func w () = { |
---|
| 52 | + | let x = extract(blockInfoByHeight(height)) |
---|
| 53 | + | toString(x.timestamp) |
---|
| 54 | + | } |
---|
| 55 | + | |
---|
| 56 | + | |
---|
51 | 57 | | @Callable(v) |
---|
52 | 58 | | func fund () = { |
---|
53 | 59 | | let n = toBase58String(v.callerPublicKey) |
---|
54 | | - | let w = extract(blockInfoByHeight(height)) |
---|
55 | | - | let x = (((n + ":") + toString(w.timestamp)) + ":") |
---|
56 | | - | let y = extract(v.payment).amount |
---|
57 | | - | let z = u(v) |
---|
| 60 | + | let y = ((n + ":") + w()) |
---|
| 61 | + | let z = extract(v.payment).amount |
---|
| 62 | + | let A = u(v) |
---|
58 | 63 | | ScriptResult(WriteSet({ |
---|
59 | 64 | | let k = getString(this, (n + "_refstructure")) |
---|
60 | 65 | | if ($isInstanceOf(k, "String")) |
---|
61 | 66 | | then { |
---|
62 | | - | let A = k |
---|
63 | | - | let B = split(A, ",") |
---|
64 | | - | let C = size(B) |
---|
65 | | - | let D = ((y * a) / 1000) |
---|
66 | | - | let E = ((y * d) / 1000) |
---|
67 | | - | [g(n, E), m(n, x, E, "_txs_cashback"), g(B[0], D), m(B[0], x, D, "_txs_l1"), if ((C >= 2)) |
---|
| 67 | + | let B = k |
---|
| 68 | + | let C = split(B, ",") |
---|
| 69 | + | let D = size(C) |
---|
| 70 | + | let E = ((z * a) / 1000) |
---|
| 71 | + | let F = ((z * d) / 1000) |
---|
| 72 | + | [g(n, F), m(n, y, F, "_txs_cashback"), g(C[0], E), m(C[0], y, E, "_txs_l1"), if ((D >= 2)) |
---|
68 | 73 | | then { |
---|
69 | | - | let F = ((y * b) / 1000) |
---|
70 | | - | [g(B[1], F), m(B[1], x, F, "_txs_l2"), if ((C >= 3)) |
---|
| 74 | + | let G = ((z * b) / 1000) |
---|
| 75 | + | [g(C[1], G), m(C[1], y, G, "_txs_l2"), if ((D >= 3)) |
---|
71 | 76 | | then { |
---|
72 | | - | let G = ((y * c) / 1000) |
---|
73 | | - | [g(B[2], G), m(B[2], x, G, "_txs_l3"), g(f, (((y - D) - F) - G)), m(f, x, (((y - D) - F) - G), "_txs_change")] |
---|
| 77 | + | let H = ((z * c) / 1000) |
---|
| 78 | + | [g(C[2], H), m(C[2], y, H, "_txs_l3"), g(f, (((z - E) - G) - H)), m(f, y, (((z - E) - G) - H), "_txs_change")] |
---|
74 | 79 | | } |
---|
75 | | - | else [g(f, ((y - D) - F)), m(f, x, ((y - D) - F), "_txs_change")]] |
---|
| 80 | + | else [g(f, ((z - E) - G)), m(f, y, ((z - E) - G), "_txs_change")]] |
---|
76 | 81 | | } |
---|
77 | | - | else [g(f, (y - D)), m(f, x, (y - D), "_txs_change")]] |
---|
| 82 | + | else [g(f, (z - E)), m(f, y, (z - E), "_txs_change")]] |
---|
78 | 83 | | } |
---|
79 | | - | else [g(f, y), m(f, x, y, "_txs_change")] |
---|
| 84 | + | else [g(f, z), m(f, y, z, "_txs_change")] |
---|
80 | 85 | | }), TransferSet([ScriptTransfer(v.caller, v.fee, unit)])) |
---|
81 | 86 | | } |
---|
82 | 87 | | |
---|
83 | 88 | | |
---|
84 | 89 | | |
---|
85 | 90 | | @Callable(v) |
---|
86 | 91 | | func withdraw () = { |
---|
87 | | - | let z = u(v) |
---|
| 92 | + | let A = u(v) |
---|
88 | 93 | | let n = toBase58String(v.callerPublicKey) |
---|
89 | | - | let y = { |
---|
90 | | - | let k = getInteger(this, (n + "_balance")) |
---|
| 94 | + | let j = (n + "_balance") |
---|
| 95 | + | let z = { |
---|
| 96 | + | let k = getInteger(this, j) |
---|
91 | 97 | | if ($isInstanceOf(k, "Int")) |
---|
92 | 98 | | then { |
---|
93 | 99 | | let l = k |
---|
94 | 100 | | l |
---|
95 | 101 | | } |
---|
96 | 102 | | else 0 |
---|
97 | 103 | | } |
---|
98 | | - | ScriptResult(WriteSet([DataEntry((n + "_balance"), 0)]), TransferSet([ScriptTransfer(v.caller, (y + v.fee), unit)])) |
---|
| 104 | + | let I = (n + "_withdraw_txs") |
---|
| 105 | + | let J = ((((toString(z) + ":") + toBase58String(v.transactionId)) + ":") + w()) |
---|
| 106 | + | let K = { |
---|
| 107 | + | let k = getString(this, I) |
---|
| 108 | + | if ($isInstanceOf(k, "String")) |
---|
| 109 | + | then { |
---|
| 110 | + | let L = k |
---|
| 111 | + | ((L + ",") + J) |
---|
| 112 | + | } |
---|
| 113 | + | else J |
---|
| 114 | + | } |
---|
| 115 | + | ScriptResult(WriteSet([DataEntry(j, 0), DataEntry(I, K)]), TransferSet([ScriptTransfer(v.caller, (z + v.fee), unit)])) |
---|
99 | 116 | | } |
---|
100 | 117 | | |
---|
101 | 118 | | |
---|
102 | 119 | | |
---|
103 | 120 | | @Callable(v) |
---|
104 | | - | func test () = WriteSet(nil) |
---|
105 | | - | |
---|
106 | | - | |
---|
107 | | - | |
---|
108 | | - | @Callable(v) |
---|
109 | | - | func register (H,I) = { |
---|
110 | | - | let z = u(v) |
---|
| 121 | + | func register (M,N) = { |
---|
| 122 | + | let A = u(v) |
---|
111 | 123 | | if ((take(toBase58String(v.transactionId), 3) != "123")) |
---|
112 | 124 | | then throw("proof of work failed") |
---|
113 | 125 | | else { |
---|
114 | 126 | | let n = toBase58String(v.callerPublicKey) |
---|
115 | 127 | | if (isDefined(s(n))) |
---|
116 | 128 | | then throw("Already registered") |
---|
117 | 129 | | else { |
---|
118 | | - | let J = (H + "_referrals") |
---|
119 | | - | let K = { |
---|
120 | | - | let k = getString(this, J) |
---|
| 130 | + | let O = (M + "_referrals") |
---|
| 131 | + | let P = { |
---|
| 132 | + | let k = getString(this, O) |
---|
121 | 133 | | if ($isInstanceOf(k, "String")) |
---|
122 | 134 | | then { |
---|
123 | | - | let L = k |
---|
124 | | - | ((L + ",") + n) |
---|
| 135 | + | let Q = k |
---|
| 136 | + | ((Q + ",") + n) |
---|
125 | 137 | | } |
---|
126 | 138 | | else n |
---|
127 | 139 | | } |
---|
128 | | - | let M = (H + { |
---|
129 | | - | let k = s(H) |
---|
| 140 | + | let R = (M + { |
---|
| 141 | + | let k = s(M) |
---|
130 | 142 | | if ($isInstanceOf(k, "String")) |
---|
131 | 143 | | then { |
---|
132 | | - | let N = k |
---|
133 | | - | (("," + N) + { |
---|
134 | | - | let O = s(N) |
---|
135 | | - | if ($isInstanceOf(O, "String")) |
---|
| 144 | + | let S = k |
---|
| 145 | + | (("," + S) + { |
---|
| 146 | + | let T = s(S) |
---|
| 147 | + | if ($isInstanceOf(T, "String")) |
---|
136 | 148 | | then { |
---|
137 | | - | let P = O |
---|
138 | | - | ("," + P) |
---|
| 149 | + | let U = T |
---|
| 150 | + | ("," + U) |
---|
139 | 151 | | } |
---|
140 | 152 | | else "" |
---|
141 | 153 | | }) |
---|
142 | 154 | | } |
---|
143 | 155 | | else "" |
---|
144 | 156 | | }) |
---|
145 | | - | ScriptResult(WriteSet([DataEntry((n + "_referer"), H), DataEntry(J, K), DataEntry((n + "_refstructure"), M)]), TransferSet([ScriptTransfer(v.caller, v.fee, unit)])) |
---|
| 157 | + | ScriptResult(WriteSet([DataEntry((n + "_referer"), M), DataEntry(O, P), DataEntry((n + "_refstructure"), R)]), TransferSet([ScriptTransfer(v.caller, v.fee, unit)])) |
---|
146 | 158 | | } |
---|
147 | 159 | | } |
---|
148 | 160 | | } |
---|
149 | 161 | | |
---|
150 | 162 | | |
---|