tx · F9CARzQprDsQmGQdS8vrk6r4kSA3PnShUrRz9zbQd13d 3N1fUnDJnsNxqPhgnJbzqt2rkZSNHGbpXkc: -0.02500000 Waves 2022.07.06 10:35 [2127534] smart account 3N1fUnDJnsNxqPhgnJbzqt2rkZSNHGbpXkc > SELF 0.00000000 Waves
{ "type": 13, "id": "F9CARzQprDsQmGQdS8vrk6r4kSA3PnShUrRz9zbQd13d", "fee": 2500000, "feeAssetId": null, "timestamp": 1657092903074, "version": 2, "chainId": 84, "sender": "3N1fUnDJnsNxqPhgnJbzqt2rkZSNHGbpXkc", "senderPublicKey": "3Nk7cXANGgo4nph6EximnLotDFDXZyRV4MPrDNNY8hhE", "proofs": [ "5xdUh3VUtDfYCuiPSmLucqYUoxut1JUKetL5Qh5tDswViroCVd2fw8XRKELZf56J9LuYXkQDFiTxi6QBXakgYXqC", "2sm7eNtaaDeEJ3ypYgGPSDaNXEX8SpwQEN9iJfSjrNc4WY9VLuCnCW8umAjiuLrYWSPAo2fhncaC9sSafVwWtKDz" ], "script": "base64:AAIFAAAAAAAAAB4IAhIDCgEEEgUKAwgBARIAEgASAwoBARIFCgMEAQgAAABRAAAAAAd2ZXJzaW9uAgAAAAUyLjAuMAAAAAAIa1ZlcnNpb24CAAAAB3ZlcnNpb24AAAAAB2tBY3RpdmUCAAAABmFjdGl2ZQAAAAAHa0Fzc2V0cwIAAAAJYXNzZXRfaWRzAAAAAA1rQXNzZXRCYWxhbmNlAgAAAA5fYXNzZXRfYmFsYW5jZQAAAAANa1NoYXJlQXNzZXRJZAIAAAAOc2hhcmVfYXNzZXRfaWQAAAAAEWtTaGFyZUFzc2V0U3VwcGx5AgAAABJzaGFyZV9hc3NldF9zdXBwbHkAAAAABGtGZWUCAAAACmNvbW1pc3Npb24AAAAACmtJbnZhcmlhbnQCAAAACWludmFyaWFudAAAAAAGa0NhdXNlAgAAAA5zaHV0ZG93bl9jYXVzZQAAAAAMa1VTRE5BZGRyZXNzAgAAABhzdGFraW5nX3VzZ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oaXMJAAAAAAAAAggFAAAAA2ludgAAAAhmdW5jdGlvbgIAAAAZdGFrZUludG9BY2NvdW50RXh0cmFGdW5kcwcEAAAADXNpZ25lZEJ5QWRtaW4DAwMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAxhZG1pblB1YktleTEGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAMYWRtaW5QdWJLZXkyBgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADGFkbWluUHViS2V5MwYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAABFhZG1pblB1YktleUludm9rZQMDBQAAABNjYWxsVGFrZUludG9BY2NvdW50BQAAAA1zaWduZWRCeUFkbWluBwYFAAAAE211bHRpU2lnbmVkQnlBZG1pbnMFAAAAE211bHRpU2lnbmVkQnlBZG1pbnNeQQhQ", "height": 2127534, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DSLFqqRDcEK9jojruoj5oqWriPqvbWZ8GHFsAhU9anRq Next: none Diff:
Old | New | Differences | |
---|---|---|---|
57 | 57 | ||
58 | 58 | let kVotingAddress = "voting_address" | |
59 | 59 | ||
60 | - | let oracle = Address(base58' | |
60 | + | let oracle = Address(base58'3PEbqViERCoKnmcSULh6n2aiMvUdSQdCsom') | |
61 | 61 | ||
62 | 62 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
63 | 63 | case string: String => | |
400 | 400 | let balanceTo = $t01313613276._2 | |
401 | 401 | let accountBalanceFrom = $t01313613276._3 | |
402 | 402 | let accountBalanceTo = $t01313613276._4 | |
403 | - | let pmtStrAssetId = toBase58String(value(pmtAssetId)) | |
404 | - | if ((0 >= estimatedAmountToReceive)) | |
405 | - | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
406 | - | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
407 | - | then throw("Minimal amount can't be greater than estimated.") | |
408 | - | else if ((size(i.payments) != 1)) | |
409 | - | then throwOnePayment() | |
410 | - | else if (!(if ((balanceFrom > accountBalanceFrom)) | |
411 | - | then true | |
412 | - | else (balanceTo > accountBalanceTo))) | |
413 | - | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(balanceFrom, value(pmtAssetId), balanceTo, fromBase58String(exchangeAseetId))) | |
414 | - | else if (if (!(contains(value(exchangeAssets), pmtStrAssetId))) | |
415 | - | then true | |
416 | - | else !(contains(value(exchangeAssets), exchangeAseetId))) | |
417 | - | then throwAssets() | |
418 | - | else if ((10000000 > pmtAmount)) | |
419 | - | then throw("Only swap of 10.000000 or more tokens is allowed") | |
420 | - | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
403 | + | if ((1 == 1)) | |
404 | + | then throw(((((((("balanceFrom:" + toString(balanceFrom)) + " balanceTo: ") + toString(balanceTo)) + "accountBalanceFrom:") + toString(accountBalanceFrom)) + " accountBalanceTo: ") + toString(accountBalanceTo))) | |
405 | + | else { | |
406 | + | let k = 1 | |
407 | + | let pmtStrAssetId = toBase58String(value(pmtAssetId)) | |
408 | + | if ((0 >= estimatedAmountToReceive)) | |
409 | + | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
410 | + | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
411 | + | then throw("Minimal amount can't be greater than estimated.") | |
412 | + | else if ((size(i.payments) != 1)) | |
413 | + | then throwOnePayment() | |
414 | + | else if (!(if ((balanceFrom > accountBalanceFrom)) | |
415 | + | then true | |
416 | + | else (balanceTo > accountBalanceTo))) | |
417 | + | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(balanceFrom, value(pmtAssetId), balanceTo, fromBase58String(exchangeAseetId))) | |
418 | + | else if (if (!(contains(value(exchangeAssets), pmtStrAssetId))) | |
421 | 419 | then true | |
422 | - | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
423 | - | then throw("Incorrect args and pmt ratio") | |
424 | - | else { | |
425 | - | let invariant = invariantCalc(balanceFrom, balanceTo) | |
426 | - | let amount = calculateSendAmount(balanceFrom, balanceTo, invariant, estimatedAmountToReceive, minAmountToReceive, pmtAmount) | |
427 | - | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
428 | - | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
429 | - | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
430 | - | let $t01491515024 = $Tuple2((balanceFrom + pmtAmount), ((balanceTo - amountMinusFee) - governanceReward)) | |
431 | - | let newBalanceFrom = $t01491515024._1 | |
432 | - | let newBalanceTo = $t01491515024._2 | |
433 | - | let dAppThresholdAmount = fraction((newBalanceFrom + newBalanceTo), dAppThreshold, (2 * dAppThresholdScale2)) | |
434 | - | if (if ((dAppThresholdAmount > newBalanceFrom)) | |
420 | + | else !(contains(value(exchangeAssets), exchangeAseetId))) | |
421 | + | then throwAssets() | |
422 | + | else if ((10000000 > pmtAmount)) | |
423 | + | then throw("Only swap of 10.000000 or more tokens is allowed") | |
424 | + | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
435 | 425 | then true | |
436 | - | else ( | |
437 | - | then | |
426 | + | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
427 | + | then throw("Incorrect args and pmt ratio") | |
438 | 428 | else { | |
439 | - | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
440 | - | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
441 | - | else 0 | |
442 | - | if ((stake1 == stake1)) | |
443 | - | then { | |
444 | - | let stake2 = if (containsElement(stakingAssets, exchangeAseetId)) | |
445 | - | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), exchangeAseetId], nil) | |
429 | + | let invariant = invariantCalc(balanceFrom, balanceTo) | |
430 | + | let amount = calculateSendAmount(balanceFrom, balanceTo, invariant, estimatedAmountToReceive, minAmountToReceive, pmtAmount) | |
431 | + | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
432 | + | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
433 | + | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
434 | + | let $t01517415283 = $Tuple2((balanceFrom + pmtAmount), ((balanceTo - amountMinusFee) - governanceReward)) | |
435 | + | let newBalanceFrom = $t01517415283._1 | |
436 | + | let newBalanceTo = $t01517415283._2 | |
437 | + | let dAppThresholdAmount = fraction((newBalanceFrom + newBalanceTo), dAppThreshold, (2 * dAppThresholdScale2)) | |
438 | + | if (if ((dAppThresholdAmount > newBalanceFrom)) | |
439 | + | then true | |
440 | + | else (dAppThresholdAmount > newBalanceTo)) | |
441 | + | then throwThreshold(dAppThresholdAmount, newBalanceFrom, newBalanceTo, value(pmtAssetId), fromBase58String(exchangeAseetId)) | |
442 | + | else { | |
443 | + | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
444 | + | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
446 | 445 | else 0 | |
447 | - | if ((stake2 == stake2)) | |
448 | - | then $Tuple2([IntegerEntry((pmtStrAssetId + kAssetBalance), newBalanceFrom), IntegerEntry((exchangeAseetId + kAssetBalance), newBalanceTo), ScriptTransfer(i.caller, amountMinusFee, fromBase58String(exchangeAseetId)), ScriptTransfer(moneyBoxAddress, governanceReward, fromBase58String(exchangeAseetId))], $Tuple2(amountMinusFee, fromBase58String(exchangeAseetId))) | |
446 | + | if ((stake1 == stake1)) | |
447 | + | then { | |
448 | + | let stake2 = if (containsElement(stakingAssets, exchangeAseetId)) | |
449 | + | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), exchangeAseetId], nil) | |
450 | + | else 0 | |
451 | + | if ((stake2 == stake2)) | |
452 | + | then $Tuple2([IntegerEntry((pmtStrAssetId + kAssetBalance), newBalanceFrom), IntegerEntry((exchangeAseetId + kAssetBalance), newBalanceTo), ScriptTransfer(i.caller, amountMinusFee, fromBase58String(exchangeAseetId)), ScriptTransfer(moneyBoxAddress, governanceReward, fromBase58String(exchangeAseetId))], $Tuple2(amountMinusFee, fromBase58String(exchangeAseetId))) | |
453 | + | else throw("Strict value is not equal to itself.") | |
454 | + | } | |
449 | 455 | else throw("Strict value is not equal to itself.") | |
450 | 456 | } | |
451 | - | else throw("Strict value is not equal to itself.") | |
452 | 457 | } | |
453 | - | ||
458 | + | } | |
454 | 459 | } | |
455 | 460 | ||
456 | 461 | ||
478 | 483 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
479 | 484 | then throw("Only contract itself can invoke this function") | |
480 | 485 | else { | |
481 | - | let $ | |
482 | - | let call = $ | |
483 | - | let addr = $ | |
484 | - | let params = $ | |
485 | - | let payments = $ | |
486 | + | let $t01762817731 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
487 | + | let call = $t01762817731._1 | |
488 | + | let addr = $t01762817731._2 | |
489 | + | let params = $t01762817731._3 | |
490 | + | let payments = $t01762817731._4 | |
486 | 491 | let inv = invoke(addr, call, params, payments) | |
487 | 492 | if ((inv == inv)) | |
488 | 493 | then nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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 kAssets = "asset_ids" | |
11 | 11 | ||
12 | 12 | let kAssetBalance = "_asset_balance" | |
13 | 13 | ||
14 | 14 | let kShareAssetId = "share_asset_id" | |
15 | 15 | ||
16 | 16 | let kShareAssetSupply = "share_asset_supply" | |
17 | 17 | ||
18 | 18 | let kFee = "commission" | |
19 | 19 | ||
20 | 20 | let kInvariant = "invariant" | |
21 | 21 | ||
22 | 22 | let kCause = "shutdown_cause" | |
23 | 23 | ||
24 | 24 | let kUSDNAddress = "staking_usdnnsbt_address" | |
25 | 25 | ||
26 | 26 | let kEURNAddress = "staking_eurn_address" | |
27 | 27 | ||
28 | 28 | let kDiscounts = "discounts" | |
29 | 29 | ||
30 | 30 | let kDiscountValues = "discount_values" | |
31 | 31 | ||
32 | 32 | let kUserSwopInGov = "_SWOP_amount" | |
33 | 33 | ||
34 | 34 | let kFirstHarvest = "first_harvest" | |
35 | 35 | ||
36 | 36 | let kFirstHarvestHeight = "first_harvest_height" | |
37 | 37 | ||
38 | 38 | let kShareLimit = "share_limit_on_first_harvest" | |
39 | 39 | ||
40 | 40 | let kBasePeriod = "base_period" | |
41 | 41 | ||
42 | 42 | let kPeriodLength = "period_length" | |
43 | 43 | ||
44 | 44 | let kStartHeight = "start_height" | |
45 | 45 | ||
46 | 46 | let kAdminPubKey1 = "admin_pub_1" | |
47 | 47 | ||
48 | 48 | let kAdminPubKey2 = "admin_pub_2" | |
49 | 49 | ||
50 | 50 | let kAdminPubKey3 = "admin_pub_3" | |
51 | 51 | ||
52 | 52 | let kAdminInvokePubKey = "admin_invoke_pub" | |
53 | 53 | ||
54 | 54 | let kMoneyBoxAddress = "money_box_address" | |
55 | 55 | ||
56 | 56 | let kGovAddress = "governance_address" | |
57 | 57 | ||
58 | 58 | let kVotingAddress = "voting_address" | |
59 | 59 | ||
60 | - | let oracle = Address(base58' | |
60 | + | let oracle = Address(base58'3PEbqViERCoKnmcSULh6n2aiMvUdSQdCsom') | |
61 | 61 | ||
62 | 62 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
63 | 63 | case string: String => | |
64 | 64 | fromBase58String(string) | |
65 | 65 | case nothing => | |
66 | 66 | throw((key + "is empty")) | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
71 | 71 | ||
72 | 72 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
73 | 73 | ||
74 | 74 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
75 | 75 | ||
76 | 76 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
77 | 77 | ||
78 | 78 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
79 | 79 | ||
80 | 80 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
81 | 81 | ||
82 | 82 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
83 | 83 | ||
84 | 84 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
85 | 85 | ||
86 | 86 | let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
87 | 87 | ||
88 | 88 | let stakingAssets = [toBase58String(USDN)] | |
89 | 89 | ||
90 | 90 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
91 | 91 | ||
92 | 92 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
93 | 93 | ||
94 | 94 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
95 | 95 | ||
96 | 96 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
97 | 97 | ||
98 | 98 | let active = getBooleanValue(this, kActive) | |
99 | 99 | ||
100 | 100 | let shareSupply = getIntegerValue(this, kShareAssetSupply) | |
101 | 101 | ||
102 | 102 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
103 | 103 | ||
104 | 104 | let exchangeAssets = getString(this, kAssets) | |
105 | 105 | ||
106 | 106 | let fee = getIntegerValue(this, kFee) | |
107 | 107 | ||
108 | 108 | let feeGovernance = fraction(fee, 40, 100) | |
109 | 109 | ||
110 | 110 | let feeScale6 = 1000000 | |
111 | 111 | ||
112 | 112 | let scale3 = 1000 | |
113 | 113 | ||
114 | 114 | let scale8 = 100000000 | |
115 | 115 | ||
116 | 116 | let scale16 = 10000000000000000 | |
117 | 117 | ||
118 | 118 | let slippageScale3 = 1000 | |
119 | 119 | ||
120 | 120 | let digits8 = 8 | |
121 | 121 | ||
122 | 122 | let dAppThreshold = 50 | |
123 | 123 | ||
124 | 124 | let dAppThresholdScale2 = 100 | |
125 | 125 | ||
126 | 126 | let exchangeRatioLimitMin = 90000000 | |
127 | 127 | ||
128 | 128 | let exchangeRatioLimitMax = 110000000 | |
129 | 129 | ||
130 | 130 | let alpha = 50 | |
131 | 131 | ||
132 | 132 | let alphaDigits = 2 | |
133 | 133 | ||
134 | 134 | let beta = 4600000000000000 | |
135 | 135 | ||
136 | 136 | func accountBalance (assetId) = match assetId { | |
137 | 137 | case id: ByteVector => | |
138 | 138 | assetBalance(this, id) | |
139 | 139 | case waves: Unit => | |
140 | 140 | wavesBalance(this).available | |
141 | 141 | case _ => | |
142 | 142 | throw("Match error") | |
143 | 143 | } | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func stakedAmount (assetId) = { | |
147 | 147 | let stakedAmountCalculated = match assetId { | |
148 | 148 | case aId: ByteVector => | |
149 | 149 | if ((aId == USDN)) | |
150 | 150 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
151 | 151 | else 0 | |
152 | 152 | case _: Unit => | |
153 | 153 | 0 | |
154 | 154 | case _ => | |
155 | 155 | throw("Match error") | |
156 | 156 | } | |
157 | 157 | match stakedAmountCalculated { | |
158 | 158 | case i: Int => | |
159 | 159 | i | |
160 | 160 | case _ => | |
161 | 161 | 0 | |
162 | 162 | } | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func invariantCalc (x,y) = { | |
170 | 170 | let sk = skewness(x, y) | |
171 | 171 | (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))) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func calculateSendAmount (balanceFrom,balanceTo,invariant,amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount) = { | |
176 | 176 | let worstAllowedNewInvariantRatio = (scale16 - ((scale16 * 1) / 10000000)) | |
177 | 177 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
178 | 178 | func getStepAmount (acc,step) = if ((acc._1 == -1)) | |
179 | 179 | then { | |
180 | 180 | let amountToSend = (amountToSendEstimated - (((step * deltaBetweenMaxAndMinSendValue) / 3) / scale3)) | |
181 | 181 | let stepInvariant = invariantCalc(balanceFrom, (balanceTo - amountToSend)) | |
182 | 182 | if ((stepInvariant > invariant)) | |
183 | 183 | then $Tuple2(amountToSend, stepInvariant) | |
184 | 184 | else $Tuple2(-1, 0) | |
185 | 185 | } | |
186 | 186 | else acc | |
187 | 187 | ||
188 | 188 | let amountToSendMin = getStepAmount($Tuple2(-1, 0), 3000) | |
189 | 189 | if ((0 > amountToSendMin._1)) | |
190 | 190 | then throw("Price is worse than minReceived") | |
191 | 191 | else { | |
192 | 192 | let invEstimated = invariantCalc(balanceFrom, (balanceTo - amountToSendEstimated)) | |
193 | 193 | if ((invariant > invEstimated)) | |
194 | 194 | then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, invEstimated))) | |
195 | 195 | then throw("The requested price is too not profitable for user") | |
196 | 196 | else { | |
197 | 197 | let a = { | |
198 | 198 | let $l = [25, 200, 500] | |
199 | 199 | let $s = size($l) | |
200 | 200 | let $acc0 = $Tuple2(-1, 0) | |
201 | 201 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
202 | 202 | then $a | |
203 | 203 | else getStepAmount($a, $l[$i]) | |
204 | 204 | ||
205 | 205 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
206 | 206 | then $a | |
207 | 207 | else throw("List size exceeds 3") | |
208 | 208 | ||
209 | 209 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
210 | 210 | } | |
211 | 211 | if ((0 > a._1)) | |
212 | 212 | then amountToSendMin._1 | |
213 | 213 | else a._1 | |
214 | 214 | } | |
215 | 215 | else { | |
216 | 216 | let a = { | |
217 | 217 | let $l = [-500, -200, -25] | |
218 | 218 | let $s = size($l) | |
219 | 219 | let $acc0 = $Tuple2(-1, 0) | |
220 | 220 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
221 | 221 | then $a | |
222 | 222 | else getStepAmount($a, $l[$i]) | |
223 | 223 | ||
224 | 224 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
225 | 225 | then $a | |
226 | 226 | else throw("List size exceeds 3") | |
227 | 227 | ||
228 | 228 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
229 | 229 | } | |
230 | 230 | let tupleSendBetter = if ((0 > a._1)) | |
231 | 231 | then $Tuple2(amountToSendEstimated, invEstimated) | |
232 | 232 | else a | |
233 | 233 | if ((worstAllowedNewInvariantRatio >= fraction(scale16, invariant, tupleSendBetter._2))) | |
234 | 234 | then throw("The requested price is too not profitable for user") | |
235 | 235 | else tupleSendBetter._1 | |
236 | 236 | } | |
237 | 237 | } | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func getAssetInfo (assetId) = match assetId { | |
242 | 242 | case id: ByteVector => | |
243 | 243 | let stringId = toBase58String(id) | |
244 | 244 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
245 | 245 | $Tuple3(stringId, info.name, info.decimals) | |
246 | 246 | case waves: Unit => | |
247 | 247 | $Tuple3("WAVES", "WAVES", 8) | |
248 | 248 | case _ => | |
249 | 249 | throw("Match error") | |
250 | 250 | } | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func throwIsActive () = throw("DApp is already active") | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func isActive () = if (active) | |
260 | 260 | then unit | |
261 | 261 | else throw("DApp is inactive at this moment") | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
265 | 265 | then unit | |
266 | 266 | else throw("Only admin can call this function") | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func throwAssets () = throw("Incorrect assets attached.") | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func throwOnePayment () = throw("One attached payment expected") | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func throwThreshold (threshold,amountA,amountB,assetIdA,assetIdB) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(threshold)) + ": ") + toString(amountA)) + " ") + toBase58String(assetIdA)) + ", ") + toString(amountB)) + " ") + toBase58String(assetIdB))) | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | func suspendSuspicious (balanceA,assetIdA,balanceB,assetIdB) = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + toBase58String(assetIdA)) + ", ") + toString(balanceB)) + " ") + toBase58String(assetIdB)) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + toBase58String(assetIdA)) + ", ") + toString(accountBalance(assetIdB))) + " ") + toBase58String(assetIdB))) | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
282 | 282 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
283 | 283 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
287 | 287 | then { | |
288 | 288 | let $t086658731 = calcStakingFuncAndAddres(stake, assetId) | |
289 | 289 | let call = $t086658731._1 | |
290 | 290 | let stakingAddr = $t086658731._2 | |
291 | 291 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
292 | 292 | } | |
293 | 293 | else { | |
294 | 294 | let $t088178883 = calcStakingFuncAndAddres(stake, assetId) | |
295 | 295 | let call = $t088178883._1 | |
296 | 296 | let stakingAddr = $t088178883._2 | |
297 | 297 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
298 | 298 | } | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func calculateFeeDiscount (userAddr) = { | |
302 | 302 | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
303 | 303 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
304 | 304 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
305 | 305 | if (if ((swopAmount >= parseIntValue(discountValues[0]))) | |
306 | 306 | then (parseIntValue(discountValues[1]) > swopAmount) | |
307 | 307 | else false) | |
308 | 308 | then (feeScale6 - parseIntValue(discounts[0])) | |
309 | 309 | else if (if ((swopAmount >= parseIntValue(discountValues[1]))) | |
310 | 310 | then (parseIntValue(discountValues[2]) > swopAmount) | |
311 | 311 | else false) | |
312 | 312 | then (feeScale6 - parseIntValue(discounts[1])) | |
313 | 313 | else if (if ((swopAmount >= parseIntValue(discountValues[2]))) | |
314 | 314 | then (parseIntValue(discountValues[3]) > swopAmount) | |
315 | 315 | else false) | |
316 | 316 | then (feeScale6 - parseIntValue(discounts[2])) | |
317 | 317 | else if (if ((swopAmount >= parseIntValue(discountValues[3]))) | |
318 | 318 | then (parseIntValue(discountValues[4]) > swopAmount) | |
319 | 319 | else false) | |
320 | 320 | then (feeScale6 - parseIntValue(discounts[3])) | |
321 | 321 | else if ((swopAmount >= parseIntValue(discountValues[4]))) | |
322 | 322 | then (feeScale6 - parseIntValue(discounts[4])) | |
323 | 323 | else feeScale6 | |
324 | 324 | } | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | func getPoolBalances (assetIdA,assetIdB) = { | |
328 | 328 | let balanceA = getIntegerValue(this, (toBase58String(assetIdA) + kAssetBalance)) | |
329 | 329 | let balanceB = getIntegerValue(this, (toBase58String(assetIdB) + kAssetBalance)) | |
330 | 330 | let stakedAmountA = stakedAmount(assetIdA) | |
331 | 331 | let stakedAmountB = stakedAmount(assetIdB) | |
332 | 332 | let accountBalanceA = (accountBalance(assetIdA) + stakedAmountA) | |
333 | 333 | let accountBalanceB = (accountBalance(assetIdB) + stakedAmountB) | |
334 | 334 | $Tuple4(balanceA, balanceB, accountBalanceA, accountBalanceB) | |
335 | 335 | } | |
336 | 336 | ||
337 | 337 | ||
338 | 338 | @Callable(i) | |
339 | 339 | func init (firstHarvest) = if (isDefined(getBoolean(this, kActive))) | |
340 | 340 | then throwIsActive() | |
341 | 341 | else { | |
342 | 342 | func parseInitPayments (acc,payment) = { | |
343 | 343 | let $t01079110825 = acc | |
344 | 344 | let entries = $t01079110825._1 | |
345 | 345 | let assetIds = $t01079110825._2 | |
346 | 346 | let sum = $t01079110825._3 | |
347 | 347 | let $t01083810920 = $Tuple2(payment.amount, toBase58String(value(payment.assetId))) | |
348 | 348 | let amount = $t01083810920._1 | |
349 | 349 | let assetId = $t01083810920._2 | |
350 | 350 | let stake = if (containsElement(stakingAssets, assetId)) | |
351 | 351 | then invoke(this, "stakeUnstake", [true, amount, assetId], nil) | |
352 | 352 | else 0 | |
353 | 353 | if ((stake == stake)) | |
354 | 354 | then if (contains(assetIds, assetId)) | |
355 | 355 | then throw("Assets must be different") | |
356 | 356 | else $Tuple3((entries :+ IntegerEntry((assetId + kAssetBalance), amount)), if ((size(assetIds) == 0)) | |
357 | 357 | then assetId | |
358 | 358 | else ((assetIds + ",") + assetId), (sum + amount)) | |
359 | 359 | else throw("Strict value is not equal to itself.") | |
360 | 360 | } | |
361 | 361 | ||
362 | 362 | let $t01149511585 = { | |
363 | 363 | let $l = i.payments | |
364 | 364 | let $s = size($l) | |
365 | 365 | let $acc0 = $Tuple3(nil, "", 0) | |
366 | 366 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
367 | 367 | then $a | |
368 | 368 | else parseInitPayments($a, $l[$i]) | |
369 | 369 | ||
370 | 370 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
371 | 371 | then $a | |
372 | 372 | else throw("List size exceeds 10") | |
373 | 373 | ||
374 | 374 | $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) | |
375 | 375 | } | |
376 | 376 | let balanceEntries = $t01149511585._1 | |
377 | 377 | let assetIds = $t01149511585._2 | |
378 | 378 | let sum = $t01149511585._3 | |
379 | 379 | let shareName = "s_Multi_USD" | |
380 | 380 | let shareDescription = ("ShareToken of SwopFi protocol for MultiStable USD pool at address " + toString(this)) | |
381 | 381 | let shareDecimals = 6 | |
382 | 382 | let shareInitialSupply = sum | |
383 | 383 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
384 | 384 | let shareIssueId = calculateAssetId(shareIssue) | |
385 | 385 | let baseEntry = ([StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssets, assetIds), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] ++ balanceEntries) | |
386 | 386 | if (firstHarvest) | |
387 | 387 | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
388 | 388 | else baseEntry | |
389 | 389 | } | |
390 | 390 | ||
391 | 391 | ||
392 | 392 | ||
393 | 393 | @Callable(i) | |
394 | 394 | func exchange (exchangeAseetId,estimatedAmountToReceive,minAmountToReceive) = { | |
395 | 395 | let $t01305613131 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
396 | 396 | let pmtAmount = $t01305613131._1 | |
397 | 397 | let pmtAssetId = $t01305613131._2 | |
398 | 398 | let $t01313613276 = getPoolBalances(value(pmtAssetId), fromBase58String(exchangeAseetId)) | |
399 | 399 | let balanceFrom = $t01313613276._1 | |
400 | 400 | let balanceTo = $t01313613276._2 | |
401 | 401 | let accountBalanceFrom = $t01313613276._3 | |
402 | 402 | let accountBalanceTo = $t01313613276._4 | |
403 | - | let pmtStrAssetId = toBase58String(value(pmtAssetId)) | |
404 | - | if ((0 >= estimatedAmountToReceive)) | |
405 | - | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
406 | - | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
407 | - | then throw("Minimal amount can't be greater than estimated.") | |
408 | - | else if ((size(i.payments) != 1)) | |
409 | - | then throwOnePayment() | |
410 | - | else if (!(if ((balanceFrom > accountBalanceFrom)) | |
411 | - | then true | |
412 | - | else (balanceTo > accountBalanceTo))) | |
413 | - | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(balanceFrom, value(pmtAssetId), balanceTo, fromBase58String(exchangeAseetId))) | |
414 | - | else if (if (!(contains(value(exchangeAssets), pmtStrAssetId))) | |
415 | - | then true | |
416 | - | else !(contains(value(exchangeAssets), exchangeAseetId))) | |
417 | - | then throwAssets() | |
418 | - | else if ((10000000 > pmtAmount)) | |
419 | - | then throw("Only swap of 10.000000 or more tokens is allowed") | |
420 | - | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
403 | + | if ((1 == 1)) | |
404 | + | then throw(((((((("balanceFrom:" + toString(balanceFrom)) + " balanceTo: ") + toString(balanceTo)) + "accountBalanceFrom:") + toString(accountBalanceFrom)) + " accountBalanceTo: ") + toString(accountBalanceTo))) | |
405 | + | else { | |
406 | + | let k = 1 | |
407 | + | let pmtStrAssetId = toBase58String(value(pmtAssetId)) | |
408 | + | if ((0 >= estimatedAmountToReceive)) | |
409 | + | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
410 | + | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
411 | + | then throw("Minimal amount can't be greater than estimated.") | |
412 | + | else if ((size(i.payments) != 1)) | |
413 | + | then throwOnePayment() | |
414 | + | else if (!(if ((balanceFrom > accountBalanceFrom)) | |
415 | + | then true | |
416 | + | else (balanceTo > accountBalanceTo))) | |
417 | + | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(balanceFrom, value(pmtAssetId), balanceTo, fromBase58String(exchangeAseetId))) | |
418 | + | else if (if (!(contains(value(exchangeAssets), pmtStrAssetId))) | |
421 | 419 | then true | |
422 | - | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
423 | - | then throw("Incorrect args and pmt ratio") | |
424 | - | else { | |
425 | - | let invariant = invariantCalc(balanceFrom, balanceTo) | |
426 | - | let amount = calculateSendAmount(balanceFrom, balanceTo, invariant, estimatedAmountToReceive, minAmountToReceive, pmtAmount) | |
427 | - | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
428 | - | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
429 | - | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
430 | - | let $t01491515024 = $Tuple2((balanceFrom + pmtAmount), ((balanceTo - amountMinusFee) - governanceReward)) | |
431 | - | let newBalanceFrom = $t01491515024._1 | |
432 | - | let newBalanceTo = $t01491515024._2 | |
433 | - | let dAppThresholdAmount = fraction((newBalanceFrom + newBalanceTo), dAppThreshold, (2 * dAppThresholdScale2)) | |
434 | - | if (if ((dAppThresholdAmount > newBalanceFrom)) | |
420 | + | else !(contains(value(exchangeAssets), exchangeAseetId))) | |
421 | + | then throwAssets() | |
422 | + | else if ((10000000 > pmtAmount)) | |
423 | + | then throw("Only swap of 10.000000 or more tokens is allowed") | |
424 | + | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
435 | 425 | then true | |
436 | - | else ( | |
437 | - | then | |
426 | + | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
427 | + | then throw("Incorrect args and pmt ratio") | |
438 | 428 | else { | |
439 | - | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
440 | - | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
441 | - | else 0 | |
442 | - | if ((stake1 == stake1)) | |
443 | - | then { | |
444 | - | let stake2 = if (containsElement(stakingAssets, exchangeAseetId)) | |
445 | - | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), exchangeAseetId], nil) | |
429 | + | let invariant = invariantCalc(balanceFrom, balanceTo) | |
430 | + | let amount = calculateSendAmount(balanceFrom, balanceTo, invariant, estimatedAmountToReceive, minAmountToReceive, pmtAmount) | |
431 | + | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
432 | + | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
433 | + | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
434 | + | let $t01517415283 = $Tuple2((balanceFrom + pmtAmount), ((balanceTo - amountMinusFee) - governanceReward)) | |
435 | + | let newBalanceFrom = $t01517415283._1 | |
436 | + | let newBalanceTo = $t01517415283._2 | |
437 | + | let dAppThresholdAmount = fraction((newBalanceFrom + newBalanceTo), dAppThreshold, (2 * dAppThresholdScale2)) | |
438 | + | if (if ((dAppThresholdAmount > newBalanceFrom)) | |
439 | + | then true | |
440 | + | else (dAppThresholdAmount > newBalanceTo)) | |
441 | + | then throwThreshold(dAppThresholdAmount, newBalanceFrom, newBalanceTo, value(pmtAssetId), fromBase58String(exchangeAseetId)) | |
442 | + | else { | |
443 | + | let stake1 = if (containsElement(stakingAssets, pmtStrAssetId)) | |
444 | + | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
446 | 445 | else 0 | |
447 | - | if ((stake2 == stake2)) | |
448 | - | then $Tuple2([IntegerEntry((pmtStrAssetId + kAssetBalance), newBalanceFrom), IntegerEntry((exchangeAseetId + kAssetBalance), newBalanceTo), ScriptTransfer(i.caller, amountMinusFee, fromBase58String(exchangeAseetId)), ScriptTransfer(moneyBoxAddress, governanceReward, fromBase58String(exchangeAseetId))], $Tuple2(amountMinusFee, fromBase58String(exchangeAseetId))) | |
446 | + | if ((stake1 == stake1)) | |
447 | + | then { | |
448 | + | let stake2 = if (containsElement(stakingAssets, exchangeAseetId)) | |
449 | + | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), exchangeAseetId], nil) | |
450 | + | else 0 | |
451 | + | if ((stake2 == stake2)) | |
452 | + | then $Tuple2([IntegerEntry((pmtStrAssetId + kAssetBalance), newBalanceFrom), IntegerEntry((exchangeAseetId + kAssetBalance), newBalanceTo), ScriptTransfer(i.caller, amountMinusFee, fromBase58String(exchangeAseetId)), ScriptTransfer(moneyBoxAddress, governanceReward, fromBase58String(exchangeAseetId))], $Tuple2(amountMinusFee, fromBase58String(exchangeAseetId))) | |
453 | + | else throw("Strict value is not equal to itself.") | |
454 | + | } | |
449 | 455 | else throw("Strict value is not equal to itself.") | |
450 | 456 | } | |
451 | - | else throw("Strict value is not equal to itself.") | |
452 | 457 | } | |
453 | - | ||
458 | + | } | |
454 | 459 | } | |
455 | 460 | ||
456 | 461 | ||
457 | 462 | ||
458 | 463 | @Callable(i) | |
459 | 464 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
460 | 465 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
461 | 466 | else suspend("Paused by admin")) | |
462 | 467 | ||
463 | 468 | ||
464 | 469 | ||
465 | 470 | @Callable(i) | |
466 | 471 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
467 | 472 | then throwIsActive() | |
468 | 473 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
469 | 474 | ||
470 | 475 | ||
471 | 476 | ||
472 | 477 | @Callable(i) | |
473 | 478 | func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), [IntegerEntry(kShareLimit, shareLimit)])) | |
474 | 479 | ||
475 | 480 | ||
476 | 481 | ||
477 | 482 | @Callable(i) | |
478 | 483 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
479 | 484 | then throw("Only contract itself can invoke this function") | |
480 | 485 | else { | |
481 | - | let $ | |
482 | - | let call = $ | |
483 | - | let addr = $ | |
484 | - | let params = $ | |
485 | - | let payments = $ | |
486 | + | let $t01762817731 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
487 | + | let call = $t01762817731._1 | |
488 | + | let addr = $t01762817731._2 | |
489 | + | let params = $t01762817731._3 | |
490 | + | let payments = $t01762817731._4 | |
486 | 491 | let inv = invoke(addr, call, params, payments) | |
487 | 492 | if ((inv == inv)) | |
488 | 493 | then nil | |
489 | 494 | else throw("Strict value is not equal to itself.") | |
490 | 495 | } | |
491 | 496 | ||
492 | 497 | ||
493 | 498 | @Verifier(tx) | |
494 | 499 | func verify () = { | |
495 | 500 | let multiSignedByAdmins = { | |
496 | 501 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
497 | 502 | then 1 | |
498 | 503 | else 0 | |
499 | 504 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
500 | 505 | then 1 | |
501 | 506 | else 0 | |
502 | 507 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
503 | 508 | then 1 | |
504 | 509 | else 0 | |
505 | 510 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
506 | 511 | } | |
507 | 512 | match tx { | |
508 | 513 | case inv: InvokeScriptTransaction => | |
509 | 514 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
510 | 515 | then (inv.function == "takeIntoAccountExtraFunds") | |
511 | 516 | else false | |
512 | 517 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
513 | 518 | then true | |
514 | 519 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
515 | 520 | then true | |
516 | 521 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
517 | 522 | then true | |
518 | 523 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
519 | 524 | if (if (callTakeIntoAccount) | |
520 | 525 | then signedByAdmin | |
521 | 526 | else false) | |
522 | 527 | then true | |
523 | 528 | else multiSignedByAdmins | |
524 | 529 | case _ => | |
525 | 530 | multiSignedByAdmins | |
526 | 531 | } | |
527 | 532 | } | |
528 | 533 |
github/deemru/w8io/169f3d6 70.01 ms ◑