tx · D2biWyQf9VrsL32KB9iTKx9sCPWYcA114RHun7hZkfzv

3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS:  -0.01000000 Waves

2023.03.24 21:16 [2504445] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves

{ "type": 13, "id": "D2biWyQf9VrsL32KB9iTKx9sCPWYcA114RHun7hZkfzv", "fee": 1000000, "feeAssetId": null, "timestamp": 1679681830563, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "2xyr1HW72UH6VcCrdwEQxuZdoi8u7iUfRyY2KdAtG6XRPDrj12JKPSaPN8Hxt1w87rx46b3ju9qkwTm4wXQdrobD" ], "script": "base64:BgIeCAISBwoFCAEIAQESAwoBCBIDCgEIEgcKBQgIAQEBJgALU0ZfUE9TX1RZUEUCAlNGAAtXWF9QT1NfVFlQRQICV1gABlNDQUxFOACAwtcvAApGRUVfU0NBTEU2AMCEPQAUa1NGUG9vbEFBc3NldEJhbGFuY2UCD0FfYXNzZXRfYmFsYW5jZQAUa1NGUG9vbEJBc3NldEJhbGFuY2UCD0JfYXNzZXRfYmFsYW5jZQAPa1NGUG9vbEFBc3NldElkAgpBX2Fzc2V0X2lkAA9rU0ZQb29sQkFzc2V0SWQCCkJfYXNzZXRfaWQADmtTRlBvb2xTaGFyZUlkAg5zaGFyZV9hc3NldF9pZAAOa1NGUG9vbFZlcnNpb24CB3ZlcnNpb24AEGtTRkZhcm1pbmdTdGFrZWQCFF9zaGFyZV90b2tlbnNfbG9ja2VkAA1rVXNlclBvc2l0aW9uAg5fdXNlcl9wb3NpdGlvbgARa1VzZXJQb3NpdGlvblR5cGUCE191c2VyX3Bvc2l0aW9uX3R5cGUAEGtVc2VyUG9zaXRpb25OdW0CFV91c2VyX3Bvc2l0aW9uX251bWJl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kBC2luaXROZXdQb29sBQR0eXBlCHBvb2xBZGRyC2luRmVlTm9Mb2FuCWluRmVlTG9hbgZjYXBGZWUDAwkBAiE9AgUEdHlwZQULU0ZfUE9TX1RZUEUJAQIhPQIFBHR5cGUFC1dYX1BPU19UWVBFBwkAAgECCldyb25nIHR5cGUJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFFWtBeGx5SW5GZWVXaXRob3V0TG9hbgULaW5GZWVOb0xvYW4JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFEmtBeGx5SW5GZWVXaXRoTG9hbgUJaW5GZWVMb2FuCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBQtrQXhseUNhcEZlZQUGY2FwRmVlCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUFa1Bvb2wFCHBvb2xBZGRyBQR0eXBlBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V53uEfpQ==", "height": 2504445, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JDJUwqzx3X8AZzceH5WkHVYC7py7GgEWMUHWASuwdeaa Next: EYSe4yqpqsKyjx66dkvo7jievyXE2wKAyLtZp4B3AQwx Diff:
OldNewDifferences
106106
107107 func replanishSwopFi (user,pool,withLoan,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId,virtualSwapTokenPay,virtualSwapTokenGet) = {
108108 let shareBalanceBefore = accountBalance(fromBase58String(shareId))
109- let poolAddr = Address(fromBase58String(pool))
110- let ratioA = fraction(SCALE8, pmtA, balA)
111- let ratioB = fraction(SCALE8, pmtB, balB)
112- let $t045444837 = if ((ratioB > ratioA))
113- then {
114- let pmt = fraction(balB, ratioA, SCALE8, CEILING)
115- $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB)
116- }
109+ if ((1 == 1))
110+ then throw(((shareId + "|| ") + toString(shareBalanceBefore)))
117111 else {
118- let pmt = fraction(balA, ratioB, SCALE8, CEILING)
119- $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA)
120- }
121- let pmtAmountA = $t045444837._1
122- let pmtAmountB = $t045444837._2
123- let change = $t045444837._3
124- let changeAssetId = $t045444837._4
125- let poolVersion = getStringValue(poolAddr, "version")
126- let inv1 = if (if ((pmtAmountA > 0))
127- then (pmtAmountB > 0)
128- else false)
129- then {
130- let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)]
131- if ((poolVersion == "1.0.0"))
132- then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments)
133- else if ((poolVersion == "2.0.0"))
134- then invoke(poolAddr, "replenishWithTwoTokensV2", [false, 0], payments)
135- else throw("Wrong pool type")
136- }
137- else 0
138- if ((inv1 == inv1))
139- then {
140- let inv2 = if ((change > 0))
112+ let poolAddr = Address(fromBase58String(pool))
113+ let ratioA = fraction(SCALE8, pmtA, balA)
114+ let ratioB = fraction(SCALE8, pmtB, balB)
115+ let $t046194912 = if ((ratioB > ratioA))
141116 then {
142- let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)]
117+ let pmt = fraction(balB, ratioA, SCALE8, CEILING)
118+ $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB)
119+ }
120+ else {
121+ let pmt = fraction(balA, ratioB, SCALE8, CEILING)
122+ $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA)
123+ }
124+ let pmtAmountA = $t046194912._1
125+ let pmtAmountB = $t046194912._2
126+ let change = $t046194912._3
127+ let changeAssetId = $t046194912._4
128+ let poolVersion = getStringValue(poolAddr, "version")
129+ let inv1 = if (if ((pmtAmountA > 0))
130+ then (pmtAmountB > 0)
131+ else false)
132+ then {
133+ let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)]
143134 if ((poolVersion == "1.0.0"))
144- then {
145- let vars = ["0", "false", "0"]
146- invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments)
147- }
135+ then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments)
148136 else if ((poolVersion == "2.0.0"))
149- then {
150- let vars = [virtualSwapTokenPay, virtualSwapTokenGet, false, 0]
151- invoke(poolAddr, "replenishWithOneTokenV2", [false, 0], payments)
152- }
137+ then invoke(poolAddr, "replenishWithTwoTokensV2", [false, 0], payments)
153138 else throw("Wrong pool type")
154139 }
155140 else 0
156- if ((inv2 == inv2))
141+ if ((inv1 == inv1))
157142 then {
158- let shareBalanceAfter = accountBalance(fromBase58String(shareId))
159- let totalShare = (shareBalanceAfter - shareBalanceBefore)
160- let axlyInFee = fraction(totalShare, (FEE_SCALE6 - getAxlyInFee(pool, withLoan)), FEE_SCALE6)
161- let userShareForStake = (totalShare - axlyInFee)
162- if ((0 >= userShareForStake))
163- then throw("amount of staked sharetokens must be > 0")
164- else {
165- let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)])
166- if ((inv3 == inv3))
143+ let inv2 = if ((change > 0))
144+ then {
145+ let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)]
146+ if ((poolVersion == "1.0.0"))
167147 then {
168- let totalAmount = getAxlyTotalPosition(pool)
169- let newPosNum = getNewUserPositionNumber(pool, user)
148+ let vars = ["0", "false", "0"]
149+ invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments)
150+ }
151+ else if ((poolVersion == "2.0.0"))
152+ then {
153+ let vars = [virtualSwapTokenPay, virtualSwapTokenGet, false, 0]
154+ invoke(poolAddr, "replenishWithOneTokenV2", [false, 0], payments)
155+ }
156+ else throw("Wrong pool type")
157+ }
158+ else 0
159+ if ((inv2 == inv2))
160+ then {
161+ let shareBalanceAfter = accountBalance(fromBase58String(shareId))
162+ let totalShare = (shareBalanceAfter - shareBalanceBefore)
163+ let axlyInFee = fraction(totalShare, (FEE_SCALE6 - getAxlyInFee(pool, withLoan)), FEE_SCALE6)
164+ let userShareForStake = (totalShare - axlyInFee)
165+ if ((0 >= userShareForStake))
166+ then throw("amount of staked sharetokens must be > 0")
167+ else {
168+ let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)])
169+ if ((inv3 == inv3))
170+ then {
171+ let totalAmount = getAxlyTotalPosition(pool)
172+ let newPosNum = getNewUserPositionNumber(pool, user)
170173 [IntegerEntry((pool + kTotalPosition), (totalAmount + userShareForStake)), IntegerEntry((((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition), userShareForStake), StringEntry((((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPositionType), SF_POS_TYPE), IntegerEntry((((pool + "_") + user) + kUserPositionNum), newPosNum), ScriptTransfer(moneyBox, axlyInFee, fromBase58String(shareId))]
174+ }
175+ else throw("Strict value is not equal to itself.")
171176 }
172- else throw("Strict value is not equal to itself.")
173177 }
178+ else throw("Strict value is not equal to itself.")
174179 }
175180 else throw("Strict value is not equal to itself.")
176181 }
177- else throw("Strict value is not equal to itself.")
178182 }
179183
180184
184188 @Callable(i)
185189 func replanish (pool,borrowAmount,borrowAssetId,virtualSwapTokenPay,virtualSwapTokenGet) = {
186190 let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
187- let $t075837834 = if ((type == SF_POS_TYPE))
191+ let $t076587909 = if ((type == SF_POS_TYPE))
188192 then getSFPoolData(Address(fromBase58String(pool)))
189193 else if ((type == WX_POS_TYPE))
190194 then getWXPoolData(Address(fromBase58String(pool)))
191195 else throw("Wrong pool type")
192- let AId = $t075837834._1
193- let BId = $t075837834._2
194- let balA = $t075837834._3
195- let balB = $t075837834._4
196- let shareId = $t075837834._5
197- let $t078388475 = if ((size(i.payments) == 2))
196+ let AId = $t076587909._1
197+ let BId = $t076587909._2
198+ let balA = $t076587909._3
199+ let balB = $t076587909._4
200+ let shareId = $t076587909._5
201+ let $t079138550 = if ((size(i.payments) == 2))
198202 then if ((assetIdToStr(i.payments[0].assetId) != AId))
199203 then throw("Wrong payment asset A")
200204 else if ((assetIdToStr(i.payments[1].assetId) != BId))
207211 then $Tuple4(0, AId, i.payments[0].amount, BId)
208212 else throw("Wrong payment")
209213 else throw("One or two payments expected")
210- let pmtA = $t078388475._1
211- let pmtAssetA = $t078388475._2
212- let pmtB = $t078388475._3
213- let pmtAssetB = $t078388475._4
214+ let pmtA = $t079138550._1
215+ let pmtAssetA = $t079138550._2
216+ let pmtB = $t079138550._3
217+ let pmtAssetB = $t079138550._4
214218 if ((borrowAmount > 0))
215219 then {
216220 let request = makeString([type, toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, toString(virtualSwapTokenPay), toString(virtualSwapTokenGet)], ",")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SF_POS_TYPE = "SF"
55
66 let WX_POS_TYPE = "WX"
77
88 let SCALE8 = 100000000
99
1010 let FEE_SCALE6 = 1000000
1111
1212 let kSFPoolAAssetBalance = "A_asset_balance"
1313
1414 let kSFPoolBAssetBalance = "B_asset_balance"
1515
1616 let kSFPoolAAssetId = "A_asset_id"
1717
1818 let kSFPoolBAssetId = "B_asset_id"
1919
2020 let kSFPoolShareId = "share_asset_id"
2121
2222 let kSFPoolVersion = "version"
2323
2424 let kSFFarmingStaked = "_share_tokens_locked"
2525
2626 let kUserPosition = "_user_position"
2727
2828 let kUserPositionType = "_user_position_type"
2929
3030 let kUserPositionNum = "_user_position_number"
3131
3232 let kTotalPosition = "_total_position"
3333
3434 let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan"
3535
3636 let kAxlyInFeeWithLoan = "_axly_fee_with_loan"
3737
3838 let kAxlyCapFee = "_axly_fee_cap"
3939
4040 let kRequestId = "_request_id"
4141
4242 let kRequestIter = "requests_iter"
4343
4444 let kPool = "pool_"
4545
4646 let kMoneyBox = "axly_money_box"
4747
4848 let kSFFarmingAddr = "swopfi_farming_addr"
4949
5050 let kLendService = "lend_service_addr"
5151
5252 let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address")))
5353
5454 func isSelfCall (i) = if ((i.caller == this))
5555 then unit
5656 else throw("Only contract itself can call this function")
5757
5858
5959 func accountBalance (assetId) = match assetId {
6060 case id: ByteVector =>
6161 assetBalance(this, id)
6262 case waves: Unit =>
6363 wavesBalance(this).available
6464 case _ =>
6565 throw("Match error")
6666 }
6767
6868
6969 func getSFPoolData (poolAddr) = $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance"), valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id"))
7070
7171
7272 func getWXPoolData (poolAddr) = $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance"), valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id"))
7373
7474
7575 func getAxlyTotalPosition (pool) = valueOrElse(getInteger(this, (pool + kTotalPosition)), 0)
7676
7777
7878 func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (((pool + "_") + user) + kUserPositionNum)), 0) + 1)
7979
8080
8181 func getAxlyInFee (pool,withLoan) = if (withLoan)
8282 then getIntegerValue(this, (pool + kAxlyInFeeWithLoan))
8383 else getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan))
8484
8585
8686 func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr")))
8787
8888
8989 func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr")))
9090
9191
9292 func assetIdToStr (assetId) = match assetId {
9393 case id: ByteVector =>
9494 toBase58String(id)
9595 case waves: Unit =>
9696 "WAVES"
9797 case _ =>
9898 throw("Match error")
9999 }
100100
101101
102102 func assetIdFromStr (assetId) = if ((assetId == "WAVES"))
103103 then unit
104104 else fromBase58String(assetId)
105105
106106
107107 func replanishSwopFi (user,pool,withLoan,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId,virtualSwapTokenPay,virtualSwapTokenGet) = {
108108 let shareBalanceBefore = accountBalance(fromBase58String(shareId))
109- let poolAddr = Address(fromBase58String(pool))
110- let ratioA = fraction(SCALE8, pmtA, balA)
111- let ratioB = fraction(SCALE8, pmtB, balB)
112- let $t045444837 = if ((ratioB > ratioA))
113- then {
114- let pmt = fraction(balB, ratioA, SCALE8, CEILING)
115- $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB)
116- }
109+ if ((1 == 1))
110+ then throw(((shareId + "|| ") + toString(shareBalanceBefore)))
117111 else {
118- let pmt = fraction(balA, ratioB, SCALE8, CEILING)
119- $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA)
120- }
121- let pmtAmountA = $t045444837._1
122- let pmtAmountB = $t045444837._2
123- let change = $t045444837._3
124- let changeAssetId = $t045444837._4
125- let poolVersion = getStringValue(poolAddr, "version")
126- let inv1 = if (if ((pmtAmountA > 0))
127- then (pmtAmountB > 0)
128- else false)
129- then {
130- let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)]
131- if ((poolVersion == "1.0.0"))
132- then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments)
133- else if ((poolVersion == "2.0.0"))
134- then invoke(poolAddr, "replenishWithTwoTokensV2", [false, 0], payments)
135- else throw("Wrong pool type")
136- }
137- else 0
138- if ((inv1 == inv1))
139- then {
140- let inv2 = if ((change > 0))
112+ let poolAddr = Address(fromBase58String(pool))
113+ let ratioA = fraction(SCALE8, pmtA, balA)
114+ let ratioB = fraction(SCALE8, pmtB, balB)
115+ let $t046194912 = if ((ratioB > ratioA))
141116 then {
142- let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)]
117+ let pmt = fraction(balB, ratioA, SCALE8, CEILING)
118+ $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB)
119+ }
120+ else {
121+ let pmt = fraction(balA, ratioB, SCALE8, CEILING)
122+ $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA)
123+ }
124+ let pmtAmountA = $t046194912._1
125+ let pmtAmountB = $t046194912._2
126+ let change = $t046194912._3
127+ let changeAssetId = $t046194912._4
128+ let poolVersion = getStringValue(poolAddr, "version")
129+ let inv1 = if (if ((pmtAmountA > 0))
130+ then (pmtAmountB > 0)
131+ else false)
132+ then {
133+ let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)]
143134 if ((poolVersion == "1.0.0"))
144- then {
145- let vars = ["0", "false", "0"]
146- invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments)
147- }
135+ then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments)
148136 else if ((poolVersion == "2.0.0"))
149- then {
150- let vars = [virtualSwapTokenPay, virtualSwapTokenGet, false, 0]
151- invoke(poolAddr, "replenishWithOneTokenV2", [false, 0], payments)
152- }
137+ then invoke(poolAddr, "replenishWithTwoTokensV2", [false, 0], payments)
153138 else throw("Wrong pool type")
154139 }
155140 else 0
156- if ((inv2 == inv2))
141+ if ((inv1 == inv1))
157142 then {
158- let shareBalanceAfter = accountBalance(fromBase58String(shareId))
159- let totalShare = (shareBalanceAfter - shareBalanceBefore)
160- let axlyInFee = fraction(totalShare, (FEE_SCALE6 - getAxlyInFee(pool, withLoan)), FEE_SCALE6)
161- let userShareForStake = (totalShare - axlyInFee)
162- if ((0 >= userShareForStake))
163- then throw("amount of staked sharetokens must be > 0")
164- else {
165- let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)])
166- if ((inv3 == inv3))
143+ let inv2 = if ((change > 0))
144+ then {
145+ let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)]
146+ if ((poolVersion == "1.0.0"))
167147 then {
168- let totalAmount = getAxlyTotalPosition(pool)
169- let newPosNum = getNewUserPositionNumber(pool, user)
148+ let vars = ["0", "false", "0"]
149+ invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments)
150+ }
151+ else if ((poolVersion == "2.0.0"))
152+ then {
153+ let vars = [virtualSwapTokenPay, virtualSwapTokenGet, false, 0]
154+ invoke(poolAddr, "replenishWithOneTokenV2", [false, 0], payments)
155+ }
156+ else throw("Wrong pool type")
157+ }
158+ else 0
159+ if ((inv2 == inv2))
160+ then {
161+ let shareBalanceAfter = accountBalance(fromBase58String(shareId))
162+ let totalShare = (shareBalanceAfter - shareBalanceBefore)
163+ let axlyInFee = fraction(totalShare, (FEE_SCALE6 - getAxlyInFee(pool, withLoan)), FEE_SCALE6)
164+ let userShareForStake = (totalShare - axlyInFee)
165+ if ((0 >= userShareForStake))
166+ then throw("amount of staked sharetokens must be > 0")
167+ else {
168+ let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)])
169+ if ((inv3 == inv3))
170+ then {
171+ let totalAmount = getAxlyTotalPosition(pool)
172+ let newPosNum = getNewUserPositionNumber(pool, user)
170173 [IntegerEntry((pool + kTotalPosition), (totalAmount + userShareForStake)), IntegerEntry((((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition), userShareForStake), StringEntry((((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPositionType), SF_POS_TYPE), IntegerEntry((((pool + "_") + user) + kUserPositionNum), newPosNum), ScriptTransfer(moneyBox, axlyInFee, fromBase58String(shareId))]
174+ }
175+ else throw("Strict value is not equal to itself.")
171176 }
172- else throw("Strict value is not equal to itself.")
173177 }
178+ else throw("Strict value is not equal to itself.")
174179 }
175180 else throw("Strict value is not equal to itself.")
176181 }
177- else throw("Strict value is not equal to itself.")
178182 }
179183
180184
181185 func replanishWX (user,pool,withLoan,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId,virtualSwapTokenPay,virtualSwapTokenGet) = nil
182186
183187
184188 @Callable(i)
185189 func replanish (pool,borrowAmount,borrowAssetId,virtualSwapTokenPay,virtualSwapTokenGet) = {
186190 let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited")
187- let $t075837834 = if ((type == SF_POS_TYPE))
191+ let $t076587909 = if ((type == SF_POS_TYPE))
188192 then getSFPoolData(Address(fromBase58String(pool)))
189193 else if ((type == WX_POS_TYPE))
190194 then getWXPoolData(Address(fromBase58String(pool)))
191195 else throw("Wrong pool type")
192- let AId = $t075837834._1
193- let BId = $t075837834._2
194- let balA = $t075837834._3
195- let balB = $t075837834._4
196- let shareId = $t075837834._5
197- let $t078388475 = if ((size(i.payments) == 2))
196+ let AId = $t076587909._1
197+ let BId = $t076587909._2
198+ let balA = $t076587909._3
199+ let balB = $t076587909._4
200+ let shareId = $t076587909._5
201+ let $t079138550 = if ((size(i.payments) == 2))
198202 then if ((assetIdToStr(i.payments[0].assetId) != AId))
199203 then throw("Wrong payment asset A")
200204 else if ((assetIdToStr(i.payments[1].assetId) != BId))
201205 then throw("Wrong payment asset B")
202206 else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId)
203207 else if ((size(i.payments) == 1))
204208 then if ((assetIdToStr(i.payments[0].assetId) == AId))
205209 then $Tuple4(i.payments[0].amount, AId, 0, BId)
206210 else if ((assetIdToStr(i.payments[0].assetId) == BId))
207211 then $Tuple4(0, AId, i.payments[0].amount, BId)
208212 else throw("Wrong payment")
209213 else throw("One or two payments expected")
210- let pmtA = $t078388475._1
211- let pmtAssetA = $t078388475._2
212- let pmtB = $t078388475._3
213- let pmtAssetB = $t078388475._4
214+ let pmtA = $t079138550._1
215+ let pmtAssetA = $t079138550._2
216+ let pmtB = $t079138550._3
217+ let pmtAssetB = $t079138550._4
214218 if ((borrowAmount > 0))
215219 then {
216220 let request = makeString([type, toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, toString(virtualSwapTokenPay), toString(virtualSwapTokenGet)], ",")
217221 let newRequestId = {
218222 let @ = invoke(this, "createNewRequest", [request], nil)
219223 if ($isInstanceOf(@, "Int"))
220224 then @
221225 else unit
222226 }
223227 if ((newRequestId == newRequestId))
224228 then {
225229 let args = [toString(i.caller), shareId, borrowAssetId, borrowAmount, toString(this), "replanishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))]
226230 let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil)
227231 nil
228232 }
229233 else throw("Strict value is not equal to itself.")
230234 }
231235 else if ((type == SF_POS_TYPE))
232236 then replanishSwopFi(toString(i.caller), pool, false, pmtA, pmtAssetA, pmtB, pmtAssetB, balA, balB, shareId, virtualSwapTokenPay, virtualSwapTokenGet)
233237 else throw("Cant wx")
234238 }
235239
236240
237241
238242 @Callable(i)
239243 func replanishFromLand (requestId) = {
240244 let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",")
241245 if ((request[0] == SF_POS_TYPE))
242246 then replanishSwopFi(request[1], request[2], true, parseIntValue(request[3]), request[4], parseIntValue(request[5]), request[6], parseIntValue(request[7]), parseIntValue(request[8]), request[9], parseIntValue(request[10]), parseIntValue(request[11]))
243247 else throw("Cant wx")
244248 }
245249
246250
247251
248252 @Callable(i)
249253 func createNewRequest (params) = valueOrElse(isSelfCall(i), {
250254 let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1)
251255 $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params)], newRequestId)
252256 })
253257
254258
255259
256260 @Callable(i)
257261 func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_POS_TYPE))
258262 then (type != WX_POS_TYPE)
259263 else false)
260264 then throw("Wrong type")
261265 else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), StringEntry((kPool + poolAddr), type)]
262266
263267
264268 @Verifier(tx)
265269 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
266270

github/deemru/w8io/026f985 
61.43 ms