tx · 46drfk4cqfd98yHBmxgEe9oJDMQ4by34r7Nw4bgQoGFp 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.01000000 Waves 2023.03.27 09:23 [2508016] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "46drfk4cqfd98yHBmxgEe9oJDMQ4by34r7Nw4bgQoGFp", "fee": 1000000, "feeAssetId": null, "timestamp": 1679898248829, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "4rprVXH3dVrmy28E2ncL7t3D4PYA88eKTPKRGVmvmNhoNL23cx8cy4UQMgDP3z2dzjjPr82BysKSSn5x6vF8g4MD" ], "script": "base64:BgIeCAISBwoFCAEIAQESAwoBCBIDCgEIEgcKBQgIAQEBJgALU0ZfUE9TX1RZUEUCAlNGAAtXWF9QT1NfVFlQRQICV1gABlNDQUxFOACAwtcvAApGRUVfU0NBTEU2AMCEPQAUa1NGUG9vbEFBc3NldEJhbGFuY2UCD0FfYXNzZXRfYmFsYW5jZQAUa1NGUG9vbEJBc3NldEJhbGFuY2UCD0JfYXNzZXRfYmFsYW5jZQAPa1NGUG9vbEFBc3NldElkAgpBX2Fzc2V0X2lkAA9rU0ZQb29sQkFzc2V0SWQCCkJfYXNzZXRfaWQADmtTRlBvb2xTaGFyZUlkAg5zaGFyZV9hc3NldF9pZAAOa1NGUG9vbFZlcnNpb24CB3ZlcnNpb24AEGtTRkZhcm1pbmdTdGFrZWQCFF9zaGFyZV90b2tlbnNfbG9ja2VkAA1rVXNlclBvc2l0aW9uAg5fdXNlcl9wb3NpdGlvbgARa1VzZXJQb3NpdGlvblR5cGUCE191c2VyX3Bvc2l0aW9uX3R5cGUAEGtVc2VyUG9zaXRpb25OdW0CFV91c2VyX3Bvc2l0aW9uX251bW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gUEdHlwZQULU0ZfUE9TX1RZUEUJAQIhPQIFBHR5cGUFC1dYX1BPU19UWVBFBwkAAgECCldyb25nIHR5cGUJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFFWtBeGx5SW5GZWVXaXRob3V0TG9hbgULaW5GZWVOb0xvYW4JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFEmtBeGx5SW5GZWVXaXRoTG9hbgUJaW5GZWVMb2FuCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBQtrQXhseUNhcEZlZQUGY2FwRmVlCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUFa1Bvb2wFCHBvb2xBZGRyBQR0eXBlBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5hcXtMw==", "height": 2508016, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CvYbWqgLQ9FqJyFAk6qVaywZnTpKcQwj9YfPt6vpmfpk Next: GDKW3UDDBE6382rTSZo4yK5ZTPhWHDHpKEdvS7t8516c Diff:
Old | New | Differences | |
---|---|---|---|
169 | 169 | then { | |
170 | 170 | let totalAmount = getAxlyTotalPosition(pool) | |
171 | 171 | let newPosNum = getNewUserPositionNumber(pool, user) | |
172 | - | [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))] | |
172 | + | $Tuple2([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))], userShareForStake) | |
173 | 173 | } | |
174 | 174 | else throw("Strict value is not equal to itself.") | |
175 | 175 | } | |
188 | 188 | @Callable(i) | |
189 | 189 | func replanish (pool,borrowAmount,borrowAssetId,virtualSwapTokenPay,virtualSwapTokenGet) = { | |
190 | 190 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
191 | - | let $ | |
191 | + | let $t075947845 = if ((type == SF_POS_TYPE)) | |
192 | 192 | then getSFPoolData(Address(fromBase58String(pool))) | |
193 | 193 | else if ((type == WX_POS_TYPE)) | |
194 | 194 | then getWXPoolData(Address(fromBase58String(pool))) | |
195 | 195 | else throw("Wrong pool type") | |
196 | - | let AId = $ | |
197 | - | let BId = $ | |
198 | - | let balA = $ | |
199 | - | let balB = $ | |
200 | - | let shareId = $ | |
201 | - | let $ | |
196 | + | let AId = $t075947845._1 | |
197 | + | let BId = $t075947845._2 | |
198 | + | let balA = $t075947845._3 | |
199 | + | let balB = $t075947845._4 | |
200 | + | let shareId = $t075947845._5 | |
201 | + | let $t078498486 = if ((size(i.payments) == 2)) | |
202 | 202 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
203 | 203 | then throw("Wrong payment asset A") | |
204 | 204 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
211 | 211 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
212 | 212 | else throw("Wrong payment") | |
213 | 213 | else throw("One or two payments expected") | |
214 | - | let pmtA = $ | |
215 | - | let pmtAssetA = $ | |
216 | - | let pmtB = $ | |
217 | - | let pmtAssetB = $ | |
214 | + | let pmtA = $t078498486._1 | |
215 | + | let pmtAssetA = $t078498486._2 | |
216 | + | let pmtB = $t078498486._3 | |
217 | + | let pmtAssetB = $t078498486._4 | |
218 | 218 | if ((borrowAmount > 0)) | |
219 | 219 | then { | |
220 | 220 | let request = makeString([type, toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, toString(virtualSwapTokenPay), toString(virtualSwapTokenGet), borrowAssetId, toString(borrowAmount)], ",") | |
256 | 256 | then (parseIntValue(request[5]) + i.payments[0].amount) | |
257 | 257 | else parseIntValue(request[3]) | |
258 | 258 | if ((request[0] == SF_POS_TYPE)) | |
259 | - | then (replanishSwopFi(request[1], request[2], true, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), request[9], parseIntValue(request[10]), parseIntValue(request[11])) :+ DeleteEntry((requestId + kRequestId))) | |
259 | + | then { | |
260 | + | let $t01070711133 = replanishSwopFi(request[1], request[2], true, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), request[9], parseIntValue(request[10]), parseIntValue(request[11])) | |
261 | + | let entries = $t01070711133._1 | |
262 | + | let lpAmount = $t01070711133._2 | |
263 | + | $Tuple2((entries :+ DeleteEntry((requestId + kRequestId))), lpAmount) | |
264 | + | } | |
260 | 265 | else throw("Cant wx") | |
261 | 266 | } | |
262 | 267 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SF_POS_TYPE = "SF" | |
5 | 5 | ||
6 | 6 | let WX_POS_TYPE = "WX" | |
7 | 7 | ||
8 | 8 | let SCALE8 = 100000000 | |
9 | 9 | ||
10 | 10 | let FEE_SCALE6 = 1000000 | |
11 | 11 | ||
12 | 12 | let kSFPoolAAssetBalance = "A_asset_balance" | |
13 | 13 | ||
14 | 14 | let kSFPoolBAssetBalance = "B_asset_balance" | |
15 | 15 | ||
16 | 16 | let kSFPoolAAssetId = "A_asset_id" | |
17 | 17 | ||
18 | 18 | let kSFPoolBAssetId = "B_asset_id" | |
19 | 19 | ||
20 | 20 | let kSFPoolShareId = "share_asset_id" | |
21 | 21 | ||
22 | 22 | let kSFPoolVersion = "version" | |
23 | 23 | ||
24 | 24 | let kSFFarmingStaked = "_share_tokens_locked" | |
25 | 25 | ||
26 | 26 | let kUserPosition = "_user_position" | |
27 | 27 | ||
28 | 28 | let kUserPositionType = "_user_position_type" | |
29 | 29 | ||
30 | 30 | let kUserPositionNum = "_user_position_number" | |
31 | 31 | ||
32 | 32 | let kTotalPosition = "_total_position" | |
33 | 33 | ||
34 | 34 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
35 | 35 | ||
36 | 36 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
37 | 37 | ||
38 | 38 | let kAxlyCapFee = "_axly_fee_cap" | |
39 | 39 | ||
40 | 40 | let kRequestId = "_request_id" | |
41 | 41 | ||
42 | 42 | let kRequestIter = "requests_iter" | |
43 | 43 | ||
44 | 44 | let kPool = "pool_" | |
45 | 45 | ||
46 | 46 | let kMoneyBox = "axly_money_box" | |
47 | 47 | ||
48 | 48 | let kSFFarmingAddr = "swopfi_farming_addr" | |
49 | 49 | ||
50 | 50 | let kLendService = "lend_service_addr" | |
51 | 51 | ||
52 | 52 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
53 | 53 | ||
54 | 54 | func isSelfCall (i) = if ((i.caller == this)) | |
55 | 55 | then unit | |
56 | 56 | else throw("Only contract itself can call this function") | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func accountBalance (assetId) = match assetId { | |
60 | 60 | case id: ByteVector => | |
61 | 61 | assetBalance(this, id) | |
62 | 62 | case waves: Unit => | |
63 | 63 | wavesBalance(this).available | |
64 | 64 | case _ => | |
65 | 65 | throw("Match error") | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | 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")) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | 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")) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getAxlyTotalPosition (pool) = valueOrElse(getInteger(this, (pool + kTotalPosition)), 0) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (((pool + "_") + user) + kUserPositionNum)), 0) + 1) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func getAxlyInFee (pool,withLoan) = if (withLoan) | |
82 | 82 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
83 | 83 | else getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func assetIdToStr (assetId) = match assetId { | |
93 | 93 | case id: ByteVector => | |
94 | 94 | toBase58String(id) | |
95 | 95 | case waves: Unit => | |
96 | 96 | "WAVES" | |
97 | 97 | case _ => | |
98 | 98 | throw("Match error") | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
103 | 103 | then unit | |
104 | 104 | else fromBase58String(assetId) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func replanishSwopFi (user,pool,withLoan,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId,virtualSwapTokenPay,virtualSwapTokenGet) = { | |
108 | 108 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
109 | 109 | if ((shareBalanceBefore == shareBalanceBefore)) | |
110 | 110 | then { | |
111 | 111 | let poolAddr = Address(fromBase58String(pool)) | |
112 | 112 | let ratioA = fraction(SCALE8, pmtA, balA) | |
113 | 113 | let ratioB = fraction(SCALE8, pmtB, balB) | |
114 | 114 | let $t045474840 = if ((ratioB > ratioA)) | |
115 | 115 | then { | |
116 | 116 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
117 | 117 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
118 | 118 | } | |
119 | 119 | else { | |
120 | 120 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
121 | 121 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
122 | 122 | } | |
123 | 123 | let pmtAmountA = $t045474840._1 | |
124 | 124 | let pmtAmountB = $t045474840._2 | |
125 | 125 | let change = $t045474840._3 | |
126 | 126 | let changeAssetId = $t045474840._4 | |
127 | 127 | let poolVersion = getStringValue(poolAddr, "version") | |
128 | 128 | let inv1 = if (if ((pmtAmountA > 0)) | |
129 | 129 | then (pmtAmountB > 0) | |
130 | 130 | else false) | |
131 | 131 | then { | |
132 | 132 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
133 | 133 | if ((poolVersion == "1.0.0")) | |
134 | 134 | then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
135 | 135 | else if ((poolVersion == "2.0.0")) | |
136 | 136 | then invoke(poolAddr, "replenishWithTwoTokensV2", [false, 0], payments) | |
137 | 137 | else throw("Wrong pool type") | |
138 | 138 | } | |
139 | 139 | else 0 | |
140 | 140 | if ((inv1 == inv1)) | |
141 | 141 | then { | |
142 | 142 | let inv2 = if ((change > 0)) | |
143 | 143 | then { | |
144 | 144 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
145 | 145 | if ((poolVersion == "1.0.0")) | |
146 | 146 | then { | |
147 | 147 | let vars = ["0", "false", "0"] | |
148 | 148 | invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments) | |
149 | 149 | } | |
150 | 150 | else if ((poolVersion == "2.0.0")) | |
151 | 151 | then { | |
152 | 152 | let vars = [virtualSwapTokenPay, virtualSwapTokenGet, false, 0] | |
153 | 153 | invoke(poolAddr, "replenishWithOneTokenV2", [false, 0], payments) | |
154 | 154 | } | |
155 | 155 | else throw("Wrong pool type") | |
156 | 156 | } | |
157 | 157 | else 0 | |
158 | 158 | if ((inv2 == inv2)) | |
159 | 159 | then { | |
160 | 160 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
161 | 161 | let totalShare = (shareBalanceAfter - shareBalanceBefore) | |
162 | 162 | let axlyInFee = fraction(totalShare, getAxlyInFee(pool, withLoan), FEE_SCALE6) | |
163 | 163 | let userShareForStake = (totalShare - axlyInFee) | |
164 | 164 | if ((0 >= userShareForStake)) | |
165 | 165 | then throw("amount of staked sharetokens must be > 0") | |
166 | 166 | else { | |
167 | 167 | let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
168 | 168 | if ((inv3 == inv3)) | |
169 | 169 | then { | |
170 | 170 | let totalAmount = getAxlyTotalPosition(pool) | |
171 | 171 | let newPosNum = getNewUserPositionNumber(pool, user) | |
172 | - | [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))] | |
172 | + | $Tuple2([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))], userShareForStake) | |
173 | 173 | } | |
174 | 174 | else throw("Strict value is not equal to itself.") | |
175 | 175 | } | |
176 | 176 | } | |
177 | 177 | else throw("Strict value is not equal to itself.") | |
178 | 178 | } | |
179 | 179 | else throw("Strict value is not equal to itself.") | |
180 | 180 | } | |
181 | 181 | else throw("Strict value is not equal to itself.") | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func replanishWX (user,pool,withLoan,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId,virtualSwapTokenPay,virtualSwapTokenGet) = nil | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | @Callable(i) | |
189 | 189 | func replanish (pool,borrowAmount,borrowAssetId,virtualSwapTokenPay,virtualSwapTokenGet) = { | |
190 | 190 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
191 | - | let $ | |
191 | + | let $t075947845 = if ((type == SF_POS_TYPE)) | |
192 | 192 | then getSFPoolData(Address(fromBase58String(pool))) | |
193 | 193 | else if ((type == WX_POS_TYPE)) | |
194 | 194 | then getWXPoolData(Address(fromBase58String(pool))) | |
195 | 195 | else throw("Wrong pool type") | |
196 | - | let AId = $ | |
197 | - | let BId = $ | |
198 | - | let balA = $ | |
199 | - | let balB = $ | |
200 | - | let shareId = $ | |
201 | - | let $ | |
196 | + | let AId = $t075947845._1 | |
197 | + | let BId = $t075947845._2 | |
198 | + | let balA = $t075947845._3 | |
199 | + | let balB = $t075947845._4 | |
200 | + | let shareId = $t075947845._5 | |
201 | + | let $t078498486 = if ((size(i.payments) == 2)) | |
202 | 202 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
203 | 203 | then throw("Wrong payment asset A") | |
204 | 204 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
205 | 205 | then throw("Wrong payment asset B") | |
206 | 206 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
207 | 207 | else if ((size(i.payments) == 1)) | |
208 | 208 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
209 | 209 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
210 | 210 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
211 | 211 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
212 | 212 | else throw("Wrong payment") | |
213 | 213 | else throw("One or two payments expected") | |
214 | - | let pmtA = $ | |
215 | - | let pmtAssetA = $ | |
216 | - | let pmtB = $ | |
217 | - | let pmtAssetB = $ | |
214 | + | let pmtA = $t078498486._1 | |
215 | + | let pmtAssetA = $t078498486._2 | |
216 | + | let pmtB = $t078498486._3 | |
217 | + | let pmtAssetB = $t078498486._4 | |
218 | 218 | if ((borrowAmount > 0)) | |
219 | 219 | then { | |
220 | 220 | let request = makeString([type, toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, toString(virtualSwapTokenPay), toString(virtualSwapTokenGet), borrowAssetId, toString(borrowAmount)], ",") | |
221 | 221 | let newRequestId = { | |
222 | 222 | let @ = invoke(this, "createNewRequest", [request], nil) | |
223 | 223 | if ($isInstanceOf(@, "Int")) | |
224 | 224 | then @ | |
225 | 225 | else unit | |
226 | 226 | } | |
227 | 227 | if ((newRequestId == newRequestId)) | |
228 | 228 | then { | |
229 | 229 | let args = [toString(i.caller), shareId, borrowAssetId, borrowAmount, toString(this), "replanishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
230 | 230 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
231 | 231 | nil | |
232 | 232 | } | |
233 | 233 | else throw("Strict value is not equal to itself.") | |
234 | 234 | } | |
235 | 235 | else if ((type == SF_POS_TYPE)) | |
236 | 236 | then replanishSwopFi(toString(i.caller), pool, false, pmtA, pmtAssetA, pmtB, pmtAssetB, balA, balB, shareId, virtualSwapTokenPay, virtualSwapTokenGet) | |
237 | 237 | else throw("Cant wx") | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Callable(i) | |
243 | 243 | func replanishFromLand (requestId) = { | |
244 | 244 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
245 | 245 | if ((size(i.payments) != 1)) | |
246 | 246 | then throw("Wrong payment size") | |
247 | 247 | else if (if ((assetIdToStr(i.payments[0].assetId) != request[12])) | |
248 | 248 | then true | |
249 | 249 | else (i.payments[0].amount != parseIntValue(request[13]))) | |
250 | 250 | then throw("Wrong payment") | |
251 | 251 | else { | |
252 | 252 | let pmtA = if ((request[4] == assetIdToStr(i.payments[0].assetId))) | |
253 | 253 | then (parseIntValue(request[3]) + i.payments[0].amount) | |
254 | 254 | else parseIntValue(request[3]) | |
255 | 255 | let pmtB = if ((request[6] == assetIdToStr(i.payments[0].assetId))) | |
256 | 256 | then (parseIntValue(request[5]) + i.payments[0].amount) | |
257 | 257 | else parseIntValue(request[3]) | |
258 | 258 | if ((request[0] == SF_POS_TYPE)) | |
259 | - | then (replanishSwopFi(request[1], request[2], true, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), request[9], parseIntValue(request[10]), parseIntValue(request[11])) :+ DeleteEntry((requestId + kRequestId))) | |
259 | + | then { | |
260 | + | let $t01070711133 = replanishSwopFi(request[1], request[2], true, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), request[9], parseIntValue(request[10]), parseIntValue(request[11])) | |
261 | + | let entries = $t01070711133._1 | |
262 | + | let lpAmount = $t01070711133._2 | |
263 | + | $Tuple2((entries :+ DeleteEntry((requestId + kRequestId))), lpAmount) | |
264 | + | } | |
260 | 265 | else throw("Cant wx") | |
261 | 266 | } | |
262 | 267 | } | |
263 | 268 | ||
264 | 269 | ||
265 | 270 | ||
266 | 271 | @Callable(i) | |
267 | 272 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
268 | 273 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
269 | 274 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params)], newRequestId) | |
270 | 275 | }) | |
271 | 276 | ||
272 | 277 | ||
273 | 278 | ||
274 | 279 | @Callable(i) | |
275 | 280 | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_POS_TYPE)) | |
276 | 281 | then (type != WX_POS_TYPE) | |
277 | 282 | else false) | |
278 | 283 | then throw("Wrong type") | |
279 | 284 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), StringEntry((kPool + poolAddr), type)] | |
280 | 285 | ||
281 | 286 | ||
282 | 287 | @Verifier(tx) | |
283 | 288 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
284 | 289 |
github/deemru/w8io/169f3d6 53.68 ms ◑