tx · 6x5vRTZqZcXoeH4miDhJWU9qEGeSRHjv2aAFBnueiDBe

3N1rzvSD6e3e8EAAe58DSPPmAmgHzU8keGW:  -0.14000000 Waves

2022.11.14 15:49 [2316821] smart account 3N1rzvSD6e3e8EAAe58DSPPmAmgHzU8keGW > SELF 0.00000000 Waves

{ "type": 13, "id": "6x5vRTZqZcXoeH4miDhJWU9qEGeSRHjv2aAFBnueiDBe", "fee": 14000000, "feeAssetId": null, "timestamp": 1668430153359, "version": 2, "chainId": 84, "sender": "3N1rzvSD6e3e8EAAe58DSPPmAmgHzU8keGW", "senderPublicKey": "DfabAmKWXpe5iKMWYEYbph4E3w2pTX8Znzgh2MgxqKuc", "proofs": [ "4QX9CBsRiRkYkWijrVrCNWcqNX9UvDEzNNKLdTN9NtpdgY4vjTXf9FpXgxcuX2H4fdoP7EiemuD5CgDiynVpexBF", "SSwLgMCaTrxZrCGSVuciN3wDedSjSJgJNqpSrNL1Z9CqpxVLZNvVoBjbHDPafjzhCcjtFZR3dQNgFCK93mLhhqH" ], "script": "base64:BgIkCAISBAoCCBgSABIAEgUKAwQBCBIDCgEBEgMKAQESABIDCgEBJwAHa0FjdGl2ZQIGYWN0aXZlAAZrQ2F1c2UCDnNodXRkb3duX2NhdXNlAAxrVVNETkFkZHJlc3MCGHN0YWtpbmdfdXNkbm5zYnRfYWRkcmVzcwAMa0VVUk5BZGRyZXNzAhRzdGFraW5nX2V1cm5fYWRkcmVzcwAMa0xlYXNpbmdQb29sAg9sZWFzaW5nX2FkZHJlc3MADmtMZWFzaW5nQW1vdW50Ag5sZWFzaW5nX2Ftb3VudAAKa0xlYXNpbmdJZAIKbGVhc2luZ19pZAANa0FkbWluUHViS2V5MQILYWRtaW5fcHViXzEADWtBZG1pblB1YktleTICC2FkbWluX3B1Yl8yAA1rQWRtaW5QdWJLZXkzAgthZG1pbl9wdWJfMwASa0FkbWluSW52b2tlUHViS2V5AhBhZG1pbl9pbnZva2VfcHViAA1rQ3BtbUNvbnRyYWN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mlsCAUBaQhwYXltZW50cwECdHgBBnZlcmlmeQAEE211bHRpU2lnbmVkQnlBZG1pbnMEEmFkbWluUHViS2V5MVNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQABAAAEEmFkbWluUHViS2V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFDGFkbWluUHViS2V5MgABAAAEEmFkbWluUHViS2V5M1NpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFDGFkbWluUHViS2V5MwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAgUTbXVsdGlTaWduZWRCeUFkbWluc1qBBMc=", "height": 2316821, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G7fx5vZKsdBZN2gNbnD84kxTrkkCdrvSgXu18E6wkjao Next: 4Y9jYWx7yUsE7iovoPcK72UaVd8dFr5EXXqKapA9fdne Diff:
OldNewDifferences
139139 }
140140
141141
142-@Callable(i)
143-func callFunction (funcName,args) = valueOrElse(isActive(), {
144- let $t037383824 = {
145- let $l = i.payments
142+func callCommon (funcName,caller,args,payments) = valueOrElse(isActive(), {
143+ let $t037773861 = {
144+ let $l = payments
146145 let $s = size($l)
147146 let $acc0 = $Tuple2(nil, nil)
148147 func $f0_1 ($a,$i) = if (($i >= $s))
155154
156155 $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)
157156 }
158- let paymentAmounts = $t037383824._1
159- let paymentAssetIds = $t037383824._2
160- let $t038273983 = {
161- let @ = reentrantInvoke(cpmmContract, funcName, [i.caller.bytes, args, paymentAmounts, paymentAssetIds], nil)
157+ let paymentAmounts = $t037773861._1
158+ let paymentAssetIds = $t037773861._2
159+ let $t038664014 = {
160+ let @ = reentrantInvoke(cpmmContract, funcName, [caller, args, paymentAmounts, paymentAssetIds], nil)
162161 if ($isInstanceOf(@, "(List[Any], List[Any])"))
163162 then @
164163 else throw(($getType(@) + " couldn't be cast to (List[Any], List[Any])"))
165164 }
166- if (($t038273983 == $t038273983))
165+ if (($t038664014 == $t038664014))
167166 then {
168- let data = $t038273983._2
169- let actions = $t038273983._1
167+ let data = $t038664014._2
168+ let actions = $t038664014._1
170169 let mappedData = {
171170 let $l = data
172171 let $s = size($l)
201200 })
202201
203202
203+@Callable(i)
204+func callFunction (funcName,args) = callCommon(funcName, i.caller.bytes, args, i.payments)
205+
206+
204207
205208 @Callable(i)
206209 func shutdown () = valueOrElse(isAdminCall(i.callerPublicKey), if (!(active))
217220
218221
219222 @Callable(i)
220-func stakeUnstake (stake,amount,assetIdString) = valueOrElse(isGlobalCaller(i.caller), valueOrElse(isActive(), if ((i.caller != cpmmContract))
223+func stakeUnstake (stake,amount,assetIdString) = valueOrElse(isActive(), if ((i.caller != cpmmContract))
221224 then throw("Only global Contract can invoke this function")
222225 else if ((assetIdString == "WAVES"))
223226 then {
238241 }
239242 }
240243 else {
241- let $t059776080 = calcStakingParams(stake, amount, fromBase58String(assetIdString))
242- let call = $t059776080._1
243- let addr = $t059776080._2
244- let params = $t059776080._3
245- let payments = $t059776080._4
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
246249 let inv = invoke(addr, call, params, payments)
247250 if ((inv == inv))
248251 then nil
249252 else throw("Strict value is not equal to itself.")
250- }))
253+ })
251254
252255
253256
256259 let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId))
257260 [Reissue(shareAssetId, amount, true), ScriptTransfer(i.caller, amount, shareAssetId)]
258261 }))
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)
259277
260278
261279 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kActive = "active"
55
66 let kCause = "shutdown_cause"
77
88 let kUSDNAddress = "staking_usdnnsbt_address"
99
1010 let kEURNAddress = "staking_eurn_address"
1111
1212 let kLeasingPool = "leasing_address"
1313
1414 let kLeasingAmount = "leasing_amount"
1515
1616 let kLeasingId = "leasing_id"
1717
1818 let kAdminPubKey1 = "admin_pub_1"
1919
2020 let kAdminPubKey2 = "admin_pub_2"
2121
2222 let kAdminPubKey3 = "admin_pub_3"
2323
2424 let kAdminInvokePubKey = "admin_invoke_pub"
2525
2626 let kCpmmContract = "cpmm_contract"
2727
2828 let kUSDNAssetId = "usdn_asset_id"
2929
3030 let kEURNAssetId = "eurn_asset_id"
3131
3232 let kStakingAssets = "staking_assets"
3333
3434 let kShareAssetId = "share_asset_id"
3535
3636 let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz')
3737
3838 func getBase58FromOracle (key) = match getString(oracle, key) {
3939 case string: String =>
4040 fromBase58String(string)
4141 case nothing =>
4242 throw((key + "is empty"))
4343 }
4444
4545
4646 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
4747
4848 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
4949
5050 let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
5151
5252 let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey)
5353
5454 let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress))
5555
5656 let stakingEURNAddress = Address(getBase58FromOracle(kEURNAddress))
5757
5858 let cpmmContract = Address(getBase58FromOracle(kCpmmContract))
5959
6060 let USDN = getBase58FromOracle(kUSDNAssetId)
6161
6262 let EURN = getBase58FromOracle(kEURNAssetId)
6363
6464 let stakingAssets = getStringValue(oracle, kStakingAssets)
6565
6666 let active = valueOrElse(getBoolean(this, kActive), true)
6767
6868 func isActive () = if (active)
6969 then unit
7070 else throw("DApp is inactive at this moment")
7171
7272
7373 func isGlobalCaller (caller) = if ((caller == cpmmContract))
7474 then unit
7575 else throw("Only global Contract can invoke this function")
7676
7777
7878 func isAdminCall (callerPubKey) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], callerPubKey))
7979 then unit
8080 else throw("Only admin can call this function")
8181
8282
8383 func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
8484
8585
8686 func calcStakingFuncAndAddres (stake,assetId) = if (stake)
8787 then if ((assetId == USDN))
8888 then $Tuple2("lockNeutrino", stakingUSDNAddress)
8989 else $Tuple2("startStaking", stakingEURNAddress)
9090 else if ((assetId == USDN))
9191 then $Tuple2("unlockNeutrino", stakingUSDNAddress)
9292 else $Tuple2("stopStaking", stakingEURNAddress)
9393
9494
9595 func calcStakingParams (stake,amount,assetId) = if (stake)
9696 then {
9797 let $t024732539 = calcStakingFuncAndAddres(stake, assetId)
9898 let call = $t024732539._1
9999 let stakingAddr = $t024732539._2
100100 $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)])
101101 }
102102 else {
103103 let $t026252691 = calcStakingFuncAndAddres(stake, assetId)
104104 let call = $t026252691._1
105105 let stakingAddr = $t026252691._2
106106 $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil)
107107 }
108108
109109
110110 func collectPayments (acc,payment) = {
111111 let $t028532896 = acc
112112 let paymentAmounts = $t028532896._1
113113 let paymentAssetIds = $t028532896._2
114114 $Tuple2((paymentAmounts :+ payment.amount), (paymentAssetIds :+ (if ((payment.assetId == unit))
115115 then base58''
116116 else payment.assetId)))
117117 }
118118
119119
120120 func collectState (result,source) = match source {
121121 case e: Issue|Burn|Reissue|ScriptTransfer|BinaryEntry|BooleanEntry|StringEntry|IntegerEntry =>
122122 (result :+ e)
123123 case _ =>
124124 result
125125 }
126126
127127
128128 func collectData (result,source) = match source {
129129 case v: String =>
130130 (result :+ v)
131131 case v: Int =>
132132 (result :+ v)
133133 case v: Boolean =>
134134 (result :+ v)
135135 case v: ByteVector =>
136136 (result :+ v)
137137 case _ =>
138138 throw()
139139 }
140140
141141
142-@Callable(i)
143-func callFunction (funcName,args) = valueOrElse(isActive(), {
144- let $t037383824 = {
145- let $l = i.payments
142+func callCommon (funcName,caller,args,payments) = valueOrElse(isActive(), {
143+ let $t037773861 = {
144+ let $l = payments
146145 let $s = size($l)
147146 let $acc0 = $Tuple2(nil, nil)
148147 func $f0_1 ($a,$i) = if (($i >= $s))
149148 then $a
150149 else collectPayments($a, $l[$i])
151150
152151 func $f0_2 ($a,$i) = if (($i >= $s))
153152 then $a
154153 else throw("List size exceeds 10")
155154
156155 $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)
157156 }
158- let paymentAmounts = $t037383824._1
159- let paymentAssetIds = $t037383824._2
160- let $t038273983 = {
161- let @ = reentrantInvoke(cpmmContract, funcName, [i.caller.bytes, args, paymentAmounts, paymentAssetIds], nil)
157+ let paymentAmounts = $t037773861._1
158+ let paymentAssetIds = $t037773861._2
159+ let $t038664014 = {
160+ let @ = reentrantInvoke(cpmmContract, funcName, [caller, args, paymentAmounts, paymentAssetIds], nil)
162161 if ($isInstanceOf(@, "(List[Any], List[Any])"))
163162 then @
164163 else throw(($getType(@) + " couldn't be cast to (List[Any], List[Any])"))
165164 }
166- if (($t038273983 == $t038273983))
165+ if (($t038664014 == $t038664014))
167166 then {
168- let data = $t038273983._2
169- let actions = $t038273983._1
167+ let data = $t038664014._2
168+ let actions = $t038664014._1
170169 let mappedData = {
171170 let $l = data
172171 let $s = size($l)
173172 let $acc0 = nil
174173 func $f1_1 ($a,$i) = if (($i >= $s))
175174 then $a
176175 else collectData($a, $l[$i])
177176
178177 func $f1_2 ($a,$i) = if (($i >= $s))
179178 then $a
180179 else throw("List size exceeds 10")
181180
182181 $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)
183182 }
184183 let mappedActions = {
185184 let $l = actions
186185 let $s = size($l)
187186 let $acc0 = nil
188187 func $f2_1 ($a,$i) = if (($i >= $s))
189188 then $a
190189 else collectState($a, $l[$i])
191190
192191 func $f2_2 ($a,$i) = if (($i >= $s))
193192 then $a
194193 else throw("List size exceeds 15")
195194
196195 $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)
197196 }
198197 $Tuple2(mappedActions, mappedData)
199198 }
200199 else throw("Strict value is not equal to itself.")
201200 })
202201
203202
203+@Callable(i)
204+func callFunction (funcName,args) = callCommon(funcName, i.caller.bytes, args, i.payments)
205+
206+
204207
205208 @Callable(i)
206209 func shutdown () = valueOrElse(isAdminCall(i.callerPublicKey), if (!(active))
207210 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
208211 else suspend("Paused by admin"))
209212
210213
211214
212215 @Callable(i)
213216 func activate () = valueOrElse(isAdminCall(i.callerPublicKey), if (active)
214217 then throw("DApp is already active")
215218 else [BooleanEntry(kActive, true), DeleteEntry(kCause)])
216219
217220
218221
219222 @Callable(i)
220-func stakeUnstake (stake,amount,assetIdString) = valueOrElse(isGlobalCaller(i.caller), valueOrElse(isActive(), if ((i.caller != cpmmContract))
223+func stakeUnstake (stake,amount,assetIdString) = valueOrElse(isActive(), if ((i.caller != cpmmContract))
221224 then throw("Only global Contract can invoke this function")
222225 else if ((assetIdString == "WAVES"))
223226 then {
224227 let pool = addressFromStringValue(valueOrErrorMessage(getString(oracle, kLeasingPool), "No leasing pool in oracle"))
225228 let leasingId = getBinary(this, kLeasingId)
226229 let leasingAmount = valueOrElse(getInteger(this, kLeasingAmount), 0)
227230 let newLeaseAmount = if (stake)
228231 then (leasingAmount + amount)
229232 else (leasingAmount - amount)
230233 let newLease = Lease(pool, newLeaseAmount)
231234 let newLeaseId = calculateLeaseId(newLease)
232235 let baseEtry = [newLease, BinaryEntry(kLeasingId, newLeaseId), IntegerEntry(kLeasingAmount, newLeaseAmount)]
233236 match leasingId {
234237 case lId: ByteVector =>
235238 ([LeaseCancel(lId)] ++ baseEtry)
236239 case _ =>
237240 baseEtry
238241 }
239242 }
240243 else {
241- let $t059776080 = calcStakingParams(stake, amount, fromBase58String(assetIdString))
242- let call = $t059776080._1
243- let addr = $t059776080._2
244- let params = $t059776080._3
245- let payments = $t059776080._4
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
246249 let inv = invoke(addr, call, params, payments)
247250 if ((inv == inv))
248251 then nil
249252 else throw("Strict value is not equal to itself.")
250- }))
253+ })
251254
252255
253256
254257 @Callable(i)
255258 func reissueShareToken (amount) = valueOrElse(isGlobalCaller(i.caller), valueOrElse(isActive(), {
256259 let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId))
257260 [Reissue(shareAssetId, amount, true), ScriptTransfer(i.caller, amount, shareAssetId)]
258261 }))
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)
259277
260278
261279 @Verifier(tx)
262280 func verify () = {
263281 let multiSignedByAdmins = {
264282 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
265283 then 1
266284 else 0
267285 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
268286 then 1
269287 else 0
270288 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
271289 then 1
272290 else 0
273291 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
274292 }
275293 multiSignedByAdmins
276294 }
277295

github/deemru/w8io/026f985 
48.17 ms