tx · EJQVqvWvQiWxAd27h5wSe5jmnjjhJdMD1GbGUZ9xQTeF 3Mu3EJiCghVGuYRs42MZ5Hp72PzYaMkMZ9y: -0.05000000 Waves 2023.04.26 11:48 [2551290] smart account 3Mu3EJiCghVGuYRs42MZ5Hp72PzYaMkMZ9y > SELF 0.00000000 Waves
{ "type": 13, "id": "EJQVqvWvQiWxAd27h5wSe5jmnjjhJdMD1GbGUZ9xQTeF", "fee": 5000000, "feeAssetId": null, "timestamp": 1682498942164, "version": 2, "chainId": 84, "sender": "3Mu3EJiCghVGuYRs42MZ5Hp72PzYaMkMZ9y", "senderPublicKey": "5qWvVQ38AoZSrVNg1iR23EeecerhU2TcRMXMGG4aXmK9", "proofs": [ "2R5UVHnXdJJsUDFhidh6nxZxUz7BkZKwweW3hF2NgkvpMJyfhJLTHzh9oYifMGgAXnFmr3dBBpfv6DJAXN2B3UT1" ], "script": "base64:BgIKCAISBAoCCAgSAG4AA1NFUAICX18ABUVNUFRZAgAACVBSRUNJU0lPTgCAoJSljR0ACERFQ0lNQUxTAIDC1y8AFERFRkFVTFRfTUFYX1NMSVBQQUdFCQBoAgkAaQIFCVBSRUNJU0lPTgAUABMAA0RBWQkAaAIJAGgCADwAPAAYAARZRUFSCQBoAgUDREFZAO0CAA9PUkFDTEVfREVDSU1BTFMAwIQ9AAhJTkZJTklUWQD//////////38AEE1JTl9BTU9VTlRfREVMVEEA6AcAFU1BWF9SQVRFX0hFSUdIVF9ERUxUQQAFABFMSVFVSURBVElPTl9CT05VUwkAaAIJAGkCBQlQUkVDSVNJT04AZAAFABhMSVFVSURBVElPTl9QUk9UT0NPTF9GRUUJAGgCCQBpAgUJUFJFQ0lTSU9OAGQAAgAUTUFYX0xJUVVJREFUSU9OX1BBUlQJAGgCCQBpAgUJUFJFQ0lTSU9OAGQAMgANU1RBQklMSVRZX0ZFRQkAaQIFCVBSRUNJU0lPTgBkAAdFTkFCTEVEAgdFTkFCTEVEAAhESVNBQkxFRAIIRElTQUJMRUQ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CB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAEByRtYXRjaDAJAQh2ZXJpZmllcgADCQABAgUHJG1hdGNoMAIGU3RyaW5nBAdhZGRyZXNzBQckbWF0Y2gwCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFB2FkZHJlc3MJAQlrZXlTaWduZWQCCQClCAEFBHRoaXMJANgEAQgFAnR4AmlkBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleZ0mMIo=", "height": 2551290, "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 EMPTY = "" | |
7 | + | ||
8 | + | let PRECISION = 1000000000000 | |
9 | + | ||
10 | + | let DECIMALS = 100000000 | |
11 | + | ||
12 | + | let DEFAULT_MAX_SLIPPAGE = ((PRECISION / 20) * 19) | |
13 | + | ||
14 | + | let DAY = ((60 * 60) * 24) | |
15 | + | ||
16 | + | let YEAR = (DAY * 365) | |
17 | + | ||
18 | + | let ORACLE_DECIMALS = 1000000 | |
19 | + | ||
20 | + | let INFINITY = 9223372036854775807 | |
21 | + | ||
22 | + | let MIN_AMOUNT_DELTA = 1000 | |
23 | + | ||
24 | + | let MAX_RATE_HEIGHT_DELTA = 5 | |
25 | + | ||
26 | + | let LIQUIDATION_BONUS = ((PRECISION / 100) * 5) | |
27 | + | ||
28 | + | let LIQUIDATION_PROTOCOL_FEE = ((PRECISION / 100) * 2) | |
29 | + | ||
30 | + | let MAX_LIQUIDATION_PART = ((PRECISION / 100) * 50) | |
31 | + | ||
32 | + | let STABILITY_FEE = (PRECISION / 100) | |
33 | + | ||
34 | + | let ENABLED = "ENABLED" | |
35 | + | ||
36 | + | let DISABLED = "DISABLED" | |
37 | + | ||
38 | + | let IdxVaultAssetCount = 1 | |
39 | + | ||
40 | + | let IdxVaultAssetAmount = 2 | |
41 | + | ||
42 | + | let IdxVaultAssetRate = 3 | |
43 | + | ||
44 | + | let IdxVaultCount = 1 | |
45 | + | ||
46 | + | let IdxVaultEastAmount = 2 | |
47 | + | ||
48 | + | let IdxVaultTimestamp = 3 | |
49 | + | ||
50 | + | let IdxStabilityFee = 4 | |
51 | + | ||
52 | + | let IdxLastFraction = 5 | |
53 | + | ||
54 | + | let invocationError = "Invocation error" | |
55 | + | ||
56 | + | func divd (_x,_y) = fraction(_x, DECIMALS, _y, HALFEVEN) | |
57 | + | ||
58 | + | ||
59 | + | func muld (_x,_y) = fraction(_x, _y, DECIMALS, HALFEVEN) | |
60 | + | ||
61 | + | ||
62 | + | func divp (_x,_y) = fraction(_x, PRECISION, _y, HALFEVEN) | |
63 | + | ||
64 | + | ||
65 | + | func mulp (_x,_y) = fraction(_x, _y, PRECISION, HALFEVEN) | |
66 | + | ||
67 | + | ||
68 | + | func join (ar) = makeString(ar, SEP) | |
69 | + | ||
70 | + | ||
71 | + | func keyInitialized () = join(["%s", "initialized"]) | |
72 | + | ||
73 | + | ||
74 | + | func keyCoordinatorAddress () = join(["%s", "coordinatorAddress"]) | |
75 | + | ||
76 | + | ||
77 | + | func keyVerifierAddress () = join(["%s", "verifierAddress"]) | |
78 | + | ||
79 | + | ||
80 | + | func keyServiceAddress () = join(["%s", "serviceAddress"]) | |
81 | + | ||
82 | + | ||
83 | + | func keyFrontendAddress () = join(["%s", "frontendAddress"]) | |
84 | + | ||
85 | + | ||
86 | + | func keyMinterAddress () = join(["%s", "minterAddress"]) | |
87 | + | ||
88 | + | ||
89 | + | func keyTreasuryAddress () = join(["%s", "treasuryAddress"]) | |
90 | + | ||
91 | + | ||
92 | + | func keyBackendAddress () = join(["%s", "backendAddress"]) | |
93 | + | ||
94 | + | ||
95 | + | func keyEastStakingAddress () = join(["%s", "eastStakingAddress"]) | |
96 | + | ||
97 | + | ||
98 | + | func keyOracleAddress () = join(["%s", "oracleAddress"]) | |
99 | + | ||
100 | + | ||
101 | + | func keyExchangeAddress () = join(["%s", "exchangeAddress"]) | |
102 | + | ||
103 | + | ||
104 | + | func keyEastAsset () = join(["%s", "eastAsset"]) | |
105 | + | ||
106 | + | ||
107 | + | func keyStEastAsset () = join(["%s", "stEastAsset"]) | |
108 | + | ||
109 | + | ||
110 | + | func keyAAssetBalance () = "A_asset_balance" | |
111 | + | ||
112 | + | ||
113 | + | func keyBAssetBalance () = "B_asset_balance" | |
114 | + | ||
115 | + | ||
116 | + | func keyVaultAsset (address,asset) = join(["%s%s%s", "vault", address, asset]) | |
117 | + | ||
118 | + | ||
119 | + | func keyVaultData (address) = join(["%s%s", "vault", address]) | |
120 | + | ||
121 | + | ||
122 | + | func keyPrecision () = join(["%s", "precision"]) | |
123 | + | ||
124 | + | ||
125 | + | func keyBackingRatio () = join(["%s", "backingRatio"]) | |
126 | + | ||
127 | + | ||
128 | + | func keyLiquidationRatio () = join(["%s", "liquidationRatio"]) | |
129 | + | ||
130 | + | ||
131 | + | func keyLiquidationBonus () = join(["%s", "liquidationBonus"]) | |
132 | + | ||
133 | + | ||
134 | + | func keyLiquidationProtocolFee () = join(["%s", "liquidationProtocolFee"]) | |
135 | + | ||
136 | + | ||
137 | + | func keyStabilityFee () = join(["%s", "stabilityFee"]) | |
138 | + | ||
139 | + | ||
140 | + | func keyMinAmountDelta () = join(["%s", "minAmountDelta"]) | |
141 | + | ||
142 | + | ||
143 | + | func keyTicker () = join(["%s", "ticker"]) | |
144 | + | ||
145 | + | ||
146 | + | func keyMaxRateHeightDelta () = join(["%s", "maxRateHeightDelta"]) | |
147 | + | ||
148 | + | ||
149 | + | func keyContractAssetId () = join(["%s", "contractAssetId"]) | |
150 | + | ||
151 | + | ||
152 | + | func keyOracleTickerPrice (ticker) = join(["%s%s", "price", ticker]) | |
153 | + | ||
154 | + | ||
155 | + | func keyOracleTickerPriceHeight (ticker) = join(["%s%s", "lastHeight", ticker]) | |
156 | + | ||
157 | + | ||
158 | + | func keySigned (_address,_txId) = join(["%s%s%s", "signed", _address, _txId]) | |
159 | + | ||
160 | + | ||
161 | + | func keyProtocolActive () = join(["%s", "protocolActive"]) | |
162 | + | ||
163 | + | ||
164 | + | func isInitialized () = valueOrElse(getBoolean(this, keyInitialized()), false) | |
165 | + | ||
166 | + | ||
167 | + | func mustInitialized () = if (!(isInitialized())) | |
168 | + | then throw("Not initialized") | |
169 | + | else unit | |
170 | + | ||
171 | + | ||
172 | + | func mustNotInitialized () = if (isInitialized()) | |
173 | + | then throw("Already initialized") | |
174 | + | else unit | |
175 | + | ||
176 | + | ||
177 | + | func mustSelf (i) = if ((i.caller != this)) | |
178 | + | then throw("Only self invocation allowed.") | |
179 | + | else unit | |
180 | + | ||
181 | + | ||
182 | + | func coordinator () = addressFromStringValue(valueOrErrorMessage(getString(keyCoordinatorAddress()), "Coordinator is not set")) | |
183 | + | ||
184 | + | ||
185 | + | func verifier () = match getString(keyCoordinatorAddress()) { | |
186 | + | case s: String => | |
187 | + | getString(addressFromStringValue(s), keyVerifierAddress()) | |
188 | + | case _: Unit => | |
189 | + | unit | |
190 | + | case _ => | |
191 | + | throw("Match error") | |
192 | + | } | |
193 | + | ||
194 | + | ||
195 | + | func getAddress (key,err) = addressFromStringValue(valueOrErrorMessage(getString(coordinator(), key), err)) | |
196 | + | ||
197 | + | ||
198 | + | func getMinterAddress () = getAddress(keyMinterAddress(), "Minter is not set") | |
199 | + | ||
200 | + | ||
201 | + | func getFrontendAddress () = getAddress(keyFrontendAddress(), "Frontend is not set") | |
202 | + | ||
203 | + | ||
204 | + | func getTreasuryAddress () = getAddress(keyTreasuryAddress(), "Treasury is not set") | |
205 | + | ||
206 | + | ||
207 | + | func getBackendAddress () = getAddress(keyBackendAddress(), "Backend is not set") | |
208 | + | ||
209 | + | ||
210 | + | func getOracleAddress () = getAddress(keyOracleAddress(), "Oracle is not set") | |
211 | + | ||
212 | + | ||
213 | + | func getEastStakingAddress () = getAddress(keyEastStakingAddress(), "East staking is not set") | |
214 | + | ||
215 | + | ||
216 | + | func isNotTreasury (i) = (i.caller != getTreasuryAddress()) | |
217 | + | ||
218 | + | ||
219 | + | func getMinAmountDelta () = valueOrElse(getInteger(coordinator(), keyMinAmountDelta()), MIN_AMOUNT_DELTA) | |
220 | + | ||
221 | + | ||
222 | + | func getMaxRateHeightDelta () = valueOrElse(getInteger(coordinator(), keyMaxRateHeightDelta()), MAX_RATE_HEIGHT_DELTA) | |
223 | + | ||
224 | + | ||
225 | + | func getLiquidationBonus () = valueOrElse(getInteger(coordinator(), keyLiquidationBonus()), LIQUIDATION_BONUS) | |
226 | + | ||
227 | + | ||
228 | + | func getLiquidationProtocolFee () = valueOrElse(getInteger(coordinator(), keyLiquidationProtocolFee()), LIQUIDATION_PROTOCOL_FEE) | |
229 | + | ||
230 | + | ||
231 | + | func getStabilityFee () = valueOrElse(getInteger(coordinator(), keyStabilityFee()), STABILITY_FEE) | |
232 | + | ||
233 | + | ||
234 | + | func getAssetId () = getStringValue(keyContractAssetId()) | |
235 | + | ||
236 | + | ||
237 | + | func getEastAssetStr () = valueOrErrorMessage(getString(coordinator(), keyEastAsset()), "East asset is not set") | |
238 | + | ||
239 | + | ||
240 | + | func getEastAsset () = fromBase58String(getEastAssetStr()) | |
241 | + | ||
242 | + | ||
243 | + | func isActive () = valueOrElse(getBoolean(coordinator(), keyProtocolActive()), false) | |
244 | + | ||
245 | + | ||
246 | + | func mustActive () = if (if (!(isActive())) | |
247 | + | then true | |
248 | + | else !(isInitialized())) | |
249 | + | then throw("Protocol is disabled. Please contact support.") | |
250 | + | else unit | |
251 | + | ||
252 | + | ||
253 | + | func mustFrontend (i) = if ((i.caller != getFrontendAddress())) | |
254 | + | then throw("Not allowed") | |
255 | + | else unit | |
256 | + | ||
257 | + | ||
258 | + | func mustBackend (i) = if ((i.caller != getBackendAddress())) | |
259 | + | then throw("Not allowed") | |
260 | + | else unit | |
261 | + | ||
262 | + | ||
263 | + | func mustNotVaultOwner (i,address) = if ((toBase58String(i.caller.bytes) == address)) | |
264 | + | then throw("Self invocation not allowed.") | |
265 | + | else unit | |
266 | + | ||
267 | + | ||
268 | + | func mustHaveOnePayment (i) = if ((size(i.payments) != 1)) | |
269 | + | then throw("Only one payment allowed.") | |
270 | + | else unit | |
271 | + | ||
272 | + | ||
273 | + | func mustHaveNoPayment (i) = if ((size(i.payments) != 0)) | |
274 | + | then throw("No payment allowed.") | |
275 | + | else unit | |
276 | + | ||
277 | + | ||
278 | + | func hasOnePayment (i) = (size(i.payments) == 1) | |
279 | + | ||
280 | + | ||
281 | + | func isPositive (number) = if ((0 >= number)) | |
282 | + | then throw("Attribute should be positive or zero.") | |
283 | + | else unit | |
284 | + | ||
285 | + | ||
286 | + | func isNotNegative (number) = if ((0 > number)) | |
287 | + | then throw("Attribute should be positive.") | |
288 | + | else unit | |
289 | + | ||
290 | + | ||
291 | + | func getSubvault (address,asset) = getString(keyVaultAsset(address, asset)) | |
292 | + | ||
293 | + | ||
294 | + | func isSubvaultExists (address,asset) = valueOrErrorMessage(getSubvault(address, asset), "Vault not exists") | |
295 | + | ||
296 | + | ||
297 | + | func getAssetString (p) = match p.assetId { | |
298 | + | case assetId: ByteVector => | |
299 | + | toBase58String(assetId) | |
300 | + | case _: Unit => | |
301 | + | "WAVES" | |
302 | + | case _ => | |
303 | + | throw("Match error") | |
304 | + | } | |
305 | + | ||
306 | + | ||
307 | + | func getAssetIdFromString (assetId) = if ((assetId == "WAVES")) | |
308 | + | then unit | |
309 | + | else fromBase58String(assetId) | |
310 | + | ||
311 | + | ||
312 | + | func isAsset (p,checkingAsset) = { | |
313 | + | let assetId = match checkingAsset { | |
314 | + | case bv: ByteVector => | |
315 | + | bv | |
316 | + | case s: String => | |
317 | + | getAssetIdFromString(s) | |
318 | + | case _: Unit => | |
319 | + | unit | |
320 | + | case _ => | |
321 | + | throw("Match error") | |
322 | + | } | |
323 | + | match assetId { | |
324 | + | case bv: ByteVector => | |
325 | + | let name = match assetInfo(bv) { | |
326 | + | case asset: Asset => | |
327 | + | asset.name | |
328 | + | case _: Unit => | |
329 | + | throw(("Can't find asset " + toBase58String(bv))) | |
330 | + | case _ => | |
331 | + | throw("Match error") | |
332 | + | } | |
333 | + | let err = throw(("Attached payment asset is not " + name)) | |
334 | + | match p.assetId { | |
335 | + | case paymentAsset: ByteVector => | |
336 | + | if ((paymentAsset != assetId)) | |
337 | + | then err | |
338 | + | else unit | |
339 | + | case _: Unit => | |
340 | + | err | |
341 | + | case _ => | |
342 | + | throw("Match error") | |
343 | + | } | |
344 | + | case _: Unit => | |
345 | + | if ((p.assetId != unit)) | |
346 | + | then throw("Attached payment asset is not WAVES") | |
347 | + | else unit | |
348 | + | case _ => | |
349 | + | throw("Match error") | |
350 | + | } | |
351 | + | } | |
352 | + | ||
353 | + | ||
354 | + | func getBackingRatio () = valueOrErrorMessage(getInteger(keyBackingRatio()), "Backing ratio is not set") | |
355 | + | ||
356 | + | ||
357 | + | func getLiquidationRatio () = valueOrErrorMessage(getInteger(keyLiquidationRatio()), "Liquidation ratio is not set") | |
358 | + | ||
359 | + | ||
360 | + | func checkAddress (_address) = match addressFromString(_address) { | |
361 | + | case address: Address => | |
362 | + | true | |
363 | + | case _: Unit => | |
364 | + | throw("Invalid address") | |
365 | + | case _ => | |
366 | + | throw("Match error") | |
367 | + | } | |
368 | + | ||
369 | + | ||
370 | + | func checkTxId (_id) = (size(fromBase58String(_id)) == 32) | |
371 | + | ||
372 | + | ||
373 | + | func getCurrentTimestampSec () = (lastBlock.timestamp / 1000) | |
374 | + | ||
375 | + | ||
376 | + | func mustWavesPayment (i) = { | |
377 | + | let check = mustHaveOnePayment(i) | |
378 | + | if ((check == check)) | |
379 | + | then { | |
380 | + | let pmtAssetId = i.payments[0].assetId | |
381 | + | match pmtAssetId { | |
382 | + | case a: Unit => | |
383 | + | unit | |
384 | + | case _ => | |
385 | + | throw("Only WAVES accepted") | |
386 | + | } | |
387 | + | } | |
388 | + | else throw("Strict value is not equal to itself.") | |
389 | + | } | |
390 | + | ||
391 | + | ||
392 | + | func getAssetInfo (assetId) = match assetId { | |
393 | + | case id: ByteVector => | |
394 | + | let stringId = toBase58String(id) | |
395 | + | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
396 | + | $Tuple3(stringId, info.name, info.decimals) | |
397 | + | case waves: Unit => | |
398 | + | $Tuple3("WAVES", "WAVES", 8) | |
399 | + | case _ => | |
400 | + | throw("Match error") | |
401 | + | } | |
402 | + | ||
403 | + | ||
404 | + | func checkHeightDelta (priceHeight) = { | |
405 | + | let maxHeightDelta = getMaxRateHeightDelta() | |
406 | + | let currentDiff = (lastBlock.height - priceHeight) | |
407 | + | if ((maxHeightDelta >= currentDiff)) | |
408 | + | then unit | |
409 | + | else throw("Large price delta.") | |
410 | + | } | |
411 | + | ||
412 | + | ||
413 | + | func getAssetUsdPrice () = { | |
414 | + | let ticker = getStringValue(this, keyTicker()) | |
415 | + | let oracleAddress = getOracleAddress() | |
416 | + | let priceHeight = getIntegerValue(oracleAddress, keyOracleTickerPriceHeight(ticker)) | |
417 | + | let checkHeight = checkHeightDelta(priceHeight) | |
418 | + | if ((checkHeight == checkHeight)) | |
419 | + | then { | |
420 | + | let price = getIntegerValue(oracleAddress, keyOracleTickerPrice(ticker)) | |
421 | + | fraction(price, PRECISION, ORACLE_DECIMALS) | |
422 | + | } | |
423 | + | else throw("Strict value is not equal to itself.") | |
424 | + | } | |
425 | + | ||
426 | + | ||
427 | + | func keyOldEastAsset () = join(["%s", "oldEastAsset"]) | |
428 | + | ||
429 | + | ||
430 | + | func getOldEastAsset () = fromBase58String(getStringValue(keyOldEastAsset())) | |
431 | + | ||
432 | + | ||
433 | + | @Callable(i) | |
434 | + | func initialize (_coordinatorAddress,_oldEastAsset) = { | |
435 | + | let checks = [mustNotInitialized(), checkAddress(_coordinatorAddress)] | |
436 | + | if ((checks == checks)) | |
437 | + | then [StringEntry(keyCoordinatorAddress(), _coordinatorAddress), StringEntry(keyOldEastAsset(), _oldEastAsset), BooleanEntry(keyInitialized(), true)] | |
438 | + | else throw("Strict value is not equal to itself.") | |
439 | + | } | |
440 | + | ||
441 | + | ||
442 | + | ||
443 | + | @Callable(i) | |
444 | + | func exchange () = { | |
445 | + | let eastAsset = getEastAsset() | |
446 | + | let oldEastAsset = getOldEastAsset() | |
447 | + | let payment = i.payments[0] | |
448 | + | let checks = [mustActive(), mustHaveOnePayment(i), isAsset(payment, oldEastAsset)] | |
449 | + | if ((checks == checks)) | |
450 | + | then { | |
451 | + | let amount = payment.amount | |
452 | + | let minter = getMinterAddress() | |
453 | + | let doIssueEast = invoke(minter, "issue", [amount], nil) | |
454 | + | if ((doIssueEast == doIssueEast)) | |
455 | + | then [Burn(oldEastAsset, amount), ScriptTransfer(i.caller, amount, eastAsset)] | |
456 | + | else throw("Strict value is not equal to itself.") | |
457 | + | } | |
458 | + | else throw("Strict value is not equal to itself.") | |
459 | + | } | |
460 | + | ||
461 | + | ||
462 | + | @Verifier(tx) | |
463 | + | func verify () = match verifier() { | |
464 | + | case address: String => | |
465 | + | valueOrElse(getBoolean(addressFromStringValue(address), keySigned(toString(this), toBase58String(tx.id))), false) | |
466 | + | case _ => | |
467 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
468 | + | } | |
469 | + |
github/deemru/w8io/026f985 32.59 ms ◑