tx · 7v9JzWmg1T4omet7mUsHJphacBekCCKtyqxUbLSh7pzm

3Mr73hWEyivaVitnLKceS6TuL2aZPZMXqjj:  -0.01000000 Waves

2022.11.15 12:41 [2318067] smart account 3Mr73hWEyivaVitnLKceS6TuL2aZPZMXqjj > SELF 0.00000000 Waves

{ "type": 13, "id": "7v9JzWmg1T4omet7mUsHJphacBekCCKtyqxUbLSh7pzm", "fee": 1000000, "feeAssetId": null, "timestamp": 1668505306943, "version": 2, "chainId": 84, "sender": "3Mr73hWEyivaVitnLKceS6TuL2aZPZMXqjj", "senderPublicKey": "4WzA9WicjphbWKaWgNBxBHFheKjEp4fcAtT8HJu19WhZ", "proofs": [ "21jJdi62bESiShiU3PMsXRjvc8ojptBAoMvTpNUpQh7m9AuKEu2HPNQVqFZyaQxJwUpMMLcwiTUe3f9Y1JCXF1di" ], "script": "base64:BgIkCAISBAoCCBgSABIAEgUKAwQBCBIDCgEBEgMKAQESABIDCgEBJwAHa0FjdGl2ZQIGYWN0aXZlAAZrQ2F1c2UCDnNodXRkb3duX2NhdXNlAAxrVVNETkFkZHJlc3MCGHN0YWtpbmdfdXNkbm5zYnRfYWRkcmVzcwAMa0VVUk5BZGRyZXNzAhRzdGFraW5nX2V1cm5fYWRkcmVzcwAMa0xlYXNpbmdQb29sAg9sZWFzaW5nX2FkZHJlc3MADmtMZWFzaW5nQW1vdW50Ag5sZWFzaW5nX2Ftb3VudAAKa0xlYXNpbmdJZAIKbGVhc2luZ19pZAANa0FkbWluUHViS2V5MQILYWRtaW5fcHViXzEADWtBZG1pblB1YktleTICC2FkbWluX3B1Yl8yAA1rQWRtaW5QdWJLZXkzAgthZG1pbl9wdWJfMwASa0FkbWluSW52b2tlUHViS2V5AhBhZG1pbl9pbnZva2VfcHViAA1rQ3BtbUNvbnRyYWN0Ag1jcG1tX2NvbnRyYWN0AAxrVVNETkFzc2V0SWQCDXVzZG5fYXNzZXRfaWQADGtFVVJOQXNzZXRJZAINZXVybl9hc3NldF9pZAAO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nR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQABAAAEEmFkbWluUHViS2V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFDGFkbWluUHViS2V5MgABAAAEEmFkbWluUHViS2V5M1NpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFDGFkbWluUHViS2V5MwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAgUTbXVsdGlTaWduZWRCeUFkbWluc1qBBMc=", "height": 2318067, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: Ev7KbcbPrF6QuNnUY7LJbm91sUPGqc8cqQ71cQDw9ymj Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let kActive = "active"
5+
6+let kCause = "shutdown_cause"
7+
8+let kUSDNAddress = "staking_usdnnsbt_address"
9+
10+let kEURNAddress = "staking_eurn_address"
11+
12+let kLeasingPool = "leasing_address"
13+
14+let kLeasingAmount = "leasing_amount"
15+
16+let kLeasingId = "leasing_id"
17+
18+let kAdminPubKey1 = "admin_pub_1"
19+
20+let kAdminPubKey2 = "admin_pub_2"
21+
22+let kAdminPubKey3 = "admin_pub_3"
23+
24+let kAdminInvokePubKey = "admin_invoke_pub"
25+
26+let kCpmmContract = "cpmm_contract"
27+
28+let kUSDNAssetId = "usdn_asset_id"
29+
30+let kEURNAssetId = "eurn_asset_id"
31+
32+let kStakingAssets = "staking_assets"
33+
34+let kShareAssetId = "share_asset_id"
35+
36+let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz')
37+
38+func getBase58FromOracle (key) = match getString(oracle, key) {
39+ case string: String =>
40+ fromBase58String(string)
41+ case nothing =>
42+ throw((key + "is empty"))
43+}
44+
45+
46+let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
47+
48+let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
49+
50+let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
51+
52+let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey)
53+
54+let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress))
55+
56+let stakingEURNAddress = Address(getBase58FromOracle(kEURNAddress))
57+
58+let cpmmContract = Address(getBase58FromOracle(kCpmmContract))
59+
60+let USDN = getBase58FromOracle(kUSDNAssetId)
61+
62+let EURN = getBase58FromOracle(kEURNAssetId)
63+
64+let stakingAssets = getStringValue(oracle, kStakingAssets)
65+
66+let active = valueOrElse(getBoolean(this, kActive), true)
67+
68+func isActive () = if (active)
69+ then unit
70+ else throw("DApp is inactive at this moment")
71+
72+
73+func isGlobalCaller (caller) = if ((caller == cpmmContract))
74+ then unit
75+ else throw("Only global Contract can invoke this function")
76+
77+
78+func isAdminCall (callerPubKey) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], callerPubKey))
79+ then unit
80+ else throw("Only admin can call this function")
81+
82+
83+func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
84+
85+
86+func calcStakingFuncAndAddres (stake,assetId) = if (stake)
87+ then if ((assetId == USDN))
88+ then $Tuple2("lockNeutrino", stakingUSDNAddress)
89+ else $Tuple2("startStaking", stakingEURNAddress)
90+ else if ((assetId == USDN))
91+ then $Tuple2("unlockNeutrino", stakingUSDNAddress)
92+ else $Tuple2("stopStaking", stakingEURNAddress)
93+
94+
95+func calcStakingParams (stake,amount,assetId) = if (stake)
96+ then {
97+ let $t024732539 = calcStakingFuncAndAddres(stake, assetId)
98+ let call = $t024732539._1
99+ let stakingAddr = $t024732539._2
100+ $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)])
101+ }
102+ else {
103+ let $t026252691 = calcStakingFuncAndAddres(stake, assetId)
104+ let call = $t026252691._1
105+ let stakingAddr = $t026252691._2
106+ $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil)
107+ }
108+
109+
110+func collectPayments (acc,payment) = {
111+ let $t028532896 = acc
112+ let paymentAmounts = $t028532896._1
113+ let paymentAssetIds = $t028532896._2
114+ $Tuple2((paymentAmounts :+ payment.amount), (paymentAssetIds :+ (if ((payment.assetId == unit))
115+ then base58''
116+ else payment.assetId)))
117+ }
118+
119+
120+func collectState (result,source) = match source {
121+ case e: Issue|Burn|Reissue|ScriptTransfer|BinaryEntry|BooleanEntry|StringEntry|IntegerEntry =>
122+ (result :+ e)
123+ case _ =>
124+ result
125+}
126+
127+
128+func collectData (result,source) = match source {
129+ case v: String =>
130+ (result :+ v)
131+ case v: Int =>
132+ (result :+ v)
133+ case v: Boolean =>
134+ (result :+ v)
135+ case v: ByteVector =>
136+ (result :+ v)
137+ case _ =>
138+ throw()
139+}
140+
141+
142+func callCommon (funcName,caller,args,payments) = valueOrElse(isActive(), {
143+ let $t037773861 = {
144+ let $l = payments
145+ let $s = size($l)
146+ let $acc0 = $Tuple2(nil, nil)
147+ func $f0_1 ($a,$i) = if (($i >= $s))
148+ then $a
149+ else collectPayments($a, $l[$i])
150+
151+ func $f0_2 ($a,$i) = if (($i >= $s))
152+ then $a
153+ else throw("List size exceeds 10")
154+
155+ $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)
156+ }
157+ let paymentAmounts = $t037773861._1
158+ let paymentAssetIds = $t037773861._2
159+ let $t038664014 = {
160+ let @ = reentrantInvoke(cpmmContract, funcName, [caller, args, paymentAmounts, paymentAssetIds], nil)
161+ if ($isInstanceOf(@, "(List[Any], List[Any])"))
162+ then @
163+ else throw(($getType(@) + " couldn't be cast to (List[Any], List[Any])"))
164+ }
165+ if (($t038664014 == $t038664014))
166+ then {
167+ let data = $t038664014._2
168+ let actions = $t038664014._1
169+ let mappedData = {
170+ let $l = data
171+ let $s = size($l)
172+ let $acc0 = nil
173+ func $f1_1 ($a,$i) = if (($i >= $s))
174+ then $a
175+ else collectData($a, $l[$i])
176+
177+ func $f1_2 ($a,$i) = if (($i >= $s))
178+ then $a
179+ else throw("List size exceeds 10")
180+
181+ $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
182+ }
183+ let mappedActions = {
184+ let $l = actions
185+ let $s = size($l)
186+ let $acc0 = nil
187+ func $f2_1 ($a,$i) = if (($i >= $s))
188+ then $a
189+ else collectState($a, $l[$i])
190+
191+ func $f2_2 ($a,$i) = if (($i >= $s))
192+ then $a
193+ else throw("List size exceeds 15")
194+
195+ $f2_2($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
196+ }
197+ $Tuple2(mappedActions, mappedData)
198+ }
199+ else throw("Strict value is not equal to itself.")
200+ })
201+
202+
203+@Callable(i)
204+func callFunction (funcName,args) = callCommon(funcName, i.caller.bytes, args, i.payments)
205+
206+
207+
208+@Callable(i)
209+func shutdown () = valueOrElse(isAdminCall(i.callerPublicKey), if (!(active))
210+ then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
211+ else suspend("Paused by admin"))
212+
213+
214+
215+@Callable(i)
216+func activate () = valueOrElse(isAdminCall(i.callerPublicKey), if (active)
217+ then throw("DApp is already active")
218+ else [BooleanEntry(kActive, true), DeleteEntry(kCause)])
219+
220+
221+
222+@Callable(i)
223+func stakeUnstake (stake,amount,assetIdString) = valueOrElse(isActive(), if ((i.caller != cpmmContract))
224+ then throw("Only global Contract can invoke this function")
225+ else if ((assetIdString == "WAVES"))
226+ then {
227+ let pool = addressFromStringValue(valueOrErrorMessage(getString(oracle, kLeasingPool), "No leasing pool in oracle"))
228+ let leasingId = getBinary(this, kLeasingId)
229+ let leasingAmount = valueOrElse(getInteger(this, kLeasingAmount), 0)
230+ let newLeaseAmount = if (stake)
231+ then (leasingAmount + amount)
232+ else (leasingAmount - amount)
233+ let newLease = Lease(pool, newLeaseAmount)
234+ let newLeaseId = calculateLeaseId(newLease)
235+ let baseEtry = [newLease, BinaryEntry(kLeasingId, newLeaseId), IntegerEntry(kLeasingAmount, newLeaseAmount)]
236+ match leasingId {
237+ case lId: ByteVector =>
238+ ([LeaseCancel(lId)] ++ baseEtry)
239+ case _ =>
240+ baseEtry
241+ }
242+ }
243+ else {
244+ let $t060106113 = calcStakingParams(stake, amount, fromBase58String(assetIdString))
245+ let call = $t060106113._1
246+ let addr = $t060106113._2
247+ let params = $t060106113._3
248+ let payments = $t060106113._4
249+ let inv = invoke(addr, call, params, payments)
250+ if ((inv == inv))
251+ then nil
252+ else throw("Strict value is not equal to itself.")
253+ })
254+
255+
256+
257+@Callable(i)
258+func reissueShareToken (amount) = valueOrElse(isGlobalCaller(i.caller), valueOrElse(isActive(), {
259+ let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId))
260+[Reissue(shareAssetId, amount, true), ScriptTransfer(i.caller, amount, shareAssetId)]
261+ }))
262+
263+
264+
265+@Callable(i)
266+func replenishWithTwoTokens (slippageTolerance) = callCommon("replenishWithTwoTokens", i.caller.bytes, ["false", "0"], i.payments)
267+
268+
269+
270+@Callable(i)
271+func withdraw () = callCommon("withdraw", i.caller.bytes, ["0"], i.payments)
272+
273+
274+
275+@Callable(i)
276+func exchange (minAmountToReceive) = callCommon("exchange", i.caller.bytes, [toString(minAmountToReceive)], i.payments)
277+
278+
279+@Verifier(tx)
280+func verify () = {
281+ let multiSignedByAdmins = {
282+ let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
283+ then 1
284+ else 0
285+ let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
286+ then 1
287+ else 0
288+ let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
289+ then 1
290+ else 0
291+ (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
292+ }
293+ multiSignedByAdmins
294+ }
295+

github/deemru/w8io/026f985 
27.87 ms