tx · 3NSjPRFkQBV7imW7QJVVUEgG5MZSoqzdnikEg9b7JKMB 3N32tQmmrYnh4Nf3uwwpC5mvBav21uS4Npm: -0.01400000 Waves 2021.05.20 02:39 [1533220] smart account 3N32tQmmrYnh4Nf3uwwpC5mvBav21uS4Npm > SELF 0.00000000 Waves
{ "type": 13, "id": "3NSjPRFkQBV7imW7QJVVUEgG5MZSoqzdnikEg9b7JKMB", "fee": 1400000, "feeAssetId": null, "timestamp": 1621467558660, "version": 2, "chainId": 84, "sender": "3N32tQmmrYnh4Nf3uwwpC5mvBav21uS4Npm", "senderPublicKey": "3W4UxWT2M3gKvVSQsrwnuRWF6HoCoZ7gHx86DdQUEnWj", "proofs": [ "4fdcWo3i3mcyMiyiN34qCEDYSs36ie6rZWTiTGUJ6fmo3Cz1qzbwQUhCAFrgs8FCpfbfuyZBHoFCUNcusmZxUAEh" ], "script": "base64:AAIEAAAAAAAAACoIAhIDCgEEEgcKBQEBCAgEEgMKAQESAwoBARIAEgMKAQESABIAEgMKAQEAAABEAAAAAAd2ZXJzaW9uAgAAAAUxLjAuMAAAAAAKa2V5VmVyc2lvbgIAAAAHdmVyc2lvbgAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAAC2tleUFzc2V0SWRBAgAAAApBX2Fzc2V0X2lkAAAAAAtrZXlBc3NldElkQgIAAAAKQl9hc3NldF9pZAAAAAALa2V5QmFsYW5jZUECAAAAD0FfYXNzZXRfYmFsYW5jZQAAAAALa2V5QmFsYW5jZUICAAAAD0JfYXNzZXRfYmFsYW5jZQAAAAAPa2V5QmFsYW5jZUluaXRBAgAAAAxBX2Fzc2V0X2luaXQAAAAAD2tleUJhbGFuY2VJbml0QgIAAAAMQl9hc3NldF9pbml0AAAAAA9rZXlTaGFyZUFzc2V0SWQCAAAADnNoYXJlX2Fzc2V0X2lkAAAAABNrZXlTaGFyZUFzc2V0U3VwcGx5AgAAABJzaGFyZV9hc3NldF9zdXBwbHkAAAAADWtleUNvbW1pc3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AAZwcm9vZnMAAAAAAAAAAAAFAAAADGFkbWluUHViS2V5MwYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAABJhZG1pblB1YktleVN0YWtpbmcDBQAAABNjYWxsVGFrZUludG9BY2NvdW50BgUAAAALY2FsbFN0YWtpbmcJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5cGpDSg==", "height": 1533220, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9e9yqNCfk4PDEb9XB1ZrM1DAfLfwS5VhCi59eFKZ1cGi Next: none Diff:
Old | New | Differences | |
---|---|---|---|
31 | 31 | ||
32 | 32 | let keyFirstHarvest = "first_harvest" | |
33 | 33 | ||
34 | - | let keyBasePeriod = "base_period" | |
35 | - | ||
36 | - | let keyPeriodLength = "period_length" | |
37 | - | ||
38 | - | let keyStartHeight = "start_height" | |
39 | - | ||
40 | 34 | let keyFirstHarvestHeight = "first_harvest_height" | |
41 | - | ||
42 | - | let keyDurationFullVotePower = "duration_full_vote_power" | |
43 | 35 | ||
44 | 36 | let kShareLimit = "share_limit_on_first_harvest" | |
45 | 37 | ||
46 | - | let keyMinVotePower = "min_vote_power" | |
38 | + | let kBasePeriod = "base_period" | |
39 | + | ||
40 | + | let kPeriodLength = "period_length" | |
41 | + | ||
42 | + | let kStartHeight = "start_height" | |
43 | + | ||
44 | + | let kFirstHarvestHeight = "first_harvest_height" | |
47 | 45 | ||
48 | 46 | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
49 | 47 | ||
55 | 53 | ||
56 | 54 | let adminPubKeyStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
57 | 55 | ||
58 | - | let adminPubKeyBackend = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
59 | - | ||
60 | - | let governanceAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
56 | + | let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
61 | 57 | ||
62 | 58 | let votingAddress = Address(base58'3N6CYoCsxrcXKe75pQvvV3JqJrwJjm1t4QN') | |
63 | 59 | ||
64 | 60 | let stakingAddress = Address(base58'3N6q7sCGSSLBUXDdjBdYGTJbZGZfhhh8cNg') | |
65 | 61 | ||
62 | + | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
63 | + | ||
64 | + | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
65 | + | ||
66 | + | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
67 | + | ||
68 | + | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 2) | |
69 | + | ||
66 | 70 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
67 | 71 | ||
68 | 72 | let stakingFeeInUSDN = (9 * value(value(assetInfo(USDN)).minSponsoredFee)) | |
69 | - | ||
70 | - | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, keyBasePeriod), "Empty kBasePeriod") | |
71 | - | ||
72 | - | let startHeight = valueOrErrorMessage(getInteger(votingAddress, keyStartHeight), "Empty kStartHeight") | |
73 | - | ||
74 | - | let periodLength = valueOrErrorMessage(getInteger(votingAddress, keyPeriodLength), "Empty kPeriodLength") | |
75 | - | ||
76 | - | let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, keyDurationFullVotePower), "Empty kDurationFullVotePower") | |
77 | - | ||
78 | - | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, keyMinVotePower), "Empty kMinVotePower") | |
79 | - | ||
80 | - | let currPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 2) | |
81 | 73 | ||
82 | 74 | let isActive = getBooleanValue(this, keyActive) | |
83 | 75 | ||
219 | 211 | ||
220 | 212 | @Callable(i) | |
221 | 213 | func init (firstHarvest) = { | |
222 | - | let $t065776654 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
223 | - | let pmtAmountA = $t065776654._1 | |
224 | - | let pmtAssetIdA = $t065776654._2 | |
225 | - | let $t066596736 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
226 | - | let pmtAmountB = $t066596736._1 | |
227 | - | let pmtAssetIdB = $t066596736._2 | |
228 | - | let $t067416818 = getAssetInfo(pmtAssetIdA) | |
229 | - | let pmtStrAssetIdA = $t067416818._1 | |
230 | - | let pmtAssetNameA = $t067416818._2 | |
231 | - | let pmtDecimalsA = $t067416818._3 | |
232 | - | let $t068236900 = getAssetInfo(pmtAssetIdB) | |
233 | - | let pmtStrAssetIdB = $t068236900._1 | |
234 | - | let pmtAssetNameB = $t068236900._2 | |
235 | - | let pmtDecimalsB = $t068236900._3 | |
236 | - | if (isDefined(getBoolean(this, keyActive))) | |
237 | - | then throw("DApp is already active") | |
238 | - | else if ((pmtAssetIdA == pmtAssetIdB)) | |
239 | - | then throw("Assets must be different") | |
240 | - | else { | |
241 | - | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
242 | - | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
243 | - | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
244 | - | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, HALFDOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, HALFDOWN), pow(10, 0, shareDecimals, 0, 0, HALFDOWN)) | |
245 | - | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
246 | - | let shareIssueId = calculateAssetId(shareIssue) | |
247 | - | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
248 | - | if (firstHarvest) | |
249 | - | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, currPeriod)]) | |
250 | - | else baseEntry | |
251 | - | } | |
214 | + | let $t060636140 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
215 | + | let pmtAmountA = $t060636140._1 | |
216 | + | let pmtAssetIdA = $t060636140._2 | |
217 | + | let $t061456222 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
218 | + | let pmtAmountB = $t061456222._1 | |
219 | + | let pmtAssetIdB = $t061456222._2 | |
220 | + | let $t062276304 = getAssetInfo(pmtAssetIdA) | |
221 | + | let pmtStrAssetIdA = $t062276304._1 | |
222 | + | let pmtAssetNameA = $t062276304._2 | |
223 | + | let pmtDecimalsA = $t062276304._3 | |
224 | + | let $t063096386 = getAssetInfo(pmtAssetIdB) | |
225 | + | let pmtStrAssetIdB = $t063096386._1 | |
226 | + | let pmtAssetNameB = $t063096386._2 | |
227 | + | let pmtDecimalsB = $t063096386._3 | |
228 | + | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
229 | + | then throw("Only admin can call this function") | |
230 | + | else if (isDefined(getBoolean(this, keyActive))) | |
231 | + | then throw("DApp is already active") | |
232 | + | else if ((pmtAssetIdA == pmtAssetIdB)) | |
233 | + | then throw("Assets must be different") | |
234 | + | else { | |
235 | + | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
236 | + | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
237 | + | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
238 | + | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, HALFDOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, HALFDOWN), pow(10, 0, shareDecimals, 0, 0, HALFDOWN)) | |
239 | + | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
240 | + | let shareIssueId = calculateAssetId(shareIssue) | |
241 | + | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
242 | + | if (firstHarvest) | |
243 | + | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
244 | + | else baseEntry | |
245 | + | } | |
252 | 246 | } | |
253 | 247 | ||
254 | 248 | ||
255 | 249 | ||
256 | 250 | @Callable(i) | |
257 | 251 | func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = { | |
258 | - | let $t089018988 = getAssetInfoFromString(strAssetIdA) | |
259 | - | let pmtStrAssetIdA = $t089018988._1 | |
260 | - | let pmtAssetNameA = $t089018988._2 | |
261 | - | let pmtDecimalsA = $t089018988._3 | |
262 | - | let $t089939080 = getAssetInfoFromString(strAssetIdB) | |
263 | - | let pmtStrAssetIdB = $t089939080._1 | |
264 | - | let pmtAssetNameB = $t089939080._2 | |
265 | - | let pmtDecimalsB = $t089939080._3 | |
266 | - | if (isDefined(getBoolean(this, keyActive))) | |
267 | - | then throw("DApp is already active") | |
268 | - | else if ((strAssetIdA == strAssetIdB)) | |
269 | - | then throw("Assets must be different") | |
270 | - | else { | |
271 | - | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
272 | - | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
273 | - | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
274 | - | let shareInitialSupply = 0 | |
275 | - | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
276 | - | let shareIssueId = calculateAssetId(shareIssue) | |
277 | - | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyFirstHarvestHeight, currPeriod), IntegerEntry(keyShareAssetSupply, shareInitialSupply)] | |
278 | - | if (firstHarvest) | |
279 | - | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, currPeriod)]) | |
280 | - | else baseEntry | |
281 | - | } | |
252 | + | let $t085948681 = getAssetInfoFromString(strAssetIdA) | |
253 | + | let pmtStrAssetIdA = $t085948681._1 | |
254 | + | let pmtAssetNameA = $t085948681._2 | |
255 | + | let pmtDecimalsA = $t085948681._3 | |
256 | + | let $t086868773 = getAssetInfoFromString(strAssetIdB) | |
257 | + | let pmtStrAssetIdB = $t086868773._1 | |
258 | + | let pmtAssetNameB = $t086868773._2 | |
259 | + | let pmtDecimalsB = $t086868773._3 | |
260 | + | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
261 | + | then throw("Only admin can call this function") | |
262 | + | else if (isDefined(getBoolean(this, keyActive))) | |
263 | + | then throw("DApp is already active") | |
264 | + | else if ((strAssetIdA == strAssetIdB)) | |
265 | + | then throw("Assets must be different") | |
266 | + | else { | |
267 | + | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
268 | + | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
269 | + | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
270 | + | let shareInitialSupply = 0 | |
271 | + | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
272 | + | let shareIssueId = calculateAssetId(shareIssue) | |
273 | + | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength))), IntegerEntry(keyShareAssetSupply, shareInitialSupply)] | |
274 | + | if (firstHarvest) | |
275 | + | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
276 | + | else baseEntry | |
277 | + | } | |
282 | 278 | } | |
283 | 279 | ||
284 | 280 | ||
286 | 282 | @Callable(i) | |
287 | 283 | func keepLimitForFirstHarvest (shareLimit) = if (!(isActive)) | |
288 | 284 | then throw("DApp is inactive at this moment") | |
289 | - | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, | |
285 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
290 | 286 | then throw("Only admin can call this function") | |
291 | 287 | else [IntegerEntry(kShareLimit, shareLimit)] | |
292 | 288 | ||
302 | 298 | then (balanceB == 0) | |
303 | 299 | else false) | |
304 | 300 | then { | |
305 | - | let $t01162211699 = getAssetInfo(pmtAssetIdA) | |
306 | - | let pmtStrAssetIdA = $t01162211699._1 | |
307 | - | let pmtAssetNameA = $t01162211699._2 | |
308 | - | let pmtDecimalsA = $t01162211699._3 | |
309 | - | let $t01170811785 = getAssetInfo(pmtAssetIdB) | |
310 | - | let pmtStrAssetIdB = $t01170811785._1 | |
311 | - | let pmtAssetNameB = $t01170811785._2 | |
312 | - | let pmtDecimalsB = $t01170811785._3 | |
301 | + | let $t01155911636 = getAssetInfo(pmtAssetIdA) | |
302 | + | let pmtStrAssetIdA = $t01155911636._1 | |
303 | + | let pmtAssetNameA = $t01155911636._2 | |
304 | + | let pmtDecimalsA = $t01155911636._3 | |
305 | + | let $t01164511722 = getAssetInfo(pmtAssetIdB) | |
306 | + | let pmtStrAssetIdB = $t01164511722._1 | |
307 | + | let pmtAssetNameB = $t01164511722._2 | |
308 | + | let pmtDecimalsB = $t01164511722._3 | |
309 | + | let tokenRatio = fraction(fraction(assetInitA, scaleValue8, pmtAmountA), scaleValue3, fraction(assetInitB, scaleValue8, pmtAmountB)) | |
313 | 310 | if ((pmtAssetIdA == pmtAssetIdB)) | |
314 | 311 | then throw("Assets must be different") | |
315 | 312 | else { | |
323 | 320 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
324 | 321 | else if ((size(i.payments) != 2)) | |
325 | 322 | then throw("Two attached assets expected") | |
326 | - | else if (if (( | |
323 | + | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
327 | 324 | then true | |
328 | - | else (pmtAssetIdB != assetIdB)) | |
329 | - | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
330 | - | else if ((shareInitialSupply == 0)) | |
331 | - | then throw("Too small amount to replenish") | |
332 | - | else if (!(hasEnoughBalance)) | |
333 | - | then suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
334 | - | else [Reissue(shareAssetId, shareInitialSupply, true), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareAssetId)] | |
325 | + | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
326 | + | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
327 | + | else if (if ((pmtAssetIdA != assetIdA)) | |
328 | + | then true | |
329 | + | else (pmtAssetIdB != assetIdB)) | |
330 | + | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
331 | + | else if ((shareInitialSupply == 0)) | |
332 | + | then throw("Too small amount to replenish") | |
333 | + | else if (!(hasEnoughBalance)) | |
334 | + | then suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
335 | + | else [Reissue(shareAssetId, shareInitialSupply, true), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareAssetId)] | |
335 | 336 | } | |
336 | 337 | } | |
337 | 338 | else { | |
367 | 368 | ||
368 | 369 | @Callable(i) | |
369 | 370 | func withdraw () = { | |
370 | - | let $ | |
371 | - | let pmtAmount = $ | |
372 | - | let pmtAssetId = $ | |
371 | + | let $t01635516505 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
372 | + | let pmtAmount = $t01635516505._1 | |
373 | + | let pmtAssetId = $t01635516505._2 | |
373 | 374 | let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA) | |
374 | 375 | let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB) | |
375 | 376 | if (!(isActive)) | |
391 | 392 | ||
392 | 393 | @Callable(i) | |
393 | 394 | func exchange (minAmountToReceive) = { | |
394 | - | let $ | |
395 | - | let pmtAmount = $ | |
396 | - | let pmtAssetId = $ | |
395 | + | let $t01789517970 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
396 | + | let pmtAmount = $t01789517970._1 | |
397 | + | let pmtAssetId = $t01789517970._2 | |
397 | 398 | func calculateFees (tokenFrom,tokenTo) = { | |
398 | 399 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
399 | 400 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
406 | 407 | if (!(isActive)) | |
407 | 408 | then throw("DApp is inactive at this moment") | |
408 | 409 | else if (if ((balanceA == 0)) | |
409 | - | then | |
410 | - | else | |
410 | + | then true | |
411 | + | else (balanceB == 0)) | |
411 | 412 | then throw("Can't exchange with zero balance") | |
412 | 413 | else if ((0 >= minAmountToReceive)) | |
413 | 414 | then throw(("Minimal amount to receive must be positive. Actual: " + toString(minAmountToReceive))) | |
418 | 419 | else if ((pmtAssetId == assetIdA)) | |
419 | 420 | then { | |
420 | 421 | let assetIdSend = assetIdB | |
421 | - | let $ | |
422 | - | let amountWithoutFee = $ | |
423 | - | let amountWithFee = $ | |
424 | - | let governanceReward = $ | |
422 | + | let $t01942819519 = calculateFees(balanceA, balanceB) | |
423 | + | let amountWithoutFee = $t01942819519._1 | |
424 | + | let amountWithFee = $t01942819519._2 | |
425 | + | let governanceReward = $t01942819519._3 | |
425 | 426 | let newBalanceA = (balanceA + pmtAmount) | |
426 | 427 | let newBalanceB = ((balanceB - amountWithFee) - governanceReward) | |
427 | 428 | if (if (if ((assetIdA == USDN)) | |
432 | 433 | then (stakedAmountUSDN >= newBalanceB) | |
433 | 434 | else false) | |
434 | 435 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceB, assetNameB) | |
435 | - | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer( | |
436 | + | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
436 | 437 | } | |
437 | 438 | else if ((pmtAssetId == assetIdB)) | |
438 | 439 | then { | |
439 | 440 | let assetIdSend = assetIdA | |
440 | - | let $ | |
441 | - | let amountWithoutFee = $ | |
442 | - | let amountWithFee = $ | |
443 | - | let governanceReward = $ | |
441 | + | let $t02038820479 = calculateFees(balanceB, balanceA) | |
442 | + | let amountWithoutFee = $t02038820479._1 | |
443 | + | let amountWithFee = $t02038820479._2 | |
444 | + | let governanceReward = $t02038820479._3 | |
444 | 445 | let newBalanceA = ((balanceA - amountWithFee) - governanceReward) | |
445 | 446 | let newBalanceB = (balanceB + pmtAmount) | |
446 | 447 | if (if (if ((assetIdA == USDN)) | |
451 | 452 | then (stakedAmountUSDN >= newBalanceB) | |
452 | 453 | else false) | |
453 | 454 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceA, assetNameA) | |
454 | - | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer( | |
455 | + | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
455 | 456 | } | |
456 | 457 | else throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
457 | 458 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "1.0.0" | |
5 | 5 | ||
6 | 6 | let keyVersion = "version" | |
7 | 7 | ||
8 | 8 | let keyActive = "active" | |
9 | 9 | ||
10 | 10 | let keyAssetIdA = "A_asset_id" | |
11 | 11 | ||
12 | 12 | let keyAssetIdB = "B_asset_id" | |
13 | 13 | ||
14 | 14 | let keyBalanceA = "A_asset_balance" | |
15 | 15 | ||
16 | 16 | let keyBalanceB = "B_asset_balance" | |
17 | 17 | ||
18 | 18 | let keyBalanceInitA = "A_asset_init" | |
19 | 19 | ||
20 | 20 | let keyBalanceInitB = "B_asset_init" | |
21 | 21 | ||
22 | 22 | let keyShareAssetId = "share_asset_id" | |
23 | 23 | ||
24 | 24 | let keyShareAssetSupply = "share_asset_supply" | |
25 | 25 | ||
26 | 26 | let keyCommission = "commission" | |
27 | 27 | ||
28 | 28 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
29 | 29 | ||
30 | 30 | let keyCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let keyFirstHarvest = "first_harvest" | |
33 | 33 | ||
34 | - | let keyBasePeriod = "base_period" | |
35 | - | ||
36 | - | let keyPeriodLength = "period_length" | |
37 | - | ||
38 | - | let keyStartHeight = "start_height" | |
39 | - | ||
40 | 34 | let keyFirstHarvestHeight = "first_harvest_height" | |
41 | - | ||
42 | - | let keyDurationFullVotePower = "duration_full_vote_power" | |
43 | 35 | ||
44 | 36 | let kShareLimit = "share_limit_on_first_harvest" | |
45 | 37 | ||
46 | - | let keyMinVotePower = "min_vote_power" | |
38 | + | let kBasePeriod = "base_period" | |
39 | + | ||
40 | + | let kPeriodLength = "period_length" | |
41 | + | ||
42 | + | let kStartHeight = "start_height" | |
43 | + | ||
44 | + | let kFirstHarvestHeight = "first_harvest_height" | |
47 | 45 | ||
48 | 46 | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
49 | 47 | ||
50 | 48 | let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
51 | 49 | ||
52 | 50 | let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
53 | 51 | ||
54 | 52 | let adminPubKeyStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
55 | 53 | ||
56 | 54 | let adminPubKeyStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
57 | 55 | ||
58 | - | let adminPubKeyBackend = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
59 | - | ||
60 | - | let governanceAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
56 | + | let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
61 | 57 | ||
62 | 58 | let votingAddress = Address(base58'3N6CYoCsxrcXKe75pQvvV3JqJrwJjm1t4QN') | |
63 | 59 | ||
64 | 60 | let stakingAddress = Address(base58'3N6q7sCGSSLBUXDdjBdYGTJbZGZfhhh8cNg') | |
65 | 61 | ||
62 | + | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
63 | + | ||
64 | + | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
65 | + | ||
66 | + | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
67 | + | ||
68 | + | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 2) | |
69 | + | ||
66 | 70 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
67 | 71 | ||
68 | 72 | let stakingFeeInUSDN = (9 * value(value(assetInfo(USDN)).minSponsoredFee)) | |
69 | - | ||
70 | - | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, keyBasePeriod), "Empty kBasePeriod") | |
71 | - | ||
72 | - | let startHeight = valueOrErrorMessage(getInteger(votingAddress, keyStartHeight), "Empty kStartHeight") | |
73 | - | ||
74 | - | let periodLength = valueOrErrorMessage(getInteger(votingAddress, keyPeriodLength), "Empty kPeriodLength") | |
75 | - | ||
76 | - | let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, keyDurationFullVotePower), "Empty kDurationFullVotePower") | |
77 | - | ||
78 | - | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, keyMinVotePower), "Empty kMinVotePower") | |
79 | - | ||
80 | - | let currPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 2) | |
81 | 73 | ||
82 | 74 | let isActive = getBooleanValue(this, keyActive) | |
83 | 75 | ||
84 | 76 | let strAssetIdA = getStringValue(this, keyAssetIdA) | |
85 | 77 | ||
86 | 78 | let strAssetIdB = getStringValue(this, keyAssetIdB) | |
87 | 79 | ||
88 | 80 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
89 | 81 | then unit | |
90 | 82 | else fromBase58String(strAssetIdA) | |
91 | 83 | ||
92 | 84 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
93 | 85 | then unit | |
94 | 86 | else fromBase58String(strAssetIdB) | |
95 | 87 | ||
96 | 88 | let assetNameA = match assetIdA { | |
97 | 89 | case id: ByteVector => | |
98 | 90 | value(assetInfo(id)).name | |
99 | 91 | case waves: Unit => | |
100 | 92 | "WAVES" | |
101 | 93 | case _ => | |
102 | 94 | throw("Match error") | |
103 | 95 | } | |
104 | 96 | ||
105 | 97 | let assetNameB = match assetIdB { | |
106 | 98 | case id: ByteVector => | |
107 | 99 | value(assetInfo(id)).name | |
108 | 100 | case waves: Unit => | |
109 | 101 | "WAVES" | |
110 | 102 | case _ => | |
111 | 103 | throw("Match error") | |
112 | 104 | } | |
113 | 105 | ||
114 | 106 | let balanceA = getIntegerValue(this, keyBalanceA) | |
115 | 107 | ||
116 | 108 | let balanceB = getIntegerValue(this, keyBalanceB) | |
117 | 109 | ||
118 | 110 | let shareAssetId = fromBase58String(getStringValue(this, keyShareAssetId)) | |
119 | 111 | ||
120 | 112 | let shareAssetSupply = getIntegerValue(this, keyShareAssetSupply) | |
121 | 113 | ||
122 | 114 | let commission = 3000 | |
123 | 115 | ||
124 | 116 | let commissionGovernance = 1200 | |
125 | 117 | ||
126 | 118 | let commissionScaleDelimiter = 1000000 | |
127 | 119 | ||
128 | 120 | let scaleValue3 = 1000 | |
129 | 121 | ||
130 | 122 | let scaleValue8 = 100000000 | |
131 | 123 | ||
132 | 124 | let slippageToleranceDelimiter = 1000 | |
133 | 125 | ||
134 | 126 | let scaleValue8Digits = 8 | |
135 | 127 | ||
136 | 128 | func accountBalance (assetId) = match assetId { | |
137 | 129 | case id: ByteVector => | |
138 | 130 | assetBalance(this, id) | |
139 | 131 | case waves: Unit => | |
140 | 132 | wavesBalance(this).available | |
141 | 133 | case _ => | |
142 | 134 | throw("Match error") | |
143 | 135 | } | |
144 | 136 | ||
145 | 137 | ||
146 | 138 | let stakedAmountUSDN = match getInteger(stakingAddress, ((("rpd_balance_" + toBase58String(USDN)) + "_") + toString(this))) { | |
147 | 139 | case staked: Int => | |
148 | 140 | staked | |
149 | 141 | case nothing: Unit => | |
150 | 142 | 0 | |
151 | 143 | case _ => | |
152 | 144 | throw("Match error") | |
153 | 145 | } | |
154 | 146 | ||
155 | 147 | let assetInitA = getIntegerValue(this, keyBalanceInitA) | |
156 | 148 | ||
157 | 149 | let assetInitB = getIntegerValue(this, keyBalanceInitB) | |
158 | 150 | ||
159 | 151 | let availableBalanceA = (balanceA - (if ((assetIdA == USDN)) | |
160 | 152 | then stakedAmountUSDN | |
161 | 153 | else 0)) | |
162 | 154 | ||
163 | 155 | let availableBalanceB = (balanceB - (if ((assetIdB == USDN)) | |
164 | 156 | then stakedAmountUSDN | |
165 | 157 | else 0)) | |
166 | 158 | ||
167 | 159 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + (if ((assetIdA == USDN)) | |
168 | 160 | then stakedAmountUSDN | |
169 | 161 | else 0)) | |
170 | 162 | ||
171 | 163 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + (if ((assetIdB == USDN)) | |
172 | 164 | then stakedAmountUSDN | |
173 | 165 | else 0)) | |
174 | 166 | ||
175 | 167 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
176 | 168 | then (accountBalanceWithStakedB >= balanceB) | |
177 | 169 | else false | |
178 | 170 | ||
179 | 171 | func getAssetInfo (assetId) = match assetId { | |
180 | 172 | case id: ByteVector => | |
181 | 173 | let stringId = toBase58String(id) | |
182 | 174 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
183 | 175 | $Tuple3(stringId, info.name, info.decimals) | |
184 | 176 | case waves: Unit => | |
185 | 177 | $Tuple3("WAVES", "WAVES", 8) | |
186 | 178 | case _ => | |
187 | 179 | throw("Match error") | |
188 | 180 | } | |
189 | 181 | ||
190 | 182 | ||
191 | 183 | func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES")) | |
192 | 184 | then $Tuple3("WAVES", "WAVES", 8) | |
193 | 185 | else { | |
194 | 186 | let stringId = assetStr | |
195 | 187 | let id = fromBase58String(assetStr) | |
196 | 188 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
197 | 189 | $Tuple3(stringId, info.name, info.decimals) | |
198 | 190 | } | |
199 | 191 | ||
200 | 192 | ||
201 | 193 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
202 | 194 | ||
203 | 195 | ||
204 | 196 | func deductStakingFee (amount,assetId) = if ((assetId == USDN)) | |
205 | 197 | then { | |
206 | 198 | let result = (amount - stakingFeeInUSDN) | |
207 | 199 | if ((0 >= result)) | |
208 | 200 | then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakingFeeInUSDN)) + " USD-N")) | |
209 | 201 | else result | |
210 | 202 | } | |
211 | 203 | else amount | |
212 | 204 | ||
213 | 205 | ||
214 | 206 | func throwInsufficientAvailableBalance (amount,available,assetName) = throw((((((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking. Available: ") + toString(available)) + " ") + assetName) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
215 | 207 | ||
216 | 208 | ||
217 | 209 | func throwInsufficientAvailableBalances (amountA,amountB) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(amountA)) + " ") + assetNameA) + " and ") + toString(amountB)) + " ") + assetNameB) + " due to staking. Available: ") + toString(availableBalanceA)) + " ") + assetNameA) + " and ") + toString(availableBalanceB)) + " ") + assetNameB) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
218 | 210 | ||
219 | 211 | ||
220 | 212 | @Callable(i) | |
221 | 213 | func init (firstHarvest) = { | |
222 | - | let $t065776654 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
223 | - | let pmtAmountA = $t065776654._1 | |
224 | - | let pmtAssetIdA = $t065776654._2 | |
225 | - | let $t066596736 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
226 | - | let pmtAmountB = $t066596736._1 | |
227 | - | let pmtAssetIdB = $t066596736._2 | |
228 | - | let $t067416818 = getAssetInfo(pmtAssetIdA) | |
229 | - | let pmtStrAssetIdA = $t067416818._1 | |
230 | - | let pmtAssetNameA = $t067416818._2 | |
231 | - | let pmtDecimalsA = $t067416818._3 | |
232 | - | let $t068236900 = getAssetInfo(pmtAssetIdB) | |
233 | - | let pmtStrAssetIdB = $t068236900._1 | |
234 | - | let pmtAssetNameB = $t068236900._2 | |
235 | - | let pmtDecimalsB = $t068236900._3 | |
236 | - | if (isDefined(getBoolean(this, keyActive))) | |
237 | - | then throw("DApp is already active") | |
238 | - | else if ((pmtAssetIdA == pmtAssetIdB)) | |
239 | - | then throw("Assets must be different") | |
240 | - | else { | |
241 | - | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
242 | - | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
243 | - | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
244 | - | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, HALFDOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, HALFDOWN), pow(10, 0, shareDecimals, 0, 0, HALFDOWN)) | |
245 | - | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
246 | - | let shareIssueId = calculateAssetId(shareIssue) | |
247 | - | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
248 | - | if (firstHarvest) | |
249 | - | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, currPeriod)]) | |
250 | - | else baseEntry | |
251 | - | } | |
214 | + | let $t060636140 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
215 | + | let pmtAmountA = $t060636140._1 | |
216 | + | let pmtAssetIdA = $t060636140._2 | |
217 | + | let $t061456222 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
218 | + | let pmtAmountB = $t061456222._1 | |
219 | + | let pmtAssetIdB = $t061456222._2 | |
220 | + | let $t062276304 = getAssetInfo(pmtAssetIdA) | |
221 | + | let pmtStrAssetIdA = $t062276304._1 | |
222 | + | let pmtAssetNameA = $t062276304._2 | |
223 | + | let pmtDecimalsA = $t062276304._3 | |
224 | + | let $t063096386 = getAssetInfo(pmtAssetIdB) | |
225 | + | let pmtStrAssetIdB = $t063096386._1 | |
226 | + | let pmtAssetNameB = $t063096386._2 | |
227 | + | let pmtDecimalsB = $t063096386._3 | |
228 | + | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
229 | + | then throw("Only admin can call this function") | |
230 | + | else if (isDefined(getBoolean(this, keyActive))) | |
231 | + | then throw("DApp is already active") | |
232 | + | else if ((pmtAssetIdA == pmtAssetIdB)) | |
233 | + | then throw("Assets must be different") | |
234 | + | else { | |
235 | + | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
236 | + | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
237 | + | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
238 | + | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, HALFDOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, HALFDOWN), pow(10, 0, shareDecimals, 0, 0, HALFDOWN)) | |
239 | + | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
240 | + | let shareIssueId = calculateAssetId(shareIssue) | |
241 | + | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
242 | + | if (firstHarvest) | |
243 | + | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
244 | + | else baseEntry | |
245 | + | } | |
252 | 246 | } | |
253 | 247 | ||
254 | 248 | ||
255 | 249 | ||
256 | 250 | @Callable(i) | |
257 | 251 | func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = { | |
258 | - | let $t089018988 = getAssetInfoFromString(strAssetIdA) | |
259 | - | let pmtStrAssetIdA = $t089018988._1 | |
260 | - | let pmtAssetNameA = $t089018988._2 | |
261 | - | let pmtDecimalsA = $t089018988._3 | |
262 | - | let $t089939080 = getAssetInfoFromString(strAssetIdB) | |
263 | - | let pmtStrAssetIdB = $t089939080._1 | |
264 | - | let pmtAssetNameB = $t089939080._2 | |
265 | - | let pmtDecimalsB = $t089939080._3 | |
266 | - | if (isDefined(getBoolean(this, keyActive))) | |
267 | - | then throw("DApp is already active") | |
268 | - | else if ((strAssetIdA == strAssetIdB)) | |
269 | - | then throw("Assets must be different") | |
270 | - | else { | |
271 | - | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
272 | - | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
273 | - | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
274 | - | let shareInitialSupply = 0 | |
275 | - | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
276 | - | let shareIssueId = calculateAssetId(shareIssue) | |
277 | - | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyFirstHarvestHeight, currPeriod), IntegerEntry(keyShareAssetSupply, shareInitialSupply)] | |
278 | - | if (firstHarvest) | |
279 | - | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, currPeriod)]) | |
280 | - | else baseEntry | |
281 | - | } | |
252 | + | let $t085948681 = getAssetInfoFromString(strAssetIdA) | |
253 | + | let pmtStrAssetIdA = $t085948681._1 | |
254 | + | let pmtAssetNameA = $t085948681._2 | |
255 | + | let pmtDecimalsA = $t085948681._3 | |
256 | + | let $t086868773 = getAssetInfoFromString(strAssetIdB) | |
257 | + | let pmtStrAssetIdB = $t086868773._1 | |
258 | + | let pmtAssetNameB = $t086868773._2 | |
259 | + | let pmtDecimalsB = $t086868773._3 | |
260 | + | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
261 | + | then throw("Only admin can call this function") | |
262 | + | else if (isDefined(getBoolean(this, keyActive))) | |
263 | + | then throw("DApp is already active") | |
264 | + | else if ((strAssetIdA == strAssetIdB)) | |
265 | + | then throw("Assets must be different") | |
266 | + | else { | |
267 | + | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
268 | + | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
269 | + | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
270 | + | let shareInitialSupply = 0 | |
271 | + | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
272 | + | let shareIssueId = calculateAssetId(shareIssue) | |
273 | + | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength))), IntegerEntry(keyShareAssetSupply, shareInitialSupply)] | |
274 | + | if (firstHarvest) | |
275 | + | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
276 | + | else baseEntry | |
277 | + | } | |
282 | 278 | } | |
283 | 279 | ||
284 | 280 | ||
285 | 281 | ||
286 | 282 | @Callable(i) | |
287 | 283 | func keepLimitForFirstHarvest (shareLimit) = if (!(isActive)) | |
288 | 284 | then throw("DApp is inactive at this moment") | |
289 | - | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, | |
285 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
290 | 286 | then throw("Only admin can call this function") | |
291 | 287 | else [IntegerEntry(kShareLimit, shareLimit)] | |
292 | 288 | ||
293 | 289 | ||
294 | 290 | ||
295 | 291 | @Callable(i) | |
296 | 292 | func replenishWithTwoTokens (slippageTolerance) = { | |
297 | 293 | let pmtAssetIdA = i.payments[0].assetId | |
298 | 294 | let pmtAssetIdB = i.payments[1].assetId | |
299 | 295 | let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA) | |
300 | 296 | let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB) | |
301 | 297 | if (if ((balanceA == 0)) | |
302 | 298 | then (balanceB == 0) | |
303 | 299 | else false) | |
304 | 300 | then { | |
305 | - | let $t01162211699 = getAssetInfo(pmtAssetIdA) | |
306 | - | let pmtStrAssetIdA = $t01162211699._1 | |
307 | - | let pmtAssetNameA = $t01162211699._2 | |
308 | - | let pmtDecimalsA = $t01162211699._3 | |
309 | - | let $t01170811785 = getAssetInfo(pmtAssetIdB) | |
310 | - | let pmtStrAssetIdB = $t01170811785._1 | |
311 | - | let pmtAssetNameB = $t01170811785._2 | |
312 | - | let pmtDecimalsB = $t01170811785._3 | |
301 | + | let $t01155911636 = getAssetInfo(pmtAssetIdA) | |
302 | + | let pmtStrAssetIdA = $t01155911636._1 | |
303 | + | let pmtAssetNameA = $t01155911636._2 | |
304 | + | let pmtDecimalsA = $t01155911636._3 | |
305 | + | let $t01164511722 = getAssetInfo(pmtAssetIdB) | |
306 | + | let pmtStrAssetIdB = $t01164511722._1 | |
307 | + | let pmtAssetNameB = $t01164511722._2 | |
308 | + | let pmtDecimalsB = $t01164511722._3 | |
309 | + | let tokenRatio = fraction(fraction(assetInitA, scaleValue8, pmtAmountA), scaleValue3, fraction(assetInitB, scaleValue8, pmtAmountB)) | |
313 | 310 | if ((pmtAssetIdA == pmtAssetIdB)) | |
314 | 311 | then throw("Assets must be different") | |
315 | 312 | else { | |
316 | 313 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
317 | 314 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, HALFDOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, HALFDOWN), pow(10, 0, shareDecimals, 0, 0, HALFDOWN)) | |
318 | 315 | if (!(isActive)) | |
319 | 316 | then throw("DApp is inactive at this moment") | |
320 | 317 | else if (if ((0 > slippageTolerance)) | |
321 | 318 | then true | |
322 | 319 | else (slippageTolerance > slippageToleranceDelimiter)) | |
323 | 320 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
324 | 321 | else if ((size(i.payments) != 2)) | |
325 | 322 | then throw("Two attached assets expected") | |
326 | - | else if (if (( | |
323 | + | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
327 | 324 | then true | |
328 | - | else (pmtAssetIdB != assetIdB)) | |
329 | - | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
330 | - | else if ((shareInitialSupply == 0)) | |
331 | - | then throw("Too small amount to replenish") | |
332 | - | else if (!(hasEnoughBalance)) | |
333 | - | then suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
334 | - | else [Reissue(shareAssetId, shareInitialSupply, true), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareAssetId)] | |
325 | + | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
326 | + | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
327 | + | else if (if ((pmtAssetIdA != assetIdA)) | |
328 | + | then true | |
329 | + | else (pmtAssetIdB != assetIdB)) | |
330 | + | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
331 | + | else if ((shareInitialSupply == 0)) | |
332 | + | then throw("Too small amount to replenish") | |
333 | + | else if (!(hasEnoughBalance)) | |
334 | + | then suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
335 | + | else [Reissue(shareAssetId, shareInitialSupply, true), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareAssetId)] | |
335 | 336 | } | |
336 | 337 | } | |
337 | 338 | else { | |
338 | 339 | let tokenRatio = fraction(fraction(balanceA, scaleValue8, pmtAmountA), scaleValue3, fraction(balanceB, scaleValue8, pmtAmountB)) | |
339 | 340 | let ratioShareTokensInA = fraction(pmtAmountA, scaleValue8, balanceA) | |
340 | 341 | let ratioShareTokensInB = fraction(pmtAmountB, scaleValue8, balanceB) | |
341 | 342 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
342 | 343 | if (!(isActive)) | |
343 | 344 | then throw("DApp is inactive at this moment") | |
344 | 345 | else if (if ((0 > slippageTolerance)) | |
345 | 346 | then true | |
346 | 347 | else (slippageTolerance > slippageToleranceDelimiter)) | |
347 | 348 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
348 | 349 | else if ((size(i.payments) != 2)) | |
349 | 350 | then throw("Two attached assets expected") | |
350 | 351 | else if (if ((pmtAssetIdA != assetIdA)) | |
351 | 352 | then true | |
352 | 353 | else (pmtAssetIdB != assetIdB)) | |
353 | 354 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
354 | 355 | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
355 | 356 | then true | |
356 | 357 | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
357 | 358 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
358 | 359 | else if ((shareTokenToPayAmount == 0)) | |
359 | 360 | then throw("Too small amount to replenish") | |
360 | 361 | else if (!(hasEnoughBalance)) | |
361 | 362 | then suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
362 | 363 | else [IntegerEntry(keyBalanceA, (balanceA + pmtAmountA)), IntegerEntry(keyBalanceB, (balanceB + pmtAmountB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)] | |
363 | 364 | } | |
364 | 365 | } | |
365 | 366 | ||
366 | 367 | ||
367 | 368 | ||
368 | 369 | @Callable(i) | |
369 | 370 | func withdraw () = { | |
370 | - | let $ | |
371 | - | let pmtAmount = $ | |
372 | - | let pmtAssetId = $ | |
371 | + | let $t01635516505 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
372 | + | let pmtAmount = $t01635516505._1 | |
373 | + | let pmtAssetId = $t01635516505._2 | |
373 | 374 | let amountToPayA = deductStakingFee(fraction(pmtAmount, balanceA, shareAssetSupply), assetIdA) | |
374 | 375 | let amountToPayB = deductStakingFee(fraction(pmtAmount, balanceB, shareAssetSupply), assetIdB) | |
375 | 376 | if (!(isActive)) | |
376 | 377 | then throw("DApp is inactive at this moment") | |
377 | 378 | else if ((size(i.payments) != 1)) | |
378 | 379 | then throw("One attached payment expected") | |
379 | 380 | else if ((pmtAssetId != shareAssetId)) | |
380 | 381 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
381 | 382 | else if (!(hasEnoughBalance)) | |
382 | 383 | then suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
383 | 384 | else if (if ((amountToPayA > availableBalanceA)) | |
384 | 385 | then true | |
385 | 386 | else (amountToPayB > availableBalanceB)) | |
386 | 387 | then throwInsufficientAvailableBalances(amountToPayA, amountToPayB) | |
387 | 388 | else [IntegerEntry(keyBalanceA, (balanceA - amountToPayA)), IntegerEntry(keyBalanceB, (balanceB - amountToPayB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply - pmtAmount)), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
388 | 389 | } | |
389 | 390 | ||
390 | 391 | ||
391 | 392 | ||
392 | 393 | @Callable(i) | |
393 | 394 | func exchange (minAmountToReceive) = { | |
394 | - | let $ | |
395 | - | let pmtAmount = $ | |
396 | - | let pmtAssetId = $ | |
395 | + | let $t01789517970 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
396 | + | let pmtAmount = $t01789517970._1 | |
397 | + | let pmtAssetId = $t01789517970._2 | |
397 | 398 | func calculateFees (tokenFrom,tokenTo) = { | |
398 | 399 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
399 | 400 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
400 | 401 | let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter) | |
401 | 402 | if ((minAmountToReceive > amountWithFee)) | |
402 | 403 | then throw(((("Calculated amount to receive " + toString(amountWithFee)) + " is less than specified minimum ") + toString(minAmountToReceive))) | |
403 | 404 | else $Tuple3(amountWithoutFee, amountWithFee, governanceReward) | |
404 | 405 | } | |
405 | 406 | ||
406 | 407 | if (!(isActive)) | |
407 | 408 | then throw("DApp is inactive at this moment") | |
408 | 409 | else if (if ((balanceA == 0)) | |
409 | - | then | |
410 | - | else | |
410 | + | then true | |
411 | + | else (balanceB == 0)) | |
411 | 412 | then throw("Can't exchange with zero balance") | |
412 | 413 | else if ((0 >= minAmountToReceive)) | |
413 | 414 | then throw(("Minimal amount to receive must be positive. Actual: " + toString(minAmountToReceive))) | |
414 | 415 | else if ((size(i.payments) != 1)) | |
415 | 416 | then throw("One attached payment expected") | |
416 | 417 | else if (!(hasEnoughBalance)) | |
417 | 418 | then suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
418 | 419 | else if ((pmtAssetId == assetIdA)) | |
419 | 420 | then { | |
420 | 421 | let assetIdSend = assetIdB | |
421 | - | let $ | |
422 | - | let amountWithoutFee = $ | |
423 | - | let amountWithFee = $ | |
424 | - | let governanceReward = $ | |
422 | + | let $t01942819519 = calculateFees(balanceA, balanceB) | |
423 | + | let amountWithoutFee = $t01942819519._1 | |
424 | + | let amountWithFee = $t01942819519._2 | |
425 | + | let governanceReward = $t01942819519._3 | |
425 | 426 | let newBalanceA = (balanceA + pmtAmount) | |
426 | 427 | let newBalanceB = ((balanceB - amountWithFee) - governanceReward) | |
427 | 428 | if (if (if ((assetIdA == USDN)) | |
428 | 429 | then (stakedAmountUSDN >= newBalanceA) | |
429 | 430 | else false) | |
430 | 431 | then true | |
431 | 432 | else if ((assetIdB == USDN)) | |
432 | 433 | then (stakedAmountUSDN >= newBalanceB) | |
433 | 434 | else false) | |
434 | 435 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceB, assetNameB) | |
435 | - | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer( | |
436 | + | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
436 | 437 | } | |
437 | 438 | else if ((pmtAssetId == assetIdB)) | |
438 | 439 | then { | |
439 | 440 | let assetIdSend = assetIdA | |
440 | - | let $ | |
441 | - | let amountWithoutFee = $ | |
442 | - | let amountWithFee = $ | |
443 | - | let governanceReward = $ | |
441 | + | let $t02038820479 = calculateFees(balanceB, balanceA) | |
442 | + | let amountWithoutFee = $t02038820479._1 | |
443 | + | let amountWithFee = $t02038820479._2 | |
444 | + | let governanceReward = $t02038820479._3 | |
444 | 445 | let newBalanceA = ((balanceA - amountWithFee) - governanceReward) | |
445 | 446 | let newBalanceB = (balanceB + pmtAmount) | |
446 | 447 | if (if (if ((assetIdA == USDN)) | |
447 | 448 | then (stakedAmountUSDN >= newBalanceA) | |
448 | 449 | else false) | |
449 | 450 | then true | |
450 | 451 | else if ((assetIdB == USDN)) | |
451 | 452 | then (stakedAmountUSDN >= newBalanceB) | |
452 | 453 | else false) | |
453 | 454 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceA, assetNameA) | |
454 | - | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer( | |
455 | + | else [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
455 | 456 | } | |
456 | 457 | else throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
457 | 458 | } | |
458 | 459 | ||
459 | 460 | ||
460 | 461 | ||
461 | 462 | @Callable(i) | |
462 | 463 | func shutdown () = if (!(isActive)) | |
463 | 464 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
464 | 465 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
465 | 466 | then throw("Only admin can call this function") | |
466 | 467 | else suspend("Paused by admin") | |
467 | 468 | ||
468 | 469 | ||
469 | 470 | ||
470 | 471 | @Callable(i) | |
471 | 472 | func activate () = if (isActive) | |
472 | 473 | then throw("DApp is already active") | |
473 | 474 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
474 | 475 | then throw("Only admin can call this function") | |
475 | 476 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
476 | 477 | ||
477 | 478 | ||
478 | 479 | ||
479 | 480 | @Callable(i) | |
480 | 481 | func takeIntoAccountExtraFunds (amountLeave) = { | |
481 | 482 | let uncountableAmountEnrollAssetA = (accountBalanceWithStakedA - balanceA) | |
482 | 483 | let uncountableAmountEnrollAssetB = (accountBalanceWithStakedB - balanceB) | |
483 | 484 | let amountEnrollA = (uncountableAmountEnrollAssetA - (if ((assetIdA == USDN)) | |
484 | 485 | then amountLeave | |
485 | 486 | else 0)) | |
486 | 487 | let amountEnrollB = (uncountableAmountEnrollAssetB - (if ((assetIdB == USDN)) | |
487 | 488 | then amountLeave | |
488 | 489 | else 0)) | |
489 | 490 | if (!(isActive)) | |
490 | 491 | then throw("DApp is inactive at this moment") | |
491 | 492 | else if ((i.caller != this)) | |
492 | 493 | then throw("Only the DApp itself can call this function") | |
493 | 494 | else if ((0 > amountLeave)) | |
494 | 495 | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(amountLeave))) | |
495 | 496 | else if (if ((0 > uncountableAmountEnrollAssetA)) | |
496 | 497 | then true | |
497 | 498 | else (0 > uncountableAmountEnrollAssetB)) | |
498 | 499 | then suspend("Enroll amount negative") | |
499 | 500 | else if (if ((0 > amountEnrollA)) | |
500 | 501 | then true | |
501 | 502 | else (0 > amountEnrollB)) | |
502 | 503 | then throw("Too large amountLeave") | |
503 | 504 | else [IntegerEntry(keyBalanceA, (balanceA + amountEnrollA)), IntegerEntry(keyBalanceB, (balanceB + amountEnrollB)), IntegerEntry(("last_income_" + strAssetIdA), amountEnrollA), IntegerEntry(("last_income_" + strAssetIdB), amountEnrollB)] | |
504 | 505 | } | |
505 | 506 | ||
506 | 507 | ||
507 | 508 | @Verifier(tx) | |
508 | 509 | func verify () = match tx { | |
509 | 510 | case invoke: InvokeScriptTransaction => | |
510 | 511 | let callTakeIntoAccount = if ((invoke.dApp == this)) | |
511 | 512 | then (invoke.function == "takeIntoAccountExtraFunds") | |
512 | 513 | else false | |
513 | 514 | let callStaking = if ((invoke.dApp == stakingAddress)) | |
514 | 515 | then if (if (if ((invoke.function == "lockNeutrino")) | |
515 | 516 | then (size(invoke.payments) == 1) | |
516 | 517 | else false) | |
517 | 518 | then (invoke.payments[0].assetId == USDN) | |
518 | 519 | else false) | |
519 | 520 | then true | |
520 | 521 | else if ((invoke.function == "unlockNeutrino")) | |
521 | 522 | then (size(invoke.payments) == 0) | |
522 | 523 | else false | |
523 | 524 | else false | |
524 | 525 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
525 | 526 | then true | |
526 | 527 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
527 | 528 | then true | |
528 | 529 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
529 | 530 | then true | |
530 | 531 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking) | |
531 | 532 | if (callTakeIntoAccount) | |
532 | 533 | then true | |
533 | 534 | else callStaking | |
534 | 535 | case _ => | |
535 | 536 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
536 | 537 | } | |
537 | 538 |
github/deemru/w8io/169f3d6 86.80 ms ◑