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/F0P0QgUmXQAMa2V5QWN0aXZhdGVkAhVBY3RpdmF0ZWQgYmxvY2toZWlnaHQAEmtleVN1cnBsdXNSZWNlaXZlZAIcc3Vyc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5AglrZXlTdHJpbmcHaW50ZWdlcgMJAQIhPQIIBQFpBmNhbGxlcgUEdGhpcwkAAgECHGFjY2VzcyBvbmx5IGJ5IHByb2plY3Qgb3duZXIJAMwIAgkBDEludGVnZXJFbnRyeQIFCWtleVN0cmluZwUHaW50ZWdlcgUDbmlsAWkBCWFjdGl2YXRlZAADCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAhN5b3UgYXJlIG5vdCBhbGxvd2VkCQDMCAIJAQxJbnRlZ2VyRW50cnkCBQxrZXlBY3RpdmF0ZWQFBmhlaWdodAUDbmlsAQJ0eAEGdmVyaWZ5AAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkGAwkAZgIJAGQCCQENdHJ5R2V0SW50ZWdlcgIFBHRoaXMFDGtleUFjdGl2YXRlZAULdW5sb2NrQmxvY2sFBmhlaWdodAcDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQpoZWlyUHViS2V5BgMJAGYCCQBkAgkBDXRyeUdldEludGVnZXICBQR0aGlzBQxrZXlBY3RpdmF0ZWQFDHVubG9ja0Jsb2NrMgUGaGVpZ2h0BwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUSUHV6emxlTWFzdGVyUHViS2V5X/k0aA==", "height": 2858546, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HurA397CWQ22bVAdDRbvX74Gh67BzVnm2KowNrwQVLUi Next: A3WTPGqr2CUHx3uqzosmiwZx1VLW4RQHwV83NQX5cg1w Diff:
OldNewDifferences
2121
2222 let d16 = (d8 * d8)
2323
24+let unlockBlock = (30 * 1440)
25+
2426 let heirPubKey = base58'2kpmuzw1ZbrtgAN3BrR7vbEW1XrJoJKCstL7mf7XNf2P'
27+
28+let unlockBlock2 = (90 * 1440)
2529
2630 let PuzzleMasterPubKey = base58'4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU'
2731
28-let unlockBlock = (30 * 1440)
32+let keyActivated = "Activated blockheight"
2933
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"
3145
3246 let burnxtnPPTpoolId = base58'3PQHndCUVrv3wBuQjbvVP9SnGmfbfitGxfx'
3347
8195
8296 let SWAVES_stake = Address(base58'3PDPzZVLhN1EuzGy4xAxjjTVkawKDLEaHiV')
8397
84-let ethInPool = tryGetInteger(Address(burnxtnPPTpoolId), (("global_" + toBase58String(eth)) + "_balance"))
98+let WX_ETH_WAVES = Address(base58'3P2yiVnK48evTLr8MAZWavpE4WA4fw1weQg')
8599
86100 let wavesInPool = tryGetInteger(Address(burnxtnPPTpoolId), (("global_" + toBase58String(waves)) + "_balance"))
87-
88-let ethWaves = fraction(d8, wavesInPool, ethInPool)
89101
90102 let projectStake = tryGetInteger(Address(burnxtnPPTpoolId), (toString(this) + "_indexStaked"))
91103
128140
129141 let wavesEast = fraction((d8 * 100), eastInWX, wavesInWX)
130142
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+
131149 let wavesInWhirlpool = tryGetInteger(Address(whirlpoolPoolId), (("global_" + toBase58String(waves)) + "_balance"))
132150
133151 let whirlInWhirlpool = tryGetInteger(Address(whirlpoolPoolId), (("global_" + whirlpoolString) + "_balance"))
164182
165183 let tvlInWaves = ((fraction((wavesInPool * 10), projectStake, totalStake) + fraction((wavesInWhirlpool * 10), projectStakeWhirl, totalStakeWhirl)) + ETHinViresWavelets)
166184
185+let totalBT = WAVESinEAST
186+
187+let totalTreasury = (totalBT + tvlInWaves)
188+
167189 let whirlpoolSupply = match assetInfo(whirlpool) {
168190 case asset: Asset =>
169191 asset.quantity
171193 throw("Can't find asset")
172194 }
173195
174-let price = if (((fraction((tvlInWaves + tryGetInteger(this, "surplus received in wavelets")), d8, whirlpoolSupply) + d8) >= tryGetInteger(this, "WHIRLPOOL issue price in wavelets")))
175- then (fraction((tvlInWaves + tryGetInteger(this, "surplus received in wavelets")), d8, whirlpoolSupply) + d8)
176- else tryGetInteger(this, "WHIRLPOOL issue price in wavelets")
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)
177199
178200 @Callable(i)
179201 func buyWHIRLPOOLwithWAVES () = {
202224 then IssueAmount
203225 else 0, true), if ((AmountOut > IssueAmount))
204226 then ScriptTransfer(i.caller, WhirlpoolFromSwap, whirlpool)
205- else ScriptTransfer(i.caller, IssueAmount, whirlpool), IntegerEntry("WHIRLPOOL issue price in wavelets", price), IntegerEntry(if ((AmountOut > IssueAmount))
227+ else ScriptTransfer(i.caller, IssueAmount, whirlpool), IntegerEntry(keyWhirlpoolIssuePrice, price), IntegerEntry(if ((AmountOut > IssueAmount))
206228 then "price WHIRLPOOL/WAVES"
207229 else "WHIRLPOOL/WAVES mid market price", if ((AmountOut > IssueAmount))
208230 then fraction(d8, pmt.amount, WhirlpoolFromSwap)
209- else fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry("total WAVES received in wavelets", if ((IssueAmount >= AmountOut))
210- then (pmt.amount + tryGetInteger(this, "total WAVES received in wavelets"))
211- else tryGetInteger(this, "total WAVES received in wavelets")), IntegerEntry("total wavelets received for base treasury", if ((IssueAmount >= AmountOut))
212- then ((pmt.amount - surplus) + tryGetInteger(this, "total wavelets received for base treasury"))
213- else tryGetInteger(this, "total wavelets received for base treasury")), IntegerEntry("surplus received in wavelets", if ((AmountOut > IssueAmount))
214- then getIntegerValue(this, "surplus received in wavelets")
215- else (surplus + getIntegerValue(this, "surplus received in wavelets")))]
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)))]
216238 }
217239 else throw("Strict value is not equal to itself.")
218240 }
223245
224246
225247 @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("WHIRLPOOL issue price in wavelets", price), IntegerEntry("WHIRLPOOL/WAVES mid market price", fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry("WHIRLPOOL total supply", whirlpoolSupply), IntegerEntry("Total treasury", (WAVESinEAST + tvlInWaves)), IntegerEntry("NAV WHIRLPOOL", fraction(d8, (WAVESinEAST + tvlInWaves), whirlpoolSupply)), IntegerEntry("total WAVES received in wavelets", tryGetInteger(this, "total WAVES received in wavelets")), IntegerEntry("surplus received in wavelets", tryGetInteger(this, "surplus received in wavelets")), IntegerEntry("total wavelets received for base treasury", tryGetInteger(this, "total wavelets received for base treasury")), IntegerEntry("total WAVES paid out in wavelets", tryGetInteger(this, "total WAVES paid out in wavelets")), IntegerEntry("total WAVES received", (tryGetInteger(this, "total WAVES received in wavelets") / d8)), IntegerEntry("surplus received in WAVES", (tryGetInteger(this, "surplus received in wavelets") / d8)), IntegerEntry("total WAVES received for base treasury", (tryGetInteger(this, "total wavelets received for base treasury") / d8)), IntegerEntry("total WAVES paid out in WAVES", (tryGetInteger(this, "total WAVES paid out in wavelets") / d8)), IntegerEntry("ROI basis points", tryGetInteger(this, "ROI basis points"))]
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))]
227249
228250
229251
245267 then {
246268 let boost = invoke(Address(poolboostSC), "addBoosting", [toBase58String(whirlpoolPoolId), 7], [AttachedPayment(unit, amountBoost)])
247269 if ((boost == boost))
248- then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry("total WAVES paid out in wavelets", (amountBoost + tryGetInteger(this, "total WAVES paid out in wavelets"))), IntegerEntry("ROI basis points", fraction(tryGetInteger(this, "total WAVES paid out in wavelets"), 10000, tryGetInteger(this, "total WAVES received in wavelets"))), IntegerEntry("Activated blockheight", height)]
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)]
249271 else throw("Strict value is not equal to itself.")
250272 }
251273 else throw("Strict value is not equal to itself.")
272294 then {
273295 let boost = invoke(Address(poolboostSC), "addBoosting", [toBase58String(whirlpoolPoolId), 7], [AttachedPayment(unit, amountBoost)])
274296 if ((boost == boost))
275- then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry("total WAVES paid out in wavelets", (amountBoost + tryGetInteger(this, "total WAVES paid out in wavelets"))), IntegerEntry("ROI basis points", fraction(tryGetInteger(this, "total WAVES paid out in wavelets"), 10000, tryGetInteger(this, "total WAVES received in wavelets"))), IntegerEntry("Activated blockheight", height)]
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)]
276298 else throw("Strict value is not equal to itself.")
277299 }
278300 else throw("Strict value is not equal to itself.")
297319 then {
298320 let amountOwner = fraction(boost80, 20, 100)
299321 if ((amountOwner == amountOwner))
300- then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry("total WAVES paid out in wavelets", (amountBoost + tryGetInteger(this, "total WAVES paid out in wavelets"))), IntegerEntry("ROI basis points", fraction(tryGetInteger(this, "total WAVES paid out in wavelets"), 10000, tryGetInteger(this, "total WAVES received in wavelets"))), IntegerEntry("Activated blockheight", height)]
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)]
301323 else throw("Strict value is not equal to itself.")
302324 }
303325 else throw("Strict value is not equal to itself.")
319341 then {
320342 let amountOwner = fraction(balance, 20, 100)
321343 if ((amountOwner == amountOwner))
322- then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry("total WAVES paid out in wavelets", (amountBoost + tryGetInteger(this, "total WAVES paid out in wavelets"))), IntegerEntry("ROI basis points", fraction(tryGetInteger(this, "total WAVES paid out in wavelets"), 10000, tryGetInteger(this, "total WAVES received in wavelets"))), IntegerEntry("Activated blockheight", height)]
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)]
323345 else throw("Strict value is not equal to itself.")
324346 }
325347 else throw("Strict value is not equal to itself.")
331353 func poolOneTokenSurplus () = if ((i.caller != this))
332354 then throw("access only by project owner")
333355 else {
334- let surplusAmount = tryGetInteger(this, "surplus received in wavelets")
356+ let surplusAmount = tryGetInteger(this, keySurplusReceived)
335357 let PoolOneTokenSurplus = invoke(Address(base58'3PR1Qvi9mHT35SwWEkLSqqE2L8thiPLdVWU'), "generateIndexWithOneTokenAndStake", [toBase58String(burnxtnPPTpoolId)], [AttachedPayment(unit, surplusAmount)])
336358 if ((PoolOneTokenSurplus == PoolOneTokenSurplus))
337- then [IntegerEntry("surplus received in wavelets", (tryGetInteger(this, "surplus received in wavelets") - surplusAmount))]
359+ then [IntegerEntry(keySurplusReceived, (tryGetInteger(this, keySurplusReceived) - surplusAmount))]
338360 else throw("Strict value is not equal to itself.")
339361 }
340362
348370
349371
350372 @Callable(i)
351-func activate () = if ((i.caller != this))
373+func activated () = if ((i.caller != this))
352374 then throw("you are not allowed")
353- else [IntegerEntry("Activated blockheight", height)]
375+ else [IntegerEntry(keyActivated, height)]
354376
355377
356378 @Verifier(tx)
357379 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
358380 then true
359- else if (((tryGetInteger(this, "Activated blockheight") + unlockBlock) > height))
381+ else if (((tryGetInteger(this, keyActivated) + unlockBlock) > height))
360382 then false
361383 else if (sigVerify(tx.bodyBytes, tx.proofs[0], heirPubKey))
362384 then true
363- else if (((tryGetInteger(this, "Activated blockheight") + unlockBlock2) > height))
385+ else if (((tryGetInteger(this, keyActivated) + unlockBlock2) > height))
364386 then false
365387 else sigVerify(tx.bodyBytes, tx.proofs[0], PuzzleMasterPubKey)
366388
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func tryGetInteger (address,key) = match getInteger(address, key) {
55 case b: Int =>
66 b
77 case _ =>
88 0
99 }
1010
1111
1212 func tryGetString (address,key) = match getString(address, key) {
1313 case b: String =>
1414 b
1515 case _ =>
1616 ""
1717 }
1818
1919
2020 let d8 = 100000000
2121
2222 let d16 = (d8 * d8)
2323
24+let unlockBlock = (30 * 1440)
25+
2426 let heirPubKey = base58'2kpmuzw1ZbrtgAN3BrR7vbEW1XrJoJKCstL7mf7XNf2P'
27+
28+let unlockBlock2 = (90 * 1440)
2529
2630 let PuzzleMasterPubKey = base58'4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU'
2731
28-let unlockBlock = (30 * 1440)
32+let keyActivated = "Activated blockheight"
2933
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"
3145
3246 let burnxtnPPTpoolId = base58'3PQHndCUVrv3wBuQjbvVP9SnGmfbfitGxfx'
3347
3448 let projectOwner = base58'3PEtLVxDT8mxAh1SDAn8m7JTGNkdpkaFxBk'
3549
3650 let whirlpoolPoolId = base58'3P2myTbd5zpEHcYmNpdWTp5gXS5B8tL1RCY'
3751
3852 let whirlpool = base58'fHJWWsh2hZAc4Atv8VRhKy3jNbHLeMwQMsLpdaBY51Y'
3953
4054 let whirlpoolString = toBase58String(base58'73tY3E6Gd5AWYmsuq8m8Kek7KnJNAYyS3GoveTbc6jCi')
4155
4256 let waves = base58'WAVES'
4357
4458 let usdterc = base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
4559
4660 let usdcerc = base58'HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW'
4761
4862 let usdtbsc = base58'A81p1LTRyoq2rDR2TNxB2dWYxsiNwCSSi8sXef2SEkwb'
4963
5064 let usdcbsc = base58'4BKKSp6NoNcrFHyorZogDyctq1fq6w7114Ym1pw6HUtC'
5165
5266 let burnxtn = base58'3SjxA2YLdfF9fTRbzLm9xFn27C6MW34W1YsdJ6Axefns'
5367
5468 let eth = base58'3VuV5WTmDz47Dmdn3QpcYjzbSdipjQE4JMdNe1xZpX13'
5569
5670 let bnb = base58'66a1br3BrkoaJgP7yEar9hJcSTvJPoH6PYBLqscXcMGo'
5771
5872 let wbtc = base58'2Fge5HEBRD3XTeg7Xg3FW5yiB9HVJFQtMXiWMQo72Up6'
5973
6074 let btcb = base58'EW1uGLVo21Wd9i2Rhq8o4VKDTCQTGCGXE8DqayHGrLg8'
6175
6276 let east = base58'6phK22ztGBW127gUFmdMEHKB3CVd6ZhWox2WtwJkbqTq'
6377
6478 let steast = base58'GAB8JowY9UANZ4TQy2TzJyhxjPqXX3DUrb2cdMWrrJus'
6579
6680 let swaves = base58'YiNbofFzC17jEHHCMwrRcpy9MrrjabMMLZxg8g5xmf7'
6781
6882 let surf = base58'At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL'
6983
7084 let poolboostSC = base58'3P8eeDzUnoDNbQjW617pAe76cEUDQsP1m1V'
7185
7286 let PL_Main = Address(base58'3P4uA5etnZi4AmBabKinq2bMiWU8KcnHZdH')
7387
7488 let PL_Defi = Address(base58'3P4DK5VzDwL3vfc5ahUEhtoe5ByZNyacJ3X')
7589
7690 let PL_Low = Address(base58'3PHpuQUPVUoR3AYzFeJzeWJfYLsLTmWssVH')
7791
7892 let EAST_stake = Address(base58'3P2hbtheN5apNppqqUK7L7qAwmRFXy91CNa')
7993
8094 let WX_WAVES_EAST = Address(base58'3PJVwjfi2fF5Jv9AauayU6xLxrYBn8bpGH1')
8195
8296 let SWAVES_stake = Address(base58'3PDPzZVLhN1EuzGy4xAxjjTVkawKDLEaHiV')
8397
84-let ethInPool = tryGetInteger(Address(burnxtnPPTpoolId), (("global_" + toBase58String(eth)) + "_balance"))
98+let WX_ETH_WAVES = Address(base58'3P2yiVnK48evTLr8MAZWavpE4WA4fw1weQg')
8599
86100 let wavesInPool = tryGetInteger(Address(burnxtnPPTpoolId), (("global_" + toBase58String(waves)) + "_balance"))
87-
88-let ethWaves = fraction(d8, wavesInPool, ethInPool)
89101
90102 let projectStake = tryGetInteger(Address(burnxtnPPTpoolId), (toString(this) + "_indexStaked"))
91103
92104 let totalStake = tryGetInteger(Address(burnxtnPPTpoolId), "global_poolToken_amount")
93105
94106 func PL_value (dAppAddress,asset) = fraction(tryGetInteger(dAppAddress, ((toString(this) + "_supplied_") + toBase58String(asset))), tryGetInteger(dAppAddress, (toBase58String(asset) + "_sRate")), d16)
95107
96108
97109 func _loadInt (key_,default_) = match getInteger(SWAVES_stake, key_) {
98110 case a: Int =>
99111 a
100112 case _ =>
101113 default_
102114 }
103115
104116
105117 func _loadBigInt (key_,default_) = match getBinary(SWAVES_stake, key_) {
106118 case a: ByteVector =>
107119 toBigInt(a)
108120 case _ =>
109121 default_
110122 }
111123
112124
113125 let lastRate = _loadBigInt("LAST_RATE", toBigInt(1000000000000))
114126
115127 let currentRate = _loadBigInt("CURRENT_RATE", toBigInt(0))
116128
117129 let lastHeight = _loadInt("LAST_HEIGHT", 0)
118130
119131 let targetHeight = min([_loadInt("TARGET_HEIGHT", 0), height])
120132
121133 let lastRateUpdated = (lastRate + (currentRate * toBigInt((targetHeight - lastHeight))))
122134
123135 let baseAmount = toInt(fraction(toBigInt(assetBalance(WX_WAVES_EAST, swaves)), lastRateUpdated, toBigInt(1000000000000), FLOOR))
124136
125137 let wavesInWX = (wavesBalance(WX_WAVES_EAST).regular + baseAmount)
126138
127139 let eastInWX = assetBalance(WX_WAVES_EAST, east)
128140
129141 let wavesEast = fraction((d8 * 100), eastInWX, wavesInWX)
130142
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+
131149 let wavesInWhirlpool = tryGetInteger(Address(whirlpoolPoolId), (("global_" + toBase58String(waves)) + "_balance"))
132150
133151 let whirlInWhirlpool = tryGetInteger(Address(whirlpoolPoolId), (("global_" + whirlpoolString) + "_balance"))
134152
135153 let projectStakeWhirl = tryGetInteger(Address(whirlpoolPoolId), (toString(this) + "_indexStaked"))
136154
137155 let totalStakeWhirl = tryGetInteger(Address(whirlpoolPoolId), "global_poolToken_amount")
138156
139157 let stEastInWaves = (fraction((fraction(assetBalance(this, steast), tryGetInteger(EAST_stake, "%s__rate"), 1000000000000, HALFEVEN) / 100), d8, wavesEast) * 100)
140158
141159 let eastInStaking = (fraction(assetBalance(this, steast), tryGetInteger(EAST_stake, "%s__rate"), 1000000000000, HALFEVEN) / 100)
142160
143161 let keyVaultAsset = tryGetString(Address(base58'3PMtGnf3LXiEG6isDQLq1xMDKUqjQGqNHLb'), "%s%s%s__vault__3PAkmJniMgnnAej5pYf2jFYkCbZow5pt9tr__WAVES")
144162
145163 let WAVESinEAST = parseIntValue(split(keyVaultAsset, "__")[2])
146164
147165 let dAppaddress = Address(base58'3PHxubMUtynEY2AeHq3K1kUizRPN9HUC2rt')
148166
149167 let ETHatoken = tryGetInteger(dAppaddress, "3PAkmJniMgnnAej5pYf2jFYkCbZow5pt9tr_aTokenBalance")
150168
151169 let ETHatokenTotal = tryGetInteger(dAppaddress, "aTokenCirculation")
152170
153171 let reserveStr = tryGetString(dAppaddress, "reserveGlobalData")
154172
155173 let get1Str = split(reserveStr, "|")[1]
156174
157175 let strToInt = parseIntValue(get1Str)
158176
159177 let ETHtotalReserve = parseIntValue(split(tryGetString(dAppaddress, "reserveGlobalData"), "|")[1])
160178
161179 let ETHinVires = fraction(ETHatoken, ETHtotalReserve, ETHatokenTotal)
162180
163181 let ETHinViresWavelets = fraction(ETHinVires, ethWaves, d8)
164182
165183 let tvlInWaves = ((fraction((wavesInPool * 10), projectStake, totalStake) + fraction((wavesInWhirlpool * 10), projectStakeWhirl, totalStakeWhirl)) + ETHinViresWavelets)
166184
185+let totalBT = WAVESinEAST
186+
187+let totalTreasury = (totalBT + tvlInWaves)
188+
167189 let whirlpoolSupply = match assetInfo(whirlpool) {
168190 case asset: Asset =>
169191 asset.quantity
170192 case _ =>
171193 throw("Can't find asset")
172194 }
173195
174-let price = if (((fraction((tvlInWaves + tryGetInteger(this, "surplus received in wavelets")), d8, whirlpoolSupply) + d8) >= tryGetInteger(this, "WHIRLPOOL issue price in wavelets")))
175- then (fraction((tvlInWaves + tryGetInteger(this, "surplus received in wavelets")), d8, whirlpoolSupply) + d8)
176- else tryGetInteger(this, "WHIRLPOOL issue price in wavelets")
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)
177199
178200 @Callable(i)
179201 func buyWHIRLPOOLwithWAVES () = {
180202 let WhirlpoolBalanceBefore = assetBalance(this, whirlpool)
181203 if ((WhirlpoolBalanceBefore == WhirlpoolBalanceBefore))
182204 then {
183205 let pmt = value(i.payments[0])
184206 let surplus = fraction((price - d8), pmt.amount, d8)
185207 let IssueAmount = if ((pmt.amount >= fraction(pmt.amount, d8, price)))
186208 then fraction(pmt.amount, d8, price)
187209 else throw("please contact project owner: issue amount error")
188210 let supplyAmount = ((pmt.amount - surplus) / 3)
189211 let cleanAmountIn = (pmt.amount - fraction(pmt.amount, 200, 10000))
190212 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)
191213 if ((pmt.assetId != unit))
192214 then throw("attach WAVES token only")
193215 else {
194216 let buy = if ((AmountOut > IssueAmount))
195217 then invoke(Address(whirlpoolPoolId), "swap", [whirlpoolString, (IssueAmount + 1)], [AttachedPayment(unit, pmt.amount)])
196218 else unit
197219 if ((buy == buy))
198220 then {
199221 let WhirlpoolBalanceAfter = assetBalance(this, whirlpool)
200222 let WhirlpoolFromSwap = (WhirlpoolBalanceAfter - WhirlpoolBalanceBefore)
201223 [Reissue(whirlpool, if ((IssueAmount >= AmountOut))
202224 then IssueAmount
203225 else 0, true), if ((AmountOut > IssueAmount))
204226 then ScriptTransfer(i.caller, WhirlpoolFromSwap, whirlpool)
205- else ScriptTransfer(i.caller, IssueAmount, whirlpool), IntegerEntry("WHIRLPOOL issue price in wavelets", price), IntegerEntry(if ((AmountOut > IssueAmount))
227+ else ScriptTransfer(i.caller, IssueAmount, whirlpool), IntegerEntry(keyWhirlpoolIssuePrice, price), IntegerEntry(if ((AmountOut > IssueAmount))
206228 then "price WHIRLPOOL/WAVES"
207229 else "WHIRLPOOL/WAVES mid market price", if ((AmountOut > IssueAmount))
208230 then fraction(d8, pmt.amount, WhirlpoolFromSwap)
209- else fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry("total WAVES received in wavelets", if ((IssueAmount >= AmountOut))
210- then (pmt.amount + tryGetInteger(this, "total WAVES received in wavelets"))
211- else tryGetInteger(this, "total WAVES received in wavelets")), IntegerEntry("total wavelets received for base treasury", if ((IssueAmount >= AmountOut))
212- then ((pmt.amount - surplus) + tryGetInteger(this, "total wavelets received for base treasury"))
213- else tryGetInteger(this, "total wavelets received for base treasury")), IntegerEntry("surplus received in wavelets", if ((AmountOut > IssueAmount))
214- then getIntegerValue(this, "surplus received in wavelets")
215- else (surplus + getIntegerValue(this, "surplus received in wavelets")))]
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)))]
216238 }
217239 else throw("Strict value is not equal to itself.")
218240 }
219241 }
220242 else throw("Strict value is not equal to itself.")
221243 }
222244
223245
224246
225247 @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("WHIRLPOOL issue price in wavelets", price), IntegerEntry("WHIRLPOOL/WAVES mid market price", fraction(d8, (wavesInWhirlpool * 9), whirlInWhirlpool)), IntegerEntry("WHIRLPOOL total supply", whirlpoolSupply), IntegerEntry("Total treasury", (WAVESinEAST + tvlInWaves)), IntegerEntry("NAV WHIRLPOOL", fraction(d8, (WAVESinEAST + tvlInWaves), whirlpoolSupply)), IntegerEntry("total WAVES received in wavelets", tryGetInteger(this, "total WAVES received in wavelets")), IntegerEntry("surplus received in wavelets", tryGetInteger(this, "surplus received in wavelets")), IntegerEntry("total wavelets received for base treasury", tryGetInteger(this, "total wavelets received for base treasury")), IntegerEntry("total WAVES paid out in wavelets", tryGetInteger(this, "total WAVES paid out in wavelets")), IntegerEntry("total WAVES received", (tryGetInteger(this, "total WAVES received in wavelets") / d8)), IntegerEntry("surplus received in WAVES", (tryGetInteger(this, "surplus received in wavelets") / d8)), IntegerEntry("total WAVES received for base treasury", (tryGetInteger(this, "total wavelets received for base treasury") / d8)), IntegerEntry("total WAVES paid out in WAVES", (tryGetInteger(this, "total WAVES paid out in wavelets") / d8)), IntegerEntry("ROI basis points", tryGetInteger(this, "ROI basis points"))]
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))]
227249
228250
229251
230252 @Callable(i)
231253 func boostPoolAPY () = if ((i.caller != this))
232254 then throw("access only by project owner")
233255 else {
234256 let balance = if ((d8 > wavesBalance(this).available))
235257 then throw("not enough WAVES")
236258 else (wavesBalance(this).available - d8)
237259 let boost80 = fraction(balance, 80, 100)
238260 if ((boost80 == boost80))
239261 then {
240262 let amountBoost = fraction(boost80, 80, 100)
241263 if ((amountBoost == amountBoost))
242264 then {
243265 let amountOwner = fraction(boost80, 20, 100)
244266 if ((amountOwner == amountOwner))
245267 then {
246268 let boost = invoke(Address(poolboostSC), "addBoosting", [toBase58String(whirlpoolPoolId), 7], [AttachedPayment(unit, amountBoost)])
247269 if ((boost == boost))
248- then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry("total WAVES paid out in wavelets", (amountBoost + tryGetInteger(this, "total WAVES paid out in wavelets"))), IntegerEntry("ROI basis points", fraction(tryGetInteger(this, "total WAVES paid out in wavelets"), 10000, tryGetInteger(this, "total WAVES received in wavelets"))), IntegerEntry("Activated blockheight", height)]
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)]
249271 else throw("Strict value is not equal to itself.")
250272 }
251273 else throw("Strict value is not equal to itself.")
252274 }
253275 else throw("Strict value is not equal to itself.")
254276 }
255277 else throw("Strict value is not equal to itself.")
256278 }
257279
258280
259281
260282 @Callable(i)
261283 func boostPoolAPY_all () = if ((i.caller != this))
262284 then throw("access only by project owner")
263285 else {
264286 let balance = if ((d8 > wavesBalance(this).available))
265287 then throw("not enough WAVES")
266288 else (wavesBalance(this).available - d8)
267289 let amountBoost = fraction(balance, 80, 100)
268290 if ((amountBoost == amountBoost))
269291 then {
270292 let amountOwner = fraction(balance, 20, 100)
271293 if ((amountOwner == amountOwner))
272294 then {
273295 let boost = invoke(Address(poolboostSC), "addBoosting", [toBase58String(whirlpoolPoolId), 7], [AttachedPayment(unit, amountBoost)])
274296 if ((boost == boost))
275- then [ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry("total WAVES paid out in wavelets", (amountBoost + tryGetInteger(this, "total WAVES paid out in wavelets"))), IntegerEntry("ROI basis points", fraction(tryGetInteger(this, "total WAVES paid out in wavelets"), 10000, tryGetInteger(this, "total WAVES received in wavelets"))), IntegerEntry("Activated blockheight", height)]
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)]
276298 else throw("Strict value is not equal to itself.")
277299 }
278300 else throw("Strict value is not equal to itself.")
279301 }
280302 else throw("Strict value is not equal to itself.")
281303 }
282304
283305
284306
285307 @Callable(i)
286308 func transferPoolAPY () = if ((i.caller != this))
287309 then throw("access only by project owner")
288310 else {
289311 let balance = if ((d8 > wavesBalance(this).available))
290312 then throw("not enough WAVES")
291313 else (wavesBalance(this).available - d8)
292314 let boost80 = fraction(balance, 80, 100)
293315 if ((boost80 == boost80))
294316 then {
295317 let amountBoost = fraction(boost80, 80, 100)
296318 if ((amountBoost == amountBoost))
297319 then {
298320 let amountOwner = fraction(boost80, 20, 100)
299321 if ((amountOwner == amountOwner))
300- then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry("total WAVES paid out in wavelets", (amountBoost + tryGetInteger(this, "total WAVES paid out in wavelets"))), IntegerEntry("ROI basis points", fraction(tryGetInteger(this, "total WAVES paid out in wavelets"), 10000, tryGetInteger(this, "total WAVES received in wavelets"))), IntegerEntry("Activated blockheight", height)]
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)]
301323 else throw("Strict value is not equal to itself.")
302324 }
303325 else throw("Strict value is not equal to itself.")
304326 }
305327 else throw("Strict value is not equal to itself.")
306328 }
307329
308330
309331
310332 @Callable(i)
311333 func transferPoolAPY_all () = if ((i.caller != this))
312334 then throw("access only by project owner")
313335 else {
314336 let balance = if ((d8 > wavesBalance(this).available))
315337 then throw("not enough WAVES")
316338 else (wavesBalance(this).available - d8)
317339 let amountBoost = fraction(balance, 80, 100)
318340 if ((amountBoost == amountBoost))
319341 then {
320342 let amountOwner = fraction(balance, 20, 100)
321343 if ((amountOwner == amountOwner))
322- then [ScriptTransfer(Address(whirlpoolPoolId), amountBoost, unit), ScriptTransfer(Address(projectOwner), amountOwner, unit), IntegerEntry("total WAVES paid out in wavelets", (amountBoost + tryGetInteger(this, "total WAVES paid out in wavelets"))), IntegerEntry("ROI basis points", fraction(tryGetInteger(this, "total WAVES paid out in wavelets"), 10000, tryGetInteger(this, "total WAVES received in wavelets"))), IntegerEntry("Activated blockheight", height)]
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)]
323345 else throw("Strict value is not equal to itself.")
324346 }
325347 else throw("Strict value is not equal to itself.")
326348 }
327349
328350
329351
330352 @Callable(i)
331353 func poolOneTokenSurplus () = if ((i.caller != this))
332354 then throw("access only by project owner")
333355 else {
334- let surplusAmount = tryGetInteger(this, "surplus received in wavelets")
356+ let surplusAmount = tryGetInteger(this, keySurplusReceived)
335357 let PoolOneTokenSurplus = invoke(Address(base58'3PR1Qvi9mHT35SwWEkLSqqE2L8thiPLdVWU'), "generateIndexWithOneTokenAndStake", [toBase58String(burnxtnPPTpoolId)], [AttachedPayment(unit, surplusAmount)])
336358 if ((PoolOneTokenSurplus == PoolOneTokenSurplus))
337- then [IntegerEntry("surplus received in wavelets", (tryGetInteger(this, "surplus received in wavelets") - surplusAmount))]
359+ then [IntegerEntry(keySurplusReceived, (tryGetInteger(this, keySurplusReceived) - surplusAmount))]
338360 else throw("Strict value is not equal to itself.")
339361 }
340362
341363
342364
343365 @Callable(i)
344366 func changeIntegerEntry (keyString,integer) = if ((i.caller != this))
345367 then throw("access only by project owner")
346368 else [IntegerEntry(keyString, integer)]
347369
348370
349371
350372 @Callable(i)
351-func activate () = if ((i.caller != this))
373+func activated () = if ((i.caller != this))
352374 then throw("you are not allowed")
353- else [IntegerEntry("Activated blockheight", height)]
375+ else [IntegerEntry(keyActivated, height)]
354376
355377
356378 @Verifier(tx)
357379 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
358380 then true
359- else if (((tryGetInteger(this, "Activated blockheight") + unlockBlock) > height))
381+ else if (((tryGetInteger(this, keyActivated) + unlockBlock) > height))
360382 then false
361383 else if (sigVerify(tx.bodyBytes, tx.proofs[0], heirPubKey))
362384 then true
363- else if (((tryGetInteger(this, "Activated blockheight") + unlockBlock2) > height))
385+ else if (((tryGetInteger(this, keyActivated) + unlockBlock2) > height))
364386 then false
365387 else sigVerify(tx.bodyBytes, tx.proofs[0], PuzzleMasterPubKey)
366388

github/deemru/w8io/026f985 
97.12 ms