tx · 287fu18v9SMtwsn7pu62rzpNro9QS4iDuWn5pmvrhswj 3N9ptcZ3FABe4Vm2Gt68dYdzQU2ve6aoq9p: -0.05000000 Waves 2023.07.12 15:21 [2662674] smart account 3N9ptcZ3FABe4Vm2Gt68dYdzQU2ve6aoq9p > SELF 0.00000000 Waves
{ "type": 13, "id": "287fu18v9SMtwsn7pu62rzpNro9QS4iDuWn5pmvrhswj", "fee": 5000000, "feeAssetId": null, "timestamp": 1689164534278, "version": 2, "chainId": 84, "sender": "3N9ptcZ3FABe4Vm2Gt68dYdzQU2ve6aoq9p", "senderPublicKey": "9Xngx7HnYeFNUUxARD5uXKqT7oD3zsKqQffS3Mwgf8rT", "proofs": [ "24AQ8fLw4egE9XWyDB8k28S6uSTF7ZNs31rmf2qXTAoMiBoi48ak4U6G5MMFWLEA7KT9N71Xxq29d4LawbkPwVyv" ], "script": "base64:BgKJCAgCEgMKAQgSABIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQESAwoBARIDCgEBEgMKAQQSAwoBARIDCgEIIgNTRVAiCVBSRUNJU0lPTiIQTUlOX0FNT1VOVF9ERUxUQSIVTUFYX1JBVEVfSEVJR0hUX0RFTFRBIhFMSVFVSURBVElPTl9CT05VUyIYTElRVUlEQVRJT05fUFJPVE9DT0xfRkVFIg1TVEFCSUxJVFlfRkVFIgRkaXZwIgJfeCICX3kiBGpvaW4iAmFyIg5rZXlJbml0aWFsaXplZCIVa2V5Q29vcmRpbmF0b3JBZGRyZXNzIhJrZXlWZXJpZmllckFkZHJlc3MiEmtleUZyb250ZW5kQWRkcmVzcyIQa2V5TWludGVyQWRkcmVzcyISa2V5VHJlYXN1cnlBZGRyZXNzIhVrZXlFYXN0U3Rha2luZ0FkZHJlc3MiEmtleUV4Y2hhbmdlQWRkcmVzcyIUa2V5U3RhYmlsaXplckFkZHJlc3MiGWtleVJld2FyZEV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IAgkBDEludGVnZXJFbnRyeQIJAQFDAAUCYWwFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFSARJzZXRSZXdhcmRFeGNoYW5nZXIBAUcEAmFkCQDMCAIJAQFRAQUBUgkAzAgCCQECYWEBBQFHBQNuaWwDCQAAAgUCYWQFAmFkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAQF2AAUBRwUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJhbQECYW4ABAFVCQEBVAADCQABAgUBVQIGU3RyaW5nBAJhYgUBVQkBC3ZhbHVlT3JFbHNlAgkAmwgCCQERQGV4dHJOYXRpdmUoMTA2MikBBQJhYgkBAUYCCQClCAEFBHRoaXMJANgEAQgFAmFtAmlkBwkA9AMDCAUCYW0JYm9keUJ5dGVzCQCRAwIIBQJhbQZwcm9vZnMAAAgFAmFtD3NlbmRlclB1YmxpY0tleVsPav0=", "height": 2662674, "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 SEP = "__" | |
5 | + | ||
6 | + | let PRECISION = 1000000000000 | |
7 | + | ||
8 | + | let MIN_AMOUNT_DELTA = 1000 | |
9 | + | ||
10 | + | let MAX_RATE_HEIGHT_DELTA = 5 | |
11 | + | ||
12 | + | let LIQUIDATION_BONUS = ((PRECISION / 100) * 5) | |
13 | + | ||
14 | + | let LIQUIDATION_PROTOCOL_FEE = ((PRECISION / 100) * 2) | |
15 | + | ||
16 | + | let STABILITY_FEE = (PRECISION / 100) | |
17 | + | ||
18 | + | func divp (_x,_y) = fraction(_x, PRECISION, _y, HALFEVEN) | |
19 | + | ||
20 | + | ||
21 | + | func join (ar) = makeString(ar, SEP) | |
22 | + | ||
23 | + | ||
24 | + | func keyInitialized () = join(["%s", "initialized"]) | |
25 | + | ||
26 | + | ||
27 | + | func keyCoordinatorAddress () = join(["%s", "coordinatorAddress"]) | |
28 | + | ||
29 | + | ||
30 | + | func keyVerifierAddress () = join(["%s", "verifierAddress"]) | |
31 | + | ||
32 | + | ||
33 | + | func keyFrontendAddress () = join(["%s", "frontendAddress"]) | |
34 | + | ||
35 | + | ||
36 | + | func keyMinterAddress () = join(["%s", "minterAddress"]) | |
37 | + | ||
38 | + | ||
39 | + | func keyTreasuryAddress () = join(["%s", "treasuryAddress"]) | |
40 | + | ||
41 | + | ||
42 | + | func keyEastStakingAddress () = join(["%s", "eastStakingAddress"]) | |
43 | + | ||
44 | + | ||
45 | + | func keyExchangeAddress () = join(["%s", "exchangeAddress"]) | |
46 | + | ||
47 | + | ||
48 | + | func keyStabilizerAddress () = join(["%s", "stabilizerAddress"]) | |
49 | + | ||
50 | + | ||
51 | + | func keyRewardExchangerAddress () = join(["%s", "rewardExchangeAddress"]) | |
52 | + | ||
53 | + | ||
54 | + | func keyEastAsset () = join(["%s", "eastAsset"]) | |
55 | + | ||
56 | + | ||
57 | + | func keyStEastAsset () = join(["%s", "stEastAsset"]) | |
58 | + | ||
59 | + | ||
60 | + | func keyPrecision () = join(["%s", "precision"]) | |
61 | + | ||
62 | + | ||
63 | + | func keyLiquidationBonus () = join(["%s", "liquidationBonus"]) | |
64 | + | ||
65 | + | ||
66 | + | func keyLiquidationProtocolFee () = join(["%s", "liquidationProtocolFee"]) | |
67 | + | ||
68 | + | ||
69 | + | func keyStabilityFee () = join(["%s", "stabilityFee"]) | |
70 | + | ||
71 | + | ||
72 | + | func keyMaxSlippage () = join(["%s", "maxSlippage"]) | |
73 | + | ||
74 | + | ||
75 | + | func keyMinAmountDelta () = join(["%s", "minAmountDelta"]) | |
76 | + | ||
77 | + | ||
78 | + | func keyMaxRateHeightDelta () = join(["%s", "maxRateHeightDelta"]) | |
79 | + | ||
80 | + | ||
81 | + | func keySigned (_address,_txId) = join(["%s%s%s", "signed", _address, _txId]) | |
82 | + | ||
83 | + | ||
84 | + | func keyProtocolActive () = join(["%s", "protocolActive"]) | |
85 | + | ||
86 | + | ||
87 | + | func keyOrientMinterAddress () = join(["%s", "orientMinterAddress"]) | |
88 | + | ||
89 | + | ||
90 | + | func keyOrientWestingAddress () = join(["%s", "orientWestingAddress"]) | |
91 | + | ||
92 | + | ||
93 | + | func keyOrientStakingAddress () = join(["%s", "orientStakingAddress"]) | |
94 | + | ||
95 | + | ||
96 | + | func keyOrientBackendAddress () = join(["%s", "orientBackendAddress"]) | |
97 | + | ||
98 | + | ||
99 | + | func keyOrientAsset () = join(["%s", "orientAsset"]) | |
100 | + | ||
101 | + | ||
102 | + | func isInitialized () = valueOrElse(getBoolean(this, keyInitialized()), false) | |
103 | + | ||
104 | + | ||
105 | + | func mustNotInitialized () = if (isInitialized()) | |
106 | + | then throw("Already initialized") | |
107 | + | else unit | |
108 | + | ||
109 | + | ||
110 | + | func mustSelf (i) = if ((i.caller != this)) | |
111 | + | then throw("Only self invocation allowed.") | |
112 | + | else unit | |
113 | + | ||
114 | + | ||
115 | + | func coordinator () = addressFromStringValue(valueOrErrorMessage(getString(keyCoordinatorAddress()), "Coordinator is not set")) | |
116 | + | ||
117 | + | ||
118 | + | func verifier () = match getString(keyCoordinatorAddress()) { | |
119 | + | case s: String => | |
120 | + | getString(addressFromStringValue(s), keyVerifierAddress()) | |
121 | + | case _: Unit => | |
122 | + | unit | |
123 | + | case _ => | |
124 | + | throw("Match error") | |
125 | + | } | |
126 | + | ||
127 | + | ||
128 | + | func getAddress (key,err) = addressFromStringValue(valueOrErrorMessage(getString(coordinator(), key), err)) | |
129 | + | ||
130 | + | ||
131 | + | func getFrontendAddress () = getAddress(keyFrontendAddress(), "Frontend is not set") | |
132 | + | ||
133 | + | ||
134 | + | func checkAddress (_address) = match addressFromString(_address) { | |
135 | + | case address: Address => | |
136 | + | true | |
137 | + | case _: Unit => | |
138 | + | throw("Invalid address") | |
139 | + | case _ => | |
140 | + | throw("Match error") | |
141 | + | } | |
142 | + | ||
143 | + | ||
144 | + | @Callable(i) | |
145 | + | func setVerifier (_address) = { | |
146 | + | let checks = [mustSelf(i), checkAddress(_address)] | |
147 | + | if ((checks == checks)) | |
148 | + | then if (isDefined(verifier())) | |
149 | + | then throw("Verifier already defined") | |
150 | + | else [StringEntry(keyVerifierAddress(), _address)] | |
151 | + | else throw("Strict value is not equal to itself.") | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | ||
156 | + | @Callable(i) | |
157 | + | func initialize () = { | |
158 | + | let check = [mustSelf(i), mustNotInitialized()] | |
159 | + | if ((check == check)) | |
160 | + | then [StringEntry(keyCoordinatorAddress(), toString(this)), IntegerEntry(keyMaxRateHeightDelta(), MAX_RATE_HEIGHT_DELTA), IntegerEntry(keyMinAmountDelta(), MIN_AMOUNT_DELTA), IntegerEntry(keyLiquidationBonus(), LIQUIDATION_BONUS), IntegerEntry(keyLiquidationProtocolFee(), LIQUIDATION_PROTOCOL_FEE), IntegerEntry(keyStabilityFee(), STABILITY_FEE), IntegerEntry(keyPrecision(), PRECISION), BooleanEntry(keyProtocolActive(), true), BooleanEntry(keyInitialized(), true)] | |
161 | + | else throw("Strict value is not equal to itself.") | |
162 | + | } | |
163 | + | ||
164 | + | ||
165 | + | ||
166 | + | @Callable(i) | |
167 | + | func setMinter (_address) = { | |
168 | + | let check = [mustSelf(i), checkAddress(_address)] | |
169 | + | if ((check == check)) | |
170 | + | then [StringEntry(keyMinterAddress(), _address)] | |
171 | + | else throw("Strict value is not equal to itself.") | |
172 | + | } | |
173 | + | ||
174 | + | ||
175 | + | ||
176 | + | @Callable(i) | |
177 | + | func setFrontend (_address) = { | |
178 | + | let check = [mustSelf(i), checkAddress(_address)] | |
179 | + | if ((check == check)) | |
180 | + | then [StringEntry(keyFrontendAddress(), _address)] | |
181 | + | else throw("Strict value is not equal to itself.") | |
182 | + | } | |
183 | + | ||
184 | + | ||
185 | + | ||
186 | + | @Callable(i) | |
187 | + | func setTreasury (_address) = { | |
188 | + | let check = [mustSelf(i), checkAddress(_address)] | |
189 | + | if ((check == check)) | |
190 | + | then [StringEntry(keyTreasuryAddress(), _address)] | |
191 | + | else throw("Strict value is not equal to itself.") | |
192 | + | } | |
193 | + | ||
194 | + | ||
195 | + | ||
196 | + | @Callable(i) | |
197 | + | func setEastStaking (_address) = { | |
198 | + | let check = [mustSelf(i), checkAddress(_address)] | |
199 | + | if ((check == check)) | |
200 | + | then [StringEntry(keyEastStakingAddress(), _address)] | |
201 | + | else throw("Strict value is not equal to itself.") | |
202 | + | } | |
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | @Callable(i) | |
207 | + | func setOrientMinter (_address) = { | |
208 | + | let check = [mustSelf(i), checkAddress(_address)] | |
209 | + | if ((check == check)) | |
210 | + | then [StringEntry(keyOrientMinterAddress(), _address)] | |
211 | + | else throw("Strict value is not equal to itself.") | |
212 | + | } | |
213 | + | ||
214 | + | ||
215 | + | ||
216 | + | @Callable(i) | |
217 | + | func setOrientWesting (_address) = { | |
218 | + | let check = [mustSelf(i), checkAddress(_address)] | |
219 | + | if ((check == check)) | |
220 | + | then [StringEntry(keyOrientWestingAddress(), _address)] | |
221 | + | else throw("Strict value is not equal to itself.") | |
222 | + | } | |
223 | + | ||
224 | + | ||
225 | + | ||
226 | + | @Callable(i) | |
227 | + | func setOrientBackend (_address) = { | |
228 | + | let check = [mustSelf(i), checkAddress(_address)] | |
229 | + | if ((check == check)) | |
230 | + | then [StringEntry(keyOrientBackendAddress(), _address)] | |
231 | + | else throw("Strict value is not equal to itself.") | |
232 | + | } | |
233 | + | ||
234 | + | ||
235 | + | ||
236 | + | @Callable(i) | |
237 | + | func setOrientStaking (_address) = { | |
238 | + | let check = [mustSelf(i), checkAddress(_address)] | |
239 | + | if ((check == check)) | |
240 | + | then [StringEntry(keyOrientStakingAddress(), _address)] | |
241 | + | else throw("Strict value is not equal to itself.") | |
242 | + | } | |
243 | + | ||
244 | + | ||
245 | + | ||
246 | + | @Callable(i) | |
247 | + | func setExchange (_address) = { | |
248 | + | let check = [mustSelf(i), checkAddress(_address)] | |
249 | + | if ((check == check)) | |
250 | + | then [StringEntry(keyExchangeAddress(), _address)] | |
251 | + | else throw("Strict value is not equal to itself.") | |
252 | + | } | |
253 | + | ||
254 | + | ||
255 | + | ||
256 | + | @Callable(i) | |
257 | + | func setEastAsset (_asset) = { | |
258 | + | let check = [mustSelf(i)] | |
259 | + | if ((check == check)) | |
260 | + | then [StringEntry(keyEastAsset(), _asset)] | |
261 | + | else throw("Strict value is not equal to itself.") | |
262 | + | } | |
263 | + | ||
264 | + | ||
265 | + | ||
266 | + | @Callable(i) | |
267 | + | func setStEastAsset (_asset) = { | |
268 | + | let check = [mustSelf(i)] | |
269 | + | if ((check == check)) | |
270 | + | then [StringEntry(keyStEastAsset(), _asset)] | |
271 | + | else throw("Strict value is not equal to itself.") | |
272 | + | } | |
273 | + | ||
274 | + | ||
275 | + | ||
276 | + | @Callable(i) | |
277 | + | func setOrientAsset (_asset) = { | |
278 | + | let check = [mustSelf(i)] | |
279 | + | if ((check == check)) | |
280 | + | then [StringEntry(keyOrientAsset(), _asset)] | |
281 | + | else throw("Strict value is not equal to itself.") | |
282 | + | } | |
283 | + | ||
284 | + | ||
285 | + | ||
286 | + | @Callable(i) | |
287 | + | func setStabilizer (_stabilizerAddress) = { | |
288 | + | let check = [mustSelf(i), checkAddress(_stabilizerAddress)] | |
289 | + | if ((check == check)) | |
290 | + | then [StringEntry(keyStabilizerAddress(), _stabilizerAddress)] | |
291 | + | else throw("Strict value is not equal to itself.") | |
292 | + | } | |
293 | + | ||
294 | + | ||
295 | + | ||
296 | + | @Callable(i) | |
297 | + | func setMaxRateHeightDelta (_delta) = { | |
298 | + | let check = [mustSelf(i)] | |
299 | + | if ((check == check)) | |
300 | + | then [IntegerEntry(keyMaxRateHeightDelta(), _delta)] | |
301 | + | else throw("Strict value is not equal to itself.") | |
302 | + | } | |
303 | + | ||
304 | + | ||
305 | + | ||
306 | + | @Callable(i) | |
307 | + | func setMinAmountDelta (_delta) = { | |
308 | + | let check = [mustSelf(i)] | |
309 | + | if ((check == check)) | |
310 | + | then [IntegerEntry(keyMinAmountDelta(), _delta)] | |
311 | + | else throw("Strict value is not equal to itself.") | |
312 | + | } | |
313 | + | ||
314 | + | ||
315 | + | ||
316 | + | @Callable(i) | |
317 | + | func setStabilityFee (_fee) = { | |
318 | + | let check = [mustSelf(i)] | |
319 | + | if ((check == check)) | |
320 | + | then { | |
321 | + | let doInvoke = invoke(getFrontendAddress(), "updateFraction", nil, nil) | |
322 | + | if ((doInvoke == doInvoke)) | |
323 | + | then { | |
324 | + | let fee = divp(_fee, 1000) | |
325 | + | [IntegerEntry(keyStabilityFee(), fee)] | |
326 | + | } | |
327 | + | else throw("Strict value is not equal to itself.") | |
328 | + | } | |
329 | + | else throw("Strict value is not equal to itself.") | |
330 | + | } | |
331 | + | ||
332 | + | ||
333 | + | ||
334 | + | @Callable(i) | |
335 | + | func setProtocolActive (_status) = { | |
336 | + | let check = [mustSelf(i)] | |
337 | + | if ((check == check)) | |
338 | + | then [BooleanEntry(keyProtocolActive(), _status)] | |
339 | + | else throw("Strict value is not equal to itself.") | |
340 | + | } | |
341 | + | ||
342 | + | ||
343 | + | ||
344 | + | @Callable(i) | |
345 | + | func setMaxSlippage (_amount) = { | |
346 | + | let check = [mustSelf(i)] | |
347 | + | if ((check == check)) | |
348 | + | then [IntegerEntry(keyMaxSlippage(), _amount)] | |
349 | + | else throw("Strict value is not equal to itself.") | |
350 | + | } | |
351 | + | ||
352 | + | ||
353 | + | ||
354 | + | @Callable(i) | |
355 | + | func setRewardExchanger (_address) = { | |
356 | + | let check = [mustSelf(i), checkAddress(_address)] | |
357 | + | if ((check == check)) | |
358 | + | then [StringEntry(keyRewardExchangerAddress(), _address)] | |
359 | + | else throw("Strict value is not equal to itself.") | |
360 | + | } | |
361 | + | ||
362 | + | ||
363 | + | @Verifier(tx) | |
364 | + | func verify () = match verifier() { | |
365 | + | case address: String => | |
366 | + | valueOrElse(getBoolean(addressFromStringValue(address), keySigned(toString(this), toBase58String(tx.id))), false) | |
367 | + | case _ => | |
368 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
369 | + | } | |
370 | + |
github/deemru/w8io/026f985 29.44 ms ◑