tx · ohpvgop4CtT6XGyHfb3Wk9mpusxeppx6EmACh4Smfym 3N8WSSin2pToGPd2QkoaJMERdKaxzsWc6wb: -0.05000000 Waves 2023.07.12 15:24 [2662676] smart account 3N8WSSin2pToGPd2QkoaJMERdKaxzsWc6wb > SELF 0.00000000 Waves
{ "type": 13, "id": "ohpvgop4CtT6XGyHfb3Wk9mpusxeppx6EmACh4Smfym", "fee": 5000000, "feeAssetId": null, "timestamp": 1689164703332, "version": 2, "chainId": 84, "sender": "3N8WSSin2pToGPd2QkoaJMERdKaxzsWc6wb", "senderPublicKey": "FchMK5eDR5y83keF9EsE6eb2kCkCT6XPRCs2Nc2esDwp", "proofs": [ "4X7rumSZGAr9DY9Vs8G9x1XgaW3yxynS9MQ8QhPR3taEqjoSrZonXXGRMx2HkcHAethfFNuMNpjj87JT3qpBcAQJ" ], "script": "base64:BgLaBwgCEgUKAwgICBIAEgMKAQESACIDU0VQIglQUkVDSVNJT04iBGpvaW4iAmFyIg5rZXlJbml0aWFsaXplZCIVa2V5Q29vcmRpbmF0b3JBZGRyZXNzIhJrZXlWZXJpZmllckFkZHJlc3MiGWtleVJld2FyZEV4Y2hhbmdlckFkZHJlc3MiEmtleVN1YnZhdWx0QWRkcmVzcyIJa2V5U2lnbmVkIghfYWRkcmVzcyIFX3R4SWQiEWtleVByb3RvY29sQWN0aXZlIg1pc0luaXRpYWxpemVkIhJtdXN0Tm90SW5pdGlhbGl6ZWQiCG11c3RTZWxmIgFpIgtjb29yZGluYXRvciIIdmVyaWZpZXIiByRtYXRjaDAiAXMiCmdldEFkZHJlc3MiA2tleSIDZXJyIhlnZXRSZXdhcmRFeGNoYW5nZXJBZGRyZXNzIghpc0FjdGl2ZSIKbXVzdEFjdGl2ZSISbXVzdEhhdmVPbmVQYXltZW50Igppc1Bvc2l0aXZlIgZudW1iZXIiDGNoZWNrQWRkcmVzcyIHYWRkcmVzcyIQbXVzdFdhdmVzUGF5bWVudCIFY2hlY2siCnBtdEFzc2V0SWQiA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FpBQR1bml0BQNuaWwFAmFpCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJhdQECYXYABAF0CQEBcwADCQABAgUBdAIGU3RyaW5nBAFGBQF0CQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFAUYJAQFqAgkApQgBBQR0aGlzCQDYBAEIBQJhdQJpZAcJAPQDAwgFAmF1CWJvZHlCeXRlcwkAkQMCCAUCYXUGcHJvb2ZzAAAIBQJhdQ9zZW5kZXJQdWJsaWNLZXmV+lrj", "height": 2662676, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = "__" | |
5 | + | ||
6 | + | let b = 1000000000000 | |
7 | + | ||
8 | + | func c (d) = makeString(d, a) | |
9 | + | ||
10 | + | ||
11 | + | func e () = c(["%s", "initialized"]) | |
12 | + | ||
13 | + | ||
14 | + | func f () = c(["%s", "coordinatorAddress"]) | |
15 | + | ||
16 | + | ||
17 | + | func g () = c(["%s", "verifierAddress"]) | |
18 | + | ||
19 | + | ||
20 | + | func h () = c(["%s", "rewardExchangeAddress"]) | |
21 | + | ||
22 | + | ||
23 | + | func i () = c(["%s", "subvaultAddress"]) | |
24 | + | ||
25 | + | ||
26 | + | func j (k,l) = c(["%s%s%s", "signed", k, l]) | |
27 | + | ||
28 | + | ||
29 | + | func m () = c(["%s", "protocolActive"]) | |
30 | + | ||
31 | + | ||
32 | + | func n () = valueOrElse(getBoolean(this, e()), false) | |
33 | + | ||
34 | + | ||
35 | + | func o () = if (n()) | |
36 | + | then throw("Already initialized") | |
37 | + | else unit | |
38 | + | ||
39 | + | ||
40 | + | func p (q) = if ((q.caller != this)) | |
41 | + | then throw("Only self invocation allowed.") | |
42 | + | else unit | |
43 | + | ||
44 | + | ||
45 | + | func r () = addressFromStringValue(valueOrErrorMessage(getString(f()), "Coordinator is not set")) | |
46 | + | ||
47 | + | ||
48 | + | func s () = { | |
49 | + | let t = getString(f()) | |
50 | + | if ($isInstanceOf(t, "String")) | |
51 | + | then { | |
52 | + | let u = t | |
53 | + | getString(addressFromStringValue(u), g()) | |
54 | + | } | |
55 | + | else if ($isInstanceOf(t, "Unit")) | |
56 | + | then unit | |
57 | + | else throw("Match error") | |
58 | + | } | |
59 | + | ||
60 | + | ||
61 | + | func v (w,x) = addressFromStringValue(valueOrErrorMessage(getString(r(), w), x)) | |
62 | + | ||
63 | + | ||
64 | + | func y () = v(h(), "Reward exchanger is not set") | |
65 | + | ||
66 | + | ||
67 | + | func z () = valueOrElse(getBoolean(r(), m()), false) | |
68 | + | ||
69 | + | ||
70 | + | func A () = if (if (!(z())) | |
71 | + | then true | |
72 | + | else !(n())) | |
73 | + | then throw("Protocol is disabled. Please contact support.") | |
74 | + | else unit | |
75 | + | ||
76 | + | ||
77 | + | func B (q) = if ((size(q.payments) != 1)) | |
78 | + | then throw("Must have one payment.") | |
79 | + | else unit | |
80 | + | ||
81 | + | ||
82 | + | func C (D) = if ((0 >= D)) | |
83 | + | then throw("Attribute should be positive.") | |
84 | + | else unit | |
85 | + | ||
86 | + | ||
87 | + | func E (k) = { | |
88 | + | let t = addressFromString(k) | |
89 | + | if ($isInstanceOf(t, "Address")) | |
90 | + | then { | |
91 | + | let F = t | |
92 | + | true | |
93 | + | } | |
94 | + | else if ($isInstanceOf(t, "Unit")) | |
95 | + | then throw("Invalid address") | |
96 | + | else throw("Match error") | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | func G (q) = { | |
101 | + | let H = B(q) | |
102 | + | if ((H == H)) | |
103 | + | then { | |
104 | + | let I = q.payments[0].assetId | |
105 | + | let t = I | |
106 | + | if ($isInstanceOf(t, "Unit")) | |
107 | + | then { | |
108 | + | let J = t | |
109 | + | unit | |
110 | + | } | |
111 | + | else throw("Only WAVES accepted") | |
112 | + | } | |
113 | + | else throw("Strict value is not equal to itself.") | |
114 | + | } | |
115 | + | ||
116 | + | ||
117 | + | func K () = c(["%s", "sWavesAddress"]) | |
118 | + | ||
119 | + | ||
120 | + | func L () = c(["%s", "sWavesAsset"]) | |
121 | + | ||
122 | + | ||
123 | + | func M () = c(["%s", "balance"]) | |
124 | + | ||
125 | + | ||
126 | + | func N () = c(["%s", "totalProfit"]) | |
127 | + | ||
128 | + | ||
129 | + | func O () = valueOrErrorMessage(getString(this, K()), "sWaves address is not set") | |
130 | + | ||
131 | + | ||
132 | + | func P () = addressFromStringValue(O()) | |
133 | + | ||
134 | + | ||
135 | + | func Q () = valueOrErrorMessage(getString(this, L()), "sWaves asset is not set") | |
136 | + | ||
137 | + | ||
138 | + | func R () = fromBase58String(Q()) | |
139 | + | ||
140 | + | ||
141 | + | func S () = valueOrElse(getInteger(M()), 0) | |
142 | + | ||
143 | + | ||
144 | + | func T () = valueOrElse(getInteger(N()), 0) | |
145 | + | ||
146 | + | ||
147 | + | func U () = valueOrErrorMessage(getString(this, i()), "Subvault address is not set") | |
148 | + | ||
149 | + | ||
150 | + | func V () = addressFromString(U()) | |
151 | + | ||
152 | + | ||
153 | + | func W (q) = if ((q.caller != V())) | |
154 | + | then throw("Not allowed") | |
155 | + | else unit | |
156 | + | ||
157 | + | ||
158 | + | func X (q) = if ((q.caller != y())) | |
159 | + | then throw("Not allowed") | |
160 | + | else unit | |
161 | + | ||
162 | + | ||
163 | + | func Y (Z) = { | |
164 | + | let aa = { | |
165 | + | let ab = invoke(P(), "getRate", nil, nil) | |
166 | + | if ($isInstanceOf(ab, "String")) | |
167 | + | then ab | |
168 | + | else throw(($getType(ab) + " couldn't be cast to String")) | |
169 | + | } | |
170 | + | if ((aa == aa)) | |
171 | + | then toInt(fraction(toBigInt(Z), toBigInt(b), parseBigIntValue(aa), CEILING)) | |
172 | + | else throw("Strict value is not equal to itself.") | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | func ac () = { | |
177 | + | let ad = assetBalance(this, R()) | |
178 | + | if ((ad == ad)) | |
179 | + | then { | |
180 | + | let ae = AttachedPayment(R(), ad) | |
181 | + | if ((ae == ae)) | |
182 | + | then { | |
183 | + | let af = invoke(P(), "withdraw", nil, [ae]) | |
184 | + | if ((af == af)) | |
185 | + | then { | |
186 | + | let ag = wavesBalance(this).regular | |
187 | + | if ((ag == ag)) | |
188 | + | then { | |
189 | + | let ah = S() | |
190 | + | if ((ah == ah)) | |
191 | + | then if ((ah > ag)) | |
192 | + | then throw("Unable to proceed. Invalid state: wavesActualBalance < accountingBalance") | |
193 | + | else { | |
194 | + | let ai = (ag - ah) | |
195 | + | if ((ai == ai)) | |
196 | + | then { | |
197 | + | let aj = AttachedPayment(unit, ah) | |
198 | + | if ((aj == aj)) | |
199 | + | then { | |
200 | + | let ak = invoke(P(), "deposit", nil, [aj]) | |
201 | + | if ((ak == ak)) | |
202 | + | then ai | |
203 | + | else throw("Strict value is not equal to itself.") | |
204 | + | } | |
205 | + | else throw("Strict value is not equal to itself.") | |
206 | + | } | |
207 | + | else throw("Strict value is not equal to itself.") | |
208 | + | } | |
209 | + | else throw("Strict value is not equal to itself.") | |
210 | + | } | |
211 | + | else throw("Strict value is not equal to itself.") | |
212 | + | } | |
213 | + | else throw("Strict value is not equal to itself.") | |
214 | + | } | |
215 | + | else throw("Strict value is not equal to itself.") | |
216 | + | } | |
217 | + | else throw("Strict value is not equal to itself.") | |
218 | + | } | |
219 | + | ||
220 | + | ||
221 | + | @Callable(q) | |
222 | + | func initialize (al,am,an) = { | |
223 | + | let ao = [p(q), o(), E(al), E(am), E(an)] | |
224 | + | if ((ao == ao)) | |
225 | + | then { | |
226 | + | let ap = addressFromStringValue(an) | |
227 | + | let aq = valueOrErrorMessage(getString(ap, "ASSET"), "No sWaves Asset") | |
228 | + | [StringEntry(f(), al), StringEntry(i(), am), StringEntry(K(), an), StringEntry(L(), aq), BooleanEntry(e(), true)] | |
229 | + | } | |
230 | + | else throw("Strict value is not equal to itself.") | |
231 | + | } | |
232 | + | ||
233 | + | ||
234 | + | ||
235 | + | @Callable(q) | |
236 | + | func stake () = { | |
237 | + | let ao = [A(), W(q), G(q)] | |
238 | + | if ((ao == ao)) | |
239 | + | then { | |
240 | + | let ar = q.payments[0] | |
241 | + | let ak = invoke(P(), "deposit", nil, [ar]) | |
242 | + | if ((ak == ak)) | |
243 | + | then { | |
244 | + | let as = (S() + ar.amount) | |
245 | + | [IntegerEntry(M(), as)] | |
246 | + | } | |
247 | + | else throw("Strict value is not equal to itself.") | |
248 | + | } | |
249 | + | else throw("Strict value is not equal to itself.") | |
250 | + | } | |
251 | + | ||
252 | + | ||
253 | + | ||
254 | + | @Callable(q) | |
255 | + | func unstake (Z) = { | |
256 | + | let ao = [A(), W(q), C(Z)] | |
257 | + | if ((ao == ao)) | |
258 | + | then if ((Z > S())) | |
259 | + | then throw("Unable to proceed. Amount larger than balance.") | |
260 | + | else { | |
261 | + | let as = (S() - Z) | |
262 | + | let ad = Y(Z) | |
263 | + | if ((ad == ad)) | |
264 | + | then { | |
265 | + | let ar = AttachedPayment(R(), ad) | |
266 | + | let af = invoke(P(), "withdraw", nil, [ar]) | |
267 | + | if ((af == af)) | |
268 | + | then [IntegerEntry(M(), as), ScriptTransfer(q.caller, Z, unit)] | |
269 | + | else throw("Strict value is not equal to itself.") | |
270 | + | } | |
271 | + | else throw("Strict value is not equal to itself.") | |
272 | + | } | |
273 | + | else throw("Strict value is not equal to itself.") | |
274 | + | } | |
275 | + | ||
276 | + | ||
277 | + | ||
278 | + | @Callable(q) | |
279 | + | func claimProfit () = { | |
280 | + | let ao = [A(), X(q)] | |
281 | + | if ((ao == ao)) | |
282 | + | then { | |
283 | + | let ai = ac() | |
284 | + | if ((ai == ai)) | |
285 | + | then { | |
286 | + | let at = (T() + ai) | |
287 | + | $Tuple2([IntegerEntry(N(), at), ScriptTransfer(q.caller, ai, unit)], ai) | |
288 | + | } | |
289 | + | else throw("Strict value is not equal to itself.") | |
290 | + | } | |
291 | + | else throw("Strict value is not equal to itself.") | |
292 | + | } | |
293 | + | ||
294 | + | ||
295 | + | @Verifier(au) | |
296 | + | func av () = { | |
297 | + | let t = s() | |
298 | + | if ($isInstanceOf(t, "String")) | |
299 | + | then { | |
300 | + | let F = t | |
301 | + | valueOrElse(getBoolean(addressFromStringValue(F), j(toString(this), toBase58String(au.id))), false) | |
302 | + | } | |
303 | + | else sigVerify(au.bodyBytes, au.proofs[0], au.senderPublicKey) | |
304 | + | } | |
305 | + |
github/deemru/w8io/026f985 20.44 ms ◑