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