tx · 6ZAaHhj1he28UkFKT3YcTsLXLfvhizgYniWba3Rkta6x 3MxovCV2pBS5Z6YEcj3Gap5ish6dX3YERfP: -0.05000000 Waves 2022.11.09 20:51 [2309921] smart account 3MxovCV2pBS5Z6YEcj3Gap5ish6dX3YERfP > SELF 0.00000000 Waves
{ "type": 13, "id": "6ZAaHhj1he28UkFKT3YcTsLXLfvhizgYniWba3Rkta6x", "fee": 5000000, "feeAssetId": null, "timestamp": 1668016288985, "version": 2, "chainId": 84, "sender": "3MxovCV2pBS5Z6YEcj3Gap5ish6dX3YERfP", "senderPublicKey": "6aZUzHaTgW7zPizjKqNFNAaKdYXVUaNwstd6E3NsD3YF", "proofs": [ "2HZX8dJ7ZrUeg2Qer7iCdb3JLdAUP5JYuAV3fh3gd78vfPVXbkbvvEpXRj4954VKEbYN4v5JSBZgoacFBza9M4ci" ], "script": "base64:AAIFAAAAAAAAAA0IAhIDCgEIEgASABIAAAAAEwAAAAAJcHJlY2lzaW9uAA3gtrOnZAAAAQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAkABCIAAAABAgAAABBtYW5hZ2VyUHVibGljS2V5AQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAQAAAAHJG1hdGNoMAkBAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAJAAJZAAAAAQUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAUAAAAEdW5pdAkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgEAAAALbXVzdE1hbmFnZXIAAAABAAAAAWkEAAAAAnBkCQAAAgAAAAECAAAAEXBlcm1pc3Npb24gZGVuaWVkBAAAAAckbWF0Y2gwCQEAAAAWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3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AAAAGYW1vdW50CQEAAAAJc2VuZFdhdmVzAAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAA50cmFuc2ZlckFtb3VudAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRgWASc=", "height": 2309921, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: mKTDV39acEKVnuZwHoV7AFvZpFVAPPNkaT1MTBidUGL Next: 2u3faHFP2Kn2Gsp5oiLk9QUFc3PhWj3ogPyf3PG5t52o Diff:
Old | New | Differences | |
---|---|---|---|
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | - | func H (I,J) = [IntegerEntry("lastRate", I), IntegerEntry("lastTimestamp", lastBlock.timestamp)] | |
130 | + | func H (I,J) = [IntegerEntry("lastRate", I), IntegerEntry("lastTimestamp", lastBlock.timestamp), IntegerEntry("growthRate", J)] | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func K () = { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 1000000000000000000 | |
5 | 5 | ||
6 | 6 | func b () = getString("managerPublicKey") | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func c () = { | |
10 | 10 | let d = b() | |
11 | 11 | if ($isInstanceOf(d, "String")) | |
12 | 12 | then { | |
13 | 13 | let e = d | |
14 | 14 | fromBase58String(e) | |
15 | 15 | } | |
16 | 16 | else if ($isInstanceOf(d, "Unit")) | |
17 | 17 | then unit | |
18 | 18 | else throw("Match error") | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func f (g) = { | |
23 | 23 | let h = throw("permission denied") | |
24 | 24 | let d = c() | |
25 | 25 | if ($isInstanceOf(d, "ByteVector")) | |
26 | 26 | then { | |
27 | 27 | let i = d | |
28 | 28 | if ((g.callerPublicKey == i)) | |
29 | 29 | then true | |
30 | 30 | else h | |
31 | 31 | } | |
32 | 32 | else if ($isInstanceOf(d, "Unit")) | |
33 | 33 | then if ((g.caller == this)) | |
34 | 34 | then true | |
35 | 35 | else h | |
36 | 36 | else throw("Match error") | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func j () = { | |
41 | 41 | let d = getBoolean("inited") | |
42 | 42 | if ($isInstanceOf(d, "Boolean")) | |
43 | 43 | then { | |
44 | 44 | let k = d | |
45 | 45 | if ((k == false)) | |
46 | 46 | then true | |
47 | 47 | else throw("Already inited") | |
48 | 48 | } | |
49 | 49 | else if ($isInstanceOf(d, "Unit")) | |
50 | 50 | then false | |
51 | 51 | else throw("Match error") | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func l () = { | |
56 | 56 | let d = getBinary("leaseId") | |
57 | 57 | if ($isInstanceOf(d, "ByteVector")) | |
58 | 58 | then { | |
59 | 59 | let m = d | |
60 | 60 | [LeaseCancel(m), DeleteEntry("leaseId")] | |
61 | 61 | } | |
62 | 62 | else if ($isInstanceOf(d, "Unit")) | |
63 | 63 | then nil | |
64 | 64 | else throw("Match error") | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func n () = valueOrElse(getInteger("balance"), 0) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func o (p) = IntegerEntry("balance", p) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func q (p) = if ((p == 0)) | |
75 | 75 | then nil | |
76 | 76 | else { | |
77 | 77 | let r = Address(fromBase58String(getStringValue("leaserAddress"))) | |
78 | 78 | let s = n() | |
79 | 79 | let t = (s + p) | |
80 | 80 | let u = if ((t > 0)) | |
81 | 81 | then { | |
82 | 82 | let v = Lease(r, t) | |
83 | 83 | let w = calculateLeaseId(v) | |
84 | 84 | [v, BinaryEntry("leaseId", w)] | |
85 | 85 | } | |
86 | 86 | else nil | |
87 | 87 | ((l() ++ u) :+ o(t)) | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func x (p) = { | |
92 | 92 | let y = fromBase58String(getStringValue("sWavesAssetId")) | |
93 | 93 | Reissue(y, p, true) | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func z (p) = { | |
98 | 98 | let y = fromBase58String(getStringValue("sWavesAssetId")) | |
99 | 99 | Burn(y, p) | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func A (B,p) = { | |
104 | 104 | let y = fromBase58String(getStringValue("sWavesAssetId")) | |
105 | 105 | ScriptTransfer(B, p, y) | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func C (B,p) = ScriptTransfer(B, p, unit) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func D () = { | |
113 | 113 | let E = fromBase58String(getStringValue("sWavesAssetId")) | |
114 | 114 | let d = assetInfo(E) | |
115 | 115 | if ($isInstanceOf(d, "Asset")) | |
116 | 116 | then { | |
117 | 117 | let F = d | |
118 | 118 | F.quantity | |
119 | 119 | } | |
120 | 120 | else throw("Can't find asset") | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func G () = { | |
125 | 125 | let r = Address(fromBase58String(getStringValue("leaserAddress"))) | |
126 | 126 | wavesBalance(r).regular | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | - | func H (I,J) = [IntegerEntry("lastRate", I), IntegerEntry("lastTimestamp", lastBlock.timestamp)] | |
130 | + | func H (I,J) = [IntegerEntry("lastRate", I), IntegerEntry("lastTimestamp", lastBlock.timestamp), IntegerEntry("growthRate", J)] | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func K () = { | |
134 | 134 | let L = Address(fromBase58String(getStringValue("leaserAddress"))) | |
135 | 135 | let M = invoke(L, "withdraw", nil, nil) | |
136 | 136 | if ((M == M)) | |
137 | 137 | then M | |
138 | 138 | else throw("Strict value is not equal to itself.") | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func N (O) = (getIntegerValue("lastRate") + (getIntegerValue("growthRate") * O)) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func P () = (lastBlock.timestamp - getIntegerValue("lastTimestamp")) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | @Callable(g) | |
149 | 149 | func init (r) = { | |
150 | 150 | let Q = [f(g), j()] | |
151 | 151 | if ((Q == Q)) | |
152 | 152 | then { | |
153 | 153 | let R = Issue("sWaves", "", 0, 8, true, unit, 0) | |
154 | 154 | let y = calculateAssetId(R) | |
155 | 155 | [BooleanEntry("inited", true), StringEntry("sWavesAssetId", toBase58String(y)), StringEntry("leaserAddress", r), IntegerEntry("lastRate", a), IntegerEntry("lastTimestamp", lastBlock.timestamp), IntegerEntry("growthRate", 0), IntegerEntry("balance", 0), R] | |
156 | 156 | } | |
157 | 157 | else throw("Strict value is not equal to itself.") | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | ||
162 | 162 | @Callable(g) | |
163 | 163 | func compound () = { | |
164 | 164 | let O = P() | |
165 | 165 | let S = D() | |
166 | 166 | if (if ((O == 0)) | |
167 | 167 | then true | |
168 | 168 | else (S == 0)) | |
169 | 169 | then nil | |
170 | 170 | else { | |
171 | 171 | let I = N(O) | |
172 | 172 | let T = G() | |
173 | 173 | let J = (fraction(T, a, S) / O) | |
174 | 174 | let U = K() | |
175 | 175 | if ((U == U)) | |
176 | 176 | then (q(T) ++ H(I, J)) | |
177 | 177 | else throw("Strict value is not equal to itself.") | |
178 | 178 | } | |
179 | 179 | } | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | ||
183 | 183 | @Callable(g) | |
184 | 184 | func stake () = { | |
185 | 185 | let V = g.payments[0] | |
186 | 186 | if ((V.assetId != unit)) | |
187 | 187 | then throw("Only WAVES supported") | |
188 | 188 | else if ((size(g.payments) != 1)) | |
189 | 189 | then throw("Wrong payments amount") | |
190 | 190 | else { | |
191 | 191 | let O = P() | |
192 | 192 | let I = N(O) | |
193 | 193 | let W = fraction(V.amount, a, I) | |
194 | 194 | let M = invoke(this, "compound", nil, nil) | |
195 | 195 | if ((M == M)) | |
196 | 196 | then ((q(V.amount) :+ x(W)) :+ A(g.caller, W)) | |
197 | 197 | else throw("Strict value is not equal to itself.") | |
198 | 198 | } | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | ||
203 | 203 | @Callable(g) | |
204 | 204 | func unstake () = { | |
205 | 205 | let V = g.payments[0] | |
206 | 206 | let y = fromBase58String(getStringValue("sWavesAssetId")) | |
207 | 207 | if ((V.assetId != y)) | |
208 | 208 | then throw("Only sWAVES supported") | |
209 | 209 | else if ((size(g.payments) != 1)) | |
210 | 210 | then throw("Wrong payments amount") | |
211 | 211 | else { | |
212 | 212 | let O = P() | |
213 | 213 | let I = N(O) | |
214 | 214 | let X = fraction(V.amount, I, a) | |
215 | 215 | let M = invoke(this, "compound", nil, nil) | |
216 | 216 | if ((M == M)) | |
217 | 217 | then ((q(-(X)) :+ z(V.amount)) :+ C(g.caller, X)) | |
218 | 218 | else throw("Strict value is not equal to itself.") | |
219 | 219 | } | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Verifier(Y) | |
224 | 224 | func Z () = sigVerify(Y.bodyBytes, Y.proofs[0], Y.senderPublicKey) | |
225 | 225 |
github/deemru/w8io/169f3d6 32.50 ms ◑