tx · HHBv7JxqsXywDm63FDf429FKDtyhdzjMWyJqNqFYP6Fs

3My8v3Ev8Uy7RJqQ64c4rmvtWM48dyUUUWH:  -0.05000000 Waves

2023.07.18 16:28 [2671378] smart account 3My8v3Ev8Uy7RJqQ64c4rmvtWM48dyUUUWH > SELF 0.00000000 Waves

{ "type": 13, "id": "HHBv7JxqsXywDm63FDf429FKDtyhdzjMWyJqNqFYP6Fs", "fee": 5000000, "feeAssetId": null, "timestamp": 1689686928393, "version": 2, "chainId": 84, "sender": "3My8v3Ev8Uy7RJqQ64c4rmvtWM48dyUUUWH", "senderPublicKey": "DjdxYmdJZYpqYDAR87ZysJMV8nmTgK5CfeyV1trVHcb3", "proofs": [ "2RWvLsvYBYaK4jbdE1JKcoyjUTjVtbdYwkY5XYcDu7yXUYuBzhx1xRVYBv3R3PMTqcX26Ezw2GdzA2gVCbPUPg1g" ], "script": "base64:BgK5DggCEgMKAQgSABIAEgASABIECgIICBIDCgEIEgMKAQgiA1NFUCIJUFJFQ0lTSU9OIgdFTkFCTEVEIghESVNBQkxFRCIEZGl2cCICX3giAl95IgRtdWxwIghjb252NnRvOCICX3YiCGNvbnY4dG82IgRqb2luIgJhciIOa2V5SW5pdGlhbGl6ZWQiFWtleUNvb3JkaW5hdG9yQWRkcmVzcyISa2V5VmVyaWZpZXJBZGRyZXNzIgxrZXlFYXN0QXNzZXQiCWtleVNpZ25lZCIIX2FkZHJlc3MiBV90eElkIhFrZXlQcm90b2NvbEFjdGl2ZSINaXNJbml0aWFsaXplZCIPbXVzdEluaXRpYWxpemVkIhJtdXN0Tm90SW5pdGlhbGl6ZWQiCG11c3RTZWxmIgFpIgtjb29yZGluYXRvciIIdmVyaWZpZXIiByRtYXRjaDAiAXMiD2dldEVhc3RBc3NldFN0ciIMZ2V0RWFzdEFzc2V0Ighpc0FjdGl2ZSIKbXVzdEFjdGl2ZSINaGFzT25lUGF5bWVudCIUZ2V0QXNzZXRJZEZyb21TdHJpbmciB2Fzc2V0SWQiB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vdCBlcXVhbCB0byBpdHNlbGYuAQJiSwECYkwABAFDCQEBQgADCQABAgUBQwIGU3RyaW5nBAFWBQFDCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFAVYJAQFyAgkApQgBBQR0aGlzCQDYBAEIBQJiSwJpZAcJAPQDAwgFAmJLCWJvZHlCeXRlcwkAkQMCCAUCYksGcHJvb2ZzAAAIBQJiSw9zZW5kZXJQdWJsaWNLZXlYUuXI", "height": 2671378, "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 PRECISION = 1000000000000
7+
8+let ENABLED = "ENABLED"
9+
10+let DISABLED = "DISABLED"
11+
12+func divp (_x,_y) = fraction(_x, PRECISION, _y, HALFEVEN)
13+
14+
15+func mulp (_x,_y) = fraction(_x, _y, PRECISION, HALFEVEN)
16+
17+
18+func conv6to8 (_v) = (_v * 100)
19+
20+
21+func conv8to6 (_v) = (_v / 100)
22+
23+
24+func join (ar) = makeString(ar, SEP)
25+
26+
27+func keyInitialized () = join(["%s", "initialized"])
28+
29+
30+func keyCoordinatorAddress () = join(["%s", "coordinatorAddress"])
31+
32+
33+func keyVerifierAddress () = join(["%s", "verifierAddress"])
34+
35+
36+func keyEastAsset () = join(["%s", "eastAsset"])
37+
38+
39+func keySigned (_address,_txId) = join(["%s%s%s", "signed", _address, _txId])
40+
41+
42+func keyProtocolActive () = join(["%s", "protocolActive"])
43+
44+
45+func isInitialized () = valueOrElse(getBoolean(this, keyInitialized()), false)
46+
47+
48+func mustInitialized () = if (!(isInitialized()))
49+ then throw("Not initialized")
50+ else unit
51+
52+
53+func mustNotInitialized () = if (isInitialized())
54+ then throw("Already initialized")
55+ else unit
56+
57+
58+func mustSelf (i) = if ((i.caller != this))
59+ then throw("Only self invocation allowed.")
60+ else unit
61+
62+
63+func coordinator () = addressFromStringValue(valueOrErrorMessage(getString(keyCoordinatorAddress()), "Coordinator is not set"))
64+
65+
66+func verifier () = match getString(keyCoordinatorAddress()) {
67+ case s: String =>
68+ getString(addressFromStringValue(s), keyVerifierAddress())
69+ case _: Unit =>
70+ unit
71+ case _ =>
72+ throw("Match error")
73+}
74+
75+
76+func getEastAssetStr () = valueOrErrorMessage(getString(coordinator(), keyEastAsset()), "East asset is not set")
77+
78+
79+func getEastAsset () = fromBase58String(getEastAssetStr())
80+
81+
82+func isActive () = valueOrElse(getBoolean(coordinator(), keyProtocolActive()), false)
83+
84+
85+func mustActive () = if (if (!(isActive()))
86+ then true
87+ else !(isInitialized()))
88+ then throw("Protocol is disabled. Please contact support.")
89+ else unit
90+
91+
92+func hasOnePayment (i) = (size(i.payments) == 1)
93+
94+
95+func getAssetIdFromString (assetId) = if ((assetId == "WAVES"))
96+ then unit
97+ else fromBase58String(assetId)
98+
99+
100+func isAsset (p,checkingAsset) = {
101+ let assetId = match checkingAsset {
102+ case bv: ByteVector =>
103+ bv
104+ case s: String =>
105+ getAssetIdFromString(s)
106+ case _: Unit =>
107+ unit
108+ case _ =>
109+ throw("Match error")
110+ }
111+ match assetId {
112+ case bv: ByteVector =>
113+ let name = match assetInfo(bv) {
114+ case asset: Asset =>
115+ asset.name
116+ case _: Unit =>
117+ throw(("Can't find asset " + toBase58String(bv)))
118+ case _ =>
119+ throw("Match error")
120+ }
121+ let err = throw(("Attached payment asset is not " + name))
122+ match p.assetId {
123+ case paymentAsset: ByteVector =>
124+ if ((paymentAsset != assetId))
125+ then err
126+ else unit
127+ case _: Unit =>
128+ err
129+ case _ =>
130+ throw("Match error")
131+ }
132+ case _: Unit =>
133+ if ((p.assetId != unit))
134+ then throw("Attached payment asset is not WAVES")
135+ else unit
136+ case _ =>
137+ throw("Match error")
138+ }
139+ }
140+
141+
142+func checkAddress (_address) = match addressFromString(_address) {
143+ case address: Address =>
144+ true
145+ case _: Unit =>
146+ throw("Invalid address")
147+ case _ =>
148+ throw("Match error")
149+}
150+
151+
152+func getCurrentTimestampSec () = (lastBlock.timestamp / 1000)
153+
154+
155+func keyBalance () = join(["%s", "balance"])
156+
157+
158+func keyRate () = join(["%s", "rate"])
159+
160+
161+func keyStEast () = join(["%s", "stEast"])
162+
163+
164+func getStEast () = fromBase58String(getStringValue(this, keyStEast()))
165+
166+
167+func getBalance () = valueOrElse(getInteger(keyBalance()), 0)
168+
169+
170+func getRate () = getIntegerValue(keyRate())
171+
172+
173+let IdxAssetPoolStatus = 1
174+
175+let IdxAssetPoolContractId = 2
176+
177+let IdxBalancesLastEastBalance = 1
178+
179+let IdxBalancesLastTimestamp = 2
180+
181+let IdxBalancesLastStEastBalance = 3
182+
183+func keyAssetsInPools () = join(["%s", "assetsInPools"])
184+
185+
186+func keyAssetPool (_assetId) = join(["%s%s", "assetPool", _assetId])
187+
188+
189+func keyAssetPoolBalances (_assetStr) = join(["%s%s", "assetPoolBalances", _assetStr])
190+
191+
192+func getAssetsInPools () = match getString(this, keyAssetsInPools()) {
193+ case s: String =>
194+ split(s, SEP)
195+ case _: Unit =>
196+ nil
197+ case _ =>
198+ throw("Match error")
199+}
200+
201+
202+func getAssetPool (_assetId) = {
203+ let poolArr = split(getStringValue(this, keyAssetPool(_assetId)), SEP)
204+ let pool = poolArr[IdxAssetPoolContractId]
205+ pool
206+ }
207+
208+
209+func getEastBalance (_address) = {
210+ let eastAsset = getEastAsset()
211+ let address = addressFromStringValue(_address)
212+ let balance = assetBalance(address, eastAsset)
213+ balance
214+ }
215+
216+
217+func getCurrentPoolEastBalance (_assetId) = {
218+ let pool = getAssetPool(_assetId)
219+ let balance = getEastBalance(pool)
220+ balance
221+ }
222+
223+
224+func isPoolEnabled (_assetStr) = {
225+ let poolCfg = getStringValue(keyAssetPool(_assetStr))
226+ let poolArr = split(poolCfg, SEP)
227+ if ((poolArr[IdxAssetPoolStatus] != ENABLED))
228+ then throw((("Asset " + _assetStr) + " is not enabled"))
229+ else unit
230+ }
231+
232+
233+func assetExist (_assetStr) = match getString(keyAssetPool(_assetStr)) {
234+ case s: String =>
235+ true
236+ case _: Unit =>
237+ false
238+ case _ =>
239+ throw("Match error")
240+}
241+
242+
243+func dataAssetPool (_status,_poolStr) = join(["%s%s", _status, _poolStr])
244+
245+
246+func getAssetPoolBalances (_assetStr) = {
247+ let balancesArr = match getString(keyAssetPoolBalances(_assetStr)) {
248+ case s: String =>
249+ split(s, SEP)
250+ case _: Unit =>
251+["%d%d%d", "0", toString(getCurrentTimestampSec()), "0"]
252+ case _ =>
253+ throw("Match error")
254+ }
255+ let lastEastBalance = parseIntValue(balancesArr[IdxBalancesLastEastBalance])
256+ let lastTimestamp = parseIntValue(balancesArr[IdxBalancesLastTimestamp])
257+ let lastStEastBalance = parseIntValue(balancesArr[IdxBalancesLastStEastBalance])
258+ $Tuple3(lastEastBalance, lastTimestamp, lastStEastBalance)
259+ }
260+
261+
262+func updateAssetPoolBalances (_currentPoolEastBalance,_newStEastBalanceForPool) = makeString(["%d%d%d", toString(_currentPoolEastBalance), toString(getCurrentTimestampSec()), toString(_newStEastBalanceForPool)], SEP)
263+
264+
265+func updateBalance (_amount) = {
266+ let balance = (getBalance() + _amount)
267+[IntegerEntry(keyBalance(), balance)]
268+ }
269+
270+
271+func updateRate (_rate) = [IntegerEntry(keyRate(), _rate)]
272+
273+
274+func issueStEast (_amount) = {
275+ let stEast = getStEast()
276+[Reissue(stEast, _amount, true)]
277+ }
278+
279+
280+func burnStEast (_amount) = {
281+ let stEast = getStEast()
282+[Burn(stEast, _amount)]
283+ }
284+
285+
286+func sendStEast (_recipient,_amount) = {
287+ let stEast = getStEast()
288+[ScriptTransfer(_recipient, _amount, stEast)]
289+ }
290+
291+
292+func sendEast (_recipient,_amount) = {
293+ let eastAsset = getEastAsset()
294+[ScriptTransfer(_recipient, _amount, eastAsset)]
295+ }
296+
297+
298+func stEastQuantity () = {
299+ let stEast = getStEast()
300+ match assetInfo(stEast) {
301+ case asset: Asset =>
302+ asset.quantity
303+ case _ =>
304+ throw("Can't find stEAST asset")
305+ }
306+ }
307+
308+
309+@Callable(i)
310+func initialize (_coordinatorAddress) = {
311+ let checks = [mustSelf(i), mustNotInitialized(), checkAddress(_coordinatorAddress)]
312+ if ((checks == checks))
313+ then {
314+ let stEast = Issue("stEAST", "", 0, 8, true, unit, 0)
315+ let stEastId = calculateAssetId(stEast)
316+[BooleanEntry(keyInitialized(), true), StringEntry(keyCoordinatorAddress(), _coordinatorAddress), StringEntry(keyStEast(), toBase58String(stEastId)), IntegerEntry(keyRate(), PRECISION), stEast]
317+ }
318+ else throw("Strict value is not equal to itself.")
319+ }
320+
321+
322+
323+@Callable(i)
324+func updateLpPoolBalances () = {
325+ let checks = [mustInitialized(), mustSelf(i)]
326+ if ((checks == checks))
327+ then {
328+ let rate = getRate()
329+ let stAssetAmountBefore = stEastQuantity()
330+ func updateBalances (acc,next) = match next {
331+ case asset: String =>
332+ let check = [isPoolEnabled(asset)]
333+ if ((check == check))
334+ then {
335+ let currentPoolEastBalance = getCurrentPoolEastBalance(asset)
336+ let $t01580115913 = {
337+ let @ = getAssetPoolBalances(asset)
338+ if ($isInstanceOf(@, "(Int, Int, Int)"))
339+ then @
340+ else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
341+ }
342+ let oldPoolEastBalance = $t01580115913._1
343+ let lastTimestamp = $t01580115913._2
344+ let oldStEastBalance = $t01580115913._3
345+ let poolBalanceDiff = (currentPoolEastBalance - oldPoolEastBalance)
346+ let stAssetDiff = conv6to8(divp(poolBalanceDiff, rate))
347+ let newStEastBalanceForPool = (oldStEastBalance + stAssetDiff)
348+ let actions = [StringEntry(keyAssetPoolBalances(asset), updateAssetPoolBalances(currentPoolEastBalance, newStEastBalanceForPool))]
349+ $Tuple3((acc._1 ++ actions), (acc._2 + stAssetDiff), (acc._3 + poolBalanceDiff))
350+ }
351+ else throw("Strict value is not equal to itself.")
352+ case _: Unit =>
353+ acc
354+ case _ =>
355+ throw("Match error")
356+ }
357+
358+ let assets = getAssetsInPools()
359+ let $t01649416685 = if ((1 > size(assets)))
360+ then $Tuple3(nil, 0, 0)
361+ else {
362+ let $l = assets
363+ let $s = size($l)
364+ let $acc0 = $Tuple3(nil, 0, 0)
365+ func $f0_1 ($a,$i) = if (($i >= $s))
366+ then $a
367+ else updateBalances($a, $l[$i])
368+
369+ func $f0_2 ($a,$i) = if (($i >= $s))
370+ then $a
371+ else throw("List size exceeds 10")
372+
373+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
374+ }
375+ let poolAssetBalancesActions = $t01649416685._1
376+ let totalStEastAmountChange = $t01649416685._2
377+ let totalEastBalancesChange = $t01649416685._3
378+ let stEast = getStEast()
379+ let stEastOp = if ((totalStEastAmountChange > 0))
380+ then issueStEast(totalStEastAmountChange)
381+ else burnStEast((totalStEastAmountChange * -1))
382+ let updatedBalance = updateBalance(totalEastBalancesChange)
383+ ((poolAssetBalancesActions ++ stEastOp) ++ updatedBalance)
384+ }
385+ else throw("Strict value is not equal to itself.")
386+ }
387+
388+
389+
390+@Callable(i)
391+func stake () = {
392+ let payment = i.payments[0]
393+ let eastAsset = getEastAsset()
394+ let checks = [mustActive(), hasOnePayment(i), isAsset(payment, eastAsset)]
395+ if ((checks == checks))
396+ then {
397+ let doUpdatePoolBalances = invoke(this, "updateLpPoolBalances", nil, nil)
398+ if ((doUpdatePoolBalances == doUpdatePoolBalances))
399+ then {
400+ let rate = getRate()
401+ let mainAssetAmount = conv6to8(payment.amount)
402+ let toReissue = divp(mainAssetAmount, rate)
403+ $Tuple2(((updateBalance(payment.amount) ++ issueStEast(toReissue)) ++ sendStEast(i.caller, toReissue)), toReissue)
404+ }
405+ else throw("Strict value is not equal to itself.")
406+ }
407+ else throw("Strict value is not equal to itself.")
408+ }
409+
410+
411+
412+@Callable(i)
413+func unstake () = {
414+ let payment = i.payments[0]
415+ let stEast = getStEast()
416+ let checks = [mustActive(), hasOnePayment(i), isAsset(payment, stEast)]
417+ if ((checks == checks))
418+ then {
419+ let doUpdatePoolBalances = invoke(this, "updateLpPoolBalances", nil, nil)
420+ if ((doUpdatePoolBalances == doUpdatePoolBalances))
421+ then {
422+ let rate = getRate()
423+ let transferAmount = conv8to6(mulp(payment.amount, rate))
424+ ((updateBalance(-(transferAmount)) ++ burnStEast(payment.amount)) ++ sendEast(i.caller, transferAmount))
425+ }
426+ else throw("Strict value is not equal to itself.")
427+ }
428+ else throw("Strict value is not equal to itself.")
429+ }
430+
431+
432+
433+@Callable(i)
434+func addStakingRewards () = {
435+ let payment = i.payments[0]
436+ let eastAsset = getEastAsset()
437+ let checks = [mustActive(), hasOnePayment(i), isAsset(payment, eastAsset)]
438+ if ((checks == checks))
439+ then {
440+ let doUpdatePoolBalances = invoke(this, "updateLpPoolBalances", nil, nil)
441+ if ((doUpdatePoolBalances == doUpdatePoolBalances))
442+ then {
443+ let balance = getBalance()
444+ let newEastAmount = conv6to8((balance + payment.amount))
445+ let stEastSupply = stEastQuantity()
446+ let newRate = divp(newEastAmount, stEastSupply)
447+ (updateBalance(payment.amount) ++ updateRate(newRate))
448+ }
449+ else throw("Strict value is not equal to itself.")
450+ }
451+ else throw("Strict value is not equal to itself.")
452+ }
453+
454+
455+
456+@Callable(i)
457+func addAssetPool (_poolStr,_assetStr) = {
458+ let checks = [mustInitialized(), mustSelf(i)]
459+ if ((checks == checks))
460+ then if (!(checkAddress(_poolStr)))
461+ then throw("Address is not valid")
462+ else if (assetExist(_assetStr))
463+ then throw("Asset is already set")
464+ else {
465+ let assetsInPools = makeString((getAssetsInPools() ++ [_assetStr]), SEP)
466+[StringEntry(keyAssetPool(_assetStr), dataAssetPool(ENABLED, _poolStr)), StringEntry(keyAssetsInPools(), assetsInPools)]
467+ }
468+ else throw("Strict value is not equal to itself.")
469+ }
470+
471+
472+
473+@Callable(i)
474+func disableAssetPool (_assetStr) = {
475+ let check = [mustInitialized(), mustSelf(i)]
476+ if ((check == check))
477+ then {
478+ let poolData = split(valueOrErrorMessage(getString(keyAssetPool(_assetStr)), "Unknown asset"), SEP)
479+[StringEntry(keyAssetPool(_assetStr), dataAssetPool(DISABLED, poolData[IdxAssetPoolContractId]))]
480+ }
481+ else throw("Strict value is not equal to itself.")
482+ }
483+
484+
485+
486+@Callable(i)
487+func enableAssetPool (_assetStr) = {
488+ let check = [mustInitialized(), mustSelf(i)]
489+ if ((check == check))
490+ then {
491+ let poolData = split(valueOrErrorMessage(getString(keyAssetPool(_assetStr)), "Unknown asset"), SEP)
492+[StringEntry(keyAssetPool(_assetStr), dataAssetPool(ENABLED, poolData[IdxAssetPoolContractId]))]
493+ }
494+ else throw("Strict value is not equal to itself.")
495+ }
496+
497+
498+@Verifier(tx)
499+func verify () = match verifier() {
500+ case address: String =>
501+ valueOrElse(getBoolean(addressFromStringValue(address), keySigned(toString(this), toBase58String(tx.id))), false)
502+ case _ =>
503+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
504+}
505+

github/deemru/w8io/026f985 
30.74 ms