tx · DVJhJY9qMtNso9cXVeqB65Ye9gnoQRTzYC8mSvWXszX4

3Mz5ATw6LwUDu33kbwLF8o5JyCff3L4wRTo:  -0.05000000 Waves

2023.07.12 15:24 [2662676] smart account 3Mz5ATw6LwUDu33kbwLF8o5JyCff3L4wRTo > SELF 0.00000000 Waves

{ "type": 13, "id": "DVJhJY9qMtNso9cXVeqB65Ye9gnoQRTzYC8mSvWXszX4", "fee": 5000000, "feeAssetId": null, "timestamp": 1689164703230, "version": 2, "chainId": 84, "sender": "3Mz5ATw6LwUDu33kbwLF8o5JyCff3L4wRTo", "senderPublicKey": "GgkzmDh7PX2TVPKJ2Yeb9CKkdXb1ba9X22gZnuKFvxnq", "proofs": [ "5rgCjYwJJdr9MtMjwCdfQn6eR5GhBpGSCkgDMnxXpaSffC57sYBrmNonhG7qzDZ9U2vFWeA4BRnreCFwc8XgfnkU" ], "script": "base64:BgLdDwgCEggKBggIAQEICBIECgIBARIDCgEIEgMKAQESAwoBCBIDCgEIEgMKAQgSBAoCCAESBQoDCAgBEgASAwoBCCIDU0VQIgVFTVBUWSIJUFJFQ0lTSU9OIhVNQVhfUkFURV9IRUlHSFRfREVMVEEiD09SQUNMRV9ERUNJTUFMUyIRTElRVUlEQVRJT05fQk9OVVMiGExJUVVJREFUSU9OX1BST1RPQ09MX0ZFRSISSWR4VmF1bHRBc3NldENvdW50IhNJZHhWYXVsdEFzc2V0QW1vdW50IhFJZHhWYXVsdEFzc2V0UmF0ZSIEZGl2cCICX3giAl95IgRtdWxwIgRqb2luIgJhciIOa2V5SW5pdGlhbGl6ZWQiFWtleUNvb3JkaW5hdG9yQWRkcmVzcyISa2V5VmVyaWZpZXJBZGRyZXNzIhJrZXlGcm9udGVuZEFkZHJlc3MiEmtleVRyZWFzdXJ5QWRkcmVzcyIQa2V5T3JhY2xlQWRkcmVzcyINa2V5VmF1bHRBc3NldCIHYWRkcmVzcyIFYXNzZXQiD2tleUJhY2tpbmdSYXRpbyITa2V5TGlxdWlkYXR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MCWJvZHlCeXRlcwkAkQMCCAUCYkwGcHJvb2ZzAAAIBQJiTA9zZW5kZXJQdWJsaWNLZXno9RIx", "height": 2662676, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
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 MAX_RATE_HEIGHT_DELTA = 5
11+
12+let ORACLE_DECIMALS = 1000000
13+
14+let LIQUIDATION_BONUS = ((PRECISION / 100) * 5)
15+
16+let LIQUIDATION_PROTOCOL_FEE = ((PRECISION / 100) * 2)
17+
18+let IdxVaultAssetCount = 1
19+
20+let IdxVaultAssetAmount = 2
21+
22+let IdxVaultAssetRate = 3
23+
24+func divp (_x,_y) = fraction(_x, PRECISION, _y, HALFEVEN)
25+
26+
27+func mulp (_x,_y) = fraction(_x, _y, PRECISION, HALFEVEN)
28+
29+
30+func join (ar) = makeString(ar, SEP)
31+
32+
33+func keyInitialized () = join(["%s", "initialized"])
34+
35+
36+func keyCoordinatorAddress () = join(["%s", "coordinatorAddress"])
37+
38+
39+func keyVerifierAddress () = join(["%s", "verifierAddress"])
40+
41+
42+func keyFrontendAddress () = join(["%s", "frontendAddress"])
43+
44+
45+func keyTreasuryAddress () = join(["%s", "treasuryAddress"])
46+
47+
48+func keyOracleAddress () = join(["%s", "oracleAddress"])
49+
50+
51+func keyVaultAsset (address,asset) = join(["%s%s%s", "vault", address, asset])
52+
53+
54+func keyBackingRatio () = join(["%s", "backingRatio"])
55+
56+
57+func keyLiquidationRatio () = join(["%s", "liquidationRatio"])
58+
59+
60+func keyLiquidationProtocolFee () = join(["%s", "liquidationProtocolFee"])
61+
62+
63+func keyTicker () = join(["%s", "ticker"])
64+
65+
66+func keyMaxRateHeightDelta () = join(["%s", "maxRateHeightDelta"])
67+
68+
69+func keyContractAssetId () = join(["%s", "contractAssetId"])
70+
71+
72+func keyOracleTickerPrice (ticker) = join(["%s%s", "price", ticker])
73+
74+
75+func keyOracleTickerPriceHeight (ticker) = join(["%s%s", "lastHeight", ticker])
76+
77+
78+func keySigned (_address,_txId) = join(["%s%s%s", "signed", _address, _txId])
79+
80+
81+func keyProtocolActive () = join(["%s", "protocolActive"])
82+
83+
84+func isInitialized () = valueOrElse(getBoolean(this, keyInitialized()), false)
85+
86+
87+func mustInitialized () = if (!(isInitialized()))
88+ then throw("Not initialized")
89+ else unit
90+
91+
92+func mustNotInitialized () = if (isInitialized())
93+ then throw("Already initialized")
94+ else unit
95+
96+
97+func mustSelf (i) = if ((i.caller != this))
98+ then throw("Only self invocation allowed.")
99+ else unit
100+
101+
102+func coordinator () = addressFromStringValue(valueOrErrorMessage(getString(keyCoordinatorAddress()), "Coordinator is not set"))
103+
104+
105+func oracle () = addressFromStringValue(valueOrErrorMessage(getString(keyOracleAddress()), "Oracle is not set"))
106+
107+
108+func verifier () = match getString(keyCoordinatorAddress()) {
109+ case s: String =>
110+ getString(addressFromStringValue(s), keyVerifierAddress())
111+ case _: Unit =>
112+ unit
113+ case _ =>
114+ throw("Match error")
115+}
116+
117+
118+func getAddress (key,err) = addressFromStringValue(valueOrErrorMessage(getString(coordinator(), key), err))
119+
120+
121+func getFrontendAddress () = getAddress(keyFrontendAddress(), "Frontend is not set")
122+
123+
124+func getTreasuryAddress () = getAddress(keyTreasuryAddress(), "Treasury is not set")
125+
126+
127+func getMaxRateHeightDelta () = valueOrElse(getInteger(coordinator(), keyMaxRateHeightDelta()), MAX_RATE_HEIGHT_DELTA)
128+
129+
130+func getLiquidationProtocolFee () = valueOrElse(getInteger(coordinator(), keyLiquidationProtocolFee()), LIQUIDATION_PROTOCOL_FEE)
131+
132+
133+func getAssetId () = getStringValue(keyContractAssetId())
134+
135+
136+func isActive () = valueOrElse(getBoolean(coordinator(), keyProtocolActive()), false)
137+
138+
139+func mustActive () = if (if (!(isActive()))
140+ then true
141+ else !(isInitialized()))
142+ then throw("Protocol is disabled. Please contact support.")
143+ else unit
144+
145+
146+func mustFrontend (i) = if ((i.caller != getFrontendAddress()))
147+ then throw("Not allowed")
148+ else unit
149+
150+
151+func mustHaveOnePayment (i) = if ((size(i.payments) != 1))
152+ then throw("Must have one payment.")
153+ else unit
154+
155+
156+func isPositive (number) = if ((0 >= number))
157+ then throw("Attribute should be positive.")
158+ else unit
159+
160+
161+func isNotNegative (number) = if ((0 > number))
162+ then throw("Attribute should be positive or zero.")
163+ else unit
164+
165+
166+func getAssetIdFromString (assetId) = if ((assetId == "WAVES"))
167+ then unit
168+ else fromBase58String(assetId)
169+
170+
171+func isAsset (p,checkingAsset) = {
172+ let assetId = match checkingAsset {
173+ case bv: ByteVector =>
174+ bv
175+ case s: String =>
176+ getAssetIdFromString(s)
177+ case _: Unit =>
178+ unit
179+ case _ =>
180+ throw("Match error")
181+ }
182+ match assetId {
183+ case bv: ByteVector =>
184+ let name = match assetInfo(bv) {
185+ case asset: Asset =>
186+ asset.name
187+ case _: Unit =>
188+ throw(("Can't find asset " + toBase58String(bv)))
189+ case _ =>
190+ throw("Match error")
191+ }
192+ let err = throw(("Attached payment asset is not " + name))
193+ match p.assetId {
194+ case paymentAsset: ByteVector =>
195+ if ((paymentAsset != assetId))
196+ then err
197+ else unit
198+ case _: Unit =>
199+ err
200+ case _ =>
201+ throw("Match error")
202+ }
203+ case _: Unit =>
204+ if ((p.assetId != unit))
205+ then throw("Attached payment asset is not WAVES")
206+ else unit
207+ case _ =>
208+ throw("Match error")
209+ }
210+ }
211+
212+
213+func getBackingRatio () = valueOrErrorMessage(getInteger(keyBackingRatio()), "Backing ratio is not set")
214+
215+
216+func getLiquidationRatio () = valueOrErrorMessage(getInteger(keyLiquidationRatio()), "Liquidation ratio is not set")
217+
218+
219+func checkAddress (_address) = match addressFromString(_address) {
220+ case address: Address =>
221+ true
222+ case _: Unit =>
223+ throw("Invalid address")
224+ case _ =>
225+ throw("Match error")
226+}
227+
228+
229+func keyTotalAssetAccepted () = join(["%s", "totalAssetAccepted"])
230+
231+
232+func keyTotalEastMinted () = join(["%s", "totalEastMinted"])
233+
234+
235+func keyEastMintedLimit () = join(["%s", "eastMintedLimit"])
236+
237+
238+func keyStakerAddress () = join(["%s", "stakerAddress"])
239+
240+
241+func getTotalAssetAccepted () = valueOrElse(getInteger(keyTotalAssetAccepted()), 0)
242+
243+
244+func getTotalEastMinted () = valueOrElse(getInteger(keyTotalEastMinted()), 0)
245+
246+
247+func getEastMintedLimit () = valueOrElse(getInteger(keyEastMintedLimit()), 0)
248+
249+
250+func getStakerAddress () = valueOrElse(getString(keyStakerAddress()), EMPTY)
251+
252+
253+func staker () = addressFromStringValue(getStakerAddress())
254+
255+
256+func isStaked () = (getStakerAddress() != EMPTY)
257+
258+
259+func checkBackingRatios (_br,_lr) = if (if ((0 > _lr))
260+ then true
261+ else (0 > _br))
262+ then throw("Backing ratio must be positive")
263+ else if (((PRECISION + LIQUIDATION_BONUS) > _lr))
264+ then throw("Liquidation ratio must be higher than 105%")
265+ else if ((_lr >= _br))
266+ then throw("Backing ratio must be higher than liquidation ratio")
267+ else unit
268+
269+
270+func getVaultData (_address) = {
271+ let asset = getAssetId()
272+ let frontend = getFrontendAddress()
273+ let vault = getString(frontend, keyVaultAsset(_address, asset))
274+ let v = match vault {
275+ case _: Unit =>
276+["%d%d%d", "0", "0", "0"]
277+ case s: String =>
278+ split(s, SEP)
279+ case _ =>
280+ throw("Match error")
281+ }
282+ let count = parseIntValue(v[IdxVaultAssetCount])
283+ let assetAmount = parseIntValue(v[IdxVaultAssetAmount])
284+ let rate = parseIntValue(v[IdxVaultAssetRate])
285+ $Tuple3(assetAmount, count, rate)
286+ }
287+
288+
289+func checkHeightDelta (priceHeight) = {
290+ let maxHeightDelta = getMaxRateHeightDelta()
291+ let currentDiff = (lastBlock.height - priceHeight)
292+ if ((maxHeightDelta >= currentDiff))
293+ then unit
294+ else throw("Large price delta.")
295+ }
296+
297+
298+func getAssetUsdPrice () = {
299+ let ticker = getStringValue(keyTicker())
300+ let priceHeight = getIntegerValue(oracle(), keyOracleTickerPriceHeight(ticker))
301+ let checkHeight = checkHeightDelta(priceHeight)
302+ if ((checkHeight == checkHeight))
303+ then {
304+ let price = getIntegerValue(oracle(), keyOracleTickerPrice(ticker))
305+ fraction(price, PRECISION, ORACLE_DECIMALS)
306+ }
307+ else throw("Strict value is not equal to itself.")
308+ }
309+
310+
311+func updateVault (_address,_amount) = {
312+ let $t01309913148 = getVaultData(_address)
313+ let assetAmount = $t01309913148._1
314+ let count = $t01309913148._2
315+ let newCount = (count + 1)
316+ let newAssetAmount = (assetAmount + _amount)
317+ if ((0 > newAssetAmount))
318+ then throw("Something went wrong. Contact support.")
319+ else {
320+ let assetRate = getAssetUsdPrice()
321+ makeString(["%d%d%d", toString(newCount), toString(newAssetAmount), toString(assetRate)], SEP)
322+ }
323+ }
324+
325+
326+func countEquivalent (_amount) = {
327+ let backingRatio = getBackingRatio()
328+ let assetRate = getAssetUsdPrice()
329+ let usdEq = mulp(_amount, assetRate)
330+ let eastEq = divp(usdEq, backingRatio)
331+ $Tuple2(usdEq, eastEq)
332+ }
333+
334+
335+@Callable(i)
336+func initialize (_coordinatorAddress,_oracleAddress,_backingRatio,_liquidationRatio,_assetId,_ticker) = {
337+ let checks = [mustSelf(i), mustNotInitialized(), checkAddress(_coordinatorAddress), checkAddress(_oracleAddress), checkBackingRatios(_backingRatio, _liquidationRatio)]
338+ if ((checks == checks))
339+ then [IntegerEntry(keyBackingRatio(), _backingRatio), IntegerEntry(keyLiquidationRatio(), _liquidationRatio), StringEntry(keyCoordinatorAddress(), _coordinatorAddress), StringEntry(keyOracleAddress(), _oracleAddress), StringEntry(keyTicker(), _ticker), StringEntry(keyContractAssetId(), _assetId), BooleanEntry(keyInitialized(), true)]
340+ else throw("Strict value is not equal to itself.")
341+ }
342+
343+
344+
345+@Callable(i)
346+func setRatios (_backingRatio,_liquidationRatio) = {
347+ let checks = [mustInitialized(), mustSelf(i), checkBackingRatios(_backingRatio, _liquidationRatio)]
348+ if ((checks == checks))
349+ then [IntegerEntry(keyBackingRatio(), _backingRatio), IntegerEntry(keyLiquidationRatio(), _liquidationRatio)]
350+ else throw("Strict value is not equal to itself.")
351+ }
352+
353+
354+
355+@Callable(i)
356+func setOracle (_address) = {
357+ let check = [mustSelf(i), checkAddress(_address)]
358+ if ((check == check))
359+ then [StringEntry(keyOracleAddress(), _address)]
360+ else throw("Strict value is not equal to itself.")
361+ }
362+
363+
364+
365+@Callable(i)
366+func setEastMintedLimit (_eastMintedLimit) = {
367+ let checks = [mustInitialized(), mustSelf(i), isNotNegative(_eastMintedLimit)]
368+ if ((checks == checks))
369+ then [IntegerEntry(keyEastMintedLimit(), _eastMintedLimit)]
370+ else throw("Strict value is not equal to itself.")
371+ }
372+
373+
374+
375+@Callable(i)
376+func setStaker (_address) = {
377+ let checks = [mustInitialized(), mustSelf(i), checkAddress(_address)]
378+ if ((checks == checks))
379+ then if (isStaked())
380+ then throw("Unable to proceed. Staker is already set.")
381+ else [StringEntry(keyStakerAddress(), _address)]
382+ else throw("Strict value is not equal to itself.")
383+ }
384+
385+
386+
387+@Callable(i)
388+func mint (_address) = {
389+ let payment = i.payments[0]
390+ let vaultAsset = getAssetId()
391+ let check = [mustActive(), mustFrontend(i), mustHaveOnePayment(i), isAsset(payment, vaultAsset)]
392+ if ((check == check))
393+ then {
394+ let $t01577015823 = countEquivalent(payment.amount)
395+ let usdEq = $t01577015823._1
396+ let eastEq = $t01577015823._2
397+ let vault = updateVault(_address, payment.amount)
398+ let newTotalAssetAccepted = (getTotalAssetAccepted() + payment.amount)
399+ let newTotalEastMinted = (getTotalEastMinted() + (eastEq / 100))
400+ let eastMintedLimit = getEastMintedLimit()
401+ if (if ((eastMintedLimit > 0))
402+ then (newTotalEastMinted > eastMintedLimit)
403+ else false)
404+ then throw("Unable to proceed. Too much EAST minted with this asset.")
405+ else {
406+ let doAction = if (isStaked())
407+ then invoke(staker(), "stake", nil, [payment])
408+ else unit
409+ if ((doAction == doAction))
410+ then $Tuple2([IntegerEntry(keyTotalAssetAccepted(), newTotalAssetAccepted), IntegerEntry(keyTotalEastMinted(), newTotalEastMinted)], $Tuple2(vault, eastEq))
411+ else throw("Strict value is not equal to itself.")
412+ }
413+ }
414+ else throw("Strict value is not equal to itself.")
415+ }
416+
417+
418+
419+@Callable(i)
420+func supply (_address) = {
421+ let payment = i.payments[0]
422+ let vaultAsset = getAssetId()
423+ let check = [mustActive(), mustFrontend(i), mustHaveOnePayment(i), isAsset(payment, vaultAsset)]
424+ if ((check == check))
425+ then {
426+ let vault = updateVault(_address, payment.amount)
427+ let newTotalAssetAccepted = (getTotalAssetAccepted() + payment.amount)
428+ let doAction = if (isStaked())
429+ then invoke(staker(), "stake", nil, [payment])
430+ else unit
431+ if ((doAction == doAction))
432+ then $Tuple2([IntegerEntry(keyTotalAssetAccepted(), newTotalAssetAccepted)], vault)
433+ else throw("Strict value is not equal to itself.")
434+ }
435+ else throw("Strict value is not equal to itself.")
436+ }
437+
438+
439+
440+@Callable(i)
441+func close (_address,_amount) = {
442+ let check = [mustActive(), mustFrontend(i), checkAddress(_address), isPositive(_amount)]
443+ if ((check == check))
444+ then {
445+ let assetAmount = getVaultData(_address)._1
446+ if ((_amount > assetAmount))
447+ then throw("Unable to proceed. Not enough asset in vault.")
448+ else if ((_amount > getTotalAssetAccepted()))
449+ then throw("Unable to proceed. Not enough asset in treasury.")
450+ else {
451+ let updatedVault = updateVault(_address, -(_amount))
452+ let $t01749717543 = countEquivalent(_amount)
453+ let usdEq = $t01749717543._1
454+ let eastEq = $t01749717543._2
455+ let doAction = if (isStaked())
456+ then invoke(staker(), "unstake", [_amount], nil)
457+ else unit
458+ if ((doAction == doAction))
459+ then {
460+ let assetId = getAssetIdFromString(getAssetId())
461+ let address = addressFromStringValue(_address)
462+ let newTotalAssetAccepted = (getTotalAssetAccepted() - _amount)
463+ let newTotalEastMinted = (getTotalEastMinted() - (eastEq / 100))
464+ $Tuple2([IntegerEntry(keyTotalAssetAccepted(), newTotalAssetAccepted), IntegerEntry(keyTotalEastMinted(), newTotalEastMinted), ScriptTransfer(address, _amount, assetId)], $Tuple3(updatedVault, eastEq, usdEq))
465+ }
466+ else throw("Strict value is not equal to itself.")
467+ }
468+ }
469+ else throw("Strict value is not equal to itself.")
470+ }
471+
472+
473+
474+@Callable(i)
475+func liquidate (_liquidatorAddress,_address,_ratio) = {
476+ let check = [mustActive(), mustFrontend(i)]
477+ if ((check == check))
478+ then {
479+ let assetAmount = getVaultData(_address)._1
480+ let assetRequested = mulp(assetAmount, _ratio)
481+ if ((assetRequested > assetAmount))
482+ then throw("Unable to proceed. Not enough asset in vault.")
483+ else if ((assetRequested > getTotalAssetAccepted()))
484+ then throw("Unable to proceed. Not enough asset.")
485+ else {
486+ let updatedVault = updateVault(_address, -(assetRequested))
487+ let $t01863318686 = countEquivalent(assetRequested)
488+ let usdEq = $t01863318686._1
489+ let eastEq = $t01863318686._2
490+ let doAction = if (isStaked())
491+ then invoke(staker(), "unstake", [assetRequested], nil)
492+ else unit
493+ if ((doAction == doAction))
494+ then {
495+ let fee = mulp(assetRequested, getLiquidationProtocolFee())
496+ let liquidated = (assetRequested - fee)
497+ let newTotalAssetAccepted = (getTotalAssetAccepted() - assetRequested)
498+ let newTotalEastMinted = (getTotalEastMinted() - (eastEq / 100))
499+ let treasuryAddress = getTreasuryAddress()
500+ let liquidatorAddress = addressFromStringValue(_liquidatorAddress)
501+ let assetId = getAssetIdFromString(getAssetId())
502+ $Tuple2([IntegerEntry(keyTotalAssetAccepted(), newTotalAssetAccepted), IntegerEntry(keyTotalEastMinted(), newTotalEastMinted), ScriptTransfer(liquidatorAddress, liquidated, assetId), ScriptTransfer(treasuryAddress, fee, assetId)], $Tuple2(updatedVault, eastEq))
503+ }
504+ else throw("Strict value is not equal to itself.")
505+ }
506+ }
507+ else throw("Strict value is not equal to itself.")
508+ }
509+
510+
511+
512+@Callable(i)
513+func getCurrentUsdPrice () = $Tuple2(nil, getAssetUsdPrice())
514+
515+
516+
517+@Callable(i)
518+func getSubvaultInfo (_address) = {
519+ let assetAmount = getVaultData(_address)._1
520+ let $t01967319723 = countEquivalent(assetAmount)
521+ let usdEq = $t01967319723._1
522+ let eastEq = $t01967319723._2
523+ let liquidationRatio = getLiquidationRatio()
524+ let threshold = mulp(usdEq, liquidationRatio)
525+ $Tuple2(nil, $Tuple3(usdEq, eastEq, threshold))
526+ }
527+
528+
529+@Verifier(tx)
530+func verify () = match verifier() {
531+ case address: String =>
532+ valueOrElse(getBoolean(addressFromStringValue(address), keySigned(toString(this), toBase58String(tx.id))), false)
533+ case _ =>
534+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
535+}
536+

github/deemru/w8io/026f985 
27.59 ms