tx · 6NwR2aJdVYwbQk78DbZgfvAbr8DUXakA8pJZkX5dLPBm 3MuADE2ryaHKiVHXg5uFLyB4NYnvQJLZBUv: -0.01400000 Waves 2019.12.25 12:51 [824370] smart account 3MuADE2ryaHKiVHXg5uFLyB4NYnvQJLZBUv > SELF 0.00000000 Waves
{ "type": 13, "id": "6NwR2aJdVYwbQk78DbZgfvAbr8DUXakA8pJZkX5dLPBm", "fee": 1400000, "feeAssetId": null, "timestamp": 1577267500791, "version": 1, "sender": "3MuADE2ryaHKiVHXg5uFLyB4NYnvQJLZBUv", "senderPublicKey": "A4bJfnBhBTVh7GRNr1hHz6iqJta6eBbaExPDG7UapoaD", "proofs": [ "5NjUjTdmSKyKBGMqwdTQ5atRnW13J9BuDeVY1P9TsJicKQJHrUhRks5SDsdpyaEdbMDiJEAAH64T7wij3PsqAdHj" ], "script": "base64:AAIDAAAAAAAAABMIARIICgYIAQEBAQESABIDCgEIAAAAGQAAAAAHd2F2ZWxldAAAAAAABfXhAAAAAAAPd2F2ZXNEZXBvc2l0QW10CQAAaAAAAAIAAAAAAAAACigFAAAAB3dhdmVsZXQAAAAADWJ0Y0RlcG9zaXRBbXQJAABpAAAAAgkAAGgAAAACAAAAAAAAAAooBQAAAAd3YXZlbGV0AAAAAAAAACcQAAAAAA1ldGhEZXBvc2l0QW10CQAAaAAAAAIAAAAAAAAAAA0FAAAAB3dhdmVsZXQAAAAADWx0Y0RlcG9zaXRBbXQJAABoAAAAAgAAAAAAAAAAJwUAAAAHd2F2ZWxldAAAAAAOd2VzdERlcG9zaXRBbXQJAABoAAAAAgAAAAAAAABlkAUAAAAHd2F2ZWxldAAAAAANd2N0RGVwb3NpdEFtdAkAAGgAAAACAAAAAAAAAGWQBQAAAAd3YXZlbGV0AAAAABJEcmFnb25GcnVpdEFkZHJlc3MCAAAAIzNNekRHOXJ0MTNFdTV1dzRtWnFrRzVheERpaWp2VlNEYmpjAAAAAA1kaXZQcm9ncmFtUHViCQACWQAAAAECAAAALEE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HNXaXRoZHJhd24JAQAAABtnZXREaXZpZGVuZHNXaXRoZHJhd25BbW91bnQAAAABBQAAAAlhc3NldE5hbWUEAAAACWRpdmlkZW5kcwkBAAAAEmdldERpdmlkZW5kQmFsYW5jZQAAAAMIBQAAAAN0dHgAAAAHYXNzZXRJZAUAAAASZGl2aWRlbmRzV2l0aGRyYXduBQAAABBkaXZpZGVuZHNQZXJjZW50BAAAAA5hY2NvdW50QmFsYW5jZQkAA+sAAAACBQAAAAR0aGlzCAUAAAADdHR4AAAAB2Fzc2V0SWQJAABnAAAAAgkAAGUAAAACBQAAAA5hY2NvdW50QmFsYW5jZQgFAAAAA3R0eAAAAAZhbW91bnQFAAAACWRpdmlkZW5kcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAAA2l0eAUAAAAHJG1hdGNoMAYHB94Ko4I=", "chainId": 84, "height": 824370, "spentComplexity": 0 } View: original | compacted Prev: 36569vB25gWNF8iX8UV3DSLYTLCoET3kLshoGv8c1tq7 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
86 | 86 | else if ((E == n)) | |
87 | 87 | then "LTC" | |
88 | 88 | else if ((E == o)) | |
89 | - | then " | |
89 | + | then "WEST" | |
90 | 90 | else if ((E == p)) | |
91 | 91 | then "WCT" | |
92 | 92 | else throw("AssetId is incorrect") | |
100 | 100 | then m | |
101 | 101 | else if ((t == "LTC")) | |
102 | 102 | then n | |
103 | - | else if ((t == " | |
103 | + | else if ((t == "WEST")) | |
104 | 104 | then o | |
105 | 105 | else if ((t == "WCT")) | |
106 | 106 | then p | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func H (t) = { | |
124 | - | let x = getInteger(this, (t + "_ | |
124 | + | let x = getInteger(this, (t + "_DividendsWithdrawn")) | |
125 | 125 | let y = x | |
126 | 126 | if ($isInstanceOf(y, "Int")) | |
127 | 127 | then { | |
158 | 158 | let O = A(t, V.amount) | |
159 | 159 | let W = getString(this, (t + "_DepositState")) | |
160 | 160 | if ((W == "Created")) | |
161 | - | then ScriptResult(WriteSet([DataEntry((t + "_DepositOwner"), T), DataEntry((t + "_DepositState"), "Active"), DataEntry((t + "_ | |
161 | + | then ScriptResult(WriteSet([DataEntry((t + "_DepositOwner"), T), DataEntry((t + "_DepositState"), "Active"), DataEntry((t + "_DividendsWithdrawn"), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(h), O, V.assetId)])) | |
162 | 162 | else throw("Deposit is unavailable") | |
163 | 163 | } | |
164 | 164 | ||
171 | 171 | let K = G(t) | |
172 | 172 | let J = H(t) | |
173 | 173 | let X = I(E, J, K) | |
174 | - | ScriptResult(WriteSet([DataEntry((t + "_ | |
174 | + | ScriptResult(WriteSet([DataEntry((t + "_DividendsWithdrawn"), (J + X))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(u)), X, E)])) | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 100000000 | |
5 | 5 | ||
6 | 6 | let b = (2600 * a) | |
7 | 7 | ||
8 | 8 | let c = ((2600 * a) / 10000) | |
9 | 9 | ||
10 | 10 | let d = (13 * a) | |
11 | 11 | ||
12 | 12 | let e = (39 * a) | |
13 | 13 | ||
14 | 14 | let f = (26000 * a) | |
15 | 15 | ||
16 | 16 | let g = (26000 * a) | |
17 | 17 | ||
18 | 18 | let h = "3MzDG9rt13Eu5uw4mZqkG5axDiijvVSDbjc" | |
19 | 19 | ||
20 | 20 | let i = fromBase58String("A4bJfnBhBTVh7GRNr1hHz6iqJta6eBbaExPDG7UapoaD") | |
21 | 21 | ||
22 | 22 | let j = fromBase58String("5yjcfvH6iuwrkFghXuWaJeMppaQ893FSs8HCAgVQzuNY") | |
23 | 23 | ||
24 | 24 | let k = unit | |
25 | 25 | ||
26 | 26 | let l = base58'8HRQdqJBBeqZvgMtg6we6sw11i5GzpFNs7onNeVRBmaq' | |
27 | 27 | ||
28 | 28 | let m = base58'4oHq3C7ar7kmcRHEZBrgPyGtU6fkqJ1pHoRYboKeYSWQ' | |
29 | 29 | ||
30 | 30 | let n = base58'Gd9pdZw9muDBZwwsQLqyigRJCDABbiJaksmemzFCorsV' | |
31 | 31 | ||
32 | 32 | let o = base58'C2Pz1Q9QYaF9MkK9J9mX9vAMVc25R3w6Lr5g5B5Yje87' | |
33 | 33 | ||
34 | 34 | let p = base58'AMQkRmWSWHEd1nMDvDZFkadoCFCxRkDzBsEbscJ9ZZ2P' | |
35 | 35 | ||
36 | 36 | func q (r) = if ((r == j)) | |
37 | 37 | then r | |
38 | 38 | else throw("You cannot create deposits") | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func s (t,r) = { | |
42 | 42 | let u = getString(this, (t + "_DepositOwner")) | |
43 | 43 | if ((r == u)) | |
44 | 44 | then r | |
45 | 45 | else throw("Only deposit owner can withdrawal dividends") | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func v (t) = { | |
50 | 50 | let w = (t + "_DepositOwner") | |
51 | 51 | let x = getString(this, w) | |
52 | 52 | let y = x | |
53 | 53 | if ($isInstanceOf(y, "String")) | |
54 | 54 | then { | |
55 | 55 | let z = y | |
56 | 56 | true | |
57 | 57 | } | |
58 | 58 | else false | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func A (t,B) = { | |
63 | 63 | let w = (t + "_DepositAmount") | |
64 | 64 | let x = getInteger(this, w) | |
65 | 65 | let C = { | |
66 | 66 | let y = x | |
67 | 67 | if ($isInstanceOf(y, "Int")) | |
68 | 68 | then { | |
69 | 69 | let z = y | |
70 | 70 | z | |
71 | 71 | } | |
72 | 72 | else throw("Couldn't find deposit amount") | |
73 | 73 | } | |
74 | 74 | if ((B == C)) | |
75 | 75 | then B | |
76 | 76 | else throw("Amount is incorrect") | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func D (E) = if (!(isDefined(E))) | |
81 | 81 | then "WAVES" | |
82 | 82 | else if ((E == l)) | |
83 | 83 | then "BTC" | |
84 | 84 | else if ((E == m)) | |
85 | 85 | then "ETH" | |
86 | 86 | else if ((E == n)) | |
87 | 87 | then "LTC" | |
88 | 88 | else if ((E == o)) | |
89 | - | then " | |
89 | + | then "WEST" | |
90 | 90 | else if ((E == p)) | |
91 | 91 | then "WCT" | |
92 | 92 | else throw("AssetId is incorrect") | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func F (t) = if ((t == "WAVES")) | |
96 | 96 | then k | |
97 | 97 | else if ((t == "BTC")) | |
98 | 98 | then l | |
99 | 99 | else if ((t == "ETH")) | |
100 | 100 | then m | |
101 | 101 | else if ((t == "LTC")) | |
102 | 102 | then n | |
103 | - | else if ((t == " | |
103 | + | else if ((t == "WEST")) | |
104 | 104 | then o | |
105 | 105 | else if ((t == "WCT")) | |
106 | 106 | then p | |
107 | 107 | else throw("Asset name is incorrect") | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func G (t) = { | |
111 | 111 | let w = (t + "_DividendPercent") | |
112 | 112 | let x = getInteger(this, w) | |
113 | 113 | let y = x | |
114 | 114 | if ($isInstanceOf(y, "Int")) | |
115 | 115 | then { | |
116 | 116 | let z = y | |
117 | 117 | z | |
118 | 118 | } | |
119 | 119 | else throw("Couldn't Find dividend percent") | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func H (t) = { | |
124 | - | let x = getInteger(this, (t + "_ | |
124 | + | let x = getInteger(this, (t + "_DividendsWithdrawn")) | |
125 | 125 | let y = x | |
126 | 126 | if ($isInstanceOf(y, "Int")) | |
127 | 127 | then { | |
128 | 128 | let z = y | |
129 | 129 | z | |
130 | 130 | } | |
131 | 131 | else 0 | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func I (E,J,K) = { | |
136 | 136 | let L = (assetBalance(this, E) + J) | |
137 | 137 | let M = ((L * K) / 100) | |
138 | 138 | (M - J) | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Callable(N) | |
143 | 143 | func createDeposit (t,O,P,Q,R,S) = { | |
144 | 144 | let T = q(N.callerPublicKey) | |
145 | 145 | let U = v(t) | |
146 | 146 | if (U) | |
147 | 147 | then throw("Deposit is already created") | |
148 | 148 | else WriteSet([DataEntry((t + "_DepositState"), "Created"), DataEntry((t + "_DepositAmount"), O), DataEntry((t + "_DividendPercent"), P), DataEntry((t + "_DepositStartBlock"), Q), DataEntry((t + "_DepositStartTimestamp"), S), DataEntry((t + "_DepositDurationBlock"), R)]) | |
149 | 149 | } | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | 153 | @Callable(N) | |
154 | 154 | func deposit () = { | |
155 | 155 | let T = toBase58String(N.callerPublicKey) | |
156 | 156 | let V = extract(N.payment) | |
157 | 157 | let t = D(V.assetId) | |
158 | 158 | let O = A(t, V.amount) | |
159 | 159 | let W = getString(this, (t + "_DepositState")) | |
160 | 160 | if ((W == "Created")) | |
161 | - | then ScriptResult(WriteSet([DataEntry((t + "_DepositOwner"), T), DataEntry((t + "_DepositState"), "Active"), DataEntry((t + "_ | |
161 | + | then ScriptResult(WriteSet([DataEntry((t + "_DepositOwner"), T), DataEntry((t + "_DepositState"), "Active"), DataEntry((t + "_DividendsWithdrawn"), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(h), O, V.assetId)])) | |
162 | 162 | else throw("Deposit is unavailable") | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | ||
167 | 167 | @Callable(N) | |
168 | 168 | func withdrawDividends (t) = { | |
169 | 169 | let E = F(t) | |
170 | 170 | let u = s(t, toBase58String(N.callerPublicKey)) | |
171 | 171 | let K = G(t) | |
172 | 172 | let J = H(t) | |
173 | 173 | let X = I(E, J, K) | |
174 | - | ScriptResult(WriteSet([DataEntry((t + "_ | |
174 | + | ScriptResult(WriteSet([DataEntry((t + "_DividendsWithdrawn"), (J + X))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(u)), X, E)])) | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | @Verifier(Y) | |
179 | 179 | func Z () = if (sigVerify(Y.bodyBytes, Y.proofs[0], i)) | |
180 | 180 | then { | |
181 | 181 | let y = Y | |
182 | 182 | if ($isInstanceOf(y, "SetScriptTransaction")) | |
183 | 183 | then { | |
184 | 184 | let aa = y | |
185 | 185 | true | |
186 | 186 | } | |
187 | 187 | else if ($isInstanceOf(y, "TransferTransaction")) | |
188 | 188 | then { | |
189 | 189 | let ab = y | |
190 | 190 | let t = D(ab.assetId) | |
191 | 191 | let K = G(t) | |
192 | 192 | let J = H(t) | |
193 | 193 | let ac = I(ab.assetId, J, K) | |
194 | 194 | let ad = assetBalance(this, ab.assetId) | |
195 | 195 | ((ad - ab.amount) >= ac) | |
196 | 196 | } | |
197 | 197 | else if ($isInstanceOf(y, "InvokeScriptTransaction")) | |
198 | 198 | then { | |
199 | 199 | let ae = y | |
200 | 200 | true | |
201 | 201 | } | |
202 | 202 | else false | |
203 | 203 | } | |
204 | 204 | else false | |
205 | 205 |
github/deemru/w8io/026f985 50.52 ms ◑