tx · 6WZjsTb3UjQnBUi7rMF7p7Hb7XXYnc8KUeWiQHHeUhu 3Muq5wV3BDmwMhJVZYV29DzxmK1omjyuibx: -0.01400000 Waves 2019.12.30 15:44 [831832] smart account 3Muq5wV3BDmwMhJVZYV29DzxmK1omjyuibx > SELF 0.00000000 Waves
{ "type": 13, "id": "6WZjsTb3UjQnBUi7rMF7p7Hb7XXYnc8KUeWiQHHeUhu", "fee": 1400000, "feeAssetId": null, "timestamp": 1577709899454, "version": 1, "sender": "3Muq5wV3BDmwMhJVZYV29DzxmK1omjyuibx", "senderPublicKey": "2VedaSDtTc2zJEQPTDwrUiyjjbQAbFbjtyuFWe5HSt4S", "proofs": [ "2NE9rMBPHGnDUUZPVQSxH7ubnER7Z7ngohJDMCcwQSMsYQuQRqk8dpXQ952mQH1mC5QWkZnLYyhyakL1NLaUaatT" ], "script": "base64:AAIDAAAAAAAAABMIARIICgYIAQEBAQESABIDCgEIAAAAEgAAAAAOZHJhZ29uRnJ1aXRQdWIJAAJZAAAAAQIAAAAsNk1UU2ZERWJmWjlWcjdoeE4yUGtKVDZ0UXZDUFoxak43SzlMOGdDaVpuRjUAAAAADWRpdlByb2dyYW1QdWIJAAJZAAAAAQIAAAAsMlZlZGFTRHRUYzJ6SkVRUFREd3JVaXlqamJRQWJGYmp0eXVGV2U1SFN0NFMAAAAACGFkbWluUHViCQACWQAAAAECAAAALDV5amNmdkg2aXV3cmtGZ2hYdVdhSmVNcHBhUTg5M0ZTczhIQ0FnVlF6dU5ZAAAAAAx3YXZlc0Fzc2V0SWQFAAAABHVuaXQAAAAACmJ0Y0Fzc2V0SWQBAAAAIGw2svbUHBLcx3bdEkweEtAA7iFIG3KIbsVzvK0POdsqAAAAAApldGhBc3NldElkAQAAACA4bs5FVt7Ax9sDrZr+iUOq6OcehVaQAjpoAtv2uen+FQAAAAAKbHRjQXNzZXRJZAEAAAAg6CIv7HSbViz3QYRuEC38aHBhr9J9Sz2LpOTF5OT5oDQAAAAAC3dlc3RB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c2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQkAAlkAAAABBQAAAAxkZXBvc2l0T3duZXIFAAAAEmRpdmlkZW5kc0F2YWxpYWJsZQUAAAAHYXNzZXRJZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAZ9LtjQ", "chainId": 84, "height": 831832, "spentComplexity": 0 } View: original | compacted Prev: 4Sjx5AjS1w4oTGPZdBtH1QM6DcDSrTjseCXywWPfD7vD Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = " | |
4 | + | let a = fromBase58String("6MTSfDEbfZ9Vr7hxN2PkJT6tQvCPZ1jN7K9L8gCiZnF5") | |
5 | 5 | ||
6 | 6 | let b = fromBase58String("2VedaSDtTc2zJEQPTDwrUiyjjbQAbFbjtyuFWe5HSt4S") | |
7 | 7 | ||
144 | 144 | let H = t(m, O.amount) | |
145 | 145 | let P = getString(this, (m + "_DepositState")) | |
146 | 146 | if ((P == "Created")) | |
147 | - | then ScriptResult(WriteSet([DataEntry("_Operation", height), DataEntry((m + "_DepositOwner"), M), DataEntry((m + "_DepositState"), "Active"), DataEntry((m + "_DividendWithdrawn"), 0)]), TransferSet([ScriptTransfer( | |
147 | + | then ScriptResult(WriteSet([DataEntry("_Operation", height), DataEntry((m + "_DepositOwner"), M), DataEntry((m + "_DepositState"), "Active"), DataEntry((m + "_DividendWithdrawn"), 0)]), TransferSet([ScriptTransfer(addressFromPublicKey(a), H, O.assetId)])) | |
148 | 148 | else throw("Deposit is unavailable") | |
149 | 149 | } | |
150 | 150 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = " | |
4 | + | let a = fromBase58String("6MTSfDEbfZ9Vr7hxN2PkJT6tQvCPZ1jN7K9L8gCiZnF5") | |
5 | 5 | ||
6 | 6 | let b = fromBase58String("2VedaSDtTc2zJEQPTDwrUiyjjbQAbFbjtyuFWe5HSt4S") | |
7 | 7 | ||
8 | 8 | let c = fromBase58String("5yjcfvH6iuwrkFghXuWaJeMppaQ893FSs8HCAgVQzuNY") | |
9 | 9 | ||
10 | 10 | let d = unit | |
11 | 11 | ||
12 | 12 | let e = base58'8HRQdqJBBeqZvgMtg6we6sw11i5GzpFNs7onNeVRBmaq' | |
13 | 13 | ||
14 | 14 | let f = base58'4oHq3C7ar7kmcRHEZBrgPyGtU6fkqJ1pHoRYboKeYSWQ' | |
15 | 15 | ||
16 | 16 | let g = base58'Gd9pdZw9muDBZwwsQLqyigRJCDABbiJaksmemzFCorsV' | |
17 | 17 | ||
18 | 18 | let h = base58'C2Pz1Q9QYaF9MkK9J9mX9vAMVc25R3w6Lr5g5B5Yje87' | |
19 | 19 | ||
20 | 20 | let i = base58'AMQkRmWSWHEd1nMDvDZFkadoCFCxRkDzBsEbscJ9ZZ2P' | |
21 | 21 | ||
22 | 22 | func j (k) = if ((k == c)) | |
23 | 23 | then k | |
24 | 24 | else throw("You cannot create deposits") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func l (m,k) = { | |
28 | 28 | let n = getString(this, (m + "_DepositOwner")) | |
29 | 29 | if ((k == n)) | |
30 | 30 | then k | |
31 | 31 | else throw("Only deposit owner can withdrawal dividends") | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func o (m) = { | |
36 | 36 | let p = (m + "_DepositOwner") | |
37 | 37 | let q = getString(this, p) | |
38 | 38 | let r = q | |
39 | 39 | if ($isInstanceOf(r, "String")) | |
40 | 40 | then { | |
41 | 41 | let s = r | |
42 | 42 | true | |
43 | 43 | } | |
44 | 44 | else false | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func t (m,u) = { | |
49 | 49 | let p = (m + "_DepositAmount") | |
50 | 50 | let q = getInteger(this, p) | |
51 | 51 | let v = { | |
52 | 52 | let r = q | |
53 | 53 | if ($isInstanceOf(r, "Int")) | |
54 | 54 | then { | |
55 | 55 | let s = r | |
56 | 56 | s | |
57 | 57 | } | |
58 | 58 | else throw("Couldn't find deposit amount") | |
59 | 59 | } | |
60 | 60 | if ((u == v)) | |
61 | 61 | then u | |
62 | 62 | else throw("Amount is incorrect") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func w (x) = if (!(isDefined(x))) | |
67 | 67 | then "WAVES" | |
68 | 68 | else if ((x == e)) | |
69 | 69 | then "BTC" | |
70 | 70 | else if ((x == f)) | |
71 | 71 | then "ETH" | |
72 | 72 | else if ((x == g)) | |
73 | 73 | then "LTC" | |
74 | 74 | else if ((x == h)) | |
75 | 75 | then "WEST" | |
76 | 76 | else if ((x == i)) | |
77 | 77 | then "WCT" | |
78 | 78 | else throw("AssetId is incorrect") | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func y (m) = if ((m == "WAVES")) | |
82 | 82 | then d | |
83 | 83 | else if ((m == "BTC")) | |
84 | 84 | then e | |
85 | 85 | else if ((m == "ETH")) | |
86 | 86 | then f | |
87 | 87 | else if ((m == "LTC")) | |
88 | 88 | then g | |
89 | 89 | else if ((m == "WEST")) | |
90 | 90 | then h | |
91 | 91 | else if ((m == "WCT")) | |
92 | 92 | then i | |
93 | 93 | else throw("Asset name is incorrect") | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func z (m) = { | |
97 | 97 | let p = (m + "_DividendPercent") | |
98 | 98 | let q = getInteger(this, p) | |
99 | 99 | let r = q | |
100 | 100 | if ($isInstanceOf(r, "Int")) | |
101 | 101 | then { | |
102 | 102 | let s = r | |
103 | 103 | s | |
104 | 104 | } | |
105 | 105 | else throw("Couldn't Find dividend percent") | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func A (m) = { | |
110 | 110 | let q = getInteger(this, (m + "_DividendWithdrawn")) | |
111 | 111 | let r = q | |
112 | 112 | if ($isInstanceOf(r, "Int")) | |
113 | 113 | then { | |
114 | 114 | let s = r | |
115 | 115 | s | |
116 | 116 | } | |
117 | 117 | else 0 | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func B (x,C,D) = { | |
122 | 122 | let E = (assetBalance(this, x) + C) | |
123 | 123 | let F = ((E * D) / 100) | |
124 | 124 | (F - C) | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(G) | |
129 | 129 | func createDeposit (m,H,I,J,K,L) = { | |
130 | 130 | let M = j(G.callerPublicKey) | |
131 | 131 | let N = o(m) | |
132 | 132 | if (N) | |
133 | 133 | then throw("Deposit is already created") | |
134 | 134 | else WriteSet([DataEntry((m + "_DepositState"), "Created"), DataEntry((m + "_DepositAmount"), H), DataEntry((m + "_DividendPercent"), I), DataEntry((m + "_DepositStartBlock"), J), DataEntry((m + "_DepositStartTimestamp"), L), DataEntry((m + "_DepositDurationBlock"), K)]) | |
135 | 135 | } | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | 139 | @Callable(G) | |
140 | 140 | func deposit () = { | |
141 | 141 | let M = toBase58String(G.callerPublicKey) | |
142 | 142 | let O = extract(G.payment) | |
143 | 143 | let m = w(O.assetId) | |
144 | 144 | let H = t(m, O.amount) | |
145 | 145 | let P = getString(this, (m + "_DepositState")) | |
146 | 146 | if ((P == "Created")) | |
147 | - | then ScriptResult(WriteSet([DataEntry("_Operation", height), DataEntry((m + "_DepositOwner"), M), DataEntry((m + "_DepositState"), "Active"), DataEntry((m + "_DividendWithdrawn"), 0)]), TransferSet([ScriptTransfer( | |
147 | + | then ScriptResult(WriteSet([DataEntry("_Operation", height), DataEntry((m + "_DepositOwner"), M), DataEntry((m + "_DepositState"), "Active"), DataEntry((m + "_DividendWithdrawn"), 0)]), TransferSet([ScriptTransfer(addressFromPublicKey(a), H, O.assetId)])) | |
148 | 148 | else throw("Deposit is unavailable") | |
149 | 149 | } | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | 153 | @Callable(G) | |
154 | 154 | func withdrawDividends (m) = { | |
155 | 155 | let x = y(m) | |
156 | 156 | let n = l(m, toBase58String(G.callerPublicKey)) | |
157 | 157 | let D = z(m) | |
158 | 158 | let C = A(m) | |
159 | 159 | let Q = B(x, C, D) | |
160 | 160 | ScriptResult(WriteSet([DataEntry((m + "_DividendWithdrawn"), (C + Q))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(n)), Q, x)])) | |
161 | 161 | } | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | @Verifier(R) | |
165 | 165 | func S () = true | |
166 | 166 |
github/deemru/w8io/026f985 40.37 ms ◑