tx · CZHRW83L3jrKgPjrDp9UJ1zCjV27zQSKPpuoHnoTfvMn 3N8E9LU71MDkdP8FWtbP4TBXCNhoc15hWfs: -0.14000000 Waves 2022.10.19 16:58 [2279358] smart account 3N8E9LU71MDkdP8FWtbP4TBXCNhoc15hWfs > SELF 0.00000000 Waves
{ "type": 13, "id": "CZHRW83L3jrKgPjrDp9UJ1zCjV27zQSKPpuoHnoTfvMn", "fee": 14000000, "feeAssetId": null, "timestamp": 1666187990653, "version": 2, "chainId": 84, "sender": "3N8E9LU71MDkdP8FWtbP4TBXCNhoc15hWfs", "senderPublicKey": "2EDucEDvqYfn6hdx4PbvykQFRoNgPMWX6SiVPjM8AyxM", "proofs": [ "35BR14HSBfd1zGMq9z3UZrcBBQhZAbrWF1FqkVUEb7daDJ18SyBL2gZkqUtN1vocXr2qKrBuqBPCi5iwJDf5stqg", "228i2eGzgJ8KxDNPTSKZ89Z7oThjv2UkcDxXrhLUVmuL7ZgsknMPzSq9ajKpvZY6ppX9JZJGr1jqg4m9KKvXPF5x" ], "script": "base64:BgIiCAISAwoBCBIAEgASAwoBARIAEgASABIGCgQYEQEBEgASAFsAB2tBY3RpdmUCBmFjdGl2ZQALa0FjdGl2ZUdsb2ICFGFjdGl2ZV9hbGxfY29udHJhY3RzAAZrQ2F1c2UCDnNodXRkb3duX2NhdXNlAA1rTGFzdEludGVyZXN0Ag1sYXN0X2ludGVyZXN0ABFrVXNlckxhc3RJbnRlcmVzdAIOX2xhc3RfaW50ZXJlc3QAD2tVc2VyU1dPUExvY2tlZAIMX1NXT1BfYW1vdW50ABBrVG90YWxTV09QTG9ja2VkAhF0b3RhbF9TV09QX2Ftb3VudAAVa1VzZXJTd29wVW5sb2NrSGVpZ2h0AhNfU1dPUF91bmxvY2tfaGVpZ2h0ABBrVXNlckdTd29wTG9ja2VkAg1fR1N3b3BfYW1vdW50ABFrVG90YWxHU3dvcExvY2tlZAISdG90YWxfR1N3b3BfYW1vdW50ABJrVXNlclRvdGFsVm90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HNlAgkBC2lzQWRtaW5DYWxsAQUBaQMFBmFjdGl2ZQkAAgECFkRBcHAgaXMgYWxyZWFkeSBhY3RpdmUJAMwIAgkBDEJvb2xlYW5FbnRyeQIFB2tBY3RpdmUGCQDMCAIJAQtEZWxldGVFbnRyeQEFBmtDYXVzZQUDbmlsAQJ0eAEGdmVyaWZ5AAQSYWRtaW5QdWJLZXkxU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkxAAEAAAQSYWRtaW5QdWJLZXkyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUMYWRtaW5QdWJLZXkyAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUMYWRtaW5QdWJLZXkzAAEAAAkAZwIJAGQCCQBkAgUSYWRtaW5QdWJLZXkxU2lnbmVkBRJhZG1pblB1YktleTJTaWduZWQFEmFkbWluUHViS2V5M1NpZ25lZAACLy++PQ==", "height": 2279358, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DUg3371WqvKdHqXYPo6PGFt8PPWKGKBNPRSqTTLwGgqb Next: EHYDiRDmTfBPmLcejzEMHuQ3iGqnPppZham6mRg8hwrN Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kActive = "active" | |
5 | + | ||
6 | + | let kActiveGlob = "active_all_contracts" | |
5 | 7 | ||
6 | 8 | let kCause = "shutdown_cause" | |
7 | 9 | ||
91 | 93 | ||
92 | 94 | let kAirdropMoneyBoxAddr = "airdrop_fee_money_box" | |
93 | 95 | ||
96 | + | let kOraclePool = "pool_" | |
97 | + | ||
94 | 98 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
95 | 99 | ||
96 | 100 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
143 | 147 | ||
144 | 148 | let active = valueOrElse(getBoolean(this, kActive), true) | |
145 | 149 | ||
150 | + | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
151 | + | ||
146 | 152 | let airdropFee = getIntegerValue(oracle, kAirdropFee) | |
147 | 153 | ||
148 | 154 | let currVotingPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
150 | 156 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
151 | 157 | ||
152 | 158 | ||
153 | - | func isActive () = if (active) | |
159 | + | func isActive () = if (if (active) | |
160 | + | then activeGlob | |
161 | + | else false) | |
154 | 162 | then unit | |
155 | 163 | else throw("DApp is inactive at this moment") | |
156 | 164 | ||
178 | 186 | ||
179 | 187 | ||
180 | 188 | func getUserInterestInfo (user,lastInterest) = { | |
181 | - | let $ | |
182 | - | let userSWOPAmount = $ | |
183 | - | let userGSwopAmount = $ | |
189 | + | let $t050365099 = getUserLockedInfo(user) | |
190 | + | let userSWOPAmount = $t050365099._1 | |
191 | + | let userGSwopAmount = $t050365099._2 | |
184 | 192 | let userLastInterest = valueOrElse(getInteger(this, (user + kUserLastInterest)), lastInterest) | |
185 | 193 | $Tuple3(userLastInterest, userSWOPAmount, userGSwopAmount) | |
186 | 194 | } | |
231 | 239 | ||
232 | 240 | ||
233 | 241 | func getUserVoteInfo (user) = { | |
234 | - | let $ | |
242 | + | let $t074637996 = if (isDefined(getString(votingAddr, (toString(user) + kUserTotalStruc)))) | |
235 | 243 | then { | |
236 | 244 | let data = split(valueOrErrorMessage(getString(votingAddr, (toString(user) + kUserTotalStruc)), "Empty kUserTotalStruc"), "_") | |
237 | 245 | $Tuple3(parseIntValue(data[0]), parseIntValue(data[1]), parseIntValue(data[2])) | |
240 | 248 | let uPoolTotalSWOP = valueOrElse(getInteger(votingAddr, (toString(user) + kUserTotalVoteSWOP)), 0) | |
241 | 249 | $Tuple3(uPoolTotalSWOP, 0, currVotingPeriod) | |
242 | 250 | } | |
243 | - | let userTotalVoteSWOP = $ | |
244 | - | let userUnvoted = $ | |
245 | - | let userUnvotedPeriod = $ | |
251 | + | let userTotalVoteSWOP = $t074637996._1 | |
252 | + | let userUnvoted = $t074637996._2 | |
253 | + | let userUnvotedPeriod = $t074637996._3 | |
246 | 254 | let userUnvotedActual = if ((userUnvotedPeriod == currVotingPeriod)) | |
247 | 255 | then userUnvoted | |
248 | 256 | else 0 | |
264 | 272 | ||
265 | 273 | func claimCalc (user) = { | |
266 | 274 | let lastInterest = getLastInterestInfo() | |
267 | - | let $ | |
268 | - | let userLastInterest = $ | |
269 | - | let userSWOPLocked = $ | |
270 | - | let userGSwopAmount = $ | |
275 | + | let $t088708967 = getUserInterestInfo(user, lastInterest) | |
276 | + | let userLastInterest = $t088708967._1 | |
277 | + | let userSWOPLocked = $t088708967._2 | |
278 | + | let userGSwopAmount = $t088708967._3 | |
271 | 279 | let claimAmount = fraction(userGSwopAmount, (lastInterest - userLastInterest), scaleValue) | |
272 | 280 | let userNewInterest = lastInterest | |
273 | 281 | $Tuple2(userNewInterest, claimAmount) | |
274 | 282 | } | |
275 | 283 | ||
276 | 284 | ||
285 | + | func isOraclePool (poolAddress) = if (isDefined(getString(oracle, (kOraclePool + poolAddress)))) | |
286 | + | then unit | |
287 | + | else throw("DApp is not registered pool") | |
288 | + | ||
289 | + | ||
290 | + | @Callable(i) | |
291 | + | func addPool (poolAddress) = valueOrElse(isAdminCall(i), valueOrElse(isActive(), valueOrElse(isOraclePool(poolAddress), if (isDefined(getInteger(this, (poolAddress + kRewardPoolFractionCurrent)))) | |
292 | + | then throw("Pool already in governance") | |
293 | + | else [IntegerEntry((poolAddress + kRewardPoolFractionCurrent), 0), IntegerEntry((poolAddress + kRewardPoolFractionPrevious), 0), IntegerEntry((poolAddress + kHeightPoolFraction), getIntegerValue(this, kRewardUpdateHeight))]))) | |
294 | + | ||
295 | + | ||
296 | + | ||
277 | 297 | @Callable(i) | |
278 | 298 | func airDrop () = valueOrElse(isActive(), { | |
279 | - | let $ | |
280 | - | let pmtAmount = $ | |
281 | - | let pmtAssetId = $ | |
299 | + | let $t098669941 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
300 | + | let pmtAmount = $t098669941._1 | |
301 | + | let pmtAssetId = $t098669941._2 | |
282 | 302 | if ((pmtAssetId != SWOP)) | |
283 | 303 | then throw("Incorrect pmtAssetId") | |
284 | 304 | else { | |
285 | 305 | let airdropFeeAmount = fraction(pmtAmount, airdropFee, feeSacle6, CEILING) | |
286 | - | let $ | |
287 | - | let totalSWOPLocked = $ | |
288 | - | let totalGSwopLocked = $ | |
306 | + | let $t01011410176 = getTotalLockedInfo() | |
307 | + | let totalSWOPLocked = $t01011410176._1 | |
308 | + | let totalGSwopLocked = $t01011410176._2 | |
289 | 309 | let lastInterest = getLastInterestInfo() | |
290 | 310 | let interestNew = (lastInterest + fraction((pmtAmount - airdropFeeAmount), scaleValue, totalGSwopLocked)) | |
291 | 311 | [IntegerEntry(kLastInterest, interestNew), ScriptTransfer(airdropMoneyBoxAddr, airdropFeeAmount, SWOP)] | |
296 | 316 | ||
297 | 317 | @Callable(i) | |
298 | 318 | func lockSWOP () = valueOrElse(isActive(), { | |
299 | - | let $ | |
300 | - | let pmtAmount = $ | |
301 | - | let pmtAssetId = $ | |
319 | + | let $t01055410629 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
320 | + | let pmtAmount = $t01055410629._1 | |
321 | + | let pmtAssetId = $t01055410629._2 | |
302 | 322 | if ((pmtAssetId != SWOP)) | |
303 | 323 | then throw("Incorrect pmtAssetId") | |
304 | 324 | else { | |
305 | 325 | let user = toString(i.caller) | |
306 | 326 | let lastInterest = getLastInterestInfo() | |
307 | - | let $ | |
308 | - | let userSWOPLocked = $ | |
309 | - | let userGSwopLocked = $ | |
310 | - | let $ | |
311 | - | let userNewInterest = $ | |
312 | - | let claimAmountAvailable = $ | |
327 | + | let $t01078010843 = getUserLockedInfo(user) | |
328 | + | let userSWOPLocked = $t01078010843._1 | |
329 | + | let userGSwopLocked = $t01078010843._2 | |
330 | + | let $t01084810909 = claimCalc(user) | |
331 | + | let userNewInterest = $t01084810909._1 | |
332 | + | let claimAmountAvailable = $t01084810909._2 | |
313 | 333 | let availableForClaim = getUserAvailableForClaim(user) | |
314 | 334 | let availableForClaimNew = (availableForClaim + claimAmountAvailable) | |
315 | 335 | let userSWOPLockedNew = (userSWOPLocked + pmtAmount) | |
316 | 336 | let userGSwopLockedNew = (userGSwopLocked + pmtAmount) | |
317 | - | let $ | |
318 | - | let totalSWOPLocked = $ | |
319 | - | let totalGSwopLocked = $ | |
337 | + | let $t01115711219 = getTotalLockedInfo() | |
338 | + | let totalSWOPLocked = $t01115711219._1 | |
339 | + | let totalGSwopLocked = $t01115711219._2 | |
320 | 340 | let totalSWOPLockedNew = (totalSWOPLocked + pmtAmount) | |
321 | 341 | let totalGSwopLockedNew = (totalGSwopLocked + pmtAmount) | |
322 | 342 | [IntegerEntry((user + kUserSwopUnlockHeight), (height + lockSwopBlocksAmount)), IntegerEntry((user + kUserLastInterest), userNewInterest), IntegerEntry((user + kUserSWOPLocked), userSWOPLockedNew), IntegerEntry((user + kUserGSwopLocked), userGSwopLockedNew), IntegerEntry((user + kUserAvailableForClaim), availableForClaimNew), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew)] | |
334 | 354 | else if ((unlockHeight > height)) | |
335 | 355 | then throw(("You can't withdraw till " + toString(unlockHeight))) | |
336 | 356 | else { | |
337 | - | let $ | |
338 | - | let totalSWOPLocked = $ | |
339 | - | let totalGSwopLocked = $ | |
340 | - | let $ | |
341 | - | let userSWOPLocked = $ | |
342 | - | let userGSwopLocked = $ | |
343 | - | let $ | |
344 | - | let userNewInterest = $ | |
345 | - | let claimAmountAvailable = $ | |
346 | - | let $ | |
347 | - | let userVoteAmount = $ | |
348 | - | let userUnvoteAmount = $ | |
357 | + | let $t01219712259 = getTotalLockedInfo() | |
358 | + | let totalSWOPLocked = $t01219712259._1 | |
359 | + | let totalGSwopLocked = $t01219712259._2 | |
360 | + | let $t01226412327 = getUserLockedInfo(user) | |
361 | + | let userSWOPLocked = $t01226412327._1 | |
362 | + | let userGSwopLocked = $t01226412327._2 | |
363 | + | let $t01233212393 = claimCalc(user) | |
364 | + | let userNewInterest = $t01233212393._1 | |
365 | + | let claimAmountAvailable = $t01233212393._2 | |
366 | + | let $t01239812464 = getUserVoteInfo(i.caller) | |
367 | + | let userVoteAmount = $t01239812464._1 | |
368 | + | let userUnvoteAmount = $t01239812464._2 | |
349 | 369 | let userVoteAmountForNewPool = getUserTotalVoteForNewPoolAmount(i.caller) | |
350 | 370 | let blockedInLaunchpad = getUserBlockedInLauchpad(i.caller) | |
351 | 371 | if (if (if ((0 > userUnvoteAmount)) | |
376 | 396 | func claimAndWithdrawSWOP () = valueOrElse(isActive(), { | |
377 | 397 | let user = toString(i.caller) | |
378 | 398 | let availableForClaim = getUserAvailableForClaim(user) | |
379 | - | let $ | |
380 | - | let userNewInterest = $ | |
381 | - | let claimAmount = $ | |
399 | + | let $t01398314035 = claimCalc(user) | |
400 | + | let userNewInterest = $t01398314035._1 | |
401 | + | let claimAmount = $t01398314035._2 | |
382 | 402 | let userClaimAmount = (availableForClaim + claimAmount) | |
383 | 403 | if ((userClaimAmount == 0)) | |
384 | 404 | then throw("You have 0 available SWOP") | |
385 | - | else [IntegerEntry((user + kUserLastInterest), userNewInterest), ScriptTransfer(i.caller, userClaimAmount, SWOP)] | |
405 | + | else [IntegerEntry((user + kUserLastInterest), userNewInterest), IntegerEntry((user + kUserAvailableForClaim), 0), ScriptTransfer(i.caller, userClaimAmount, SWOP)] | |
386 | 406 | }) | |
387 | 407 | ||
388 | 408 | ||
390 | 410 | @Callable(i) | |
391 | 411 | func claimAndStakeSWOP () = valueOrElse(isActive(), { | |
392 | 412 | let user = toString(i.caller) | |
393 | - | let $ | |
394 | - | let totalSWOPLocked = $ | |
395 | - | let totalGSwopLocked = $ | |
396 | - | let $ | |
397 | - | let userSWOPLocked = $ | |
398 | - | let userGSwopLocked = $ | |
413 | + | let $t01446514527 = getTotalLockedInfo() | |
414 | + | let totalSWOPLocked = $t01446514527._1 | |
415 | + | let totalGSwopLocked = $t01446514527._2 | |
416 | + | let $t01453214595 = getUserLockedInfo(user) | |
417 | + | let userSWOPLocked = $t01453214595._1 | |
418 | + | let userGSwopLocked = $t01453214595._2 | |
399 | 419 | let availableForClaim = getUserAvailableForClaim(user) | |
400 | - | let $ | |
401 | - | let userNewInterest = $ | |
402 | - | let claimAmount = $ | |
420 | + | let $t01465914710 = claimCalc(user) | |
421 | + | let userNewInterest = $t01465914710._1 | |
422 | + | let claimAmount = $t01465914710._2 | |
403 | 423 | let userClaimAmount = (availableForClaim + claimAmount) | |
404 | 424 | let userSWOPLockedNew = (userSWOPLocked + userClaimAmount) | |
405 | 425 | let userGSwopLockedNew = (userGSwopLocked + (userClaimAmount * 2)) | |
407 | 427 | let totalGSwopLockedNew = (totalGSwopLocked + (userClaimAmount * 2)) | |
408 | 428 | if ((userClaimAmount == 0)) | |
409 | 429 | then throw("You have 0 available SWOP") | |
410 | - | else [IntegerEntry((toString(i.caller) + kUserSwopUnlockHeight), (height + lockSwopBlocksAmount)), IntegerEntry((toString(i.caller) + kUserLastInterest), userNewInterest), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew), IntegerEntry((toString(i.caller) + kUserSWOPLocked), userSWOPLockedNew), IntegerEntry((toString(i.caller) + kUserGSwopLocked), userGSwopLockedNew)] | |
430 | + | else [IntegerEntry((toString(i.caller) + kUserSwopUnlockHeight), (height + lockSwopBlocksAmount)), IntegerEntry((toString(i.caller) + kUserLastInterest), userNewInterest), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew), IntegerEntry((toString(i.caller) + kUserSWOPLocked), userSWOPLockedNew), IntegerEntry((toString(i.caller) + kUserGSwopLocked), userGSwopLockedNew), IntegerEntry((user + kUserAvailableForClaim), 0)] | |
411 | 431 | }) | |
412 | 432 | ||
413 | 433 | ||
414 | 434 | ||
415 | 435 | @Callable(i) | |
416 | 436 | func lockSWOPFromFarming () = valueOrElse(isActive(), { | |
417 | - | let $ | |
418 | - | let pmtAmount = $ | |
419 | - | let pmtAssetId = $ | |
437 | + | let $t01570615781 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
438 | + | let pmtAmount = $t01570615781._1 | |
439 | + | let pmtAssetId = $t01570615781._2 | |
420 | 440 | if ((i.caller != farmingAddr)) | |
421 | 441 | then throw("Only farming can call this function") | |
422 | 442 | else if ((pmtAssetId != SWOP)) | |
424 | 444 | else { | |
425 | 445 | let user = toString(i.originCaller) | |
426 | 446 | let lastInterest = getLastInterestInfo() | |
427 | - | let $ | |
428 | - | let userSWOPLocked = $ | |
429 | - | let userGSwopLocked = $ | |
430 | - | let $ | |
431 | - | let userNewInterest = $ | |
432 | - | let claimAmountAvailable = $ | |
447 | + | let $t01602416087 = getUserLockedInfo(user) | |
448 | + | let userSWOPLocked = $t01602416087._1 | |
449 | + | let userGSwopLocked = $t01602416087._2 | |
450 | + | let $t01609216153 = claimCalc(user) | |
451 | + | let userNewInterest = $t01609216153._1 | |
452 | + | let claimAmountAvailable = $t01609216153._2 | |
433 | 453 | let availableForClaim = getUserAvailableForClaim(user) | |
434 | 454 | let availableForClaimNew = (availableForClaim + claimAmountAvailable) | |
435 | 455 | let userSWOPLockedNew = (userSWOPLocked + pmtAmount) | |
436 | 456 | let userGSwopLockedNew = (userGSwopLocked + (pmtAmount * 2)) | |
437 | - | let $ | |
438 | - | let totalSWOPLocked = $ | |
439 | - | let totalGSwopLocked = $ | |
457 | + | let $t01640516467 = getTotalLockedInfo() | |
458 | + | let totalSWOPLocked = $t01640516467._1 | |
459 | + | let totalGSwopLocked = $t01640516467._2 | |
440 | 460 | let totalSWOPLockedNew = (totalSWOPLocked + pmtAmount) | |
441 | 461 | let totalGSwopLockedNew = (totalGSwopLocked + (pmtAmount * 2)) | |
442 | 462 | [IntegerEntry((user + kUserSwopUnlockHeight), (height + lockSwopBlocksAmount)), IntegerEntry((user + kUserLastInterest), userNewInterest), IntegerEntry((user + kUserSWOPLocked), userSWOPLockedNew), IntegerEntry((user + kUserGSwopLocked), userGSwopLocked), IntegerEntry((user + kUserAvailableForClaim), availableForClaimNew), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew)] | |
577 | 597 | ||
578 | 598 | $f3_2($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
579 | 599 | } | |
580 | - | let $ | |
581 | - | let sumRewardCurrent = $ | |
582 | - | let rewardUpdateHeightFirstPaginationEntry = $ | |
600 | + | let $t02148821599 = getSumReward(sumRewardCurrentTemp, pagination) | |
601 | + | let sumRewardCurrent = $t02148821599._1 | |
602 | + | let rewardUpdateHeightFirstPaginationEntry = $t02148821599._2 | |
583 | 603 | let rewardUpdateHeightEntry = if ((pagination == 2)) | |
584 | 604 | then [IntegerEntry(kRewardUpdateHeight, rewardUpdateHeight)] | |
585 | 605 | else nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kActive = "active" | |
5 | + | ||
6 | + | let kActiveGlob = "active_all_contracts" | |
5 | 7 | ||
6 | 8 | let kCause = "shutdown_cause" | |
7 | 9 | ||
8 | 10 | let kLastInterest = "last_interest" | |
9 | 11 | ||
10 | 12 | let kUserLastInterest = "_last_interest" | |
11 | 13 | ||
12 | 14 | let kUserSWOPLocked = "_SWOP_amount" | |
13 | 15 | ||
14 | 16 | let kTotalSWOPLocked = "total_SWOP_amount" | |
15 | 17 | ||
16 | 18 | let kUserSwopUnlockHeight = "_SWOP_unlock_height" | |
17 | 19 | ||
18 | 20 | let kUserGSwopLocked = "_GSwop_amount" | |
19 | 21 | ||
20 | 22 | let kTotalGSwopLocked = "total_GSwop_amount" | |
21 | 23 | ||
22 | 24 | let kUserTotalVoteSWOP = "_user_total_vote_gSWOP" | |
23 | 25 | ||
24 | 26 | let kUserAvailableForClaim = "_user_available_for_claim" | |
25 | 27 | ||
26 | 28 | let kRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
27 | 29 | ||
28 | 30 | let kRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
29 | 31 | ||
30 | 32 | let kHeightPoolFraction = "_pool_reward_update_height" | |
31 | 33 | ||
32 | 34 | let kRewardUpdateHeight = "reward_update_height" | |
33 | 35 | ||
34 | 36 | let kRewardUpdateFirstPaginationHeight = "reward_update_height_first_pagination" | |
35 | 37 | ||
36 | 38 | let kNoVotingForNewPool = "_vote_no" | |
37 | 39 | ||
38 | 40 | let kYesVotingForNewPool = "_vote_yes" | |
39 | 41 | ||
40 | 42 | let kStatusOfVotingForNewPool = "_status" | |
41 | 43 | ||
42 | 44 | let kHeightOfPoolVotingForNewPool = "_finish_height" | |
43 | 45 | ||
44 | 46 | let activeVoteFirst = "voting_active_cell_1" | |
45 | 47 | ||
46 | 48 | let activeVoteSecond = "voting_active_cell_2" | |
47 | 49 | ||
48 | 50 | let activeVoteThird = "voting_active_cell_3" | |
49 | 51 | ||
50 | 52 | let kTempCurSum = "sum_reward_current" | |
51 | 53 | ||
52 | 54 | let kLaunchpadBoughtTickets = "_bought_tickets" | |
53 | 55 | ||
54 | 56 | let kLaunchpadSwopPerTickets = "_swop_per_ticket" | |
55 | 57 | ||
56 | 58 | let kLaunchpadActiveId = "launchpad_active_id" | |
57 | 59 | ||
58 | 60 | let kLaunchpadDuration = "_duration" | |
59 | 61 | ||
60 | 62 | let kLaunchpadStartHeight = "_start_height" | |
61 | 63 | ||
62 | 64 | let kStartHeight = "start_height" | |
63 | 65 | ||
64 | 66 | let kBasePeriod = "base_period" | |
65 | 67 | ||
66 | 68 | let kPeriodLength = "period_length" | |
67 | 69 | ||
68 | 70 | let kUserTotalStruc = "_user_total_struc" | |
69 | 71 | ||
70 | 72 | let kLauchpadFreezSwopDuration = "_freeze_swop_duration" | |
71 | 73 | ||
72 | 74 | let kSWOPid = "SWOP_id" | |
73 | 75 | ||
74 | 76 | let kAirdropFee = "airdrop_fee" | |
75 | 77 | ||
76 | 78 | let kAdminPubKey1 = "admin_pub_1" | |
77 | 79 | ||
78 | 80 | let kAdminPubKey2 = "admin_pub_2" | |
79 | 81 | ||
80 | 82 | let kAdminPubKey3 = "admin_pub_3" | |
81 | 83 | ||
82 | 84 | let kMoneyBoxPubKey = "money_box_pub_key" | |
83 | 85 | ||
84 | 86 | let kFarmingAddr = "farming_address" | |
85 | 87 | ||
86 | 88 | let kVotingAddr = "voting_address" | |
87 | 89 | ||
88 | 90 | let kVotingNewPoolAddr = "voting_new_pool_address" | |
89 | 91 | ||
90 | 92 | let kLaunchpadAddr = "launchpad_address" | |
91 | 93 | ||
92 | 94 | let kAirdropMoneyBoxAddr = "airdrop_fee_money_box" | |
93 | 95 | ||
96 | + | let kOraclePool = "pool_" | |
97 | + | ||
94 | 98 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
95 | 99 | ||
96 | 100 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
97 | 101 | case string: String => | |
98 | 102 | fromBase58String(string) | |
99 | 103 | case nothing => | |
100 | 104 | throw((key + "is empty")) | |
101 | 105 | } | |
102 | 106 | ||
103 | 107 | ||
104 | 108 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
105 | 109 | ||
106 | 110 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
107 | 111 | ||
108 | 112 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
109 | 113 | ||
110 | 114 | let moneyBoxPubKey = getBase58FromOracle(kMoneyBoxPubKey) | |
111 | 115 | ||
112 | 116 | let farmingAddr = Address(getBase58FromOracle(kFarmingAddr)) | |
113 | 117 | ||
114 | 118 | let votingAddr = Address(getBase58FromOracle(kVotingAddr)) | |
115 | 119 | ||
116 | 120 | let votingNewPoolAddr = Address(getBase58FromOracle(kVotingNewPoolAddr)) | |
117 | 121 | ||
118 | 122 | let launchpadAddr = Address(getBase58FromOracle(kLaunchpadAddr)) | |
119 | 123 | ||
120 | 124 | let airdropMoneyBoxAddr = Address(getBase58FromOracle(kAirdropMoneyBoxAddr)) | |
121 | 125 | ||
122 | 126 | let lockSwopBlocksAmount = (10102 * 4) | |
123 | 127 | ||
124 | 128 | let SWOP = fromBase58String(getStringValue(farmingAddr, kSWOPid)) | |
125 | 129 | ||
126 | 130 | let scaleValue = 100000000 | |
127 | 131 | ||
128 | 132 | let totalVoteShare = 10000000000 | |
129 | 133 | ||
130 | 134 | let feeSacle6 = 1000000 | |
131 | 135 | ||
132 | 136 | let basePeriod = valueOrErrorMessage(getInteger(votingAddr, kBasePeriod), "Empty kBasePeriod at voting contract") | |
133 | 137 | ||
134 | 138 | let startHeight = valueOrErrorMessage(getInteger(votingAddr, kStartHeight), "Empty kStartHeight at voting contract") | |
135 | 139 | ||
136 | 140 | let periodLength = valueOrErrorMessage(getInteger(votingAddr, kPeriodLength), "Empty kPeriodLength at voting contract") | |
137 | 141 | ||
138 | 142 | let firstActiveVote = valueOrElse(getString(votingNewPoolAddr, activeVoteFirst), "") | |
139 | 143 | ||
140 | 144 | let secondActiveVote = valueOrElse(getString(votingNewPoolAddr, activeVoteSecond), "") | |
141 | 145 | ||
142 | 146 | let thirdActiveVote = valueOrElse(getString(votingNewPoolAddr, activeVoteThird), "") | |
143 | 147 | ||
144 | 148 | let active = valueOrElse(getBoolean(this, kActive), true) | |
145 | 149 | ||
150 | + | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
151 | + | ||
146 | 152 | let airdropFee = getIntegerValue(oracle, kAirdropFee) | |
147 | 153 | ||
148 | 154 | let currVotingPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
149 | 155 | ||
150 | 156 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
151 | 157 | ||
152 | 158 | ||
153 | - | func isActive () = if (active) | |
159 | + | func isActive () = if (if (active) | |
160 | + | then activeGlob | |
161 | + | else false) | |
154 | 162 | then unit | |
155 | 163 | else throw("DApp is inactive at this moment") | |
156 | 164 | ||
157 | 165 | ||
158 | 166 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
159 | 167 | then unit | |
160 | 168 | else throw("Only admin can call this function") | |
161 | 169 | ||
162 | 170 | ||
163 | 171 | func getLastInterestInfo () = valueOrElse(getInteger(this, kLastInterest), 0) | |
164 | 172 | ||
165 | 173 | ||
166 | 174 | func getTotalLockedInfo () = { | |
167 | 175 | let totalSwopLocked = valueOrElse(getInteger(this, kTotalSWOPLocked), 0) | |
168 | 176 | let totalGSwopLocked = valueOrElse(getInteger(this, kTotalGSwopLocked), totalSwopLocked) | |
169 | 177 | $Tuple2(totalSwopLocked, totalGSwopLocked) | |
170 | 178 | } | |
171 | 179 | ||
172 | 180 | ||
173 | 181 | func getUserLockedInfo (user) = { | |
174 | 182 | let userSwopLocked = valueOrElse(getInteger(this, (user + kUserSWOPLocked)), 0) | |
175 | 183 | let userGSwopLocked = valueOrElse(getInteger(this, (user + kUserGSwopLocked)), userSwopLocked) | |
176 | 184 | $Tuple2(userSwopLocked, userGSwopLocked) | |
177 | 185 | } | |
178 | 186 | ||
179 | 187 | ||
180 | 188 | func getUserInterestInfo (user,lastInterest) = { | |
181 | - | let $ | |
182 | - | let userSWOPAmount = $ | |
183 | - | let userGSwopAmount = $ | |
189 | + | let $t050365099 = getUserLockedInfo(user) | |
190 | + | let userSWOPAmount = $t050365099._1 | |
191 | + | let userGSwopAmount = $t050365099._2 | |
184 | 192 | let userLastInterest = valueOrElse(getInteger(this, (user + kUserLastInterest)), lastInterest) | |
185 | 193 | $Tuple3(userLastInterest, userSWOPAmount, userGSwopAmount) | |
186 | 194 | } | |
187 | 195 | ||
188 | 196 | ||
189 | 197 | func getUserAvailableForClaim (user) = valueOrElse(getInteger(this, (user + kUserAvailableForClaim)), 0) | |
190 | 198 | ||
191 | 199 | ||
192 | 200 | func getUserTotalVoteAmountForOnePool (pool,user) = { | |
193 | 201 | let voting = valueOrElse(getInteger(votingNewPoolAddr, pool), -1) | |
194 | 202 | let heightOfVoting = valueOrElse(getInteger(votingNewPoolAddr, (toString(voting) + kHeightOfPoolVotingForNewPool)), 0) | |
195 | 203 | let statusOfVoting = valueOrElse(getBoolean(votingNewPoolAddr, (toString(voting) + kStatusOfVotingForNewPool)), true) | |
196 | 204 | let currentHeight = height | |
197 | 205 | if ((0 > voting)) | |
198 | 206 | then 0 | |
199 | 207 | else if (!(statusOfVoting)) | |
200 | 208 | then 0 | |
201 | 209 | else if ((heightOfVoting > currentHeight)) | |
202 | 210 | then (valueOrElse(getInteger(votingNewPoolAddr, (((toString(user) + "_") + toString(voting)) + kYesVotingForNewPool)), 0) + valueOrElse(getInteger(votingNewPoolAddr, (((toString(user) + "_") + toString(voting)) + kNoVotingForNewPool)), 0)) | |
203 | 211 | else 0 | |
204 | 212 | } | |
205 | 213 | ||
206 | 214 | ||
207 | 215 | func getUserTotalVoteForNewPoolAmount (user) = { | |
208 | 216 | let listOfVoting = [getUserTotalVoteAmountForOnePool(firstActiveVote, user), getUserTotalVoteAmountForOnePool(secondActiveVote, user), getUserTotalVoteAmountForOnePool(thirdActiveVote, user)] | |
209 | 217 | max(listOfVoting) | |
210 | 218 | } | |
211 | 219 | ||
212 | 220 | ||
213 | 221 | func getUserBlockedInLauchpad (user) = { | |
214 | 222 | let lauchpadId = toString(valueOrElse(getInteger(launchpadAddr, kLaunchpadActiveId), 0)) | |
215 | 223 | if ((lauchpadId == "0")) | |
216 | 224 | then 0 | |
217 | 225 | else { | |
218 | 226 | let lStartHeight = valueOrElse(getInteger(launchpadAddr, (lauchpadId + kLaunchpadStartHeight)), 0) | |
219 | 227 | let lDuration = valueOrElse(getInteger(launchpadAddr, (lauchpadId + kLaunchpadDuration)), 0) | |
220 | 228 | let lFreezeSwopDuration = valueOrElse(getInteger(launchpadAddr, (lauchpadId + kLauchpadFreezSwopDuration)), 0) | |
221 | 229 | let blockEndHeight = ((lStartHeight + lDuration) + lFreezeSwopDuration) | |
222 | 230 | if ((height > blockEndHeight)) | |
223 | 231 | then 0 | |
224 | 232 | else { | |
225 | 233 | let boughtTickets = valueOrElse(getInteger(launchpadAddr, (((toString(user) + "_") + lauchpadId) + kLaunchpadBoughtTickets)), 0) | |
226 | 234 | let swopPerTicket = valueOrElse(getInteger(launchpadAddr, (lauchpadId + kLaunchpadSwopPerTickets)), 0) | |
227 | 235 | (boughtTickets * swopPerTicket) | |
228 | 236 | } | |
229 | 237 | } | |
230 | 238 | } | |
231 | 239 | ||
232 | 240 | ||
233 | 241 | func getUserVoteInfo (user) = { | |
234 | - | let $ | |
242 | + | let $t074637996 = if (isDefined(getString(votingAddr, (toString(user) + kUserTotalStruc)))) | |
235 | 243 | then { | |
236 | 244 | let data = split(valueOrErrorMessage(getString(votingAddr, (toString(user) + kUserTotalStruc)), "Empty kUserTotalStruc"), "_") | |
237 | 245 | $Tuple3(parseIntValue(data[0]), parseIntValue(data[1]), parseIntValue(data[2])) | |
238 | 246 | } | |
239 | 247 | else { | |
240 | 248 | let uPoolTotalSWOP = valueOrElse(getInteger(votingAddr, (toString(user) + kUserTotalVoteSWOP)), 0) | |
241 | 249 | $Tuple3(uPoolTotalSWOP, 0, currVotingPeriod) | |
242 | 250 | } | |
243 | - | let userTotalVoteSWOP = $ | |
244 | - | let userUnvoted = $ | |
245 | - | let userUnvotedPeriod = $ | |
251 | + | let userTotalVoteSWOP = $t074637996._1 | |
252 | + | let userUnvoted = $t074637996._2 | |
253 | + | let userUnvotedPeriod = $t074637996._3 | |
246 | 254 | let userUnvotedActual = if ((userUnvotedPeriod == currVotingPeriod)) | |
247 | 255 | then userUnvoted | |
248 | 256 | else 0 | |
249 | 257 | $Tuple2(userTotalVoteSWOP, userUnvotedActual) | |
250 | 258 | } | |
251 | 259 | ||
252 | 260 | ||
253 | 261 | func getPoolUpdateHeight (pool) = valueOrElse(getInteger(this, (pool + kHeightPoolFraction)), 0) | |
254 | 262 | ||
255 | 263 | ||
256 | 264 | func isDefinePoolUpdateHeight (pool) = isDefined(getInteger(this, (pool + kHeightPoolFraction))) | |
257 | 265 | ||
258 | 266 | ||
259 | 267 | func getCurPoolWeight (pool) = valueOrElse(getInteger(this, (pool + kRewardPoolFractionCurrent)), 0) | |
260 | 268 | ||
261 | 269 | ||
262 | 270 | func getPrevPoolWeight (pool) = valueOrElse(getInteger(this, (pool + kRewardPoolFractionPrevious)), 0) | |
263 | 271 | ||
264 | 272 | ||
265 | 273 | func claimCalc (user) = { | |
266 | 274 | let lastInterest = getLastInterestInfo() | |
267 | - | let $ | |
268 | - | let userLastInterest = $ | |
269 | - | let userSWOPLocked = $ | |
270 | - | let userGSwopAmount = $ | |
275 | + | let $t088708967 = getUserInterestInfo(user, lastInterest) | |
276 | + | let userLastInterest = $t088708967._1 | |
277 | + | let userSWOPLocked = $t088708967._2 | |
278 | + | let userGSwopAmount = $t088708967._3 | |
271 | 279 | let claimAmount = fraction(userGSwopAmount, (lastInterest - userLastInterest), scaleValue) | |
272 | 280 | let userNewInterest = lastInterest | |
273 | 281 | $Tuple2(userNewInterest, claimAmount) | |
274 | 282 | } | |
275 | 283 | ||
276 | 284 | ||
285 | + | func isOraclePool (poolAddress) = if (isDefined(getString(oracle, (kOraclePool + poolAddress)))) | |
286 | + | then unit | |
287 | + | else throw("DApp is not registered pool") | |
288 | + | ||
289 | + | ||
290 | + | @Callable(i) | |
291 | + | func addPool (poolAddress) = valueOrElse(isAdminCall(i), valueOrElse(isActive(), valueOrElse(isOraclePool(poolAddress), if (isDefined(getInteger(this, (poolAddress + kRewardPoolFractionCurrent)))) | |
292 | + | then throw("Pool already in governance") | |
293 | + | else [IntegerEntry((poolAddress + kRewardPoolFractionCurrent), 0), IntegerEntry((poolAddress + kRewardPoolFractionPrevious), 0), IntegerEntry((poolAddress + kHeightPoolFraction), getIntegerValue(this, kRewardUpdateHeight))]))) | |
294 | + | ||
295 | + | ||
296 | + | ||
277 | 297 | @Callable(i) | |
278 | 298 | func airDrop () = valueOrElse(isActive(), { | |
279 | - | let $ | |
280 | - | let pmtAmount = $ | |
281 | - | let pmtAssetId = $ | |
299 | + | let $t098669941 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
300 | + | let pmtAmount = $t098669941._1 | |
301 | + | let pmtAssetId = $t098669941._2 | |
282 | 302 | if ((pmtAssetId != SWOP)) | |
283 | 303 | then throw("Incorrect pmtAssetId") | |
284 | 304 | else { | |
285 | 305 | let airdropFeeAmount = fraction(pmtAmount, airdropFee, feeSacle6, CEILING) | |
286 | - | let $ | |
287 | - | let totalSWOPLocked = $ | |
288 | - | let totalGSwopLocked = $ | |
306 | + | let $t01011410176 = getTotalLockedInfo() | |
307 | + | let totalSWOPLocked = $t01011410176._1 | |
308 | + | let totalGSwopLocked = $t01011410176._2 | |
289 | 309 | let lastInterest = getLastInterestInfo() | |
290 | 310 | let interestNew = (lastInterest + fraction((pmtAmount - airdropFeeAmount), scaleValue, totalGSwopLocked)) | |
291 | 311 | [IntegerEntry(kLastInterest, interestNew), ScriptTransfer(airdropMoneyBoxAddr, airdropFeeAmount, SWOP)] | |
292 | 312 | } | |
293 | 313 | }) | |
294 | 314 | ||
295 | 315 | ||
296 | 316 | ||
297 | 317 | @Callable(i) | |
298 | 318 | func lockSWOP () = valueOrElse(isActive(), { | |
299 | - | let $ | |
300 | - | let pmtAmount = $ | |
301 | - | let pmtAssetId = $ | |
319 | + | let $t01055410629 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
320 | + | let pmtAmount = $t01055410629._1 | |
321 | + | let pmtAssetId = $t01055410629._2 | |
302 | 322 | if ((pmtAssetId != SWOP)) | |
303 | 323 | then throw("Incorrect pmtAssetId") | |
304 | 324 | else { | |
305 | 325 | let user = toString(i.caller) | |
306 | 326 | let lastInterest = getLastInterestInfo() | |
307 | - | let $ | |
308 | - | let userSWOPLocked = $ | |
309 | - | let userGSwopLocked = $ | |
310 | - | let $ | |
311 | - | let userNewInterest = $ | |
312 | - | let claimAmountAvailable = $ | |
327 | + | let $t01078010843 = getUserLockedInfo(user) | |
328 | + | let userSWOPLocked = $t01078010843._1 | |
329 | + | let userGSwopLocked = $t01078010843._2 | |
330 | + | let $t01084810909 = claimCalc(user) | |
331 | + | let userNewInterest = $t01084810909._1 | |
332 | + | let claimAmountAvailable = $t01084810909._2 | |
313 | 333 | let availableForClaim = getUserAvailableForClaim(user) | |
314 | 334 | let availableForClaimNew = (availableForClaim + claimAmountAvailable) | |
315 | 335 | let userSWOPLockedNew = (userSWOPLocked + pmtAmount) | |
316 | 336 | let userGSwopLockedNew = (userGSwopLocked + pmtAmount) | |
317 | - | let $ | |
318 | - | let totalSWOPLocked = $ | |
319 | - | let totalGSwopLocked = $ | |
337 | + | let $t01115711219 = getTotalLockedInfo() | |
338 | + | let totalSWOPLocked = $t01115711219._1 | |
339 | + | let totalGSwopLocked = $t01115711219._2 | |
320 | 340 | let totalSWOPLockedNew = (totalSWOPLocked + pmtAmount) | |
321 | 341 | let totalGSwopLockedNew = (totalGSwopLocked + pmtAmount) | |
322 | 342 | [IntegerEntry((user + kUserSwopUnlockHeight), (height + lockSwopBlocksAmount)), IntegerEntry((user + kUserLastInterest), userNewInterest), IntegerEntry((user + kUserSWOPLocked), userSWOPLockedNew), IntegerEntry((user + kUserGSwopLocked), userGSwopLockedNew), IntegerEntry((user + kUserAvailableForClaim), availableForClaimNew), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew)] | |
323 | 343 | } | |
324 | 344 | }) | |
325 | 345 | ||
326 | 346 | ||
327 | 347 | ||
328 | 348 | @Callable(i) | |
329 | 349 | func withdrawSWOP (withdrawAmount) = valueOrElse(isActive(), { | |
330 | 350 | let user = toString(i.caller) | |
331 | 351 | let unlockHeight = valueOrElse(getInteger(this, (user + kUserSwopUnlockHeight)), 0) | |
332 | 352 | if ((0 >= withdrawAmount)) | |
333 | 353 | then throw("withdrawAmount <= 0") | |
334 | 354 | else if ((unlockHeight > height)) | |
335 | 355 | then throw(("You can't withdraw till " + toString(unlockHeight))) | |
336 | 356 | else { | |
337 | - | let $ | |
338 | - | let totalSWOPLocked = $ | |
339 | - | let totalGSwopLocked = $ | |
340 | - | let $ | |
341 | - | let userSWOPLocked = $ | |
342 | - | let userGSwopLocked = $ | |
343 | - | let $ | |
344 | - | let userNewInterest = $ | |
345 | - | let claimAmountAvailable = $ | |
346 | - | let $ | |
347 | - | let userVoteAmount = $ | |
348 | - | let userUnvoteAmount = $ | |
357 | + | let $t01219712259 = getTotalLockedInfo() | |
358 | + | let totalSWOPLocked = $t01219712259._1 | |
359 | + | let totalGSwopLocked = $t01219712259._2 | |
360 | + | let $t01226412327 = getUserLockedInfo(user) | |
361 | + | let userSWOPLocked = $t01226412327._1 | |
362 | + | let userGSwopLocked = $t01226412327._2 | |
363 | + | let $t01233212393 = claimCalc(user) | |
364 | + | let userNewInterest = $t01233212393._1 | |
365 | + | let claimAmountAvailable = $t01233212393._2 | |
366 | + | let $t01239812464 = getUserVoteInfo(i.caller) | |
367 | + | let userVoteAmount = $t01239812464._1 | |
368 | + | let userUnvoteAmount = $t01239812464._2 | |
349 | 369 | let userVoteAmountForNewPool = getUserTotalVoteForNewPoolAmount(i.caller) | |
350 | 370 | let blockedInLaunchpad = getUserBlockedInLauchpad(i.caller) | |
351 | 371 | if (if (if ((0 > userUnvoteAmount)) | |
352 | 372 | then true | |
353 | 373 | else (0 > userVoteAmount)) | |
354 | 374 | then true | |
355 | 375 | else (0 > userVoteAmountForNewPool)) | |
356 | 376 | then throw("userUnvoteAmount < 0 || userVoteAmount < 0 || userVoteAmountForNewPool < 0") | |
357 | 377 | else { | |
358 | 378 | let availableToUnstake = (userSWOPLocked - max([userVoteAmountForNewPool, (userVoteAmount + userUnvoteAmount), blockedInLaunchpad])) | |
359 | 379 | if ((withdrawAmount > availableToUnstake)) | |
360 | 380 | then throw("withdrawAmount > availableToUnstake") | |
361 | 381 | else { | |
362 | 382 | let availableForClaim = getUserAvailableForClaim(user) | |
363 | 383 | let availableForClaimNew = (availableForClaim + claimAmountAvailable) | |
364 | 384 | let totalSWOPLockedNew = (totalSWOPLocked - withdrawAmount) | |
365 | 385 | let userSWOPAmountNew = (userSWOPLocked - withdrawAmount) | |
366 | 386 | let totalGSwopLockedNew = ((totalGSwopLocked - userGSwopLocked) + userSWOPAmountNew) | |
367 | 387 | [IntegerEntry((user + kUserLastInterest), userNewInterest), IntegerEntry((user + kUserSWOPLocked), userSWOPAmountNew), IntegerEntry((user + kUserGSwopLocked), userSWOPAmountNew), IntegerEntry((user + kUserAvailableForClaim), availableForClaimNew), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew), ScriptTransfer(i.caller, withdrawAmount, SWOP)] | |
368 | 388 | } | |
369 | 389 | } | |
370 | 390 | } | |
371 | 391 | }) | |
372 | 392 | ||
373 | 393 | ||
374 | 394 | ||
375 | 395 | @Callable(i) | |
376 | 396 | func claimAndWithdrawSWOP () = valueOrElse(isActive(), { | |
377 | 397 | let user = toString(i.caller) | |
378 | 398 | let availableForClaim = getUserAvailableForClaim(user) | |
379 | - | let $ | |
380 | - | let userNewInterest = $ | |
381 | - | let claimAmount = $ | |
399 | + | let $t01398314035 = claimCalc(user) | |
400 | + | let userNewInterest = $t01398314035._1 | |
401 | + | let claimAmount = $t01398314035._2 | |
382 | 402 | let userClaimAmount = (availableForClaim + claimAmount) | |
383 | 403 | if ((userClaimAmount == 0)) | |
384 | 404 | then throw("You have 0 available SWOP") | |
385 | - | else [IntegerEntry((user + kUserLastInterest), userNewInterest), ScriptTransfer(i.caller, userClaimAmount, SWOP)] | |
405 | + | else [IntegerEntry((user + kUserLastInterest), userNewInterest), IntegerEntry((user + kUserAvailableForClaim), 0), ScriptTransfer(i.caller, userClaimAmount, SWOP)] | |
386 | 406 | }) | |
387 | 407 | ||
388 | 408 | ||
389 | 409 | ||
390 | 410 | @Callable(i) | |
391 | 411 | func claimAndStakeSWOP () = valueOrElse(isActive(), { | |
392 | 412 | let user = toString(i.caller) | |
393 | - | let $ | |
394 | - | let totalSWOPLocked = $ | |
395 | - | let totalGSwopLocked = $ | |
396 | - | let $ | |
397 | - | let userSWOPLocked = $ | |
398 | - | let userGSwopLocked = $ | |
413 | + | let $t01446514527 = getTotalLockedInfo() | |
414 | + | let totalSWOPLocked = $t01446514527._1 | |
415 | + | let totalGSwopLocked = $t01446514527._2 | |
416 | + | let $t01453214595 = getUserLockedInfo(user) | |
417 | + | let userSWOPLocked = $t01453214595._1 | |
418 | + | let userGSwopLocked = $t01453214595._2 | |
399 | 419 | let availableForClaim = getUserAvailableForClaim(user) | |
400 | - | let $ | |
401 | - | let userNewInterest = $ | |
402 | - | let claimAmount = $ | |
420 | + | let $t01465914710 = claimCalc(user) | |
421 | + | let userNewInterest = $t01465914710._1 | |
422 | + | let claimAmount = $t01465914710._2 | |
403 | 423 | let userClaimAmount = (availableForClaim + claimAmount) | |
404 | 424 | let userSWOPLockedNew = (userSWOPLocked + userClaimAmount) | |
405 | 425 | let userGSwopLockedNew = (userGSwopLocked + (userClaimAmount * 2)) | |
406 | 426 | let totalSWOPLockedNew = (totalSWOPLocked + userClaimAmount) | |
407 | 427 | let totalGSwopLockedNew = (totalGSwopLocked + (userClaimAmount * 2)) | |
408 | 428 | if ((userClaimAmount == 0)) | |
409 | 429 | then throw("You have 0 available SWOP") | |
410 | - | else [IntegerEntry((toString(i.caller) + kUserSwopUnlockHeight), (height + lockSwopBlocksAmount)), IntegerEntry((toString(i.caller) + kUserLastInterest), userNewInterest), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew), IntegerEntry((toString(i.caller) + kUserSWOPLocked), userSWOPLockedNew), IntegerEntry((toString(i.caller) + kUserGSwopLocked), userGSwopLockedNew)] | |
430 | + | else [IntegerEntry((toString(i.caller) + kUserSwopUnlockHeight), (height + lockSwopBlocksAmount)), IntegerEntry((toString(i.caller) + kUserLastInterest), userNewInterest), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew), IntegerEntry((toString(i.caller) + kUserSWOPLocked), userSWOPLockedNew), IntegerEntry((toString(i.caller) + kUserGSwopLocked), userGSwopLockedNew), IntegerEntry((user + kUserAvailableForClaim), 0)] | |
411 | 431 | }) | |
412 | 432 | ||
413 | 433 | ||
414 | 434 | ||
415 | 435 | @Callable(i) | |
416 | 436 | func lockSWOPFromFarming () = valueOrElse(isActive(), { | |
417 | - | let $ | |
418 | - | let pmtAmount = $ | |
419 | - | let pmtAssetId = $ | |
437 | + | let $t01570615781 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
438 | + | let pmtAmount = $t01570615781._1 | |
439 | + | let pmtAssetId = $t01570615781._2 | |
420 | 440 | if ((i.caller != farmingAddr)) | |
421 | 441 | then throw("Only farming can call this function") | |
422 | 442 | else if ((pmtAssetId != SWOP)) | |
423 | 443 | then throw("Incorrect pmtAssetId") | |
424 | 444 | else { | |
425 | 445 | let user = toString(i.originCaller) | |
426 | 446 | let lastInterest = getLastInterestInfo() | |
427 | - | let $ | |
428 | - | let userSWOPLocked = $ | |
429 | - | let userGSwopLocked = $ | |
430 | - | let $ | |
431 | - | let userNewInterest = $ | |
432 | - | let claimAmountAvailable = $ | |
447 | + | let $t01602416087 = getUserLockedInfo(user) | |
448 | + | let userSWOPLocked = $t01602416087._1 | |
449 | + | let userGSwopLocked = $t01602416087._2 | |
450 | + | let $t01609216153 = claimCalc(user) | |
451 | + | let userNewInterest = $t01609216153._1 | |
452 | + | let claimAmountAvailable = $t01609216153._2 | |
433 | 453 | let availableForClaim = getUserAvailableForClaim(user) | |
434 | 454 | let availableForClaimNew = (availableForClaim + claimAmountAvailable) | |
435 | 455 | let userSWOPLockedNew = (userSWOPLocked + pmtAmount) | |
436 | 456 | let userGSwopLockedNew = (userGSwopLocked + (pmtAmount * 2)) | |
437 | - | let $ | |
438 | - | let totalSWOPLocked = $ | |
439 | - | let totalGSwopLocked = $ | |
457 | + | let $t01640516467 = getTotalLockedInfo() | |
458 | + | let totalSWOPLocked = $t01640516467._1 | |
459 | + | let totalGSwopLocked = $t01640516467._2 | |
440 | 460 | let totalSWOPLockedNew = (totalSWOPLocked + pmtAmount) | |
441 | 461 | let totalGSwopLockedNew = (totalGSwopLocked + (pmtAmount * 2)) | |
442 | 462 | [IntegerEntry((user + kUserSwopUnlockHeight), (height + lockSwopBlocksAmount)), IntegerEntry((user + kUserLastInterest), userNewInterest), IntegerEntry((user + kUserSWOPLocked), userSWOPLockedNew), IntegerEntry((user + kUserGSwopLocked), userGSwopLocked), IntegerEntry((user + kUserAvailableForClaim), availableForClaimNew), IntegerEntry(kTotalSWOPLocked, totalSWOPLockedNew), IntegerEntry(kTotalGSwopLocked, totalGSwopLockedNew)] | |
443 | 463 | } | |
444 | 464 | }) | |
445 | 465 | ||
446 | 466 | ||
447 | 467 | ||
448 | 468 | @Callable(i) | |
449 | 469 | func updateWeights (currentPools,currentRewards,rewardUpdateHeight,pagination) = valueOrElse(isActive(), { | |
450 | 470 | let amountPools = 10 | |
451 | 471 | let totalRewardUpdateHeight = valueOrElse(getInteger(this, kRewardUpdateHeight), 0) | |
452 | 472 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, moneyBoxPubKey], i.callerPublicKey))) | |
453 | 473 | then throw("Only admin can call this function") | |
454 | 474 | else if ((size(currentPools) > amountPools)) | |
455 | 475 | then throw(("Max amount of pool is " + toString(amountPools))) | |
456 | 476 | else if ((totalRewardUpdateHeight >= rewardUpdateHeight)) | |
457 | 477 | then throw("rewardUpdateHeight <= totalRewardUpdateHeight") | |
458 | 478 | else if ((height >= rewardUpdateHeight)) | |
459 | 479 | then throw("height >= rewardUpdateHeight") | |
460 | 480 | else if ((0 >= rewardUpdateHeight)) | |
461 | 481 | then throw("0 >= rewardUpdateHeight ") | |
462 | 482 | else { | |
463 | 483 | func sum (a,b) = (a + b) | |
464 | 484 | ||
465 | 485 | func changePreviousRewardEntry (accumulated,pool) = { | |
466 | 486 | let poolRewardUpdateHeight = getPoolUpdateHeight(pool) | |
467 | 487 | if (if (!(isDefinePoolUpdateHeight(pool))) | |
468 | 488 | then true | |
469 | 489 | else if ((rewardUpdateHeight != poolRewardUpdateHeight)) | |
470 | 490 | then (poolRewardUpdateHeight == totalRewardUpdateHeight) | |
471 | 491 | else false) | |
472 | 492 | then { | |
473 | 493 | let poolReward = getCurPoolWeight(pool) | |
474 | 494 | IntegerEntry((pool + kRewardPoolFractionPrevious), poolReward) :: accumulated | |
475 | 495 | } | |
476 | 496 | else { | |
477 | 497 | let poolReward = getPrevPoolWeight(pool) | |
478 | 498 | IntegerEntry((pool + kRewardPoolFractionPrevious), poolReward) :: accumulated | |
479 | 499 | } | |
480 | 500 | } | |
481 | 501 | ||
482 | 502 | func changeCurrentRewardEntry (accumulated,pool) = { | |
483 | 503 | let poolIndex = value(indexOf(currentPools, pool)) | |
484 | 504 | let poolReward = currentRewards[poolIndex] | |
485 | 505 | if ((0 > poolReward)) | |
486 | 506 | then throw("PoolReward < 0") | |
487 | 507 | else IntegerEntry((pool + kRewardPoolFractionCurrent), poolReward) :: accumulated | |
488 | 508 | } | |
489 | 509 | ||
490 | 510 | func changeHeightEntry (accumulated,pool) = { | |
491 | 511 | let poolHeight = rewardUpdateHeight | |
492 | 512 | let upUIntr = invoke(farmingAddr, "updatePoolInterest", [pool], nil) | |
493 | 513 | if ((upUIntr == upUIntr)) | |
494 | 514 | then IntegerEntry((pool + kHeightPoolFraction), poolHeight) :: accumulated | |
495 | 515 | else throw("Strict value is not equal to itself.") | |
496 | 516 | } | |
497 | 517 | ||
498 | 518 | func getSumReward (curTempSum,pagination) = if ((pagination == 0)) | |
499 | 519 | then if ((curTempSum > totalVoteShare)) | |
500 | 520 | then throw(((("sumRewardPrevious > totalVoteShare or sumRewardCurrent > totalVoteShare - " + toString(pagination)) + " ") + toString(curTempSum))) | |
501 | 521 | else $Tuple2([IntegerEntry(kTempCurSum, curTempSum)], [IntegerEntry(kRewardUpdateFirstPaginationHeight, rewardUpdateHeight)]) | |
502 | 522 | else if ((pagination == 1)) | |
503 | 523 | then { | |
504 | 524 | let curTempSumFromKey = valueOrElse(getInteger(this, kTempCurSum), 0) | |
505 | 525 | let rewardUpdateHeightFirstPaginationEntry = valueOrElse(getInteger(this, kRewardUpdateFirstPaginationHeight), 0) | |
506 | 526 | if (((curTempSum + curTempSumFromKey) > totalVoteShare)) | |
507 | 527 | then throw(((("sumRewardPrevious > totalVoteShare or sumRewardCurrent > totalVoteShare - " + toString(pagination)) + " ") + toString((curTempSum + curTempSumFromKey)))) | |
508 | 528 | else if ((rewardUpdateHeightFirstPaginationEntry != rewardUpdateHeight)) | |
509 | 529 | then throw("current rewardUpdateHeight != rewardUpdateHeightFirstPaginationEntry") | |
510 | 530 | else $Tuple2([IntegerEntry(kTempCurSum, (curTempSum + curTempSumFromKey))], nil) | |
511 | 531 | } | |
512 | 532 | else if ((pagination == 2)) | |
513 | 533 | then { | |
514 | 534 | let curSum = (valueOrElse(getInteger(this, kTempCurSum), 0) + curTempSum) | |
515 | 535 | let rewardUpdateHeightFirstPaginationEntry = valueOrElse(getInteger(this, kRewardUpdateFirstPaginationHeight), 0) | |
516 | 536 | if ((curSum != totalVoteShare)) | |
517 | 537 | then throw("sumRewardPrevious != totalVoteShare or sumRewardCurrent != totalVoteShare") | |
518 | 538 | else if ((rewardUpdateHeightFirstPaginationEntry != rewardUpdateHeight)) | |
519 | 539 | then throw("current rewardUpdateHeight != rewardUpdateHeightFirstPaginationEntry") | |
520 | 540 | else $Tuple2([IntegerEntry(kTempCurSum, curSum)], nil) | |
521 | 541 | } | |
522 | 542 | else throw("Incorrect pagination") | |
523 | 543 | ||
524 | 544 | let previousRewardEntryNew = { | |
525 | 545 | let $l = currentPools | |
526 | 546 | let $s = size($l) | |
527 | 547 | let $acc0 = nil | |
528 | 548 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
529 | 549 | then $a | |
530 | 550 | else changePreviousRewardEntry($a, $l[$i]) | |
531 | 551 | ||
532 | 552 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
533 | 553 | then $a | |
534 | 554 | else throw("List size exceeds 10") | |
535 | 555 | ||
536 | 556 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
537 | 557 | } | |
538 | 558 | let currentRewardEntryNew = { | |
539 | 559 | let $l = currentPools | |
540 | 560 | let $s = size($l) | |
541 | 561 | let $acc0 = nil | |
542 | 562 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
543 | 563 | then $a | |
544 | 564 | else changeCurrentRewardEntry($a, $l[$i]) | |
545 | 565 | ||
546 | 566 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
547 | 567 | then $a | |
548 | 568 | else throw("List size exceeds 10") | |
549 | 569 | ||
550 | 570 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
551 | 571 | } | |
552 | 572 | let heightEntryNewCur = { | |
553 | 573 | let $l = currentPools | |
554 | 574 | let $s = size($l) | |
555 | 575 | let $acc0 = nil | |
556 | 576 | func $f2_1 ($a,$i) = if (($i >= $s)) | |
557 | 577 | then $a | |
558 | 578 | else changeHeightEntry($a, $l[$i]) | |
559 | 579 | ||
560 | 580 | func $f2_2 ($a,$i) = if (($i >= $s)) | |
561 | 581 | then $a | |
562 | 582 | else throw("List size exceeds 10") | |
563 | 583 | ||
564 | 584 | $f2_2($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
565 | 585 | } | |
566 | 586 | let sumRewardCurrentTemp = { | |
567 | 587 | let $l = currentRewards | |
568 | 588 | let $s = size($l) | |
569 | 589 | let $acc0 = 0 | |
570 | 590 | func $f3_1 ($a,$i) = if (($i >= $s)) | |
571 | 591 | then $a | |
572 | 592 | else sum($a, $l[$i]) | |
573 | 593 | ||
574 | 594 | func $f3_2 ($a,$i) = if (($i >= $s)) | |
575 | 595 | then $a | |
576 | 596 | else throw("List size exceeds 10") | |
577 | 597 | ||
578 | 598 | $f3_2($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
579 | 599 | } | |
580 | - | let $ | |
581 | - | let sumRewardCurrent = $ | |
582 | - | let rewardUpdateHeightFirstPaginationEntry = $ | |
600 | + | let $t02148821599 = getSumReward(sumRewardCurrentTemp, pagination) | |
601 | + | let sumRewardCurrent = $t02148821599._1 | |
602 | + | let rewardUpdateHeightFirstPaginationEntry = $t02148821599._2 | |
583 | 603 | let rewardUpdateHeightEntry = if ((pagination == 2)) | |
584 | 604 | then [IntegerEntry(kRewardUpdateHeight, rewardUpdateHeight)] | |
585 | 605 | else nil | |
586 | 606 | if ((height > rewardUpdateHeight)) | |
587 | 607 | then throw("rewardUpdateHeight < height") | |
588 | 608 | else (((((previousRewardEntryNew ++ currentRewardEntryNew) ++ heightEntryNewCur) ++ sumRewardCurrent) ++ rewardUpdateHeightEntry) ++ rewardUpdateHeightFirstPaginationEntry) | |
589 | 609 | } | |
590 | 610 | }) | |
591 | 611 | ||
592 | 612 | ||
593 | 613 | ||
594 | 614 | @Callable(i) | |
595 | 615 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
596 | 616 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
597 | 617 | else suspend("Paused by admin")) | |
598 | 618 | ||
599 | 619 | ||
600 | 620 | ||
601 | 621 | @Callable(i) | |
602 | 622 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
603 | 623 | then throw("DApp is already active") | |
604 | 624 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
605 | 625 | ||
606 | 626 | ||
607 | 627 | @Verifier(tx) | |
608 | 628 | func verify () = { | |
609 | 629 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
610 | 630 | then 1 | |
611 | 631 | else 0 | |
612 | 632 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
613 | 633 | then 1 | |
614 | 634 | else 0 | |
615 | 635 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
616 | 636 | then 1 | |
617 | 637 | else 0 | |
618 | 638 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
619 | 639 | } | |
620 | 640 |
github/deemru/w8io/026f985 129.64 ms ◑