tx · 7KcqJWSgnkTciaw7yAkSNeKhp8Lp3Rm8CsfreSCT1bMh 3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH: -0.01800000 Waves 2023.11.25 09:17 [2858546] smart account 3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH > SELF 0.00000000 Waves
{ "type": 13, "id": "7KcqJWSgnkTciaw7yAkSNeKhp8Lp3Rm8CsfreSCT1bMh", "fee": 1800000, "feeAssetId": null, "timestamp": 1700893135238, "version": 2, "chainId": 84, "sender": "3N3y7nQfqDc7rBUExjKQi5ZbspWRh9q8PYH", "senderPublicKey": "9ggtmbyecVRfUY2zeZhNaoLBp2iymhnQhffXQhemTJaG", "proofs": [ "4uYzb26G4xwbke2aXQbtpvK6f2shpmE63GyfJBAQ6yyaxgmJF6AApywwAAdK5aYxVM6zeqyuHQYY8Y7JXrfpbQTj" ], "script": "base64:BgIYCAISABIAEgASABIAEgASABIECgIIARIAUgENdHJ5R2V0SW50ZWdlcgIHYWRkcmVzcwNrZXkEByRtYXRjaDAJAJoIAgUHYWRkcmVzcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQBYgUHJG1hdGNoMAUBYgAAAQx0cnlHZXRTdHJpbmcCB2FkZHJlc3MDa2V5BAckbWF0Y2gwCQCdCAIFB2FkZHJlc3MFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAWIFByRtYXRjaDAFAWICAAACZDgAgMLXLwADZDE2CQBoAgUCZDgFAmQ4AAt1bmxvY2tCbG9jawkAaAIAHgCgCwAKaGVpclB1YktleQEgGhWuLQ8iL9bocw38EUfyB7YO6jTez96WKtjdSBQafhAADHVubG9ja0Jsb2NrMgkAaAIAWgCgCwASUHV6emxlTWFzdGVyUHViS2V5ASA7NU1uP5+++FSclkQHgFarL+ITYEXEe/I/F0P0QgUmXQAMa2V5QWN0aXZhdGVkAhVBY3RpdmF0ZWQgYmxvY2toZWlnaHQAEmtleVN1cnBsdXNSZWNlaXZlZAIcc3VycG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AglrZXlTdHJpbmcHaW50ZWdlcgMJAQIhPQIIBQFpBmNhbGxlcgUEdGhpcwkAAgECHGFjY2VzcyBvbmx5IGJ5IHByb2plY3Qgb3duZXIJAMwIAgkBDEludGVnZXJFbnRyeQIFCWtleVN0cmluZwUHaW50ZWdlcgUDbmlsAWkBCWFjdGl2YXRlZAADCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAhN5b3UgYXJlIG5vdCBhbGxvd2VkCQDMCAIJAQxJbnRlZ2VyRW50cnkCBQxrZXlBY3RpdmF0ZWQFBmhlaWdodAUDbmlsAQJ0eAEGdmVyaWZ5AAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkGAwkAZgIJAGQCCQENdHJ5R2V0SW50ZWdlcgIFBHRoaXMFDGtleUFjdGl2YXRlZAULdW5sb2NrQmxvY2sFBmhlaWdodAcDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQpoZWlyUHViS2V5BgMJAGYCCQBkAgkBDXRyeUdldEludGVnZXICBQR0aGlzBQxrZXlBY3RpdmF0ZWQFDHVubG9ja0Jsb2NrMgUGaGVpZ2h0BwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUSUHV6emxlTWFzdGVyUHViS2V5X/k0aA==", "height": 2858546, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HurA397CWQ22bVAdDRbvX74Gh67BzVnm2KowNrwQVLUi Next: A3WTPGqr2CUHx3uqzosmiwZx1VLW4RQHwV83NQX5cg1w Diff:
Old | New | Differences | |
---|---|---|---|
21 | 21 | ||
22 | 22 | let d16 = (d8 * d8) | |
23 | 23 | ||
24 | + | let unlockBlock = (30 * 1440) | |
25 | + | ||
24 | 26 | let heirPubKey = base58'2kpmuzw1ZbrtgAN3BrR7vbEW1XrJoJKCstL7mf7XNf2P' | |
27 | + | ||
28 | + | let unlockBlock2 = (90 * 1440) | |
25 | 29 | ||
26 | 30 | let PuzzleMasterPubKey = base58'4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU' | |
27 | 31 | ||
28 | - | let | |
32 | + | let keyActivated = "Activated blockheight" | |
29 | 33 | ||
30 | - | let unlockBlock2 = (90 * 1440) | |
34 | + | let keySurplusReceived = "surplus received in wavelets" | |
35 | + | ||
36 | + | let keyWaveletsReceived = "total WAVES received in wavelets" | |
37 | + | ||
38 | + | let keyWaveletsReceivedBT = "total wavelets received for base treasury" | |
39 | + | ||
40 | + | let keyWaveletsPaidOut = "total WAVES paid out in wavelets" | |
41 | + | ||
42 | + | let keyROI = "ROI basis points" | |
43 | + | ||
44 | + | let keyWhirlpoolIssuePrice = "WHIRLPOOL issue price in wavelets" | |
31 | 45 | ||
32 | 46 | let burnxtnPPTpoolId = base58'3PQHndCUVrv3wBuQjbvVP9SnGmfbfitGxfx' | |
33 | 47 | ||
81 | 95 | ||
82 | 96 | let SWAVES_stake = Address(base58'3PDPzZVLhN1EuzGy4xAxjjTVkawKDLEaHiV') | |
83 | 97 | ||
84 | - | let | |
98 | + | let WX_ETH_WAVES = Address(base58'3P2yiVnK48evTLr8MAZWavpE4WA4fw1weQg') | |
85 | 99 | ||
86 | 100 | let wavesInPool = tryGetInteger(Address(burnxtnPPTpoolId), (("global_" + toBase58String(waves)) + "_balance")) | |
87 | - | ||
88 | - | let ethWaves = fraction(d8, wavesInPool, ethInPool) | |
89 | 101 | ||
90 | 102 | let projectStake = tryGetInteger(Address(burnxtnPPTpoolId), (toString(this) + "_indexStaked")) | |
91 | 103 | ||
128 | 140 | ||
129 | 141 | let wavesEast = fraction((d8 * 100), eastInWX, wavesInWX) | |
130 | 142 | ||
143 | + | let waves2InWX = (wavesBalance(WX_ETH_WAVES).regular + baseAmount) | |
144 | + | ||
145 | + | let ethInWX = assetBalance(WX_ETH_WAVES, eth) | |
146 | + | ||
147 | + | let ethWaves = fraction((d8 * 100), waves2InWX, ethInWX) | |
148 | + | ||
131 | 149 | let wavesInWhirlpool = tryGetInteger(Address(whirlpoolPoolId), (("global_" + toBase58String(waves)) + "_balance")) | |
132 | 150 | ||
133 | 151 | let whirlInWhirlpool = tryGetInteger(Address(whirlpoolPoolId), (("global_" + whirlpoolString) + "_balance")) | |
164 | 182 | ||
165 | 183 | let tvlInWaves = ((fraction((wavesInPool * 10), projectStake, totalStake) + fraction((wavesInWhirlpool * 10), projectStakeWhirl, totalStakeWhirl)) + ETHinViresWavelets) | |
166 | 184 | ||
185 | + | let totalBT = WAVESinEAST | |
186 | + | ||
187 | + | let totalTreasury = (totalBT + tvlInWaves) | |
188 | + | ||
167 | 189 | let whirlpoolSupply = match assetInfo(whirlpool) { | |
168 | 190 | case asset: Asset => | |
169 | 191 | asset.quantity | |
171 | 193 | throw("Can't find asset") | |
172 | 194 | } | |
173 | 195 | ||
174 | - | let price = if (((fraction((tvlInWaves + tryGetInteger(this, | |
175 | - | then (fraction((tvlInWaves + tryGetInteger(this, | |
176 | - | else tryGetInteger(this, | |
196 | + | let price = if (((fraction((tvlInWaves + tryGetInteger(this, keySurplusReceived)), d8, whirlpoolSupply) + d8) >= tryGetInteger(this, keyWhirlpoolIssuePrice))) | |
197 | + | then (fraction((tvlInWaves + tryGetInteger(this, keySurplusReceived)), d8, whirlpoolSupply) + d8) | |
198 | + | else tryGetInteger(this, keyWhirlpoolIssuePrice) | |
177 | 199 | ||
178 | 200 | @Callable(i) | |
179 | 201 | func buyWHIRLPOOLwithWAVES () = { | |
202 | 224 | then IssueAmount | |
203 | 225 | else 0, true), if ((AmountOut > IssueAmount)) | |
204 | 226 | then ScriptTransfer(i.caller, WhirlpoolFromSwap, whirlpool) | |
205 | - | else ScriptTransfer(i.caller, IssueAmount, whirlpool), IntegerEntry( | |
227 | + | else ScriptTransfer(i.caller, IssueAmount, whirlpool), IntegerEntry(keyWhirlpoolIssuePrice, price), IntegerEntry(if ((AmountOut > IssueAmount)) | |
206 | 228 | then "price WHIRLPOOL/WAVES" | |
207 | 229 | else "WHIRLPOOL/WAVES mid market price", if ((AmountOut > IssueAmount)) | |
208 | 230 | then fraction(d8, pmt.amount, WhirlpoolFromSwap) | |
209 | - | else fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry( | |
210 | - | then (pmt.amount + tryGetInteger(this, | |
211 | - | else tryGetInteger(this, | |
212 | - | then ((pmt.amount - surplus) + tryGetInteger(this, | |
213 | - | else tryGetInteger(this, | |
214 | - | then getIntegerValue(this, | |
215 | - | else (surplus + getIntegerValue(this, | |
231 | + | else fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry(keyWaveletsReceived, if ((IssueAmount >= AmountOut)) | |
232 | + | then (pmt.amount + tryGetInteger(this, keyWaveletsReceived)) | |
233 | + | else tryGetInteger(this, keyWaveletsReceived)), IntegerEntry(keyWaveletsReceived, if ((IssueAmount >= AmountOut)) | |
234 | + | then ((pmt.amount - surplus) + tryGetInteger(this, keyWaveletsReceived)) | |
235 | + | else tryGetInteger(this, keyWaveletsReceived)), IntegerEntry(keySurplusReceived, if ((AmountOut > IssueAmount)) | |
236 | + | then getIntegerValue(this, keySurplusReceived) | |
237 | + | else (surplus + getIntegerValue(this, keySurplusReceived)))] | |
216 | 238 | } | |
217 | 239 | else throw("Strict value is not equal to itself.") | |
218 | 240 | } | |
223 | 245 | ||
224 | 246 | ||
225 | 247 | @Callable(i) | |
226 | - | func priceSurplusSupply () = [IntegerEntry("BT WAVES in EAST vault", WAVESinEAST), IntegerEntry("ST BURN-XTN x PepeTeam in wavelets", fraction((wavesInPool * 10), projectStake, totalStake)), IntegerEntry("ST WHIRLPOOL AMM in wavelets", fraction((wavesInWhirlpool * 10), projectStakeWhirl, totalStakeWhirl)), IntegerEntry("ST vETH", ETHinVires), IntegerEntry("ST vETH in wavelets", ETHinViresWavelets), IntegerEntry("Total ST in wavelets", tvlInWaves), IntegerEntry( | |
248 | + | func priceSurplusSupply () = [IntegerEntry("ETH/WAVES price", ethWaves), IntegerEntry("BT WAVES in EAST vault", WAVESinEAST), IntegerEntry("ST BURN-XTN x PepeTeam in wavelets", fraction((wavesInPool * 10), projectStake, totalStake)), IntegerEntry("ST WHIRLPOOL AMM in wavelets", fraction((wavesInWhirlpool * 10), projectStakeWhirl, totalStakeWhirl)), IntegerEntry("ST vETH", ETHinVires), IntegerEntry("ST vETH in wavelets", ETHinViresWavelets), IntegerEntry("Total ST in wavelets", tvlInWaves), IntegerEntry(keyWhirlpoolIssuePrice, price), IntegerEntry("WHIRLPOOL/WAVES mid market price", fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry("WHIRLPOOL total supply", whirlpoolSupply), IntegerEntry("Total treasury", totalTreasury), IntegerEntry("NAV WHIRLPOOL", fraction(d8, totalTreasury, whirlpoolSupply)), IntegerEntry(keyWaveletsReceived, tryGetInteger(this, keyWaveletsReceived)), IntegerEntry(keySurplusReceived, tryGetInteger(this, keySurplusReceived)), IntegerEntry(keyWaveletsReceived, tryGetInteger(this, keyWaveletsReceived)), IntegerEntry(keyWaveletsPaidOut, tryGetInteger(this, keyWaveletsPaidOut)), IntegerEntry("total WAVES received", (tryGetInteger(this, keyWaveletsReceived) / d8)), IntegerEntry("Total treasury in WAVES", (totalTreasury / d8)), IntegerEntry("surplus received in WAVES", (tryGetInteger(this, keySurplusReceived) / d8)), IntegerEntry("total WAVES received for base treasury", (tryGetInteger(this, keyWaveletsReceived) / d8)), IntegerEntry("total WAVES paid out in WAVES", (tryGetInteger(this, keyWaveletsPaidOut) / d8)), IntegerEntry(keyROI, tryGetInteger(this, keyROI))] | |
227 | 249 | ||
228 | 250 | ||
229 | 251 | ||
245 | 267 | then { | |
246 | 268 | let boost = invoke(Address(poolboostSC), "addBoosting", [toBase58String(whirlpoolPoolId), 7], [AttachedPayment(unit, amountBoost)]) | |
247 | 269 | if ((boost == boost)) | |
248 | - | then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry( | |
270 | + | then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry(keyWaveletsPaidOut, (amountBoost + tryGetInteger(this, keyWaveletsPaidOut))), IntegerEntry(keyROI, fraction(tryGetInteger(this, keyWaveletsPaidOut), 10000, tryGetInteger(this, keyWaveletsReceived))), IntegerEntry(keyActivated, height)] | |
249 | 271 | else throw("Strict value is not equal to itself.") | |
250 | 272 | } | |
251 | 273 | else throw("Strict value is not equal to itself.") | |
272 | 294 | then { | |
273 | 295 | let boost = invoke(Address(poolboostSC), "addBoosting", [toBase58String(whirlpoolPoolId), 7], [AttachedPayment(unit, amountBoost)]) | |
274 | 296 | if ((boost == boost)) | |
275 | - | then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry( | |
297 | + | then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry(keyWaveletsPaidOut, (amountBoost + tryGetInteger(this, keyWaveletsPaidOut))), IntegerEntry(keyROI, fraction(tryGetInteger(this, keyWaveletsPaidOut), 10000, tryGetInteger(this, keyWaveletsReceived))), IntegerEntry(keyActivated, height)] | |
276 | 298 | else throw("Strict value is not equal to itself.") | |
277 | 299 | } | |
278 | 300 | else throw("Strict value is not equal to itself.") | |
297 | 319 | then { | |
298 | 320 | let amountOwner = fraction(boost80, 20, 100) | |
299 | 321 | if ((amountOwner == amountOwner)) | |
300 | - | then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry( | |
322 | + | then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry(keyWaveletsPaidOut, (amountBoost + tryGetInteger(this, keyWaveletsPaidOut))), IntegerEntry(keyROI, fraction(tryGetInteger(this, keyWaveletsPaidOut), 10000, tryGetInteger(this, keyWaveletsReceived))), IntegerEntry(keyActivated, height)] | |
301 | 323 | else throw("Strict value is not equal to itself.") | |
302 | 324 | } | |
303 | 325 | else throw("Strict value is not equal to itself.") | |
319 | 341 | then { | |
320 | 342 | let amountOwner = fraction(balance, 20, 100) | |
321 | 343 | if ((amountOwner == amountOwner)) | |
322 | - | then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry( | |
344 | + | then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry(keyWaveletsPaidOut, (amountBoost + tryGetInteger(this, keyWaveletsPaidOut))), IntegerEntry(keyROI, fraction(tryGetInteger(this, keyWaveletsPaidOut), 10000, tryGetInteger(this, keyWaveletsReceived))), IntegerEntry(keyActivated, height)] | |
323 | 345 | else throw("Strict value is not equal to itself.") | |
324 | 346 | } | |
325 | 347 | else throw("Strict value is not equal to itself.") | |
331 | 353 | func poolOneTokenSurplus () = if ((i.caller != this)) | |
332 | 354 | then throw("access only by project owner") | |
333 | 355 | else { | |
334 | - | let surplusAmount = tryGetInteger(this, | |
356 | + | let surplusAmount = tryGetInteger(this, keySurplusReceived) | |
335 | 357 | let PoolOneTokenSurplus = invoke(Address(base58'3PR1Qvi9mHT35SwWEkLSqqE2L8thiPLdVWU'), "generateIndexWithOneTokenAndStake", [toBase58String(burnxtnPPTpoolId)], [AttachedPayment(unit, surplusAmount)]) | |
336 | 358 | if ((PoolOneTokenSurplus == PoolOneTokenSurplus)) | |
337 | - | then [IntegerEntry( | |
359 | + | then [IntegerEntry(keySurplusReceived, (tryGetInteger(this, keySurplusReceived) - surplusAmount))] | |
338 | 360 | else throw("Strict value is not equal to itself.") | |
339 | 361 | } | |
340 | 362 | ||
348 | 370 | ||
349 | 371 | ||
350 | 372 | @Callable(i) | |
351 | - | func | |
373 | + | func activated () = if ((i.caller != this)) | |
352 | 374 | then throw("you are not allowed") | |
353 | - | else [IntegerEntry( | |
375 | + | else [IntegerEntry(keyActivated, height)] | |
354 | 376 | ||
355 | 377 | ||
356 | 378 | @Verifier(tx) | |
357 | 379 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
358 | 380 | then true | |
359 | - | else if (((tryGetInteger(this, | |
381 | + | else if (((tryGetInteger(this, keyActivated) + unlockBlock) > height)) | |
360 | 382 | then false | |
361 | 383 | else if (sigVerify(tx.bodyBytes, tx.proofs[0], heirPubKey)) | |
362 | 384 | then true | |
363 | - | else if (((tryGetInteger(this, | |
385 | + | else if (((tryGetInteger(this, keyActivated) + unlockBlock2) > height)) | |
364 | 386 | then false | |
365 | 387 | else sigVerify(tx.bodyBytes, tx.proofs[0], PuzzleMasterPubKey) | |
366 | 388 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func tryGetInteger (address,key) = match getInteger(address, key) { | |
5 | 5 | case b: Int => | |
6 | 6 | b | |
7 | 7 | case _ => | |
8 | 8 | 0 | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func tryGetString (address,key) = match getString(address, key) { | |
13 | 13 | case b: String => | |
14 | 14 | b | |
15 | 15 | case _ => | |
16 | 16 | "" | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | let d8 = 100000000 | |
21 | 21 | ||
22 | 22 | let d16 = (d8 * d8) | |
23 | 23 | ||
24 | + | let unlockBlock = (30 * 1440) | |
25 | + | ||
24 | 26 | let heirPubKey = base58'2kpmuzw1ZbrtgAN3BrR7vbEW1XrJoJKCstL7mf7XNf2P' | |
27 | + | ||
28 | + | let unlockBlock2 = (90 * 1440) | |
25 | 29 | ||
26 | 30 | let PuzzleMasterPubKey = base58'4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU' | |
27 | 31 | ||
28 | - | let | |
32 | + | let keyActivated = "Activated blockheight" | |
29 | 33 | ||
30 | - | let unlockBlock2 = (90 * 1440) | |
34 | + | let keySurplusReceived = "surplus received in wavelets" | |
35 | + | ||
36 | + | let keyWaveletsReceived = "total WAVES received in wavelets" | |
37 | + | ||
38 | + | let keyWaveletsReceivedBT = "total wavelets received for base treasury" | |
39 | + | ||
40 | + | let keyWaveletsPaidOut = "total WAVES paid out in wavelets" | |
41 | + | ||
42 | + | let keyROI = "ROI basis points" | |
43 | + | ||
44 | + | let keyWhirlpoolIssuePrice = "WHIRLPOOL issue price in wavelets" | |
31 | 45 | ||
32 | 46 | let burnxtnPPTpoolId = base58'3PQHndCUVrv3wBuQjbvVP9SnGmfbfitGxfx' | |
33 | 47 | ||
34 | 48 | let projectOwner = base58'3PEtLVxDT8mxAh1SDAn8m7JTGNkdpkaFxBk' | |
35 | 49 | ||
36 | 50 | let whirlpoolPoolId = base58'3P2myTbd5zpEHcYmNpdWTp5gXS5B8tL1RCY' | |
37 | 51 | ||
38 | 52 | let whirlpool = base58'fHJWWsh2hZAc4Atv8VRhKy3jNbHLeMwQMsLpdaBY51Y' | |
39 | 53 | ||
40 | 54 | let whirlpoolString = toBase58String(base58'73tY3E6Gd5AWYmsuq8m8Kek7KnJNAYyS3GoveTbc6jCi') | |
41 | 55 | ||
42 | 56 | let waves = base58'WAVES' | |
43 | 57 | ||
44 | 58 | let usdterc = base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
45 | 59 | ||
46 | 60 | let usdcerc = base58'HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW' | |
47 | 61 | ||
48 | 62 | let usdtbsc = base58'A81p1LTRyoq2rDR2TNxB2dWYxsiNwCSSi8sXef2SEkwb' | |
49 | 63 | ||
50 | 64 | let usdcbsc = base58'4BKKSp6NoNcrFHyorZogDyctq1fq6w7114Ym1pw6HUtC' | |
51 | 65 | ||
52 | 66 | let burnxtn = base58'3SjxA2YLdfF9fTRbzLm9xFn27C6MW34W1YsdJ6Axefns' | |
53 | 67 | ||
54 | 68 | let eth = base58'3VuV5WTmDz47Dmdn3QpcYjzbSdipjQE4JMdNe1xZpX13' | |
55 | 69 | ||
56 | 70 | let bnb = base58'66a1br3BrkoaJgP7yEar9hJcSTvJPoH6PYBLqscXcMGo' | |
57 | 71 | ||
58 | 72 | let wbtc = base58'2Fge5HEBRD3XTeg7Xg3FW5yiB9HVJFQtMXiWMQo72Up6' | |
59 | 73 | ||
60 | 74 | let btcb = base58'EW1uGLVo21Wd9i2Rhq8o4VKDTCQTGCGXE8DqayHGrLg8' | |
61 | 75 | ||
62 | 76 | let east = base58'6phK22ztGBW127gUFmdMEHKB3CVd6ZhWox2WtwJkbqTq' | |
63 | 77 | ||
64 | 78 | let steast = base58'GAB8JowY9UANZ4TQy2TzJyhxjPqXX3DUrb2cdMWrrJus' | |
65 | 79 | ||
66 | 80 | let swaves = base58'YiNbofFzC17jEHHCMwrRcpy9MrrjabMMLZxg8g5xmf7' | |
67 | 81 | ||
68 | 82 | let surf = base58'At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL' | |
69 | 83 | ||
70 | 84 | let poolboostSC = base58'3P8eeDzUnoDNbQjW617pAe76cEUDQsP1m1V' | |
71 | 85 | ||
72 | 86 | let PL_Main = Address(base58'3P4uA5etnZi4AmBabKinq2bMiWU8KcnHZdH') | |
73 | 87 | ||
74 | 88 | let PL_Defi = Address(base58'3P4DK5VzDwL3vfc5ahUEhtoe5ByZNyacJ3X') | |
75 | 89 | ||
76 | 90 | let PL_Low = Address(base58'3PHpuQUPVUoR3AYzFeJzeWJfYLsLTmWssVH') | |
77 | 91 | ||
78 | 92 | let EAST_stake = Address(base58'3P2hbtheN5apNppqqUK7L7qAwmRFXy91CNa') | |
79 | 93 | ||
80 | 94 | let WX_WAVES_EAST = Address(base58'3PJVwjfi2fF5Jv9AauayU6xLxrYBn8bpGH1') | |
81 | 95 | ||
82 | 96 | let SWAVES_stake = Address(base58'3PDPzZVLhN1EuzGy4xAxjjTVkawKDLEaHiV') | |
83 | 97 | ||
84 | - | let | |
98 | + | let WX_ETH_WAVES = Address(base58'3P2yiVnK48evTLr8MAZWavpE4WA4fw1weQg') | |
85 | 99 | ||
86 | 100 | let wavesInPool = tryGetInteger(Address(burnxtnPPTpoolId), (("global_" + toBase58String(waves)) + "_balance")) | |
87 | - | ||
88 | - | let ethWaves = fraction(d8, wavesInPool, ethInPool) | |
89 | 101 | ||
90 | 102 | let projectStake = tryGetInteger(Address(burnxtnPPTpoolId), (toString(this) + "_indexStaked")) | |
91 | 103 | ||
92 | 104 | let totalStake = tryGetInteger(Address(burnxtnPPTpoolId), "global_poolToken_amount") | |
93 | 105 | ||
94 | 106 | func PL_value (dAppAddress,asset) = fraction(tryGetInteger(dAppAddress, ((toString(this) + "_supplied_") + toBase58String(asset))), tryGetInteger(dAppAddress, (toBase58String(asset) + "_sRate")), d16) | |
95 | 107 | ||
96 | 108 | ||
97 | 109 | func _loadInt (key_,default_) = match getInteger(SWAVES_stake, key_) { | |
98 | 110 | case a: Int => | |
99 | 111 | a | |
100 | 112 | case _ => | |
101 | 113 | default_ | |
102 | 114 | } | |
103 | 115 | ||
104 | 116 | ||
105 | 117 | func _loadBigInt (key_,default_) = match getBinary(SWAVES_stake, key_) { | |
106 | 118 | case a: ByteVector => | |
107 | 119 | toBigInt(a) | |
108 | 120 | case _ => | |
109 | 121 | default_ | |
110 | 122 | } | |
111 | 123 | ||
112 | 124 | ||
113 | 125 | let lastRate = _loadBigInt("LAST_RATE", toBigInt(1000000000000)) | |
114 | 126 | ||
115 | 127 | let currentRate = _loadBigInt("CURRENT_RATE", toBigInt(0)) | |
116 | 128 | ||
117 | 129 | let lastHeight = _loadInt("LAST_HEIGHT", 0) | |
118 | 130 | ||
119 | 131 | let targetHeight = min([_loadInt("TARGET_HEIGHT", 0), height]) | |
120 | 132 | ||
121 | 133 | let lastRateUpdated = (lastRate + (currentRate * toBigInt((targetHeight - lastHeight)))) | |
122 | 134 | ||
123 | 135 | let baseAmount = toInt(fraction(toBigInt(assetBalance(WX_WAVES_EAST, swaves)), lastRateUpdated, toBigInt(1000000000000), FLOOR)) | |
124 | 136 | ||
125 | 137 | let wavesInWX = (wavesBalance(WX_WAVES_EAST).regular + baseAmount) | |
126 | 138 | ||
127 | 139 | let eastInWX = assetBalance(WX_WAVES_EAST, east) | |
128 | 140 | ||
129 | 141 | let wavesEast = fraction((d8 * 100), eastInWX, wavesInWX) | |
130 | 142 | ||
143 | + | let waves2InWX = (wavesBalance(WX_ETH_WAVES).regular + baseAmount) | |
144 | + | ||
145 | + | let ethInWX = assetBalance(WX_ETH_WAVES, eth) | |
146 | + | ||
147 | + | let ethWaves = fraction((d8 * 100), waves2InWX, ethInWX) | |
148 | + | ||
131 | 149 | let wavesInWhirlpool = tryGetInteger(Address(whirlpoolPoolId), (("global_" + toBase58String(waves)) + "_balance")) | |
132 | 150 | ||
133 | 151 | let whirlInWhirlpool = tryGetInteger(Address(whirlpoolPoolId), (("global_" + whirlpoolString) + "_balance")) | |
134 | 152 | ||
135 | 153 | let projectStakeWhirl = tryGetInteger(Address(whirlpoolPoolId), (toString(this) + "_indexStaked")) | |
136 | 154 | ||
137 | 155 | let totalStakeWhirl = tryGetInteger(Address(whirlpoolPoolId), "global_poolToken_amount") | |
138 | 156 | ||
139 | 157 | let stEastInWaves = (fraction((fraction(assetBalance(this, steast), tryGetInteger(EAST_stake, "%s__rate"), 1000000000000, HALFEVEN) / 100), d8, wavesEast) * 100) | |
140 | 158 | ||
141 | 159 | let eastInStaking = (fraction(assetBalance(this, steast), tryGetInteger(EAST_stake, "%s__rate"), 1000000000000, HALFEVEN) / 100) | |
142 | 160 | ||
143 | 161 | let keyVaultAsset = tryGetString(Address(base58'3PMtGnf3LXiEG6isDQLq1xMDKUqjQGqNHLb'), "%s%s%s__vault__3PAkmJniMgnnAej5pYf2jFYkCbZow5pt9tr__WAVES") | |
144 | 162 | ||
145 | 163 | let WAVESinEAST = parseIntValue(split(keyVaultAsset, "__")[2]) | |
146 | 164 | ||
147 | 165 | let dAppaddress = Address(base58'3PHxubMUtynEY2AeHq3K1kUizRPN9HUC2rt') | |
148 | 166 | ||
149 | 167 | let ETHatoken = tryGetInteger(dAppaddress, "3PAkmJniMgnnAej5pYf2jFYkCbZow5pt9tr_aTokenBalance") | |
150 | 168 | ||
151 | 169 | let ETHatokenTotal = tryGetInteger(dAppaddress, "aTokenCirculation") | |
152 | 170 | ||
153 | 171 | let reserveStr = tryGetString(dAppaddress, "reserveGlobalData") | |
154 | 172 | ||
155 | 173 | let get1Str = split(reserveStr, "|")[1] | |
156 | 174 | ||
157 | 175 | let strToInt = parseIntValue(get1Str) | |
158 | 176 | ||
159 | 177 | let ETHtotalReserve = parseIntValue(split(tryGetString(dAppaddress, "reserveGlobalData"), "|")[1]) | |
160 | 178 | ||
161 | 179 | let ETHinVires = fraction(ETHatoken, ETHtotalReserve, ETHatokenTotal) | |
162 | 180 | ||
163 | 181 | let ETHinViresWavelets = fraction(ETHinVires, ethWaves, d8) | |
164 | 182 | ||
165 | 183 | let tvlInWaves = ((fraction((wavesInPool * 10), projectStake, totalStake) + fraction((wavesInWhirlpool * 10), projectStakeWhirl, totalStakeWhirl)) + ETHinViresWavelets) | |
166 | 184 | ||
185 | + | let totalBT = WAVESinEAST | |
186 | + | ||
187 | + | let totalTreasury = (totalBT + tvlInWaves) | |
188 | + | ||
167 | 189 | let whirlpoolSupply = match assetInfo(whirlpool) { | |
168 | 190 | case asset: Asset => | |
169 | 191 | asset.quantity | |
170 | 192 | case _ => | |
171 | 193 | throw("Can't find asset") | |
172 | 194 | } | |
173 | 195 | ||
174 | - | let price = if (((fraction((tvlInWaves + tryGetInteger(this, | |
175 | - | then (fraction((tvlInWaves + tryGetInteger(this, | |
176 | - | else tryGetInteger(this, | |
196 | + | let price = if (((fraction((tvlInWaves + tryGetInteger(this, keySurplusReceived)), d8, whirlpoolSupply) + d8) >= tryGetInteger(this, keyWhirlpoolIssuePrice))) | |
197 | + | then (fraction((tvlInWaves + tryGetInteger(this, keySurplusReceived)), d8, whirlpoolSupply) + d8) | |
198 | + | else tryGetInteger(this, keyWhirlpoolIssuePrice) | |
177 | 199 | ||
178 | 200 | @Callable(i) | |
179 | 201 | func buyWHIRLPOOLwithWAVES () = { | |
180 | 202 | let WhirlpoolBalanceBefore = assetBalance(this, whirlpool) | |
181 | 203 | if ((WhirlpoolBalanceBefore == WhirlpoolBalanceBefore)) | |
182 | 204 | then { | |
183 | 205 | let pmt = value(i.payments[0]) | |
184 | 206 | let surplus = fraction((price - d8), pmt.amount, d8) | |
185 | 207 | let IssueAmount = if ((pmt.amount >= fraction(pmt.amount, d8, price))) | |
186 | 208 | then fraction(pmt.amount, d8, price) | |
187 | 209 | else throw("please contact project owner: issue amount error") | |
188 | 210 | let supplyAmount = ((pmt.amount - surplus) / 3) | |
189 | 211 | let cleanAmountIn = (pmt.amount - fraction(pmt.amount, 200, 10000)) | |
190 | 212 | let AmountOut = fraction(whirlInWhirlpool, ((d8 * d8) - toInt(pow(fraction(toBigInt(wavesInWhirlpool), toBigInt((d8 * d8)), toBigInt((wavesInWhirlpool + cleanAmountIn)), HALFUP), 16, toBigInt(fraction(100000, 10000, 900000)), 4, 16, CEILING))), (d8 * d8), DOWN) | |
191 | 213 | if ((pmt.assetId != unit)) | |
192 | 214 | then throw("attach WAVES token only") | |
193 | 215 | else { | |
194 | 216 | let buy = if ((AmountOut > IssueAmount)) | |
195 | 217 | then invoke(Address(whirlpoolPoolId), "swap", [whirlpoolString, (IssueAmount + 1)], [AttachedPayment(unit, pmt.amount)]) | |
196 | 218 | else unit | |
197 | 219 | if ((buy == buy)) | |
198 | 220 | then { | |
199 | 221 | let WhirlpoolBalanceAfter = assetBalance(this, whirlpool) | |
200 | 222 | let WhirlpoolFromSwap = (WhirlpoolBalanceAfter - WhirlpoolBalanceBefore) | |
201 | 223 | [Reissue(whirlpool, if ((IssueAmount >= AmountOut)) | |
202 | 224 | then IssueAmount | |
203 | 225 | else 0, true), if ((AmountOut > IssueAmount)) | |
204 | 226 | then ScriptTransfer(i.caller, WhirlpoolFromSwap, whirlpool) | |
205 | - | else ScriptTransfer(i.caller, IssueAmount, whirlpool), IntegerEntry( | |
227 | + | else ScriptTransfer(i.caller, IssueAmount, whirlpool), IntegerEntry(keyWhirlpoolIssuePrice, price), IntegerEntry(if ((AmountOut > IssueAmount)) | |
206 | 228 | then "price WHIRLPOOL/WAVES" | |
207 | 229 | else "WHIRLPOOL/WAVES mid market price", if ((AmountOut > IssueAmount)) | |
208 | 230 | then fraction(d8, pmt.amount, WhirlpoolFromSwap) | |
209 | - | else fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry( | |
210 | - | then (pmt.amount + tryGetInteger(this, | |
211 | - | else tryGetInteger(this, | |
212 | - | then ((pmt.amount - surplus) + tryGetInteger(this, | |
213 | - | else tryGetInteger(this, | |
214 | - | then getIntegerValue(this, | |
215 | - | else (surplus + getIntegerValue(this, | |
231 | + | else fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry(keyWaveletsReceived, if ((IssueAmount >= AmountOut)) | |
232 | + | then (pmt.amount + tryGetInteger(this, keyWaveletsReceived)) | |
233 | + | else tryGetInteger(this, keyWaveletsReceived)), IntegerEntry(keyWaveletsReceived, if ((IssueAmount >= AmountOut)) | |
234 | + | then ((pmt.amount - surplus) + tryGetInteger(this, keyWaveletsReceived)) | |
235 | + | else tryGetInteger(this, keyWaveletsReceived)), IntegerEntry(keySurplusReceived, if ((AmountOut > IssueAmount)) | |
236 | + | then getIntegerValue(this, keySurplusReceived) | |
237 | + | else (surplus + getIntegerValue(this, keySurplusReceived)))] | |
216 | 238 | } | |
217 | 239 | else throw("Strict value is not equal to itself.") | |
218 | 240 | } | |
219 | 241 | } | |
220 | 242 | else throw("Strict value is not equal to itself.") | |
221 | 243 | } | |
222 | 244 | ||
223 | 245 | ||
224 | 246 | ||
225 | 247 | @Callable(i) | |
226 | - | func priceSurplusSupply () = [IntegerEntry("BT WAVES in EAST vault", WAVESinEAST), IntegerEntry("ST BURN-XTN x PepeTeam in wavelets", fraction((wavesInPool * 10), projectStake, totalStake)), IntegerEntry("ST WHIRLPOOL AMM in wavelets", fraction((wavesInWhirlpool * 10), projectStakeWhirl, totalStakeWhirl)), IntegerEntry("ST vETH", ETHinVires), IntegerEntry("ST vETH in wavelets", ETHinViresWavelets), IntegerEntry("Total ST in wavelets", tvlInWaves), IntegerEntry( | |
248 | + | func priceSurplusSupply () = [IntegerEntry("ETH/WAVES price", ethWaves), IntegerEntry("BT WAVES in EAST vault", WAVESinEAST), IntegerEntry("ST BURN-XTN x PepeTeam in wavelets", fraction((wavesInPool * 10), projectStake, totalStake)), IntegerEntry("ST WHIRLPOOL AMM in wavelets", fraction((wavesInWhirlpool * 10), projectStakeWhirl, totalStakeWhirl)), IntegerEntry("ST vETH", ETHinVires), IntegerEntry("ST vETH in wavelets", ETHinViresWavelets), IntegerEntry("Total ST in wavelets", tvlInWaves), IntegerEntry(keyWhirlpoolIssuePrice, price), IntegerEntry("WHIRLPOOL/WAVES mid market price", fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry("WHIRLPOOL total supply", whirlpoolSupply), IntegerEntry("Total treasury", totalTreasury), IntegerEntry("NAV WHIRLPOOL", fraction(d8, totalTreasury, whirlpoolSupply)), IntegerEntry(keyWaveletsReceived, tryGetInteger(this, keyWaveletsReceived)), IntegerEntry(keySurplusReceived, tryGetInteger(this, keySurplusReceived)), IntegerEntry(keyWaveletsReceived, tryGetInteger(this, keyWaveletsReceived)), IntegerEntry(keyWaveletsPaidOut, tryGetInteger(this, keyWaveletsPaidOut)), IntegerEntry("total WAVES received", (tryGetInteger(this, keyWaveletsReceived) / d8)), IntegerEntry("Total treasury in WAVES", (totalTreasury / d8)), IntegerEntry("surplus received in WAVES", (tryGetInteger(this, keySurplusReceived) / d8)), IntegerEntry("total WAVES received for base treasury", (tryGetInteger(this, keyWaveletsReceived) / d8)), IntegerEntry("total WAVES paid out in WAVES", (tryGetInteger(this, keyWaveletsPaidOut) / d8)), IntegerEntry(keyROI, tryGetInteger(this, keyROI))] | |
227 | 249 | ||
228 | 250 | ||
229 | 251 | ||
230 | 252 | @Callable(i) | |
231 | 253 | func boostPoolAPY () = if ((i.caller != this)) | |
232 | 254 | then throw("access only by project owner") | |
233 | 255 | else { | |
234 | 256 | let balance = if ((d8 > wavesBalance(this).available)) | |
235 | 257 | then throw("not enough WAVES") | |
236 | 258 | else (wavesBalance(this).available - d8) | |
237 | 259 | let boost80 = fraction(balance, 80, 100) | |
238 | 260 | if ((boost80 == boost80)) | |
239 | 261 | then { | |
240 | 262 | let amountBoost = fraction(boost80, 80, 100) | |
241 | 263 | if ((amountBoost == amountBoost)) | |
242 | 264 | then { | |
243 | 265 | let amountOwner = fraction(boost80, 20, 100) | |
244 | 266 | if ((amountOwner == amountOwner)) | |
245 | 267 | then { | |
246 | 268 | let boost = invoke(Address(poolboostSC), "addBoosting", [toBase58String(whirlpoolPoolId), 7], [AttachedPayment(unit, amountBoost)]) | |
247 | 269 | if ((boost == boost)) | |
248 | - | then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry( | |
270 | + | then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry(keyWaveletsPaidOut, (amountBoost + tryGetInteger(this, keyWaveletsPaidOut))), IntegerEntry(keyROI, fraction(tryGetInteger(this, keyWaveletsPaidOut), 10000, tryGetInteger(this, keyWaveletsReceived))), IntegerEntry(keyActivated, height)] | |
249 | 271 | else throw("Strict value is not equal to itself.") | |
250 | 272 | } | |
251 | 273 | else throw("Strict value is not equal to itself.") | |
252 | 274 | } | |
253 | 275 | else throw("Strict value is not equal to itself.") | |
254 | 276 | } | |
255 | 277 | else throw("Strict value is not equal to itself.") | |
256 | 278 | } | |
257 | 279 | ||
258 | 280 | ||
259 | 281 | ||
260 | 282 | @Callable(i) | |
261 | 283 | func boostPoolAPY_all () = if ((i.caller != this)) | |
262 | 284 | then throw("access only by project owner") | |
263 | 285 | else { | |
264 | 286 | let balance = if ((d8 > wavesBalance(this).available)) | |
265 | 287 | then throw("not enough WAVES") | |
266 | 288 | else (wavesBalance(this).available - d8) | |
267 | 289 | let amountBoost = fraction(balance, 80, 100) | |
268 | 290 | if ((amountBoost == amountBoost)) | |
269 | 291 | then { | |
270 | 292 | let amountOwner = fraction(balance, 20, 100) | |
271 | 293 | if ((amountOwner == amountOwner)) | |
272 | 294 | then { | |
273 | 295 | let boost = invoke(Address(poolboostSC), "addBoosting", [toBase58String(whirlpoolPoolId), 7], [AttachedPayment(unit, amountBoost)]) | |
274 | 296 | if ((boost == boost)) | |
275 | - | then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry( | |
297 | + | then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry(keyWaveletsPaidOut, (amountBoost + tryGetInteger(this, keyWaveletsPaidOut))), IntegerEntry(keyROI, fraction(tryGetInteger(this, keyWaveletsPaidOut), 10000, tryGetInteger(this, keyWaveletsReceived))), IntegerEntry(keyActivated, height)] | |
276 | 298 | else throw("Strict value is not equal to itself.") | |
277 | 299 | } | |
278 | 300 | else throw("Strict value is not equal to itself.") | |
279 | 301 | } | |
280 | 302 | else throw("Strict value is not equal to itself.") | |
281 | 303 | } | |
282 | 304 | ||
283 | 305 | ||
284 | 306 | ||
285 | 307 | @Callable(i) | |
286 | 308 | func transferPoolAPY () = if ((i.caller != this)) | |
287 | 309 | then throw("access only by project owner") | |
288 | 310 | else { | |
289 | 311 | let balance = if ((d8 > wavesBalance(this).available)) | |
290 | 312 | then throw("not enough WAVES") | |
291 | 313 | else (wavesBalance(this).available - d8) | |
292 | 314 | let boost80 = fraction(balance, 80, 100) | |
293 | 315 | if ((boost80 == boost80)) | |
294 | 316 | then { | |
295 | 317 | let amountBoost = fraction(boost80, 80, 100) | |
296 | 318 | if ((amountBoost == amountBoost)) | |
297 | 319 | then { | |
298 | 320 | let amountOwner = fraction(boost80, 20, 100) | |
299 | 321 | if ((amountOwner == amountOwner)) | |
300 | - | then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry( | |
322 | + | then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry(keyWaveletsPaidOut, (amountBoost + tryGetInteger(this, keyWaveletsPaidOut))), IntegerEntry(keyROI, fraction(tryGetInteger(this, keyWaveletsPaidOut), 10000, tryGetInteger(this, keyWaveletsReceived))), IntegerEntry(keyActivated, height)] | |
301 | 323 | else throw("Strict value is not equal to itself.") | |
302 | 324 | } | |
303 | 325 | else throw("Strict value is not equal to itself.") | |
304 | 326 | } | |
305 | 327 | else throw("Strict value is not equal to itself.") | |
306 | 328 | } | |
307 | 329 | ||
308 | 330 | ||
309 | 331 | ||
310 | 332 | @Callable(i) | |
311 | 333 | func transferPoolAPY_all () = if ((i.caller != this)) | |
312 | 334 | then throw("access only by project owner") | |
313 | 335 | else { | |
314 | 336 | let balance = if ((d8 > wavesBalance(this).available)) | |
315 | 337 | then throw("not enough WAVES") | |
316 | 338 | else (wavesBalance(this).available - d8) | |
317 | 339 | let amountBoost = fraction(balance, 80, 100) | |
318 | 340 | if ((amountBoost == amountBoost)) | |
319 | 341 | then { | |
320 | 342 | let amountOwner = fraction(balance, 20, 100) | |
321 | 343 | if ((amountOwner == amountOwner)) | |
322 | - | then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry( | |
344 | + | then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry(keyWaveletsPaidOut, (amountBoost + tryGetInteger(this, keyWaveletsPaidOut))), IntegerEntry(keyROI, fraction(tryGetInteger(this, keyWaveletsPaidOut), 10000, tryGetInteger(this, keyWaveletsReceived))), IntegerEntry(keyActivated, height)] | |
323 | 345 | else throw("Strict value is not equal to itself.") | |
324 | 346 | } | |
325 | 347 | else throw("Strict value is not equal to itself.") | |
326 | 348 | } | |
327 | 349 | ||
328 | 350 | ||
329 | 351 | ||
330 | 352 | @Callable(i) | |
331 | 353 | func poolOneTokenSurplus () = if ((i.caller != this)) | |
332 | 354 | then throw("access only by project owner") | |
333 | 355 | else { | |
334 | - | let surplusAmount = tryGetInteger(this, | |
356 | + | let surplusAmount = tryGetInteger(this, keySurplusReceived) | |
335 | 357 | let PoolOneTokenSurplus = invoke(Address(base58'3PR1Qvi9mHT35SwWEkLSqqE2L8thiPLdVWU'), "generateIndexWithOneTokenAndStake", [toBase58String(burnxtnPPTpoolId)], [AttachedPayment(unit, surplusAmount)]) | |
336 | 358 | if ((PoolOneTokenSurplus == PoolOneTokenSurplus)) | |
337 | - | then [IntegerEntry( | |
359 | + | then [IntegerEntry(keySurplusReceived, (tryGetInteger(this, keySurplusReceived) - surplusAmount))] | |
338 | 360 | else throw("Strict value is not equal to itself.") | |
339 | 361 | } | |
340 | 362 | ||
341 | 363 | ||
342 | 364 | ||
343 | 365 | @Callable(i) | |
344 | 366 | func changeIntegerEntry (keyString,integer) = if ((i.caller != this)) | |
345 | 367 | then throw("access only by project owner") | |
346 | 368 | else [IntegerEntry(keyString, integer)] | |
347 | 369 | ||
348 | 370 | ||
349 | 371 | ||
350 | 372 | @Callable(i) | |
351 | - | func | |
373 | + | func activated () = if ((i.caller != this)) | |
352 | 374 | then throw("you are not allowed") | |
353 | - | else [IntegerEntry( | |
375 | + | else [IntegerEntry(keyActivated, height)] | |
354 | 376 | ||
355 | 377 | ||
356 | 378 | @Verifier(tx) | |
357 | 379 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
358 | 380 | then true | |
359 | - | else if (((tryGetInteger(this, | |
381 | + | else if (((tryGetInteger(this, keyActivated) + unlockBlock) > height)) | |
360 | 382 | then false | |
361 | 383 | else if (sigVerify(tx.bodyBytes, tx.proofs[0], heirPubKey)) | |
362 | 384 | then true | |
363 | - | else if (((tryGetInteger(this, | |
385 | + | else if (((tryGetInteger(this, keyActivated) + unlockBlock2) > height)) | |
364 | 386 | then false | |
365 | 387 | else sigVerify(tx.bodyBytes, tx.proofs[0], PuzzleMasterPubKey) | |
366 | 388 |
github/deemru/w8io/026f985 97.12 ms ◑