tx · 3EkWVLxCyv7nZ5cY3GPJsqTUodzdYsD61AY3FN76aeZc

3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq:  -0.01200000 Waves

2024.03.09 14:25 [3010438] smart account 3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq > SELF 0.00000000 Waves

{ "type": 13, "id": "3EkWVLxCyv7nZ5cY3GPJsqTUodzdYsD61AY3FN76aeZc", "fee": 1200000, "feeAssetId": null, "timestamp": 1709983548705, "version": 2, "chainId": 84, "sender": "3N61RYWc9QuqKUwLvowpZZLpgUnqpQSFwLq", "senderPublicKey": "HdwFH8HPYu3HG27yK6bszu1CdR4uik4HgzyTimeSfcYf", "proofs": [ "5t7ni53pLRAwmmuJ3QyEva3A8qVQyZicQvdDJjycADLxAcb9NjtC5yBf9EPiLVfvuvDUhhBHDfMS3m9N46ExXNA7" ], "script": "base64:BgITCAISABIDCgEBEgMKAQgSAwoBBBIAEGFtb3VudEFzc2V0SWRLZXkCDWFtb3VudEFzc2V0SWQAD3ByaWNlQXNzZXRJZEtleQIMcHJpY2VBc3NldElkAApmZWVSYXRlS2V5AgdmZWVSYXRlAAxmb3JjZVN0b3BLZXkCCWZvcmNlU3RvcAEKZ2V0QXNzZXRJZAENYXNzZXRJZFN0cmluZwMJAAACBQ1hc3NldElkU3RyaW5nAgVXQVZFUwUEdW5pdAkA2QQBBQ1hc3NldElkU3RyaW5nAQ9nZXRBc3NldEJhbGFuY2UBB2Fzc2V0SWQEByRtYXRjaDAFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCaWQFByRtYXRjaDAJAPAHAgUEdGhpcwUCaWQICQDvBwEFBHRoaXMJYXZhaWxhYmxlABNhbW91bnRBc3NldElkU3RyaW5nCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzBRBhbW91bnRBc3NldElkS2V5AA1hbW91bnRBc3NldElkCQEKZ2V0QXNzZXRJZAEFE2Ftb3VudEFzc2V0SWRTdHJp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IkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAEsw0ho=", "height": 3010438, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HhD2BVD5Nrzp9NkMnioivX7qSq4THeTBajYR1mXwDVQZ Next: none Diff:
OldNewDifferences
66 let priceAssetIdKey = "priceAssetId"
77
88 let feeRateKey = "feeRate"
9+
10+let forceStopKey = "forceStop"
911
1012 func getAssetId (assetIdString) = if ((assetIdString == "WAVES"))
1113 then unit
3234
3335 let feeRate = valueOrElse(getInteger(this, feeRateKey), 200000)
3436
37+let isForceStopped = valueOrElse(getBoolean(this, forceStopKey), false)
38+
3539 func calcPrice () = fraction(getAssetBalance(priceAssetId), SCALE8, getAssetBalance(amountAssetId))
3640
3741
38-func calcRawSendAmount (initAmBal,initPrBal,paymentAmount) = {
39- let newPrBal = (initPrBal + paymentAmount)
40- let newAmBal = fraction(initAmBal, initPrBal, newPrBal)
41- let sendAmount = (initAmBal - newAmBal)
42+func calcRawSendAmount (asset1InitBalance,asset2InitBalance,asset2PaymentAmount) = {
43+ let newAsset2Balance = (asset2InitBalance + asset2PaymentAmount)
44+ let newAsset1Balance = fraction(asset1InitBalance, asset2InitBalance, newAsset2Balance)
45+ let sendAmount = (asset1InitBalance - newAsset1Balance)
4246 sendAmount
4347 }
4448
4549
4650 func calcSendAmount (paymentAssetId,paymentAmount,readonly) = {
47- let $t013571509 = if ((paymentAssetId == amountAssetId))
51+ let $t015551715 = if ((paymentAssetId == amountAssetId))
4852 then $Tuple2(priceAssetId, amountAssetId)
4953 else $Tuple2(amountAssetId, priceAssetId)
50- let amAssetId = $t013571509._1
51- let prAssetId = $t013571509._2
52- let initAmBal = getAssetBalance(amAssetId)
53- let initPrBal = (getAssetBalance(prAssetId) - (if (readonly)
54+ let asset1AssetId = $t015551715._1
55+ let asset2AssetId = $t015551715._2
56+ let asset1InitBalance = getAssetBalance(asset1AssetId)
57+ let asset2InitBalance = (getAssetBalance(asset2AssetId) - (if (readonly)
5458 then 0
5559 else paymentAmount))
56- let rawSendAmount = calcRawSendAmount(initAmBal, initPrBal, paymentAmount)
60+ let rawSendAmount = calcRawSendAmount(asset1InitBalance, asset2InitBalance, paymentAmount)
5761 let feeAmount = fraction(rawSendAmount, feeRate, SCALE8)
5862 let sendAmount = (rawSendAmount - feeAmount)
5963 let userRealPrice = if ((paymentAssetId == amountAssetId))
6064 then fraction(sendAmount, SCALE8, paymentAmount)
6165 else fraction(paymentAmount, SCALE8, sendAmount)
62- $Tuple4(sendAmount, feeAmount, amAssetId, userRealPrice)
66+ $Tuple4(sendAmount, feeAmount, asset1AssetId, userRealPrice)
6367 }
6468
6569
6670 func swapInternal (address,i) = {
67- let checks = [if ((size(i.payments) > 0))
71+ let checks = [if (!(isForceStopped))
72+ then true
73+ else throw("contract is temporary stopped"), if ((size(i.payments) > 0))
6874 then true
6975 else throw("should be with 1 payment"), if (containsElement([amountAssetId, priceAssetId], i.payments[0].assetId))
7076 then true
7379 then {
7480 let paymentAssetId = i.payments[0].assetId
7581 let paymentAmount = i.payments[0].amount
76- let $t025142624 = calcSendAmount(paymentAssetId, paymentAmount, false)
77- let sendAmount = $t025142624._1
78- let feeAmount = $t025142624._2
79- let sendAssetId = $t025142624._3
80- let userRealPrice = $t025142624._4
82+ let $t028322942 = calcSendAmount(paymentAssetId, paymentAmount, false)
83+ let sendAmount = $t028322942._1
84+ let feeAmount = $t028322942._2
85+ let sendAssetId = $t028322942._3
86+ let userRealPrice = $t028322942._4
8187 let sendActions = if ((feeAmount > 0))
8288 then [ScriptTransfer(address, sendAmount, sendAssetId)]
8389 else throw("amount is too low")
8894
8995
9096 func calcSendAmountREADONLY (paymentAssetString,paymentAmount) = {
91- let $t029563080 = calcSendAmount(getAssetId(paymentAssetString), paymentAmount, true)
92- let sendAmount = $t029563080._1
93- let feeAmount = $t029563080._2
94- let amAssetId = $t029563080._3
95- let userRealPrice = $t029563080._4
97+ let $t032743398 = calcSendAmount(getAssetId(paymentAssetString), paymentAmount, true)
98+ let sendAmount = $t032743398._1
99+ let feeAmount = $t032743398._2
100+ let amAssetId = $t032743398._3
101+ let userRealPrice = $t032743398._4
96102 $Tuple3(sendAmount, userRealPrice, amAssetId)
97103 }
98104
104110
105111 @Callable(i)
106112 func swapNoLess (minAmount) = {
107- let $t032623314 = swapInternal(i.caller, i)
108- let sendActions = $t032623314._1
109- let tuple = $t032623314._2
110- let $t033193382 = tuple
111- let sendAmount = $t033193382._1
112- let feeAmount = $t033193382._2
113- let sendAssetId = $t033193382._3
114- let userRealPrice = $t033193382._4
113+ let $t035803632 = swapInternal(i.caller, i)
114+ let sendActions = $t035803632._1
115+ let tuple = $t035803632._2
116+ let $t036373700 = tuple
117+ let sendAmount = $t036373700._1
118+ let feeAmount = $t036373700._2
119+ let sendAssetId = $t036373700._3
120+ let userRealPrice = $t036373700._4
115121 if ((minAmount > sendAmount))
116122 then throw(makeString(["Price slipped. minAmount: ", toString(minAmount), " swapAmount: ", toString(sendAmount)], ""))
117123 else $Tuple2(sendActions, tuple)
123129 func swapFor (address) = swapInternal(addressFromStringValue(address), i)
124130
125131
132+
133+@Callable(i)
134+func forceStop (stopFlag) = {
135+ let checks = [if ((i.caller == this))
136+ then true
137+ else throw("permission denied")]
138+ if ((checks == checks))
139+ then [BooleanEntry(forceStopKey, stopFlag)]
140+ else throw("Strict value is not equal to itself.")
141+ }
142+
143+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let amountAssetIdKey = "amountAssetId"
55
66 let priceAssetIdKey = "priceAssetId"
77
88 let feeRateKey = "feeRate"
9+
10+let forceStopKey = "forceStop"
911
1012 func getAssetId (assetIdString) = if ((assetIdString == "WAVES"))
1113 then unit
1214 else fromBase58String(assetIdString)
1315
1416
1517 func getAssetBalance (assetId) = match assetId {
1618 case id: ByteVector =>
1719 assetBalance(this, id)
1820 case _ =>
1921 wavesBalance(this).available
2022 }
2123
2224
2325 let amountAssetIdString = getStringValue(this, amountAssetIdKey)
2426
2527 let amountAssetId = getAssetId(amountAssetIdString)
2628
2729 let priceAssetIdString = getStringValue(this, priceAssetIdKey)
2830
2931 let priceAssetId = getAssetId(priceAssetIdString)
3032
3133 let SCALE8 = 100000000
3234
3335 let feeRate = valueOrElse(getInteger(this, feeRateKey), 200000)
3436
37+let isForceStopped = valueOrElse(getBoolean(this, forceStopKey), false)
38+
3539 func calcPrice () = fraction(getAssetBalance(priceAssetId), SCALE8, getAssetBalance(amountAssetId))
3640
3741
38-func calcRawSendAmount (initAmBal,initPrBal,paymentAmount) = {
39- let newPrBal = (initPrBal + paymentAmount)
40- let newAmBal = fraction(initAmBal, initPrBal, newPrBal)
41- let sendAmount = (initAmBal - newAmBal)
42+func calcRawSendAmount (asset1InitBalance,asset2InitBalance,asset2PaymentAmount) = {
43+ let newAsset2Balance = (asset2InitBalance + asset2PaymentAmount)
44+ let newAsset1Balance = fraction(asset1InitBalance, asset2InitBalance, newAsset2Balance)
45+ let sendAmount = (asset1InitBalance - newAsset1Balance)
4246 sendAmount
4347 }
4448
4549
4650 func calcSendAmount (paymentAssetId,paymentAmount,readonly) = {
47- let $t013571509 = if ((paymentAssetId == amountAssetId))
51+ let $t015551715 = if ((paymentAssetId == amountAssetId))
4852 then $Tuple2(priceAssetId, amountAssetId)
4953 else $Tuple2(amountAssetId, priceAssetId)
50- let amAssetId = $t013571509._1
51- let prAssetId = $t013571509._2
52- let initAmBal = getAssetBalance(amAssetId)
53- let initPrBal = (getAssetBalance(prAssetId) - (if (readonly)
54+ let asset1AssetId = $t015551715._1
55+ let asset2AssetId = $t015551715._2
56+ let asset1InitBalance = getAssetBalance(asset1AssetId)
57+ let asset2InitBalance = (getAssetBalance(asset2AssetId) - (if (readonly)
5458 then 0
5559 else paymentAmount))
56- let rawSendAmount = calcRawSendAmount(initAmBal, initPrBal, paymentAmount)
60+ let rawSendAmount = calcRawSendAmount(asset1InitBalance, asset2InitBalance, paymentAmount)
5761 let feeAmount = fraction(rawSendAmount, feeRate, SCALE8)
5862 let sendAmount = (rawSendAmount - feeAmount)
5963 let userRealPrice = if ((paymentAssetId == amountAssetId))
6064 then fraction(sendAmount, SCALE8, paymentAmount)
6165 else fraction(paymentAmount, SCALE8, sendAmount)
62- $Tuple4(sendAmount, feeAmount, amAssetId, userRealPrice)
66+ $Tuple4(sendAmount, feeAmount, asset1AssetId, userRealPrice)
6367 }
6468
6569
6670 func swapInternal (address,i) = {
67- let checks = [if ((size(i.payments) > 0))
71+ let checks = [if (!(isForceStopped))
72+ then true
73+ else throw("contract is temporary stopped"), if ((size(i.payments) > 0))
6874 then true
6975 else throw("should be with 1 payment"), if (containsElement([amountAssetId, priceAssetId], i.payments[0].assetId))
7076 then true
7177 else throw(makeString(["payment assetId should be", amountAssetIdString, "or", priceAssetIdString], " "))]
7278 if ((checks == checks))
7379 then {
7480 let paymentAssetId = i.payments[0].assetId
7581 let paymentAmount = i.payments[0].amount
76- let $t025142624 = calcSendAmount(paymentAssetId, paymentAmount, false)
77- let sendAmount = $t025142624._1
78- let feeAmount = $t025142624._2
79- let sendAssetId = $t025142624._3
80- let userRealPrice = $t025142624._4
82+ let $t028322942 = calcSendAmount(paymentAssetId, paymentAmount, false)
83+ let sendAmount = $t028322942._1
84+ let feeAmount = $t028322942._2
85+ let sendAssetId = $t028322942._3
86+ let userRealPrice = $t028322942._4
8187 let sendActions = if ((feeAmount > 0))
8288 then [ScriptTransfer(address, sendAmount, sendAssetId)]
8389 else throw("amount is too low")
8490 $Tuple2(sendActions, $Tuple4(sendAmount, feeAmount, sendAssetId, userRealPrice))
8591 }
8692 else throw("Strict value is not equal to itself.")
8793 }
8894
8995
9096 func calcSendAmountREADONLY (paymentAssetString,paymentAmount) = {
91- let $t029563080 = calcSendAmount(getAssetId(paymentAssetString), paymentAmount, true)
92- let sendAmount = $t029563080._1
93- let feeAmount = $t029563080._2
94- let amAssetId = $t029563080._3
95- let userRealPrice = $t029563080._4
97+ let $t032743398 = calcSendAmount(getAssetId(paymentAssetString), paymentAmount, true)
98+ let sendAmount = $t032743398._1
99+ let feeAmount = $t032743398._2
100+ let amAssetId = $t032743398._3
101+ let userRealPrice = $t032743398._4
96102 $Tuple3(sendAmount, userRealPrice, amAssetId)
97103 }
98104
99105
100106 @Callable(i)
101107 func swap () = swapInternal(i.caller, i)
102108
103109
104110
105111 @Callable(i)
106112 func swapNoLess (minAmount) = {
107- let $t032623314 = swapInternal(i.caller, i)
108- let sendActions = $t032623314._1
109- let tuple = $t032623314._2
110- let $t033193382 = tuple
111- let sendAmount = $t033193382._1
112- let feeAmount = $t033193382._2
113- let sendAssetId = $t033193382._3
114- let userRealPrice = $t033193382._4
113+ let $t035803632 = swapInternal(i.caller, i)
114+ let sendActions = $t035803632._1
115+ let tuple = $t035803632._2
116+ let $t036373700 = tuple
117+ let sendAmount = $t036373700._1
118+ let feeAmount = $t036373700._2
119+ let sendAssetId = $t036373700._3
120+ let userRealPrice = $t036373700._4
115121 if ((minAmount > sendAmount))
116122 then throw(makeString(["Price slipped. minAmount: ", toString(minAmount), " swapAmount: ", toString(sendAmount)], ""))
117123 else $Tuple2(sendActions, tuple)
118124 }
119125
120126
121127
122128 @Callable(i)
123129 func swapFor (address) = swapInternal(addressFromStringValue(address), i)
124130
125131
132+
133+@Callable(i)
134+func forceStop (stopFlag) = {
135+ let checks = [if ((i.caller == this))
136+ then true
137+ else throw("permission denied")]
138+ if ((checks == checks))
139+ then [BooleanEntry(forceStopKey, stopFlag)]
140+ else throw("Strict value is not equal to itself.")
141+ }
142+
143+

github/deemru/w8io/026f985 
41.04 ms