tx · 398HaPwCJE9a9q8wEQ7TbFjPsgefp35JjwjMLpEF5TJm 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.22000000 Waves 2023.04.10 11:17 [2528229] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "398HaPwCJE9a9q8wEQ7TbFjPsgefp35JjwjMLpEF5TJm", "fee": 22000000, "feeAssetId": null, "timestamp": 1681114668750, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "Va1Wha8R3JmLa4vb1LDtBQiicUQkhgu5VjCiFjSK4UMPTZNLYJfB75TydGMQmxndi5AkKY6v41ehFC1ttWGJKGi" ], "script": "base64:BgJOCAISBQoDCAEIEgMKAQgSBAoCCAESAwoBCBIOCgwICAgBBBEYGBEBARgSCgoICAgIAQQIARgSDgoMCAgIAQQYGBgYGAEYEgcKBQgIAQEBPAALU0ZfUE9TX1RZUEUCAlNGAAtXWF9QT1NfVFlQRQICV1gAB0NBUF9GRUUCA2NhcAAITE9BTl9GRUUCBGxvYW4AC05PX0xPQU5fRkVFAgZub0xvYW4ABlNDQUxFOACAwtcvAAdTQ0FMRTEwAIDIr6AlAApGRUVfU0NBTEU2AMCEPQAUa1NGUG9vbEFBc3NldEJhbGFuY2UCD0FfYXNzZXRfYmFsYW5jZQAUa1NGUG9vbEJBc3NldEJhbGFuY2UCD0JfYXNzZXRfYmFsYW5jZQAPa1NGUG9vbEFBc3NldElkAgpBX2Fzc2V0X2lkAA9rU0ZQb29sQkFzc2V0SWQCCkJfYXNzZXRfaWQADmtTRlBvb2xTaGFyZUlkAg5zaGFyZV9hc3NldF9pZAANa1VzZXJQb3NpdGlvbgIOX3VzZXJfcG9zaXRpb24AEWtVc2VyQm9ycm93QW1vdW50AhxfdXNlcl9wb3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AgECCldyb25nIHR5cGUJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFFWtBeGx5SW5GZWVXaXRob3V0TG9hbgULaW5GZWVOb0xvYW4JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFEmtBeGx5SW5GZWVXaXRoTG9hbgUJaW5GZWVMb2FuCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBQtrQXhseUNhcEZlZQUGY2FwRmVlCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBQ1rUG9vbEludGVyZXN0AAAJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQVrUG9vbAUIcG9vbEFkZHIFBHR5cGUFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmI/PVI", "height": 2528229, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DjJtLFC2G4Dm3vuQwfzPb22ZHqRQcCfHifqZh9H4oF26 Next: 9wB2REH4Jp2dsnrS4REaNWKWmKwFVqXkL27u3DQxkFtT Diff:
Old | New | Differences | |
---|---|---|---|
267 | 267 | then { | |
268 | 268 | let lpInA = parseIntValue(evalPutInA[1]) | |
269 | 269 | let lpInB = parseIntValue(evalPutInB[1]) | |
270 | - | if (( | |
270 | + | if ((lpInB > lpInA)) | |
271 | 271 | then { | |
272 | 272 | let pmtInB = parseIntValue(evalPutInB[8]) | |
273 | 273 | $Tuple4(pmtA, pmtInB, (pmtB - pmtInB), pmtAssetB) |
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 CAP_FEE = "cap" | |
9 | 9 | ||
10 | 10 | let LOAN_FEE = "loan" | |
11 | 11 | ||
12 | 12 | let NO_LOAN_FEE = "noLoan" | |
13 | 13 | ||
14 | 14 | let SCALE8 = 100000000 | |
15 | 15 | ||
16 | 16 | let SCALE10 = 10000000000 | |
17 | 17 | ||
18 | 18 | let FEE_SCALE6 = 1000000 | |
19 | 19 | ||
20 | 20 | let kSFPoolAAssetBalance = "A_asset_balance" | |
21 | 21 | ||
22 | 22 | let kSFPoolBAssetBalance = "B_asset_balance" | |
23 | 23 | ||
24 | 24 | let kSFPoolAAssetId = "A_asset_id" | |
25 | 25 | ||
26 | 26 | let kSFPoolBAssetId = "B_asset_id" | |
27 | 27 | ||
28 | 28 | let kSFPoolShareId = "share_asset_id" | |
29 | 29 | ||
30 | 30 | let kUserPosition = "_user_position" | |
31 | 31 | ||
32 | 32 | let kUserBorrowAmount = "_user_position_borrow_amount" | |
33 | 33 | ||
34 | 34 | let kUserBorrowAssetId = "_user_position_borrow_asset_id" | |
35 | 35 | ||
36 | 36 | let kUserPositionType = "_user_position_type" | |
37 | 37 | ||
38 | 38 | let kUserPositionNum = "_user_position_number" | |
39 | 39 | ||
40 | 40 | let kUserPositionInterest = "_user_position_interest" | |
41 | 41 | ||
42 | 42 | let kPoolTotal = "_pool_total" | |
43 | 43 | ||
44 | 44 | let kPoolInterest = "_pool_interest" | |
45 | 45 | ||
46 | 46 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
47 | 47 | ||
48 | 48 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
49 | 49 | ||
50 | 50 | let kAxlyCapFee = "_axly_fee_cap" | |
51 | 51 | ||
52 | 52 | let kRequestId = "_request_id" | |
53 | 53 | ||
54 | 54 | let kRequestIter = "requests_iter" | |
55 | 55 | ||
56 | 56 | let kPool = "pool_" | |
57 | 57 | ||
58 | 58 | let kPoolCapChange = "_pool_cap_change" | |
59 | 59 | ||
60 | 60 | let kMoneyBox = "axly_money_box" | |
61 | 61 | ||
62 | 62 | let kSFFarmingAddr = "swopfi_farming_addr" | |
63 | 63 | ||
64 | 64 | let kLendService = "lend_service_addr" | |
65 | 65 | ||
66 | 66 | let kPriceOracle = "price_oracle" | |
67 | 67 | ||
68 | 68 | let kExContract = "exchangeContract" | |
69 | 69 | ||
70 | 70 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
71 | 71 | ||
72 | 72 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
73 | 73 | ||
74 | 74 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
75 | 75 | ||
76 | 76 | let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp' | |
77 | 77 | ||
78 | 78 | let WXID = base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc' | |
79 | 79 | ||
80 | 80 | func isSelfCall (i) = if ((i.caller == this)) | |
81 | 81 | then unit | |
82 | 82 | else throw("Only contract itself can call this function") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func accountBalance (assetId) = match assetId { | |
86 | 86 | case id: ByteVector => | |
87 | 87 | assetBalance(this, id) | |
88 | 88 | case waves: Unit => | |
89 | 89 | wavesBalance(this).available | |
90 | 90 | case _ => | |
91 | 91 | throw("Match error") | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | 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")) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getWXPoolData (poolAddr) = { | |
99 | 99 | let cfg = { | |
100 | 100 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
101 | 101 | if ($isInstanceOf(@, "List[Any]")) | |
102 | 102 | then @ | |
103 | 103 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
104 | 104 | } | |
105 | 105 | if ((cfg == cfg)) | |
106 | 106 | then $Tuple5(valueOrErrorMessage({ | |
107 | 107 | let @ = cfg[4] | |
108 | 108 | if ($isInstanceOf(@, "String")) | |
109 | 109 | then @ | |
110 | 110 | else unit | |
111 | 111 | }, "Can't get pool A asset id"), valueOrErrorMessage({ | |
112 | 112 | let @ = cfg[5] | |
113 | 113 | if ($isInstanceOf(@, "String")) | |
114 | 114 | then @ | |
115 | 115 | else unit | |
116 | 116 | }, "Can't get pool B asset id"), 0, 0, valueOrErrorMessage({ | |
117 | 117 | let @ = cfg[3] | |
118 | 118 | if ($isInstanceOf(@, "String")) | |
119 | 119 | then @ | |
120 | 120 | else unit | |
121 | 121 | }, "Can't get pool LP asset id")) | |
122 | 122 | else throw("Strict value is not equal to itself.") | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getPoolData (poolAddr,type) = if ((type == SF_POS_TYPE)) | |
127 | 127 | then getSFPoolData(poolAddr) | |
128 | 128 | else if ((type == WX_POS_TYPE)) | |
129 | 129 | then getWXPoolData(poolAddr) | |
130 | 130 | else throw("Wrong pool type") | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (((pool + "_") + user) + kUserPositionNum)), 0) + 1) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getAxlyFee (pool,feeType) = if ((feeType == "cap")) | |
140 | 140 | then getIntegerValue(this, (pool + kAxlyCapFee)) | |
141 | 141 | else if ((feeType == "loan")) | |
142 | 142 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
143 | 143 | else if ((feeType == "noLoan")) | |
144 | 144 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
145 | 145 | else throw("Wrong fee type") | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getWXFarmingAddr (poolAddr) = { | |
152 | 152 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
153 | 153 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
154 | 154 | Address(fromBase58String(factroyCfg[1])) | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func assetIdToStr (assetId) = match assetId { | |
162 | 162 | case id: ByteVector => | |
163 | 163 | toBase58String(id) | |
164 | 164 | case waves: Unit => | |
165 | 165 | "WAVES" | |
166 | 166 | case _ => | |
167 | 167 | throw("Match error") | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
172 | 172 | then unit | |
173 | 173 | else fromBase58String(assetId) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
177 | 177 | then 8 | |
178 | 178 | else match assetInfo(fromBase58String(assetId)) { | |
179 | 179 | case asset: Asset => | |
180 | 180 | asset.decimals | |
181 | 181 | case _ => | |
182 | 182 | throw("Can't find asset") | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func replenishSwopFi (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId) = { | |
187 | 187 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
188 | 188 | if ((shareBalanceBefore == shareBalanceBefore)) | |
189 | 189 | then { | |
190 | 190 | let poolAddr = Address(fromBase58String(pool)) | |
191 | 191 | let ratioA = fraction(SCALE8, pmtA, balA) | |
192 | 192 | let ratioB = fraction(SCALE8, pmtB, balB) | |
193 | 193 | let $t063656657 = if ((ratioB > ratioA)) | |
194 | 194 | then { | |
195 | 195 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
196 | 196 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
197 | 197 | } | |
198 | 198 | else { | |
199 | 199 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
200 | 200 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
201 | 201 | } | |
202 | 202 | let pmtAmountA = $t063656657._1 | |
203 | 203 | let pmtAmountB = $t063656657._2 | |
204 | 204 | let change = $t063656657._3 | |
205 | 205 | let changeAssetId = $t063656657._4 | |
206 | 206 | let inv1 = if (if ((pmtAmountA > 0)) | |
207 | 207 | then (pmtAmountB > 0) | |
208 | 208 | else false) | |
209 | 209 | then { | |
210 | 210 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
211 | 211 | invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
212 | 212 | } | |
213 | 213 | else 0 | |
214 | 214 | if ((inv1 == inv1)) | |
215 | 215 | then { | |
216 | 216 | let inv2 = if ((change > 0)) | |
217 | 217 | then { | |
218 | 218 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
219 | 219 | let vars = ["0", "false", "0"] | |
220 | 220 | invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments) | |
221 | 221 | } | |
222 | 222 | else 0 | |
223 | 223 | if ((inv2 == inv2)) | |
224 | 224 | then { | |
225 | 225 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
226 | 226 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
227 | 227 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
228 | 228 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
229 | 229 | if ((0 >= userShareForStake)) | |
230 | 230 | then throw("amount of staked sharetokens must be > 0") | |
231 | 231 | else { | |
232 | 232 | let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
233 | 233 | if ((inv3 == inv3)) | |
234 | 234 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
235 | 235 | else throw("Strict value is not equal to itself.") | |
236 | 236 | } | |
237 | 237 | } | |
238 | 238 | else throw("Strict value is not equal to itself.") | |
239 | 239 | } | |
240 | 240 | else throw("Strict value is not equal to itself.") | |
241 | 241 | } | |
242 | 242 | else throw("Strict value is not equal to itself.") | |
243 | 243 | } | |
244 | 244 | ||
245 | 245 | ||
246 | 246 | func replenishWX (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,shareId) = { | |
247 | 247 | let poolAddr = Address(fromBase58String(pool)) | |
248 | 248 | let $t081088957 = if (if ((pmtA > 0)) | |
249 | 249 | then (pmtB > 0) | |
250 | 250 | else false) | |
251 | 251 | then { | |
252 | 252 | let evalPutInA = split({ | |
253 | 253 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
254 | 254 | if ($isInstanceOf(@, "String")) | |
255 | 255 | then @ | |
256 | 256 | else throw(($getType(@) + " couldn't be cast to String")) | |
257 | 257 | }, "__") | |
258 | 258 | if ((evalPutInA == evalPutInA)) | |
259 | 259 | then { | |
260 | 260 | let evalPutInB = split({ | |
261 | 261 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
262 | 262 | if ($isInstanceOf(@, "String")) | |
263 | 263 | then @ | |
264 | 264 | else throw(($getType(@) + " couldn't be cast to String")) | |
265 | 265 | }, "__") | |
266 | 266 | if ((evalPutInB == evalPutInB)) | |
267 | 267 | then { | |
268 | 268 | let lpInA = parseIntValue(evalPutInA[1]) | |
269 | 269 | let lpInB = parseIntValue(evalPutInB[1]) | |
270 | - | if (( | |
270 | + | if ((lpInB > lpInA)) | |
271 | 271 | then { | |
272 | 272 | let pmtInB = parseIntValue(evalPutInB[8]) | |
273 | 273 | $Tuple4(pmtA, pmtInB, (pmtB - pmtInB), pmtAssetB) | |
274 | 274 | } | |
275 | 275 | else { | |
276 | 276 | let pmtInA = parseIntValue(evalPutInB[7]) | |
277 | 277 | $Tuple4(pmtInA, pmtB, (pmtA - pmtInA), pmtAssetA) | |
278 | 278 | } | |
279 | 279 | } | |
280 | 280 | else throw("Strict value is not equal to itself.") | |
281 | 281 | } | |
282 | 282 | else throw("Strict value is not equal to itself.") | |
283 | 283 | } | |
284 | 284 | else if ((pmtA > 0)) | |
285 | 285 | then $Tuple4(pmtA, pmtB, pmtA, pmtAssetA) | |
286 | 286 | else if ((pmtB > 0)) | |
287 | 287 | then $Tuple4(pmtA, pmtB, pmtB, pmtAssetB) | |
288 | 288 | else throw("pmts must be > 0") | |
289 | 289 | let pmtAmountA = $t081088957._1 | |
290 | 290 | let pmtAmountB = $t081088957._2 | |
291 | 291 | let change = $t081088957._3 | |
292 | 292 | let changeAssetId = $t081088957._4 | |
293 | 293 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
294 | 294 | if ((shareBalanceBefore == shareBalanceBefore)) | |
295 | 295 | then { | |
296 | 296 | let inv1 = if (if ((pmtAmountA > 0)) | |
297 | 297 | then (pmtAmountB > 0) | |
298 | 298 | else false) | |
299 | 299 | then { | |
300 | 300 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
301 | 301 | invoke(poolAddr, "put", [1, false], payments) | |
302 | 302 | } | |
303 | 303 | else 0 | |
304 | 304 | if ((inv1 == inv1)) | |
305 | 305 | then { | |
306 | 306 | let inv2 = if ((change > 0)) | |
307 | 307 | then { | |
308 | 308 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
309 | 309 | invoke(poolAddr, "putOneTkn", [0, false], payments) | |
310 | 310 | } | |
311 | 311 | else 0 | |
312 | 312 | if ((inv2 == inv2)) | |
313 | 313 | then { | |
314 | 314 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
315 | 315 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
316 | 316 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
317 | 317 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
318 | 318 | if ((0 >= userShareForStake)) | |
319 | 319 | then throw("amount of staked sharetokens must be > 0") | |
320 | 320 | else { | |
321 | 321 | let inv3 = invoke(getWXFarmingAddr(poolAddr), "stake", nil, [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
322 | 322 | if ((inv3 == inv3)) | |
323 | 323 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
324 | 324 | else throw("Strict value is not equal to itself.") | |
325 | 325 | } | |
326 | 326 | } | |
327 | 327 | else throw("Strict value is not equal to itself.") | |
328 | 328 | } | |
329 | 329 | else throw("Strict value is not equal to itself.") | |
330 | 330 | } | |
331 | 331 | else throw("Strict value is not equal to itself.") | |
332 | 332 | } | |
333 | 333 | ||
334 | 334 | ||
335 | 335 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId) = { | |
336 | 336 | let totalAmount = getPoolTotalShare(pool) | |
337 | 337 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
338 | 338 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionType), SF_POS_TYPE), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), IntegerEntry((((pool + "_") + user) + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
339 | 339 | } | |
340 | 340 | ||
341 | 341 | ||
342 | 342 | func claimFarmed (type,pool) = if ((type == SF_POS_TYPE)) | |
343 | 343 | then { | |
344 | 344 | let balBefore = accountBalance(SWOPID) | |
345 | 345 | if ((balBefore == balBefore)) | |
346 | 346 | then { | |
347 | 347 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
348 | 348 | if ((inv == inv)) | |
349 | 349 | then { | |
350 | 350 | let balAfter = accountBalance(SWOPID) | |
351 | 351 | $Tuple2((balAfter - balBefore), SWOPID) | |
352 | 352 | } | |
353 | 353 | else throw("Strict value is not equal to itself.") | |
354 | 354 | } | |
355 | 355 | else throw("Strict value is not equal to itself.") | |
356 | 356 | } | |
357 | 357 | else if ((type == WX_POS_TYPE)) | |
358 | 358 | then { | |
359 | 359 | let balBefore = accountBalance(WXID) | |
360 | 360 | if ((balBefore == balBefore)) | |
361 | 361 | then { | |
362 | 362 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
363 | 363 | if ((inv == inv)) | |
364 | 364 | then { | |
365 | 365 | let balAfter = accountBalance(WXID) | |
366 | 366 | $Tuple2((balAfter - balBefore), WXID) | |
367 | 367 | } | |
368 | 368 | else throw("Strict value is not equal to itself.") | |
369 | 369 | } | |
370 | 370 | else throw("Strict value is not equal to itself.") | |
371 | 371 | } | |
372 | 372 | else throw("Wrong pool type") | |
373 | 373 | ||
374 | 374 | ||
375 | 375 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
376 | 376 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
377 | 377 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
378 | 378 | then { | |
379 | 379 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
380 | 380 | if ((inv == inv)) | |
381 | 381 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
382 | 382 | else throw("Strict value is not equal to itself.") | |
383 | 383 | } | |
384 | 384 | else throw("Strict value is not equal to itself.") | |
385 | 385 | } | |
386 | 386 | ||
387 | 387 | ||
388 | 388 | func exchangePazzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
389 | 389 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
390 | 390 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
391 | 391 | then { | |
392 | 392 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
393 | 393 | if ((inv == inv)) | |
394 | 394 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
395 | 395 | else throw("Strict value is not equal to itself.") | |
396 | 396 | } | |
397 | 397 | else throw("Strict value is not equal to itself.") | |
398 | 398 | } | |
399 | 399 | ||
400 | 400 | ||
401 | 401 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
402 | 402 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
403 | 403 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
404 | 404 | then { | |
405 | 405 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
406 | 406 | if ((inv == inv)) | |
407 | 407 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
408 | 408 | else throw("Strict value is not equal to itself.") | |
409 | 409 | } | |
410 | 410 | else throw("Strict value is not equal to itself.") | |
411 | 411 | } | |
412 | 412 | ||
413 | 413 | ||
414 | 414 | func capitalize (pool,type,tokenId,tokenAmount) = { | |
415 | 415 | let poolAddr = Address(fromBase58String(pool)) | |
416 | 416 | let $t01325113329 = getPoolData(poolAddr, type) | |
417 | 417 | let AId = $t01325113329._1 | |
418 | 418 | let BId = $t01325113329._2 | |
419 | 419 | let balA = $t01325113329._3 | |
420 | 420 | let balB = $t01325113329._4 | |
421 | 421 | let shareId = $t01325113329._5 | |
422 | 422 | let $t01333213412 = if ((tokenId == AId)) | |
423 | 423 | then $Tuple2(tokenAmount, 0) | |
424 | 424 | else $Tuple2(0, tokenAmount) | |
425 | 425 | let pmtA = $t01333213412._1 | |
426 | 426 | let pmtB = $t01333213412._2 | |
427 | 427 | let $t01341513780 = if ((type == SF_POS_TYPE)) | |
428 | 428 | then replenishSwopFi(pool, CAP_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
429 | 429 | else replenishWX(pool, CAP_FEE, pmtA, AId, pmtB, BId, shareId) | |
430 | 430 | let stakedAmount = $t01341513780._1 | |
431 | 431 | let axlyFee = $t01341513780._2 | |
432 | 432 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
433 | 433 | let totalShareAmount = getPoolTotalShare(pool) | |
434 | 434 | let newInterest = (curPoolInterest + fraction(stakedAmount, SCALE10, totalShareAmount)) | |
435 | 435 | [IntegerEntry((pool + kPoolInterest), newInterest), ScriptTransfer(moneyBox, axlyFee, fromBase58String(shareId))] | |
436 | 436 | } | |
437 | 437 | ||
438 | 438 | ||
439 | 439 | @Callable(i) | |
440 | 440 | func replenish (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
441 | 441 | then true | |
442 | 442 | else (leverage > 300)) | |
443 | 443 | then throw("Leverage can't be <100 and >300") | |
444 | 444 | else { | |
445 | 445 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
446 | 446 | let $t01438514474 = getPoolData(Address(fromBase58String(pool)), type) | |
447 | 447 | let AId = $t01438514474._1 | |
448 | 448 | let BId = $t01438514474._2 | |
449 | 449 | let balA = $t01438514474._3 | |
450 | 450 | let balB = $t01438514474._4 | |
451 | 451 | let shareId = $t01438514474._5 | |
452 | 452 | let $t01447715114 = if ((size(i.payments) == 2)) | |
453 | 453 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
454 | 454 | then throw("Wrong payment asset A") | |
455 | 455 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
456 | 456 | then throw("Wrong payment asset B") | |
457 | 457 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
458 | 458 | else if ((size(i.payments) == 1)) | |
459 | 459 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
460 | 460 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
461 | 461 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
462 | 462 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
463 | 463 | else throw("Wrong payment") | |
464 | 464 | else throw("One or two payments expected") | |
465 | 465 | let pmtA = $t01447715114._1 | |
466 | 466 | let pmtAssetA = $t01447715114._2 | |
467 | 467 | let pmtB = $t01447715114._3 | |
468 | 468 | let pmtAssetB = $t01447715114._4 | |
469 | 469 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
470 | 470 | if ((leverage > 100)) | |
471 | 471 | then { | |
472 | 472 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
473 | 473 | if ($isInstanceOf(@, "(Int, Int)")) | |
474 | 474 | then @ | |
475 | 475 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
476 | 476 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
477 | 477 | if ($isInstanceOf(@, "(Int, Int)")) | |
478 | 478 | then @ | |
479 | 479 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
480 | 480 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
481 | 481 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
482 | 482 | let request = makeString([type, toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount), toString(newPosNum)], ",") | |
483 | 483 | let newRequestId = { | |
484 | 484 | let @ = invoke(this, "createNewRequest", [request], nil) | |
485 | 485 | if ($isInstanceOf(@, "Int")) | |
486 | 486 | then @ | |
487 | 487 | else unit | |
488 | 488 | } | |
489 | 489 | if ((newRequestId == newRequestId)) | |
490 | 490 | then { | |
491 | 491 | let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowAssetId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
492 | 492 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
493 | 493 | if ((inv == inv)) | |
494 | 494 | then nil | |
495 | 495 | else throw("Strict value is not equal to itself.") | |
496 | 496 | } | |
497 | 497 | else throw("Strict value is not equal to itself.") | |
498 | 498 | } | |
499 | 499 | else { | |
500 | 500 | let $t01645016845 = if ((type == SF_POS_TYPE)) | |
501 | 501 | then replenishSwopFi(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, balA, balB, shareId) | |
502 | 502 | else replenishWX(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, shareId) | |
503 | 503 | let userStaked = $t01645016845._1 | |
504 | 504 | let axlyFee = $t01645016845._2 | |
505 | 505 | replenishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId) | |
506 | 506 | } | |
507 | 507 | } | |
508 | 508 | ||
509 | 509 | ||
510 | 510 | ||
511 | 511 | @Callable(i) | |
512 | 512 | func replenishFromLand (requestId) = { | |
513 | 513 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
514 | 514 | if ((size(i.payments) != 1)) | |
515 | 515 | then throw("Wrong payment size") | |
516 | 516 | else if (if ((assetIdToStr(i.payments[0].assetId) != request[10])) | |
517 | 517 | then true | |
518 | 518 | else (i.payments[0].amount != parseIntValue(request[11]))) | |
519 | 519 | then throw("Wrong payment") | |
520 | 520 | else { | |
521 | 521 | let pmtA = if ((request[4] == assetIdToStr(i.payments[0].assetId))) | |
522 | 522 | then (parseIntValue(request[3]) + i.payments[0].amount) | |
523 | 523 | else parseIntValue(request[3]) | |
524 | 524 | let pmtB = if ((request[6] == assetIdToStr(i.payments[0].assetId))) | |
525 | 525 | then (parseIntValue(request[5]) + i.payments[0].amount) | |
526 | 526 | else parseIntValue(request[3]) | |
527 | 527 | let pool = request[2] | |
528 | 528 | let user = request[1] | |
529 | 529 | let shareId = request[9] | |
530 | 530 | let posNum = parseIntValue(request[12]) | |
531 | 531 | let $t01779718320 = if ((request[0] == SF_POS_TYPE)) | |
532 | 532 | then replenishSwopFi(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), shareId) | |
533 | 533 | else if ((request[0] == WX_POS_TYPE)) | |
534 | 534 | then replenishWX(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], shareId) | |
535 | 535 | else throw("Wrong request type") | |
536 | 536 | let userStaked = $t01779718320._1 | |
537 | 537 | let axlyFee = $t01779718320._2 | |
538 | 538 | let borrowEntries = [IntegerEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAmount), i.payments[0].amount), StringEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAssetId), request[10])] | |
539 | 539 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId) | |
540 | 540 | $Tuple2(((entries ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
541 | 541 | } | |
542 | 542 | } | |
543 | 543 | ||
544 | 544 | ||
545 | 545 | ||
546 | 546 | @Callable(i) | |
547 | 547 | func withdraw (pool,posId) = { | |
548 | 548 | let user = toString(i.caller) | |
549 | 549 | let pType = valueOrErrorMessage(getString(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionType)), "Can't find position") | |
550 | 550 | let pAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)) | |
551 | 551 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)) | |
552 | 552 | let poolInterst = getIntegerValue(this, (pool + kPoolInterest)) | |
553 | 553 | let poolTotalShare = getIntegerValue(this, (pool + kPoolTotal)) | |
554 | 554 | let userCanWithdraw = (pAmount + fraction(pAmount, (poolInterst - userInterest), SCALE10)) | |
555 | 555 | let poolAddr = Address(fromBase58String(pool)) | |
556 | 556 | let userAddr = Address(fromBase58String(user)) | |
557 | 557 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAmount)) | |
558 | 558 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAssetId)) | |
559 | 559 | let $t01969219792 = getPoolData(Address(fromBase58String(pool)), pType) | |
560 | 560 | let assetIdA = $t01969219792._1 | |
561 | 561 | let assetIdB = $t01969219792._2 | |
562 | 562 | let balA = $t01969219792._3 | |
563 | 563 | let balB = $t01969219792._4 | |
564 | 564 | let shareId = $t01969219792._5 | |
565 | 565 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
566 | 566 | if ((cBalABefore == cBalABefore)) | |
567 | 567 | then { | |
568 | 568 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
569 | 569 | if ((cBalBBefore == cBalBBefore)) | |
570 | 570 | then { | |
571 | 571 | let inv = if ((pType == SF_POS_TYPE)) | |
572 | 572 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
573 | 573 | else if ((pType == WX_POS_TYPE)) | |
574 | 574 | then invoke(poolAddr, "unstakeAndGet", [userCanWithdraw], nil) | |
575 | 575 | else throw("Wrong position type") | |
576 | 576 | if ((inv == inv)) | |
577 | 577 | then { | |
578 | 578 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
579 | 579 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
580 | 580 | let $t02031220401 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
581 | 581 | let tokensAmountA = $t02031220401._1 | |
582 | 582 | let tokensAmountB = $t02031220401._2 | |
583 | 583 | [DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionType)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, tokensAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, tokensAmountB, assetIdFromStr(assetIdB))] | |
584 | 584 | } | |
585 | 585 | else throw("Strict value is not equal to itself.") | |
586 | 586 | } | |
587 | 587 | else throw("Strict value is not equal to itself.") | |
588 | 588 | } | |
589 | 589 | else throw("Strict value is not equal to itself.") | |
590 | 590 | } | |
591 | 591 | ||
592 | 592 | ||
593 | 593 | ||
594 | 594 | @Callable(i) | |
595 | 595 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
596 | 596 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
597 | 597 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
598 | 598 | }) | |
599 | 599 | ||
600 | 600 | ||
601 | 601 | ||
602 | 602 | @Callable(i) | |
603 | 603 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
604 | 604 | let $t02159221790 = if (claim) | |
605 | 605 | then claimFarmed(type, pool) | |
606 | 606 | else { | |
607 | 607 | let claimedAsset = if ((type == SF_POS_TYPE)) | |
608 | 608 | then SWOPID | |
609 | 609 | else WXID | |
610 | 610 | $Tuple2(amountToExchange, claimedAsset) | |
611 | 611 | } | |
612 | 612 | let claimedAmount = $t02159221790._1 | |
613 | 613 | let claimedAsset = $t02159221790._2 | |
614 | 614 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
615 | 615 | let change = (claimedAmount - amountToExchange) | |
616 | 616 | let changeEntry = if ((change > 0)) | |
617 | 617 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
618 | 618 | else nil | |
619 | 619 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
620 | 620 | } | |
621 | 621 | ||
622 | 622 | ||
623 | 623 | ||
624 | 624 | @Callable(i) | |
625 | 625 | func capitalizeExPazzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
626 | 626 | let $t02244622644 = if (claim) | |
627 | 627 | then claimFarmed(type, pool) | |
628 | 628 | else { | |
629 | 629 | let claimedAsset = if ((type == SF_POS_TYPE)) | |
630 | 630 | then SWOPID | |
631 | 631 | else WXID | |
632 | 632 | $Tuple2(amountToExchange, claimedAsset) | |
633 | 633 | } | |
634 | 634 | let claimedAmount = $t02244622644._1 | |
635 | 635 | let claimedAsset = $t02244622644._2 | |
636 | 636 | let exchangedAmount = exchangePazzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
637 | 637 | let change = (claimedAmount - amountToExchange) | |
638 | 638 | let changeEntry = if ((change > 0)) | |
639 | 639 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
640 | 640 | else nil | |
641 | 641 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
642 | 642 | } | |
643 | 643 | ||
644 | 644 | ||
645 | 645 | ||
646 | 646 | @Callable(i) | |
647 | 647 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
648 | 648 | let $t02336723565 = if (claim) | |
649 | 649 | then claimFarmed(type, pool) | |
650 | 650 | else { | |
651 | 651 | let claimedAsset = if ((type == SF_POS_TYPE)) | |
652 | 652 | then SWOPID | |
653 | 653 | else WXID | |
654 | 654 | $Tuple2(amountToExchange, claimedAsset) | |
655 | 655 | } | |
656 | 656 | let claimedAmount = $t02336723565._1 | |
657 | 657 | let claimedAsset = $t02336723565._2 | |
658 | 658 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
659 | 659 | let change = (claimedAmount - amountToExchange) | |
660 | 660 | let changeEntry = if ((change > 0)) | |
661 | 661 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
662 | 662 | else nil | |
663 | 663 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
664 | 664 | } | |
665 | 665 | ||
666 | 666 | ||
667 | 667 | ||
668 | 668 | @Callable(i) | |
669 | 669 | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_POS_TYPE)) | |
670 | 670 | then (type != WX_POS_TYPE) | |
671 | 671 | else false) | |
672 | 672 | then throw("Wrong type") | |
673 | 673 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type)] | |
674 | 674 | ||
675 | 675 | ||
676 | 676 | @Verifier(tx) | |
677 | 677 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
678 | 678 |
github/deemru/w8io/026f985 70.82 ms ◑