tx · 9H4FHTJb9rRnseDfjoA8y6RsS7LRKHKm2qubDybjeNqZ 3Mv88Kkoay782MydZ5L4bBXTXgt43F7QLhU: -0.05000000 Waves 2023.04.24 19:04 [2548839] smart account 3Mv88Kkoay782MydZ5L4bBXTXgt43F7QLhU > SELF 0.00000000 Waves
{ "type": 13, "id": "9H4FHTJb9rRnseDfjoA8y6RsS7LRKHKm2qubDybjeNqZ", "fee": 5000000, "feeAssetId": null, "timestamp": 1682352269979, "version": 2, "chainId": 84, "sender": "3Mv88Kkoay782MydZ5L4bBXTXgt43F7QLhU", "senderPublicKey": "CZ6vEGWQSQko5PvL3BZn7FaUZyPZ6MU6wKtHwcTmKKd3", "proofs": [ "4DWVVP9ZZzRnZtH5KJ3xHHFQ48riofEpR5E53EsYSpJTKz3sQydtvh5o4e4YnDrcTntsUAADghCyPER1JfEebf9e" ], "script": "base64:BgI0CAISBwoFCAEBCAgSBAoCAQESAwoBCBIDCgEIEgMKAQgSBAoCCAESBQoDCAgBEgASAwoBCHYAA1NFUAICX18ABUVNUFRZAgAACVBSRUNJU0lPTgCAoJSljR0ACERFQ0lNQUxTAIDC1y8AFERFRkFVTFRfTUFYX1NMSVBQQUdFCQBoAgkAaQIFCVBSRUNJU0lPTgAUABMAA0RBWQkAaAIJAGgCADwAPAAYAARZRUFSCQBoAgUDREFZAO0CAA9PUkFDTEVfREVDSU1BTFMAwIQ9AAhJTkZJTklUWQD//////////38AEE1JTl9BTU9VTlRfREVMVEEA6AcAFU1BWF9SQVRFX0hFSUdIVF9ERUxUQQAFABFMSVFVSURBVElPTl9CT05VUwkAaAIJAGkCBQlQUkVDSVNJT04AZAAFABhMSVFVSURBVElPTl9QUk9UT0NPTF9GRUUJAGgCCQBpAgUJUFJFQ0lTSU9OAGQAAgAUTUFYX0xJUVVJREFUSU9OX1BBUlQJAGgCCQBpAgUJUFJFQ0lTSU9OAGQAMgANU1RBQklMSVRZX0ZFRQkAaQIFCVBSRUNJU0lPTgBkAAdFTkFCTEV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s=", "height": 2548839, "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 keyTotalAssetAccepted () = join(["%d", "totalAssetAccepted"]) | |
428 | + | ||
429 | + | ||
430 | + | func keyStakerAddress () = join(["%s", "stakerAddress"]) | |
431 | + | ||
432 | + | ||
433 | + | func getTotalAssetAccepted () = valueOrElse(getInteger(keyTotalAssetAccepted()), 0) | |
434 | + | ||
435 | + | ||
436 | + | func getStakerAddress () = valueOrElse(getString(keyStakerAddress()), EMPTY) | |
437 | + | ||
438 | + | ||
439 | + | func staker () = addressFromStringValue(getStakerAddress()) | |
440 | + | ||
441 | + | ||
442 | + | func isStaked () = (getStakerAddress() != EMPTY) | |
443 | + | ||
444 | + | ||
445 | + | func checkBackingRatios (_br,_lr) = if (if ((0 > _lr)) | |
446 | + | then true | |
447 | + | else (0 > _br)) | |
448 | + | then throw("Backing ratio must be positive") | |
449 | + | else if (((1000 + mulp(LIQUIDATION_BONUS, 1000)) > _lr)) | |
450 | + | then throw("Liquidation ratio must be higher than 105%") | |
451 | + | else if ((_lr >= _br)) | |
452 | + | then throw("Backing ratio must be higher than liquidation ratio") | |
453 | + | else unit | |
454 | + | ||
455 | + | ||
456 | + | func getVaultData (_address) = { | |
457 | + | let asset = getAssetId() | |
458 | + | let frontend = getFrontendAddress() | |
459 | + | let vault = getString(frontend, keyVaultAsset(_address, asset)) | |
460 | + | match vault { | |
461 | + | case _: Unit => | |
462 | + | ["%d%d%d", "0", "0", "0"] | |
463 | + | case s: String => | |
464 | + | split(s, SEP) | |
465 | + | case _ => | |
466 | + | throw("Match error") | |
467 | + | } | |
468 | + | } | |
469 | + | ||
470 | + | ||
471 | + | func updateVault (_address,_amount) = { | |
472 | + | let v = getVaultData(_address) | |
473 | + | let count = (parseIntValue(v[IdxVaultAssetCount]) + 1) | |
474 | + | let newAssetAmount = (parseIntValue(v[IdxVaultAssetAmount]) + _amount) | |
475 | + | if ((0 > newAssetAmount)) | |
476 | + | then throw("Something went wrong. Contact support.") | |
477 | + | else { | |
478 | + | let assetRate = getAssetUsdPrice() | |
479 | + | makeString(["%d%d%d", toString(count), toString(newAssetAmount), toString(assetRate)], SEP) | |
480 | + | } | |
481 | + | } | |
482 | + | ||
483 | + | ||
484 | + | func countEquivalent (_amount) = { | |
485 | + | let backingRatio = getBackingRatio() | |
486 | + | let assetRate = getAssetUsdPrice() | |
487 | + | let assetInUsd = mulp(_amount, assetRate) | |
488 | + | let eastAmount = divp(assetInUsd, backingRatio) | |
489 | + | $Tuple2(eastAmount, assetInUsd) | |
490 | + | } | |
491 | + | ||
492 | + | ||
493 | + | @Callable(i) | |
494 | + | func initialize (_coordinatorAddress,_backingRatio,_liquidationRatio,_assetId,_ticker) = { | |
495 | + | let checks = [mustNotInitialized(), checkAddress(_coordinatorAddress), checkBackingRatios(_backingRatio, _liquidationRatio)] | |
496 | + | if ((checks == checks)) | |
497 | + | then { | |
498 | + | let backingRatio = divp(_backingRatio, 1000) | |
499 | + | let liquidationRatio = divp(_liquidationRatio, 1000) | |
500 | + | [IntegerEntry(keyBackingRatio(), backingRatio), IntegerEntry(keyLiquidationRatio(), liquidationRatio), StringEntry(keyCoordinatorAddress(), _coordinatorAddress), StringEntry(keyTicker(), _ticker), StringEntry(keyContractAssetId(), _assetId), BooleanEntry(keyInitialized(), true)] | |
501 | + | } | |
502 | + | else throw("Strict value is not equal to itself.") | |
503 | + | } | |
504 | + | ||
505 | + | ||
506 | + | ||
507 | + | @Callable(i) | |
508 | + | func setRatios (_backingRatio,_liquidationRatio) = { | |
509 | + | let checks = [mustInitialized(), mustSelf(i), checkBackingRatios(_backingRatio, _liquidationRatio)] | |
510 | + | if ((checks == checks)) | |
511 | + | then { | |
512 | + | let backingRatio = divp(_backingRatio, 1000) | |
513 | + | let liquidationRatio = divp(_liquidationRatio, 1000) | |
514 | + | [IntegerEntry(keyBackingRatio(), backingRatio), IntegerEntry(keyLiquidationRatio(), liquidationRatio)] | |
515 | + | } | |
516 | + | else throw("Strict value is not equal to itself.") | |
517 | + | } | |
518 | + | ||
519 | + | ||
520 | + | ||
521 | + | @Callable(i) | |
522 | + | func setStaker (_address) = { | |
523 | + | let checks = [mustInitialized(), mustSelf(i), checkAddress(_address)] | |
524 | + | if ((checks == checks)) | |
525 | + | then if (isStaked()) | |
526 | + | then throw("Unable to proceed. Staker is already set.") | |
527 | + | else [StringEntry(keyStakerAddress(), _address)] | |
528 | + | else throw("Strict value is not equal to itself.") | |
529 | + | } | |
530 | + | ||
531 | + | ||
532 | + | ||
533 | + | @Callable(i) | |
534 | + | func mint (_address) = { | |
535 | + | let payment = i.payments[0] | |
536 | + | let vaultAsset = getAssetId() | |
537 | + | let check = [mustActive(), mustFrontend(i), mustHaveOnePayment(i), isAsset(payment, vaultAsset)] | |
538 | + | if ((check == check)) | |
539 | + | then { | |
540 | + | let $t01320413257 = countEquivalent(payment.amount) | |
541 | + | let eastEq = $t01320413257._1 | |
542 | + | let usdEq = $t01320413257._2 | |
543 | + | let vault = updateVault(_address, payment.amount) | |
544 | + | let newTotalAssetAccepted = (getTotalAssetAccepted() + payment.amount) | |
545 | + | let doAction = if (isStaked()) | |
546 | + | then invoke(staker(), "stake", nil, [payment]) | |
547 | + | else unit | |
548 | + | if ((doAction == doAction)) | |
549 | + | then $Tuple2([IntegerEntry(keyTotalAssetAccepted(), newTotalAssetAccepted)], $Tuple2(vault, eastEq)) | |
550 | + | else throw("Strict value is not equal to itself.") | |
551 | + | } | |
552 | + | else throw("Strict value is not equal to itself.") | |
553 | + | } | |
554 | + | ||
555 | + | ||
556 | + | ||
557 | + | @Callable(i) | |
558 | + | func supply (_address) = { | |
559 | + | let payment = i.payments[0] | |
560 | + | let vaultAsset = getAssetId() | |
561 | + | let check = [mustActive(), mustFrontend(i), mustHaveOnePayment(i), isAsset(payment, vaultAsset)] | |
562 | + | if ((check == check)) | |
563 | + | then { | |
564 | + | let vault = updateVault(_address, payment.amount) | |
565 | + | let newTotalAssetAccepted = (getTotalAssetAccepted() + payment.amount) | |
566 | + | let doAction = if (isStaked()) | |
567 | + | then invoke(staker(), "stake", nil, [payment]) | |
568 | + | else unit | |
569 | + | if ((doAction == doAction)) | |
570 | + | then $Tuple2([IntegerEntry(keyTotalAssetAccepted(), newTotalAssetAccepted)], vault) | |
571 | + | else throw("Strict value is not equal to itself.") | |
572 | + | } | |
573 | + | else throw("Strict value is not equal to itself.") | |
574 | + | } | |
575 | + | ||
576 | + | ||
577 | + | ||
578 | + | @Callable(i) | |
579 | + | func close (_address,_amount) = { | |
580 | + | let check = [mustActive(), mustFrontend(i), checkAddress(_address), isPositive(_amount)] | |
581 | + | if ((check == check)) | |
582 | + | then { | |
583 | + | let vaultData = getVaultData(_address) | |
584 | + | let assetAmount = parseIntValue(vaultData[IdxVaultAssetAmount]) | |
585 | + | if ((_amount > assetAmount)) | |
586 | + | then throw("Unable to proceed. Not enough asset in vault.") | |
587 | + | else if ((_amount > getTotalAssetAccepted())) | |
588 | + | then throw("Unable to proceed. Not enough asset.") | |
589 | + | else { | |
590 | + | let updatedVault = updateVault(_address, -(_amount)) | |
591 | + | let $t01465614702 = countEquivalent(_amount) | |
592 | + | let eastEq = $t01465614702._1 | |
593 | + | let usdEq = $t01465614702._2 | |
594 | + | let doAction = if (isStaked()) | |
595 | + | then invoke(staker(), "unstake", [_amount], nil) | |
596 | + | else unit | |
597 | + | if ((doAction == doAction)) | |
598 | + | then { | |
599 | + | let assetId = getAssetIdFromString(getAssetId()) | |
600 | + | let address = addressFromStringValue(_address) | |
601 | + | let newTotalAssetAccepted = (getTotalAssetAccepted() - _amount) | |
602 | + | $Tuple2([IntegerEntry(keyTotalAssetAccepted(), newTotalAssetAccepted), ScriptTransfer(address, _amount, assetId)], $Tuple3(updatedVault, eastEq, usdEq)) | |
603 | + | } | |
604 | + | else throw("Strict value is not equal to itself.") | |
605 | + | } | |
606 | + | } | |
607 | + | else throw("Strict value is not equal to itself.") | |
608 | + | } | |
609 | + | ||
610 | + | ||
611 | + | ||
612 | + | @Callable(i) | |
613 | + | func liquidate (_liquidatorAddress,_address,_ratio) = { | |
614 | + | let check = [mustActive(), mustFrontend(i)] | |
615 | + | if ((check == check)) | |
616 | + | then { | |
617 | + | let vaultData = getVaultData(_address) | |
618 | + | let assetAmount = parseIntValue(vaultData[IdxVaultAssetAmount]) | |
619 | + | let assetRequested = mulp(assetAmount, _ratio) | |
620 | + | if ((assetRequested > assetAmount)) | |
621 | + | then throw("Unable to proceed. Not enough asset in vault.") | |
622 | + | else if ((assetRequested > getTotalAssetAccepted())) | |
623 | + | then throw("Unable to proceed. Not enough asset.") | |
624 | + | else { | |
625 | + | let updatedVault = updateVault(_address, -(assetRequested)) | |
626 | + | let $t01573015783 = countEquivalent(assetRequested) | |
627 | + | let eastEq = $t01573015783._1 | |
628 | + | let usdEq = $t01573015783._2 | |
629 | + | let doAction = if (isStaked()) | |
630 | + | then invoke(staker(), "unstake", [assetRequested], nil) | |
631 | + | else unit | |
632 | + | if ((doAction == doAction)) | |
633 | + | then { | |
634 | + | let fee = mulp(assetRequested, getLiquidationProtocolFee()) | |
635 | + | let liquidated = (assetRequested - fee) | |
636 | + | let newTotalAssetAccepted = (getTotalAssetAccepted() - assetRequested) | |
637 | + | let treasuryAddress = getTreasuryAddress() | |
638 | + | let liquidatorAddress = addressFromStringValue(_liquidatorAddress) | |
639 | + | let assetId = getAssetIdFromString(getAssetId()) | |
640 | + | $Tuple2([IntegerEntry(keyTotalAssetAccepted(), newTotalAssetAccepted), ScriptTransfer(liquidatorAddress, liquidated, assetId), ScriptTransfer(treasuryAddress, fee, assetId)], $Tuple2(updatedVault, eastEq)) | |
641 | + | } | |
642 | + | else throw("Strict value is not equal to itself.") | |
643 | + | } | |
644 | + | } | |
645 | + | else throw("Strict value is not equal to itself.") | |
646 | + | } | |
647 | + | ||
648 | + | ||
649 | + | ||
650 | + | @Callable(i) | |
651 | + | func getCurrentUsdPrice () = $Tuple2(nil, getAssetUsdPrice()) | |
652 | + | ||
653 | + | ||
654 | + | ||
655 | + | @Callable(i) | |
656 | + | func getSubvaultInfo (_address) = { | |
657 | + | let subvaultData = getVaultData(_address) | |
658 | + | let assetAmount = parseIntValue(subvaultData[IdxVaultAssetAmount]) | |
659 | + | let rate = getAssetUsdPrice() | |
660 | + | let assetUsdPrice = mulp(assetAmount, rate) | |
661 | + | let backingRatio = getBackingRatio() | |
662 | + | let liquidationRatio = getLiquidationRatio() | |
663 | + | let eastEq = divp(assetUsdPrice, backingRatio) | |
664 | + | let threshold = mulp(assetUsdPrice, liquidationRatio) | |
665 | + | $Tuple2(nil, $Tuple3(assetUsdPrice, eastEq, threshold)) | |
666 | + | } | |
667 | + | ||
668 | + | ||
669 | + | @Verifier(tx) | |
670 | + | func verify () = match verifier() { | |
671 | + | case address: String => | |
672 | + | valueOrElse(getBoolean(addressFromStringValue(address), keySigned(toString(this), toBase58String(tx.id))), false) | |
673 | + | case _ => | |
674 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
675 | + | } | |
676 | + |
github/deemru/w8io/026f985 30.67 ms ◑