tx · CbYtV3qbrNkxmttDqXF6W9FuHHsSeaH1gkuKxoS7YJiH 3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW: -0.03000000 Waves 2022.09.14 17:32 [2228897] smart account 3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW > SELF 0.00000000 Waves
{ "type": 13, "id": "CbYtV3qbrNkxmttDqXF6W9FuHHsSeaH1gkuKxoS7YJiH", "fee": 3000000, "feeAssetId": null, "timestamp": 1663165984240, "version": 2, "chainId": 84, "sender": "3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW", "senderPublicKey": "DfbjpZJBbZwnUKysUkxCbWTE1ZWuoUb6Y6BZdu5iAE8j", "proofs": [ "5Wts8FCAyGG7yckMFTRYEnc4VHJYajrP3qEskGPqWnUxxiSmYCY54WCSZpQcA4iHaJFcq6UUvM9ezN8raUaQAtxs", "3NxUVZitqDsyu7LPZZx3LLdmrSeduSyY2GhwGjpRjysj7BfWvokv2xqBwcRVZwLvmDSqUagY6mNodokHVLWZZoMi" ], "script": "base64:BgIpCAISAwoBBBIAEgQKAgEBEgASBAoCAQESABIAEgASAwoBARIFCgMEAQhhAAd2ZXJzaW9uAgUyLjAuMAAIa1ZlcnNpb24CB3ZlcnNpb24AB2tBY3RpdmUCBmFjdGl2ZQAJa0Fzc2V0SWRBAgpBX2Fzc2V0X2lkAAlrQXNzZXRJZEICCkJfYXNzZXRfaWQACWtCYWxhbmNlQQIPQV9hc3NldF9iYWxhbmNlAAlrQmFsYW5jZUICD0JfYXNzZXRfYmFsYW5jZQANa1NoYXJlQXNzZXRJZAIOc2hhcmVfYXNzZXRfaWQAEWtTaGFyZUFzc2V0U3VwcGx5AhJzaGFyZV9hc3NldF9zdXBwbHkABGtGZWUCCmNvbW1pc3Npb24ACmtJbnZhcmlhbnQCCWludmFyaWFudAAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQAMa1VTRE5BZGRyZXNzAhhzdGFraW5nX3VzZG5uc2J0X2FkZHJlc3MADGtF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pblB1YktleTMGCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABRFhZG1pblB1YktleUludm9rZQMDBRNjYWxsVGFrZUludG9BY2NvdW50BQ1zaWduZWRCeUFkbWluBwYFE211bHRpU2lnbmVkQnlBZG1pbnMFE211bHRpU2lnbmVkQnlBZG1pbnMV5lzM", "height": 2228897, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: aK6VykmbRS8JorCBzLxarS72x4eMGBMTqPYyVrkmXJW Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "2.0.0" |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "2.0.0" | |
5 | 5 | ||
6 | 6 | let kVersion = "version" | |
7 | 7 | ||
8 | 8 | let kActive = "active" | |
9 | 9 | ||
10 | 10 | let kAssetIdA = "A_asset_id" | |
11 | 11 | ||
12 | 12 | let kAssetIdB = "B_asset_id" | |
13 | 13 | ||
14 | 14 | let kBalanceA = "A_asset_balance" | |
15 | 15 | ||
16 | 16 | let kBalanceB = "B_asset_balance" | |
17 | 17 | ||
18 | 18 | let kShareAssetId = "share_asset_id" | |
19 | 19 | ||
20 | 20 | let kShareAssetSupply = "share_asset_supply" | |
21 | 21 | ||
22 | 22 | let kFee = "commission" | |
23 | 23 | ||
24 | 24 | let kInvariant = "invariant" | |
25 | 25 | ||
26 | 26 | let kCause = "shutdown_cause" | |
27 | 27 | ||
28 | 28 | let kUSDNAddress = "staking_usdnnsbt_address" | |
29 | 29 | ||
30 | 30 | let kEURNAddress = "staking_eurn_address" | |
31 | 31 | ||
32 | 32 | let kDiscounts = "discounts" | |
33 | 33 | ||
34 | 34 | let kDiscountValues = "discount_values" | |
35 | 35 | ||
36 | 36 | let kUserSwopInGov = "_SWOP_amount" | |
37 | 37 | ||
38 | 38 | let kFirstHarvest = "first_harvest" | |
39 | 39 | ||
40 | 40 | let kFirstHarvestHeight = "first_harvest_height" | |
41 | 41 | ||
42 | 42 | let kShareLimit = "share_limit_on_first_harvest" | |
43 | 43 | ||
44 | 44 | let kBasePeriod = "base_period" | |
45 | 45 | ||
46 | 46 | let kPeriodLength = "period_length" | |
47 | 47 | ||
48 | 48 | let kStartHeight = "start_height" | |
49 | 49 | ||
50 | 50 | let kAdminPubKey1 = "admin_pub_1" | |
51 | 51 | ||
52 | 52 | let kAdminPubKey2 = "admin_pub_2" | |
53 | 53 | ||
54 | 54 | let kAdminPubKey3 = "admin_pub_3" | |
55 | 55 | ||
56 | 56 | let kAdminInvokePubKey = "admin_invoke_pub" | |
57 | 57 | ||
58 | 58 | let kMoneyBoxAddress = "money_box_address" | |
59 | 59 | ||
60 | 60 | let kGovAddress = "governance_address" | |
61 | 61 | ||
62 | 62 | let kVotingAddress = "voting_address" | |
63 | 63 | ||
64 | 64 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
65 | 65 | ||
66 | 66 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
67 | 67 | case string: String => | |
68 | 68 | fromBase58String(string) | |
69 | 69 | case nothing => | |
70 | 70 | throw((key + "is empty")) | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
75 | 75 | ||
76 | 76 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
77 | 77 | ||
78 | 78 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
79 | 79 | ||
80 | 80 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
81 | 81 | ||
82 | 82 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
83 | 83 | ||
84 | 84 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
85 | 85 | ||
86 | 86 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
87 | 87 | ||
88 | 88 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
89 | 89 | ||
90 | 90 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
91 | 91 | ||
92 | 92 | let stakingAssets = [toBase58String(USDN)] | |
93 | 93 | ||
94 | 94 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
95 | 95 | ||
96 | 96 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
97 | 97 | ||
98 | 98 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
99 | 99 | ||
100 | 100 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
101 | 101 | ||
102 | 102 | let active = getBooleanValue(this, kActive) | |
103 | 103 | ||
104 | 104 | let strAssetIdA = getStringValue(this, kAssetIdA) | |
105 | 105 | ||
106 | 106 | let strAssetIdB = getStringValue(this, kAssetIdB) | |
107 | 107 | ||
108 | 108 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
109 | 109 | then unit | |
110 | 110 | else fromBase58String(strAssetIdA) | |
111 | 111 | ||
112 | 112 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
113 | 113 | then unit | |
114 | 114 | else fromBase58String(strAssetIdB) | |
115 | 115 | ||
116 | 116 | let assetNameA = match assetIdA { | |
117 | 117 | case id: ByteVector => | |
118 | 118 | value(assetInfo(id)).name | |
119 | 119 | case waves: Unit => | |
120 | 120 | "WAVES" | |
121 | 121 | case _ => | |
122 | 122 | throw("Match error") | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | let assetNameB = match assetIdB { | |
126 | 126 | case id: ByteVector => | |
127 | 127 | value(assetInfo(id)).name | |
128 | 128 | case waves: Unit => | |
129 | 129 | "WAVES" | |
130 | 130 | case _ => | |
131 | 131 | throw("Match error") | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | let balanceA = getIntegerValue(this, kBalanceA) | |
135 | 135 | ||
136 | 136 | let balanceB = getIntegerValue(this, kBalanceB) | |
137 | 137 | ||
138 | 138 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
139 | 139 | ||
140 | 140 | let shareAssetSupply = getIntegerValue(this, kShareAssetSupply) | |
141 | 141 | ||
142 | 142 | let invariant = getIntegerValue(this, kInvariant) | |
143 | 143 | ||
144 | 144 | let fee = getIntegerValue(this, kFee) | |
145 | 145 | ||
146 | 146 | let feeGovernance = fraction(fee, 40, 100) | |
147 | 147 | ||
148 | 148 | let feeScale6 = 1000000 | |
149 | 149 | ||
150 | 150 | let scale3 = 1000 | |
151 | 151 | ||
152 | 152 | let scale8 = 100000000 | |
153 | 153 | ||
154 | 154 | let scale16 = 10000000000000000 | |
155 | 155 | ||
156 | 156 | let slippageScale3 = 1000 | |
157 | 157 | ||
158 | 158 | let digits8 = 8 | |
159 | 159 | ||
160 | 160 | let dAppThreshold = 50 | |
161 | 161 | ||
162 | 162 | let dAppThresholdScale2 = 100 | |
163 | 163 | ||
164 | 164 | let exchangeRatioLimitMin = 90000000 | |
165 | 165 | ||
166 | 166 | let exchangeRatioLimitMax = 110000000 | |
167 | 167 | ||
168 | 168 | let alpha = 50 | |
169 | 169 | ||
170 | 170 | let alphaDigits = 2 | |
171 | 171 | ||
172 | 172 | let beta = 4600000000000000 | |
173 | 173 | ||
174 | 174 | func accountBalance (assetId) = match assetId { | |
175 | 175 | case id: ByteVector => | |
176 | 176 | assetBalance(this, id) | |
177 | 177 | case waves: Unit => | |
178 | 178 | wavesBalance(this).available | |
179 | 179 | case _ => | |
180 | 180 | throw("Match error") | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func stakedAmount (assetId) = { | |
185 | 185 | let stakedAmountCalculated = match assetId { | |
186 | 186 | case aId: ByteVector => | |
187 | 187 | if ((aId == USDN)) | |
188 | 188 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
189 | 189 | else 0 | |
190 | 190 | case _: Unit => | |
191 | 191 | 0 | |
192 | 192 | case _ => | |
193 | 193 | throw("Match error") | |
194 | 194 | } | |
195 | 195 | match stakedAmountCalculated { | |
196 | 196 | case i: Int => | |
197 | 197 | i | |
198 | 198 | case _ => | |
199 | 199 | 0 | |
200 | 200 | } | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | let stakedAmountA = stakedAmount(assetIdA) | |
205 | 205 | ||
206 | 206 | let stakedAmountB = stakedAmount(assetIdB) | |
207 | 207 | ||
208 | 208 | let availableBalanceA = (balanceA - stakedAmountA) | |
209 | 209 | ||
210 | 210 | let availableBalanceB = (balanceB - stakedAmountB) | |
211 | 211 | ||
212 | 212 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA) | |
213 | 213 | ||
214 | 214 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB) | |
215 | 215 | ||
216 | 216 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
217 | 217 | then (accountBalanceWithStakedB >= balanceB) | |
218 | 218 | else false | |
219 | 219 | ||
220 | 220 | func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2) | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func invariantCalc (x,y) = { | |
224 | 224 | let sk = skewness(x, y) | |
225 | 225 | (fraction((x + y), scale16, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(x), toBigInt(y), toBigInt(scale8)), 0, toBigInt(5), 1, (digits8 / 2), DOWN)), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8))) | |
226 | 226 | } | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func calculateSendAmount (amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount,tokenId) = { | |
230 | 230 | let worstAllowedNewInvariantRatio = (scale16 - ((scale16 * 1) / 10000000)) | |
231 | 231 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
232 | 232 | let x = (balanceA + tokenReceiveAmount) | |
233 | 233 | let y = (balanceB + tokenReceiveAmount) | |
234 | 234 | func getStepAmount (acc,step) = if ((acc._1 == -1)) | |
235 | 235 | then { | |
236 | 236 | let amountToSend = (amountToSendEstimated - (((step * deltaBetweenMaxAndMinSendValue) / 3) / scale3)) | |
237 | 237 | let stepInvariant = if ((tokenId == assetIdA)) | |
238 | 238 | then invariantCalc(x, (balanceB - amountToSend)) | |
239 | 239 | else invariantCalc((balanceA - amountToSend), y) | |
240 | 240 | if ((stepInvariant > invariant)) | |
241 | 241 | then $Tuple2(amountToSend, stepInvariant) | |
242 | 242 | else $Tuple2(-1, 0) | |
243 | 243 | } | |
244 | 244 | else acc | |
245 | 245 | ||
246 | 246 | let amountToSendMin = getStepAmount($Tuple2(-1, 0), 3000) | |
247 | 247 | if ((0 > amountToSendMin._1)) | |
248 | 248 | then throw("Price is worse than minReceived") | |
249 | 249 | else { | |
250 | 250 | let invEstimated = if ((tokenId == assetIdA)) | |
251 | 251 | then invariantCalc(x, (balanceB - amountToSendEstimated)) | |
252 | 252 | else if ((tokenId == assetIdB)) | |
253 | 253 | then invariantCalc((balanceA - amountToSendEstimated), y) | |
254 | 254 | else throw("Wrong asset in payment") | |
255 | 255 | if ((invariant > invEstimated)) | |
256 | 256 | then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, invEstimated))) | |
257 | 257 | then throw("The requested price is too not profitable for user") | |
258 | 258 | else { | |
259 | 259 | let a = { | |
260 | 260 | let $l = [25, 200, 500] | |
261 | 261 | let $s = size($l) | |
262 | 262 | let $acc0 = $Tuple2(-1, 0) | |
263 | 263 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
264 | 264 | then $a | |
265 | 265 | else getStepAmount($a, $l[$i]) | |
266 | 266 | ||
267 | 267 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
268 | 268 | then $a | |
269 | 269 | else throw("List size exceeds 3") | |
270 | 270 | ||
271 | 271 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
272 | 272 | } | |
273 | 273 | if ((0 > a._1)) | |
274 | 274 | then amountToSendMin._1 | |
275 | 275 | else a._1 | |
276 | 276 | } | |
277 | 277 | else { | |
278 | 278 | let a = { | |
279 | 279 | let $l = [-500, -200, -25] | |
280 | 280 | let $s = size($l) | |
281 | 281 | let $acc0 = $Tuple2(-1, 0) | |
282 | 282 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
283 | 283 | then $a | |
284 | 284 | else getStepAmount($a, $l[$i]) | |
285 | 285 | ||
286 | 286 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
287 | 287 | then $a | |
288 | 288 | else throw("List size exceeds 3") | |
289 | 289 | ||
290 | 290 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
291 | 291 | } | |
292 | 292 | let tupleSendBetter = if ((0 > a._1)) | |
293 | 293 | then $Tuple2(amountToSendEstimated, invEstimated) | |
294 | 294 | else a | |
295 | 295 | if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, tupleSendBetter._2))) | |
296 | 296 | then throw("The requested price is too not profitable for user") | |
297 | 297 | else tupleSendBetter._1 | |
298 | 298 | } | |
299 | 299 | } | |
300 | 300 | } | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | func getAssetInfo (assetId) = match assetId { | |
304 | 304 | case id: ByteVector => | |
305 | 305 | let stringId = toBase58String(id) | |
306 | 306 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
307 | 307 | $Tuple3(stringId, info.name, info.decimals) | |
308 | 308 | case waves: Unit => | |
309 | 309 | $Tuple3("WAVES", "WAVES", 8) | |
310 | 310 | case _ => | |
311 | 311 | throw("Match error") | |
312 | 312 | } | |
313 | 313 | ||
314 | 314 | ||
315 | 315 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
316 | 316 | ||
317 | 317 | ||
318 | 318 | func throwIsActive () = throw("DApp is already active") | |
319 | 319 | ||
320 | 320 | ||
321 | 321 | func isActive () = if (active) | |
322 | 322 | then unit | |
323 | 323 | else throw("DApp is inactive at this moment") | |
324 | 324 | ||
325 | 325 | ||
326 | 326 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
327 | 327 | then unit | |
328 | 328 | else throw("Only admin can call this function") | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | func throwAssets () = throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
332 | 332 | ||
333 | 333 | ||
334 | 334 | func throwOnePayment () = throw("One attached payment expected") | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | func throwThreshold (threshold,amountA,amountB) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(threshold)) + ": ") + toString(amountA)) + " ") + assetNameA) + ", ") + toString(amountB)) + " ") + assetNameB)) | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
344 | 344 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
345 | 345 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
349 | 349 | then { | |
350 | 350 | let $t01006410130 = calcStakingFuncAndAddres(stake, assetId) | |
351 | 351 | let call = $t01006410130._1 | |
352 | 352 | let stakingAddr = $t01006410130._2 | |
353 | 353 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
354 | 354 | } | |
355 | 355 | else { | |
356 | 356 | let $t01021610282 = calcStakingFuncAndAddres(stake, assetId) | |
357 | 357 | let call = $t01021610282._1 | |
358 | 358 | let stakingAddr = $t01021610282._2 | |
359 | 359 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
360 | 360 | } | |
361 | 361 | ||
362 | 362 | ||
363 | 363 | func calculateFeeDiscount (userAddr) = { | |
364 | 364 | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
365 | 365 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
366 | 366 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
367 | 367 | if (if ((swopAmount >= parseIntValue(discountValues[0]))) | |
368 | 368 | then (parseIntValue(discountValues[1]) > swopAmount) | |
369 | 369 | else false) | |
370 | 370 | then (feeScale6 - parseIntValue(discounts[0])) | |
371 | 371 | else if (if ((swopAmount >= parseIntValue(discountValues[1]))) | |
372 | 372 | then (parseIntValue(discountValues[2]) > swopAmount) | |
373 | 373 | else false) | |
374 | 374 | then (feeScale6 - parseIntValue(discounts[1])) | |
375 | 375 | else if (if ((swopAmount >= parseIntValue(discountValues[2]))) | |
376 | 376 | then (parseIntValue(discountValues[3]) > swopAmount) | |
377 | 377 | else false) | |
378 | 378 | then (feeScale6 - parseIntValue(discounts[2])) | |
379 | 379 | else if (if ((swopAmount >= parseIntValue(discountValues[3]))) | |
380 | 380 | then (parseIntValue(discountValues[4]) > swopAmount) | |
381 | 381 | else false) | |
382 | 382 | then (feeScale6 - parseIntValue(discounts[3])) | |
383 | 383 | else if ((swopAmount >= parseIntValue(discountValues[4]))) | |
384 | 384 | then (feeScale6 - parseIntValue(discounts[4])) | |
385 | 385 | else feeScale6 | |
386 | 386 | } | |
387 | 387 | ||
388 | 388 | ||
389 | 389 | @Callable(i) | |
390 | 390 | func init (firstHarvest) = { | |
391 | 391 | let $t01147511552 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
392 | 392 | let pmtAmountA = $t01147511552._1 | |
393 | 393 | let pmtAssetIdA = $t01147511552._2 | |
394 | 394 | let $t01155711634 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
395 | 395 | let pmtAmountB = $t01155711634._1 | |
396 | 396 | let pmtAssetIdB = $t01155711634._2 | |
397 | 397 | let $t01163911716 = getAssetInfo(pmtAssetIdA) | |
398 | 398 | let pmtStrAssetIdA = $t01163911716._1 | |
399 | 399 | let pmtAssetNameA = $t01163911716._2 | |
400 | 400 | let pmtDecimalsA = $t01163911716._3 | |
401 | 401 | let $t01172111798 = getAssetInfo(pmtAssetIdB) | |
402 | 402 | let pmtStrAssetIdB = $t01172111798._1 | |
403 | 403 | let pmtAssetNameB = $t01172111798._2 | |
404 | 404 | let pmtDecimalsB = $t01172111798._3 | |
405 | 405 | if (isDefined(getBoolean(this, kActive))) | |
406 | 406 | then throwIsActive() | |
407 | 407 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
408 | 408 | then throw("Assets must be different") | |
409 | 409 | else { | |
410 | 410 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
411 | 411 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
412 | 412 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
413 | 413 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
414 | 414 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
415 | 415 | let shareIssueId = calculateAssetId(shareIssue) | |
416 | 416 | let invariantCalculated = invariantCalc(pmtAmountA, pmtAmountB) | |
417 | 417 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetIdA)) | |
418 | 418 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
419 | 419 | else 0 | |
420 | 420 | if ((stake1 == stake1)) | |
421 | 421 | then { | |
422 | 422 | let stake2 = if (containsElement(stakingAssets, pmtStrAssetIdB)) | |
423 | 423 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
424 | 424 | else 0 | |
425 | 425 | if ((stake2 == stake2)) | |
426 | 426 | then { | |
427 | 427 | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
428 | 428 | if (firstHarvest) | |
429 | 429 | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
430 | 430 | else baseEntry | |
431 | 431 | } | |
432 | 432 | else throw("Strict value is not equal to itself.") | |
433 | 433 | } | |
434 | 434 | else throw("Strict value is not equal to itself.") | |
435 | 435 | } | |
436 | 436 | } | |
437 | 437 | ||
438 | 438 | ||
439 | 439 | ||
440 | 440 | @Callable(i) | |
441 | 441 | func replenishWithTwoTokens () = valueOrElse(isActive(), { | |
442 | 442 | let pmtAssetIdA = i.payments[0].assetId | |
443 | 443 | let pmtAssetIdB = i.payments[1].assetId | |
444 | 444 | let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA) | |
445 | 445 | let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB) | |
446 | 446 | let $t01474614823 = getAssetInfo(pmtAssetIdA) | |
447 | 447 | let pmtStrAssetIdA = $t01474614823._1 | |
448 | 448 | let pmtAssetNameA = $t01474614823._2 | |
449 | 449 | let pmtDecimalsA = $t01474614823._3 | |
450 | 450 | let $t01482814945 = getAssetInfo(pmtAssetIdB) | |
451 | 451 | let pmtStrAssetIdB = $t01482814945._1 | |
452 | 452 | let pmtAssetNameB = $t01482814945._2 | |
453 | 453 | let pmtDecimalsB = $t01482814945._3 | |
454 | 454 | let $t01495015454 = if ((ratioShareTokensInB > ratioShareTokensInA)) | |
455 | 455 | then { | |
456 | 456 | let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING) | |
457 | 457 | $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA) | |
458 | 458 | } | |
459 | 459 | else { | |
460 | 460 | let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING) | |
461 | 461 | $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB) | |
462 | 462 | } | |
463 | 463 | let pmtAmountA = $t01495015454._1 | |
464 | 464 | let pmtAmountB = $t01495015454._2 | |
465 | 465 | let change = $t01495015454._3 | |
466 | 466 | let changeAssetId = $t01495015454._4 | |
467 | 467 | let shareTokenRatio = $t01495015454._5 | |
468 | 468 | let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8) | |
469 | 469 | if ((size(i.payments) != 2)) | |
470 | 470 | then throw("Two attached assets expected") | |
471 | 471 | else if (if ((pmtAssetIdA != assetIdA)) | |
472 | 472 | then true | |
473 | 473 | else (pmtAssetIdB != assetIdB)) | |
474 | 474 | then throwAssets() | |
475 | 475 | else if ((shareTokenToPayAmount == 0)) | |
476 | 476 | then throw("Too small amount to replenish") | |
477 | 477 | else if ((0 > change)) | |
478 | 478 | then throw("Change < 0") | |
479 | 479 | else if (!(hasEnoughBalance)) | |
480 | 480 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
481 | 481 | else { | |
482 | 482 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetIdA)) | |
483 | 483 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
484 | 484 | else 0 | |
485 | 485 | if ((stake1 == stake1)) | |
486 | 486 | then { | |
487 | 487 | let stake2 = if (containsElement(stakingAssets, pmtStrAssetIdB)) | |
488 | 488 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
489 | 489 | else 0 | |
490 | 490 | if ((stake2 == stake2)) | |
491 | 491 | then [IntegerEntry(kBalanceA, (balanceA + pmtAmountA)), IntegerEntry(kBalanceB, (balanceB + pmtAmountB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(kInvariant, invariantCalc((balanceA + pmtAmountA), (balanceB + pmtAmountB))), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), ScriptTransfer(i.caller, change, changeAssetId)] | |
492 | 492 | else throw("Strict value is not equal to itself.") | |
493 | 493 | } | |
494 | 494 | else throw("Strict value is not equal to itself.") | |
495 | 495 | } | |
496 | 496 | }) | |
497 | 497 | ||
498 | 498 | ||
499 | 499 | ||
500 | 500 | @Callable(i) | |
501 | 501 | func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = valueOrElse(isActive(), { | |
502 | 502 | let $t01718717262 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
503 | 503 | let pmtAmount = $t01718717262._1 | |
504 | 504 | let pmtAssetId = $t01718717262._2 | |
505 | 505 | let $t01726717340 = getAssetInfo(pmtAssetId) | |
506 | 506 | let pmtStrAssetId = $t01726717340._1 | |
507 | 507 | let pmtAssetName = $t01726717340._2 | |
508 | 508 | let pmtDecimals = $t01726717340._3 | |
509 | 509 | let pmtMinThreshold = 5000000 | |
510 | 510 | let thresholdValueForMinTolerance = 50000000 | |
511 | 511 | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
512 | 512 | then 100000 | |
513 | 513 | else 1 | |
514 | 514 | let slippageValueMinForReplenish = (scale8 - ((scale8 * tolerance) / 10000000)) | |
515 | 515 | let slippageValueMaxForReplenish = (scale8 + ((scale8 * tolerance) / 10000000)) | |
516 | 516 | let slippageValueMinForSwap = (scale8 - ((scale8 * 1) / 10000000)) | |
517 | 517 | if ((pmtMinThreshold > pmtAmount)) | |
518 | 518 | then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens")) | |
519 | 519 | else if ((size(i.payments) != 1)) | |
520 | 520 | then throwOnePayment() | |
521 | 521 | else if (!(hasEnoughBalance)) | |
522 | 522 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
523 | 523 | else if (if ((pmtAssetId != assetIdA)) | |
524 | 524 | then (pmtAssetId != assetIdB) | |
525 | 525 | else false) | |
526 | 526 | then throwAssets() | |
527 | 527 | else { | |
528 | 528 | let $t01831818960 = if ((pmtAssetId == assetIdA)) | |
529 | 529 | then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB) | |
530 | 530 | else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount)) | |
531 | 531 | let virtualReplenishA = $t01831818960._1 | |
532 | 532 | let virtualReplenishB = $t01831818960._2 | |
533 | 533 | let balanceAfterSwapA = $t01831818960._3 | |
534 | 534 | let balanceAfterSwapB = $t01831818960._4 | |
535 | 535 | let newBalanceA = $t01831818960._5 | |
536 | 536 | let newBalanceB = $t01831818960._6 | |
537 | 537 | let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB) | |
538 | 538 | let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
539 | 539 | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
540 | 540 | if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew))) | |
541 | 541 | then true | |
542 | 542 | else (invariant > invariantNew)) | |
543 | 543 | then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
544 | 544 | else if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
545 | 545 | then true | |
546 | 546 | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
547 | 547 | then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect") | |
548 | 548 | else if (if ((dAppThresholdAmount > newBalanceA)) | |
549 | 549 | then true | |
550 | 550 | else (dAppThresholdAmount > newBalanceB)) | |
551 | 551 | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
552 | 552 | else { | |
553 | 553 | let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA) | |
554 | 554 | let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB) | |
555 | 555 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8) | |
556 | 556 | let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6) | |
557 | 557 | let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6) | |
558 | 558 | let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply) | |
559 | 559 | let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply) | |
560 | 560 | let $t02094721242 = if ((pmtStrAssetId == strAssetIdA)) | |
561 | 561 | then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB) | |
562 | 562 | else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA) | |
563 | 563 | let stakeAmount = $t02094721242._1 | |
564 | 564 | let unstakeAmount = $t02094721242._2 | |
565 | 565 | let unstakeAsset = $t02094721242._3 | |
566 | 566 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
567 | 567 | then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil) | |
568 | 568 | else 0 | |
569 | 569 | if ((stake1 == stake1)) | |
570 | 570 | then { | |
571 | 571 | let stake2 = if (containsElement(stakingAssets, unstakeAsset)) | |
572 | 572 | then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil) | |
573 | 573 | else 0 | |
574 | 574 | if ((stake2 == stake2)) | |
575 | 575 | then [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId), ScriptTransfer(moneyBoxAddress, governanceRewardTokenA, assetIdA), ScriptTransfer(moneyBoxAddress, governanceRewardTokenB, assetIdB), IntegerEntry(kBalanceA, (newBalanceA - governanceRewardTokenA)), IntegerEntry(kBalanceB, (newBalanceB - governanceRewardTokenB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmountAfterFee)), IntegerEntry(kInvariant, invariantCalc((newBalanceA - governanceRewardTokenA), (newBalanceB - governanceRewardTokenB)))] | |
576 | 576 | else throw("Strict value is not equal to itself.") | |
577 | 577 | } | |
578 | 578 | else throw("Strict value is not equal to itself.") | |
579 | 579 | } | |
580 | 580 | } | |
581 | 581 | }) | |
582 | 582 | ||
583 | 583 | ||
584 | 584 | ||
585 | 585 | @Callable(i) | |
586 | 586 | func withdraw () = valueOrElse(isActive(), { | |
587 | 587 | let $t02252922604 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
588 | 588 | let pmtAmount = $t02252922604._1 | |
589 | 589 | let pmtAssetId = $t02252922604._2 | |
590 | 590 | let amountToPayA = fraction(pmtAmount, balanceA, shareAssetSupply) | |
591 | 591 | let amountToPayB = fraction(pmtAmount, balanceB, shareAssetSupply) | |
592 | 592 | let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB)) | |
593 | 593 | if ((size(i.payments) != 1)) | |
594 | 594 | then throwOnePayment() | |
595 | 595 | else if ((pmtAssetId != shareAssetId)) | |
596 | 596 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
597 | 597 | else if (!(hasEnoughBalance)) | |
598 | 598 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
599 | 599 | else { | |
600 | 600 | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
601 | 601 | then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
602 | 602 | else 0 | |
603 | 603 | if ((stake1 == stake1)) | |
604 | 604 | then { | |
605 | 605 | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
606 | 606 | then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
607 | 607 | else 0 | |
608 | 608 | if ((stake2 == stake2)) | |
609 | 609 | then [IntegerEntry(kBalanceA, (balanceA - amountToPayA)), IntegerEntry(kBalanceB, (balanceB - amountToPayB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply - pmtAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
610 | 610 | else throw("Strict value is not equal to itself.") | |
611 | 611 | } | |
612 | 612 | else throw("Strict value is not equal to itself.") | |
613 | 613 | } | |
614 | 614 | }) | |
615 | 615 | ||
616 | 616 | ||
617 | 617 | ||
618 | 618 | @Callable(i) | |
619 | 619 | func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), { | |
620 | 620 | let $t02415524230 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
621 | 621 | let pmtAmount = $t02415524230._1 | |
622 | 622 | let pmtAssetId = $t02415524230._2 | |
623 | 623 | if ((0 >= estimatedAmountToReceive)) | |
624 | 624 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
625 | 625 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
626 | 626 | then throw("Minimal amount can't be greater than estimated.") | |
627 | 627 | else if ((size(i.payments) != 1)) | |
628 | 628 | then throwOnePayment() | |
629 | 629 | else if (!(hasEnoughBalance)) | |
630 | 630 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
631 | 631 | else if (if ((pmtAssetId != assetIdA)) | |
632 | 632 | then (pmtAssetId != assetIdB) | |
633 | 633 | else false) | |
634 | 634 | then throwAssets() | |
635 | 635 | else if ((10000000 > pmtAmount)) | |
636 | 636 | then throw("Only swap of 10.000000 or more tokens is allowed") | |
637 | 637 | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
638 | 638 | then true | |
639 | 639 | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
640 | 640 | then throw("Incorrect args and pmt ratio") | |
641 | 641 | else { | |
642 | 642 | let sendAssetId = if ((pmtAssetId == assetIdA)) | |
643 | 643 | then assetIdB | |
644 | 644 | else assetIdA | |
645 | 645 | let amount = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId) | |
646 | 646 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
647 | 647 | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
648 | 648 | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
649 | 649 | let $t02568325945 = if ((pmtAssetId == assetIdA)) | |
650 | 650 | then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward)) | |
651 | 651 | else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount)) | |
652 | 652 | let newBalanceA = $t02568325945._1 | |
653 | 653 | let newBalanceB = $t02568325945._2 | |
654 | 654 | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
655 | 655 | if (if ((dAppThresholdAmount > newBalanceA)) | |
656 | 656 | then true | |
657 | 657 | else (dAppThresholdAmount > newBalanceB)) | |
658 | 658 | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
659 | 659 | else { | |
660 | 660 | let $t02624426317 = getAssetInfo(pmtAssetId) | |
661 | 661 | let pmtStrAssetId = $t02624426317._1 | |
662 | 662 | let pmtAssetName = $t02624426317._2 | |
663 | 663 | let pmtDecimals = $t02624426317._3 | |
664 | 664 | let $t02633026407 = getAssetInfo(sendAssetId) | |
665 | 665 | let sendStrAssetId = $t02633026407._1 | |
666 | 666 | let sendAssetName = $t02633026407._2 | |
667 | 667 | let sendDecimals = $t02633026407._3 | |
668 | 668 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
669 | 669 | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
670 | 670 | else 0 | |
671 | 671 | if ((stake1 == stake1)) | |
672 | 672 | then { | |
673 | 673 | let stake2 = if (containsElement(stakingAssets, sendStrAssetId)) | |
674 | 674 | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), sendStrAssetId], nil) | |
675 | 675 | else 0 | |
676 | 676 | if ((stake2 == stake2)) | |
677 | 677 | then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId)], [amountMinusFee, sendAssetId]) | |
678 | 678 | else throw("Strict value is not equal to itself.") | |
679 | 679 | } | |
680 | 680 | else throw("Strict value is not equal to itself.") | |
681 | 681 | } | |
682 | 682 | } | |
683 | 683 | }) | |
684 | 684 | ||
685 | 685 | ||
686 | 686 | ||
687 | 687 | @Callable(i) | |
688 | 688 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
689 | 689 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
690 | 690 | else suspend("Paused by admin")) | |
691 | 691 | ||
692 | 692 | ||
693 | 693 | ||
694 | 694 | @Callable(i) | |
695 | 695 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
696 | 696 | then throwIsActive() | |
697 | 697 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
698 | 698 | ||
699 | 699 | ||
700 | 700 | ||
701 | 701 | @Callable(i) | |
702 | 702 | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), { | |
703 | 703 | let amountEnrollA = (accountBalanceWithStakedA - balanceA) | |
704 | 704 | let amountEnrollB = (accountBalanceWithStakedB - balanceB) | |
705 | 705 | let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB)) | |
706 | 706 | if ((i.caller != moneyBoxAddress)) | |
707 | 707 | then throw("Only the money box can call this function") | |
708 | 708 | else if (if ((0 > amountEnrollA)) | |
709 | 709 | then true | |
710 | 710 | else (0 > amountEnrollB)) | |
711 | 711 | then suspend("Enroll amount negative") | |
712 | 712 | else if (if ((amountEnrollA == 0)) | |
713 | 713 | then (amountEnrollB == 0) | |
714 | 714 | else false) | |
715 | 715 | then throw("No money to take") | |
716 | 716 | else { | |
717 | 717 | let stake1 = if (if (containsElement(stakingAssets, strAssetIdA)) | |
718 | 718 | then (amountEnrollA > 0) | |
719 | 719 | else false) | |
720 | 720 | then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
721 | 721 | else 0 | |
722 | 722 | if ((stake1 == stake1)) | |
723 | 723 | then { | |
724 | 724 | let stake2 = if (if (containsElement(stakingAssets, strAssetIdB)) | |
725 | 725 | then (amountEnrollB > 0) | |
726 | 726 | else false) | |
727 | 727 | then invoke(this, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
728 | 728 | else 0 | |
729 | 729 | if ((stake2 == stake2)) | |
730 | 730 | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))] | |
731 | 731 | else throw("Strict value is not equal to itself.") | |
732 | 732 | } | |
733 | 733 | else throw("Strict value is not equal to itself.") | |
734 | 734 | } | |
735 | 735 | }) | |
736 | 736 | ||
737 | 737 | ||
738 | 738 | ||
739 | 739 | @Callable(i) | |
740 | 740 | func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), [IntegerEntry(kShareLimit, shareLimit)])) | |
741 | 741 | ||
742 | 742 | ||
743 | 743 | ||
744 | 744 | @Callable(i) | |
745 | 745 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
746 | 746 | then throw("Only contract itself can invoke this function") | |
747 | 747 | else { | |
748 | 748 | let $t02961429717 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
749 | 749 | let call = $t02961429717._1 | |
750 | 750 | let addr = $t02961429717._2 | |
751 | 751 | let params = $t02961429717._3 | |
752 | 752 | let payments = $t02961429717._4 | |
753 | 753 | let inv = invoke(addr, call, params, payments) | |
754 | 754 | if ((inv == inv)) | |
755 | 755 | then nil | |
756 | 756 | else throw("Strict value is not equal to itself.") | |
757 | 757 | } | |
758 | 758 | ||
759 | 759 | ||
760 | 760 | @Verifier(tx) | |
761 | 761 | func verify () = { | |
762 | 762 | let multiSignedByAdmins = { | |
763 | 763 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
764 | 764 | then 1 | |
765 | 765 | else 0 | |
766 | 766 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
767 | 767 | then 1 | |
768 | 768 | else 0 | |
769 | 769 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
770 | 770 | then 1 | |
771 | 771 | else 0 | |
772 | 772 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
773 | 773 | } | |
774 | 774 | match tx { | |
775 | 775 | case inv: InvokeScriptTransaction => | |
776 | 776 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
777 | 777 | then (inv.function == "takeIntoAccountExtraFunds") | |
778 | 778 | else false | |
779 | 779 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
780 | 780 | then true | |
781 | 781 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
782 | 782 | then true | |
783 | 783 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
784 | 784 | then true | |
785 | 785 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
786 | 786 | if (if (callTakeIntoAccount) | |
787 | 787 | then signedByAdmin | |
788 | 788 | else false) | |
789 | 789 | then true | |
790 | 790 | else multiSignedByAdmins | |
791 | 791 | case _ => | |
792 | 792 | multiSignedByAdmins | |
793 | 793 | } | |
794 | 794 | } | |
795 | 795 |
github/deemru/w8io/169f3d6 85.17 ms ◑