tx · 8xuvB84GiyhToGqbiqnzneqWyWmbhQT437RH4nnoRDm6 3Msughfkwji8uccY4RAxuKWvNpnEscWyhHK: -0.01400000 Waves 2019.07.02 16:42 [567846] smart account 3Msughfkwji8uccY4RAxuKWvNpnEscWyhHK > SELF 0.00000000 Waves
{ "type": 13, "id": "8xuvB84GiyhToGqbiqnzneqWyWmbhQT437RH4nnoRDm6", "fee": 1400000, "feeAssetId": null, "timestamp": 1562074963756, "version": 1, "sender": "3Msughfkwji8uccY4RAxuKWvNpnEscWyhHK", "senderPublicKey": "AzyC6W7iD5HYehj2xef6xWKogmxDC6RaX9N1ST8P39bn", "proofs": [ "ZKgPBZN7PTVKs2WLn7Kpq1Qtuoe5WUeGAHNE2Krspq3s84ckAcoTXLmU3fU4nvipms1MQMAEGPTR77vcyx3Ck6W" ], "script": "base64:AAIDAAAAAAAAAAAAAAALAAAAAAZsZXZlbDEAAAAAAAAAAPoAAAAABmxldmVsMgAAAAAAAAAA+gAAAAAGbGV2ZWwzAAAAAAAAAAD6AAAAAAhjYXNoQmFjawAAAAAAAAAA+gAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAA5jaGFuZ2VPd25lcktleQIAAAAsQUQydmJ6cFIzWk1YaVkxWmhCZHE0aUgxd3o1dzZ0VUNIUHoxdnZOZnlDcUUBAAAAEGJhbGFuY2VJbmNyZW1lbnQAAAACAAAAB2FkZHJlc3MAAAADaW5jBAAAAApiYWxhbmNlS2V5CQABLAAAAAIFAAAAB2FkZHJlc3MCAAAACF9iYWxhbmNlCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKYmFsYW5jZUtleQkAAGQAAAACBQAAAANpbmMEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKYmFsYW5jZUtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAAAQAAABVpbmRleEJhbGFuY2VJbmNyZW1lbnQAA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NoMQkAASwAAAACAgAAAAEsBQAAAAhyZWZlcmVyMwIAAAAAAgAAAAAJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAABW93bmVyAgAAAAhfcmVmZXJlcgUAAAAHcmVmZXJlcgkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAALcmVmZXJhbHNLZXkFAAAACHJlZmVyYWxzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAABW93bmVyAgAAAA1fcmVmc3RydWN0dXJlBQAAAAxyZWZTdHJ1Y3R1cmUFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIIBQAAAAFpAAAAA2ZlZQUAAAAEdW5pdAUAAAADbmlsAAAAAEWSj08=", "chainId": 84, "height": 567846, "spentComplexity": 0 } View: original | compacted Prev: AwPXVTnwBa6LetodXsdtp9SGyNvvcZnLiWTqhHd8wyDg Next: none Diff:
Old | New | Differences | |
---|---|---|---|
57 | 57 | @Callable(v) | |
58 | 58 | func fund () = { | |
59 | 59 | let n = toBase58String(v.callerPublicKey) | |
60 | - | let y = ((n + ":") + w()) | |
60 | + | let y = (((n + ":") + w()) + ":") | |
61 | 61 | let z = extract(v.payment).amount | |
62 | 62 | let A = u(v) | |
63 | 63 | ScriptResult(WriteSet({ |
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 | 51 | func w () = { | |
52 | 52 | let x = extract(blockInfoByHeight(height)) | |
53 | 53 | toString(x.timestamp) | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(v) | |
58 | 58 | func fund () = { | |
59 | 59 | let n = toBase58String(v.callerPublicKey) | |
60 | - | let y = ((n + ":") + w()) | |
60 | + | let y = (((n + ":") + w()) + ":") | |
61 | 61 | let z = extract(v.payment).amount | |
62 | 62 | let A = u(v) | |
63 | 63 | ScriptResult(WriteSet({ | |
64 | 64 | let k = getString(this, (n + "_refstructure")) | |
65 | 65 | if ($isInstanceOf(k, "String")) | |
66 | 66 | then { | |
67 | 67 | let B = k | |
68 | 68 | let C = split(B, ",") | |
69 | 69 | let D = size(C) | |
70 | 70 | let E = ((z * a) / 1000) | |
71 | 71 | let F = ((z * d) / 1000) | |
72 | 72 | [g(n, F), m(n, y, F, "_txs_cashback"), g(C[0], E), m(C[0], y, E, "_txs_l1"), if ((D >= 2)) | |
73 | 73 | then { | |
74 | 74 | let G = ((z * b) / 1000) | |
75 | 75 | [g(C[1], G), m(C[1], y, G, "_txs_l2"), if ((D >= 3)) | |
76 | 76 | then { | |
77 | 77 | let H = ((z * c) / 1000) | |
78 | 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")] | |
79 | 79 | } | |
80 | 80 | else [g(f, ((z - E) - G)), m(f, y, ((z - E) - G), "_txs_change")]] | |
81 | 81 | } | |
82 | 82 | else [g(f, (z - E)), m(f, y, (z - E), "_txs_change")]] | |
83 | 83 | } | |
84 | 84 | else [g(f, z), m(f, y, z, "_txs_change")] | |
85 | 85 | }), TransferSet([ScriptTransfer(v.caller, v.fee, unit)])) | |
86 | 86 | } | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(v) | |
91 | 91 | func withdraw () = { | |
92 | 92 | let A = u(v) | |
93 | 93 | let n = toBase58String(v.callerPublicKey) | |
94 | 94 | let j = (n + "_balance") | |
95 | 95 | let z = { | |
96 | 96 | let k = getInteger(this, j) | |
97 | 97 | if ($isInstanceOf(k, "Int")) | |
98 | 98 | then { | |
99 | 99 | let l = k | |
100 | 100 | l | |
101 | 101 | } | |
102 | 102 | else 0 | |
103 | 103 | } | |
104 | 104 | let I = (n + "_withdraw_txs") | |
105 | 105 | let J = ((((toString(z) + ":") + toBase58String(v.transactionId)) + ":") + w()) | |
106 | 106 | let K = { | |
107 | 107 | let k = getString(this, I) | |
108 | 108 | if ($isInstanceOf(k, "String")) | |
109 | 109 | then { | |
110 | 110 | let L = k | |
111 | 111 | ((L + ",") + J) | |
112 | 112 | } | |
113 | 113 | else J | |
114 | 114 | } | |
115 | 115 | ScriptResult(WriteSet([DataEntry(j, 0), DataEntry(I, K)]), TransferSet([ScriptTransfer(v.caller, (z + v.fee), unit)])) | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(v) | |
121 | 121 | func register (M,N) = { | |
122 | 122 | let A = u(v) | |
123 | 123 | if ((take(toBase58String(v.transactionId), 3) != "123")) | |
124 | 124 | then throw("proof of work failed") | |
125 | 125 | else { | |
126 | 126 | let n = toBase58String(v.callerPublicKey) | |
127 | 127 | if (isDefined(s(n))) | |
128 | 128 | then throw("Already registered") | |
129 | 129 | else { | |
130 | 130 | let O = (M + "_referrals") | |
131 | 131 | let P = { | |
132 | 132 | let k = getString(this, O) | |
133 | 133 | if ($isInstanceOf(k, "String")) | |
134 | 134 | then { | |
135 | 135 | let Q = k | |
136 | 136 | ((Q + ",") + n) | |
137 | 137 | } | |
138 | 138 | else n | |
139 | 139 | } | |
140 | 140 | let R = (M + { | |
141 | 141 | let k = s(M) | |
142 | 142 | if ($isInstanceOf(k, "String")) | |
143 | 143 | then { | |
144 | 144 | let S = k | |
145 | 145 | (("," + S) + { | |
146 | 146 | let T = s(S) | |
147 | 147 | if ($isInstanceOf(T, "String")) | |
148 | 148 | then { | |
149 | 149 | let U = T | |
150 | 150 | ("," + U) | |
151 | 151 | } | |
152 | 152 | else "" | |
153 | 153 | }) | |
154 | 154 | } | |
155 | 155 | else "" | |
156 | 156 | }) | |
157 | 157 | ScriptResult(WriteSet([DataEntry((n + "_referer"), M), DataEntry(O, P), DataEntry((n + "_refstructure"), R)]), TransferSet([ScriptTransfer(v.caller, v.fee, unit)])) | |
158 | 158 | } | |
159 | 159 | } | |
160 | 160 | } | |
161 | 161 | ||
162 | 162 |
github/deemru/w8io/169f3d6 39.43 ms ◑