tx · AKGttLNzSenSUFncf6Fvw7QtGpfed3SZdZLNMWcCH6B3

3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4:  -0.01700000 Waves

2023.09.15 11:17 [2756265] smart account 3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4 > SELF 0.00000000 Waves

{ "type": 13, "id": "AKGttLNzSenSUFncf6Fvw7QtGpfed3SZdZLNMWcCH6B3", "fee": 1700000, "feeAssetId": null, "timestamp": 1694765822273, "version": 2, "chainId": 84, "sender": "3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4", "senderPublicKey": "DU1U4j8FqHUMRr9WgfF3yo67ULEFkjp7dtMWMpjBK1ar", "proofs": [ "3YpZWbmrhfLXRhbmQBHL1pbAwQisyVTBzXRn8TNMNFo724JTkb7ZRf5wimoeWu2wz23gNoRv1F1B9AwFirBCtkyg", "5EzjU9oa4Du2WxUTZqYNGbrAzaUKhW4mC7gzZgkCHu2BErNY8Heg8xidSYywZVVMe1hYAAEg8qjNmN5umhnkBjZ7" ], "script": "base64:BgI0CAISABIDCgEIEgMKAQgSBwoFCAgICAESABIDCgEBEgASABIDCgEIEgUKAwgICBIAEgASACMABlNDQUxFOACAwtcvAA1QRVJDRU5UX1NDQUxFAJBOAAlTRVBBUkFUT1ICAl9fAAlrSW50ZXJlc3QCCGludGVyZXN0AA1rVXNlckludGVyZXN0Ag1fdXNlckludGVyZXN0AA5rVXNlckF2YWlsYWJsZQITX3VzZXJBdmFpbGFibGVDbGFpbQAQa1VzZXJUb2tlblN0YWtlZAIQX3VzZXJUb2tlblN0YWtlZAARa1RvdGFsVG9rZW5TdGFrZWQCEHRvdGFsVG9rZW5TdGFrZWQADGtORlRJbnRlcmVzdAILTkZUSW50ZXJlc3QAEGtORlRVc2VySW50ZXJlc3QCEF9ORlRVc2VySW50ZXJlc3QAFmtORlRVc2VyQXZhaWxhYmxlQ2xhaW0CFl9ORlRVc2VyQXZhaWxhYmxlQ2xhaW0AD2tORlRUb3RhbFN0Y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leTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBANpbnYFByRtYXRjaDAEBmlzU2VsZgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQKaXNSaWdodEZlZQMJAAACCAUDaW52A2ZlZQCg9zYJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHBAppc0luaXRDYWxsCQAAAggFA2ludghmdW5jdGlvbgIEaW5pdAQMaXNub1BheW1lbnRzCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAADAwMDBQppc1JpZ2h0RmVlBQppc0luaXRDYWxsBwUGaXNTZWxmBwUMaXNub1BheW1lbnRzBwYFE211bHRpU2lnbmVkQnlBZG1pbnMFE211bHRpU2lnbmVkQnlBZG1pbnOfdnTp", "height": 2756265, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4ipPRY1tfDjXYHf3RgACkpV6xWnLcAF4ihmfxhQifYmQ Next: 5dSyRTeK8fmHAMxrT2jEyWX8uJW41UvbJExcpAsUZGU4 Diff:
OldNewDifferences
114114 }
115115
116116
117+func getUserStakedNFT (user) = {
118+ func forNft (uNFT,nftId) = if (isDefined(getBoolean(this, (((user + "_") + nftId) + kuserNFTStakedId))))
119+ then (uNFT :+ nftId)
120+ else uNFT
121+
122+ let nftsStr = valueOrElse(getString(this, kNFTCreatedList), "")
123+ let nftList = if ((nftsStr == ""))
124+ then nil
125+ else split(nftsStr, SEPARATOR)
126+ let userNfts = {
127+ let $l = nftList
128+ let $s = size($l)
129+ let $acc0 = nil
130+ func $f0_1 ($a,$i) = if (($i >= $s))
131+ then $a
132+ else forNft($a, $l[$i])
133+
134+ func $f0_2 ($a,$i) = if (($i >= $s))
135+ then $a
136+ else throw("List size exceeds 5")
137+
138+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
139+ }
140+ makeString(userNfts, ",")
141+ }
142+
143+
117144 @Callable(i)
118145 func getStatsREADONLY () = {
119146 let apr = calcTokenApr()
126153
127154 @Callable(i)
128155 func getStatsByUserREADONLY (user) = {
129- let $t039804579 = if ((user == ""))
130- then $Tuple4(0, 0, 0, 0)
131- else {
132- let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
133- let $t042174313 = claimCalc(user)
134- let userNewInterest = $t042174313._1
135- let claimAmountAvailable = $t042174313._2
136- let userTokenStaked = $t042174313._3
137- let totalTokenStaked = $t042174313._4
138- let $t043204421 = claimCalcNft(user)
139- let userNewInterestNFT = $t043204421._1
140- let claimAmountAvailableNFT = $t043204421._2
141- let userNFTStaked = $t043204421._3
142- let totalNFTStaked = $t043204421._4
143- let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
144- $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
145- }
146- let userTokenBalance = $t039804579._1
147- let userTokenStaked = $t039804579._2
148- let claimAmountAvailable = $t039804579._3
149- let claimAmountAvailableNFT = $t039804579._4
150- $Tuple2(nil, makeString(["%d%d%d%d", toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT)], SEPARATOR))
156+ let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
157+ let $t044944590 = claimCalc(user)
158+ let userNewInterest = $t044944590._1
159+ let claimAmountAvailable = $t044944590._2
160+ let userTokenStaked = $t044944590._3
161+ let totalTokenStaked = $t044944590._4
162+ let $t045934694 = claimCalcNft(user)
163+ let userNewInterestNFT = $t045934694._1
164+ let claimAmountAvailableNFT = $t045934694._2
165+ let userNFTStaked = $t045934694._3
166+ let totalNFTStaked = $t045934694._4
167+ let userTokenBalance = assetBalance(userAddr, fromBase58String(tokenId))
168+ let userNfts = getUserStakedNFT(user)
169+ $Tuple2(nil, makeString(["%d%d%d%d%s", toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT), userNfts], SEPARATOR))
151170 }
152171
153172
155174 @Callable(i)
156175 func getUserStatsREADONLY (user) = {
157176 let apr = calcTokenApr()
158- let $t048905489 = if ((user == ""))
177+ let $t051395738 = if ((user == ""))
159178 then $Tuple4(0, 0, 0, 0)
160179 else {
161180 let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
162- let $t051275223 = claimCalc(user)
163- let userNewInterest = $t051275223._1
164- let claimAmountAvailable = $t051275223._2
165- let userTokenStaked = $t051275223._3
166- let totalTokenStaked = $t051275223._4
167- let $t052305331 = claimCalcNft(user)
168- let userNewInterestNFT = $t052305331._1
169- let claimAmountAvailableNFT = $t052305331._2
170- let userNFTStaked = $t052305331._3
171- let totalNFTStaked = $t052305331._4
181+ let $t053765472 = claimCalc(user)
182+ let userNewInterest = $t053765472._1
183+ let claimAmountAvailable = $t053765472._2
184+ let userTokenStaked = $t053765472._3
185+ let totalTokenStaked = $t053765472._4
186+ let $t054795580 = claimCalcNft(user)
187+ let userNewInterestNFT = $t054795580._1
188+ let claimAmountAvailableNFT = $t054795580._2
189+ let userNFTStaked = $t054795580._3
190+ let totalNFTStaked = $t054795580._4
172191 let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
173192 $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
174193 }
175- let userTokenBalance = $t048905489._1
176- let userTokenStaked = $t048905489._2
177- let claimAmountAvailable = $t048905489._3
178- let claimAmountAvailableNFT = $t048905489._4
194+ let userTokenBalance = $t051395738._1
195+ let userTokenStaked = $t051395738._2
196+ let claimAmountAvailable = $t051395738._3
197+ let claimAmountAvailableNFT = $t051395738._4
179198 $Tuple2(nil, makeString(["%d%d%d%d%d", toString(apr), toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT)], SEPARATOR))
180199 }
181200
200219 func stake () = valueOrElse(isActive(), if ((size(i.payments) != 1))
201220 then throw("One payment expected")
202221 else {
203- let $t066926767 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
204- let pmtAmount = $t066926767._1
205- let pmtAssetId = $t066926767._2
222+ let $t069417016 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
223+ let pmtAmount = $t069417016._1
224+ let pmtAssetId = $t069417016._2
206225 if ((pmtAssetId != fromBase58String(tokenId)))
207226 then throw("Wrong payment asset")
208227 else {
209228 let user = toString(i.caller)
210- let $t068886984 = claimCalc(user)
211- let userNewInterest = $t068886984._1
212- let claimAmountAvailable = $t068886984._2
213- let userTokenStaked = $t068886984._3
214- let totalTokenStaked = $t068886984._4
229+ let $t071377233 = claimCalc(user)
230+ let userNewInterest = $t071377233._1
231+ let claimAmountAvailable = $t071377233._2
232+ let userTokenStaked = $t071377233._3
233+ let totalTokenStaked = $t071377233._4
215234 [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked + pmtAmount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked + pmtAmount))]
216235 }
217236 })
224243 if ((0 >= amount))
225244 then throw("Amount must be greater than 0")
226245 else {
227- let $t074227518 = claimCalc(user)
228- let userNewInterest = $t074227518._1
229- let claimAmountAvailable = $t074227518._2
230- let userTokenStaked = $t074227518._3
231- let totalTokenStaked = $t074227518._4
246+ let $t076717767 = claimCalc(user)
247+ let userNewInterest = $t076717767._1
248+ let claimAmountAvailable = $t076717767._2
249+ let userTokenStaked = $t076717767._3
250+ let totalTokenStaked = $t076717767._4
232251 if ((amount > userTokenStaked))
233252 then throw("You can't unstake more than staked")
234253 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked - amount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked - amount)), ScriptTransfer(i.caller, amount, fromBase58String(tokenId))]
240259 @Callable(i)
241260 func claim () = valueOrElse(isActive(), {
242261 let user = toString(i.caller)
243- let $t080248120 = claimCalc(user)
244- let userNewInterest = $t080248120._1
245- let claimAmountAvailable = $t080248120._2
246- let userTokenStaked = $t080248120._3
247- let totalTokenStaked = $t080248120._4
248- let $t081238224 = claimCalcNft(user)
249- let userNewInterestNFT = $t081238224._1
250- let claimAmountAvailableNFT = $t081238224._2
251- let userNFTStaked = $t081238224._3
252- let totalNFTStaked = $t081238224._4
262+ let $t082738369 = claimCalc(user)
263+ let userNewInterest = $t082738369._1
264+ let claimAmountAvailable = $t082738369._2
265+ let userTokenStaked = $t082738369._3
266+ let totalTokenStaked = $t082738369._4
267+ let $t083728473 = claimCalcNft(user)
268+ let userNewInterestNFT = $t083728473._1
269+ let claimAmountAvailableNFT = $t083728473._2
270+ let userNFTStaked = $t083728473._3
271+ let totalNFTStaked = $t083728473._4
253272 if (((claimAmountAvailable + claimAmountAvailableNFT) == 0))
254273 then throw("Nothing to claim")
255274 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), 0), IntegerEntry((user + kNFTUserInterest), userNewInterestNFT), IntegerEntry((user + kNFTUserAvailableClaim), 0), ScriptTransfer(i.caller, (claimAmountAvailable + claimAmountAvailableNFT), fromBase58String(tokenId))]
261280 func stakeNFT () = valueOrElse(isActive(), if ((size(i.payments) != 1))
262281 then throw("One payment expected")
263282 else {
264- let $t087808855 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
265- let pmtAmount = $t087808855._1
266- let pmtAssetId = $t087808855._2
283+ let $t090299104 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
284+ let pmtAmount = $t090299104._1
285+ let pmtAssetId = $t090299104._2
267286 let pmtAssetIdStr = assetIdToStr(pmtAssetId)
268287 if (!(isDefined(getString(this, (pmtAssetIdStr + kNFTCreated)))))
269288 then throw("Wrong nft asset")
270289 else {
271290 let user = toString(i.caller)
272- let $t090369131 = claimCalcNft(user)
273- let userNewInterest = $t090369131._1
274- let claimAmountAvailable = $t090369131._2
275- let userNFTStaked = $t090369131._3
276- let totalNFTStaked = $t090369131._4
291+ let $t092859380 = claimCalcNft(user)
292+ let userNewInterest = $t092859380._1
293+ let claimAmountAvailable = $t092859380._2
294+ let userNFTStaked = $t092859380._3
295+ let totalNFTStaked = $t092859380._4
277296 [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked + 1)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked + 1)), BooleanEntry((((user + "_") + pmtAssetIdStr) + kuserNFTStakedId), true)]
278297 }
279298 })
286305 if (isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId))))
287306 then throw("You didn't staked")
288307 else {
289- let $t096689763 = claimCalcNft(user)
290- let userNewInterest = $t096689763._1
291- let claimAmountAvailable = $t096689763._2
292- let userNFTStaked = $t096689763._3
293- let totalNFTStaked = $t096689763._4
308+ let $t0991710012 = claimCalcNft(user)
309+ let userNewInterest = $t0991710012._1
310+ let claimAmountAvailable = $t0991710012._2
311+ let userNFTStaked = $t0991710012._3
312+ let totalNFTStaked = $t0991710012._4
294313 [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked - 1)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked - 1)), DeleteEntry((((user + "_") + id) + kuserNFTStakedId)), ScriptTransfer(i.caller, 1, fromBase58String(id))]
295314 }
296315 })
315334 func airdrop () = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if ((size(i.payments) != 1))
316335 then throw("One payment expected")
317336 else {
318- let $t01093311008 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
319- let pmtAmount = $t01093311008._1
320- let pmtAssetId = $t01093311008._2
337+ let $t01118211257 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
338+ let pmtAmount = $t01118211257._1
339+ let pmtAssetId = $t01118211257._2
321340 if ((pmtAssetId != fromBase58String(tokenId)))
322341 then throw("Wrong payment asset")
323342 else {
326345 let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
327346 let curInterest = valueOrElse(getInteger(this, kInterest), 0)
328347 let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0)
329- let $t01143111635 = if ((totalNFTStaked == 0))
348+ let $t01168011884 = if ((totalNFTStaked == 0))
330349 then $Tuple2(0, pmtAmount)
331350 else {
332351 let nftP = fraction(pmtAmount, min([percentForNFT, (totalNFTStaked * 10)]), 100)
333352 $Tuple2(nftP, (pmtAmount - nftP))
334353 }
335- let pmtNFT = $t01143111635._1
336- let pmtToken = $t01143111635._2
354+ let pmtNFT = $t01168011884._1
355+ let pmtToken = $t01168011884._2
337356 let interestNew = if ((totalTokenStaked > 0))
338357 then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked))
339358 else curInterest
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 100000000
55
66 let PERCENT_SCALE = 10000
77
88 let SEPARATOR = "__"
99
1010 let kInterest = "interest"
1111
1212 let kUserInterest = "_userInterest"
1313
1414 let kUserAvailable = "_userAvailableClaim"
1515
1616 let kUserTokenStaked = "_userTokenStaked"
1717
1818 let kTotalTokenStaked = "totalTokenStaked"
1919
2020 let kNFTInterest = "NFTInterest"
2121
2222 let kNFTUserInterest = "_NFTUserInterest"
2323
2424 let kNFTUserAvailableClaim = "_NFTUserAvailableClaim"
2525
2626 let kNFTTotalStaked = "NFTTotalStaked"
2727
2828 let kuserNFTStaked = "_userNFTStaked"
2929
3030 let kuserNFTStakedId = "_userNFTStakedId"
3131
3232 let kNFTCreated = "_NFTCreated"
3333
3434 let kLastAirdrop = "_lastAirdrop"
3535
3636 let kTokenid = "tokenId"
3737
3838 let kPersentForNFT = "percentForNFT"
3939
4040 let kNFTCreatedList = "nftCreatedList"
4141
4242 let kActive = "active"
4343
4444 let kAdmin1PK = "admin_pub_1"
4545
4646 let kAdmin2PK = "admin_pub_2"
4747
4848 let kAdmin3PK = "admin_pub_3"
4949
5050 let admin1PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin1PK), "Can't get admin1PK"))
5151
5252 let admin2PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin2PK), "Can't get admin2PK"))
5353
5454 let admin3PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin3PK), "Can't get operatorPK"))
5555
5656 let tokenId = valueOrErrorMessage(getString(this, kTokenid), "Can't get staking token")
5757
5858 func isAdminCall (i) = if (containsElement([admin1PK, admin2PK, admin3PK], i.callerPublicKey))
5959 then unit
6060 else throw("Only admin can call this function")
6161
6262
6363 func isSelfCall (i) = if ((i.caller == this))
6464 then unit
6565 else throw("Only contract itself can call this function")
6666
6767
6868 func isActive () = if (valueOrElse(getBoolean(this, kActive), true))
6969 then unit
7070 else throw("DApp is inactive at this moment")
7171
7272
7373 func assetIdToStr (assetId) = match assetId {
7474 case id: ByteVector =>
7575 toBase58String(id)
7676 case waves: Unit =>
7777 "WAVES"
7878 case _ =>
7979 throw("Not Asset id")
8080 }
8181
8282
8383 func claimCalc (user) = {
8484 let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
8585 let curInterest = valueOrElse(getInteger(this, kInterest), 0)
8686 let availableForClaim = valueOrElse(getInteger(this, (user + kUserAvailable)), 0)
8787 let userInterest = valueOrElse(getInteger(this, (user + kUserInterest)), curInterest)
8888 let userTokenStaked = valueOrElse(getInteger(this, (user + kUserTokenStaked)), 0)
8989 let claimAmount = fraction(userTokenStaked, (curInterest - userInterest), SCALE8)
9090 $Tuple4(curInterest, (claimAmount + availableForClaim), userTokenStaked, totalTokenStaked)
9191 }
9292
9393
9494 func claimCalcNft (user) = {
9595 let totalNftStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
9696 let curInterest = valueOrElse(getInteger(this, kNFTInterest), 0)
9797 let availableForClaim = valueOrElse(getInteger(this, (user + kNFTUserAvailableClaim)), 0)
9898 let userInterest = valueOrElse(getInteger(this, (user + kNFTUserInterest)), curInterest)
9999 let userNftStaked = valueOrElse(getInteger(this, (user + kuserNFTStaked)), 0)
100100 let claimAmount = (userNftStaked * (curInterest - userInterest))
101101 $Tuple4(curInterest, (claimAmount + availableForClaim), userNftStaked, totalNftStaked)
102102 }
103103
104104
105105 func calcTokenApr () = {
106106 let lastAirdrop = valueOrElse(getInteger(this, kLastAirdrop), 0)
107107 let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
108108 let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
109109 let percentForNFT = getIntegerValue(this, kPersentForNFT)
110110 let tokenAirdrop = if ((totalNFTStaked == 0))
111111 then lastAirdrop
112112 else fraction(lastAirdrop, min([percentForNFT, (totalNFTStaked * 10)]), 100)
113113 (fraction(tokenAirdrop, PERCENT_SCALE, totalTokenStaked) * 52)
114114 }
115115
116116
117+func getUserStakedNFT (user) = {
118+ func forNft (uNFT,nftId) = if (isDefined(getBoolean(this, (((user + "_") + nftId) + kuserNFTStakedId))))
119+ then (uNFT :+ nftId)
120+ else uNFT
121+
122+ let nftsStr = valueOrElse(getString(this, kNFTCreatedList), "")
123+ let nftList = if ((nftsStr == ""))
124+ then nil
125+ else split(nftsStr, SEPARATOR)
126+ let userNfts = {
127+ let $l = nftList
128+ let $s = size($l)
129+ let $acc0 = nil
130+ func $f0_1 ($a,$i) = if (($i >= $s))
131+ then $a
132+ else forNft($a, $l[$i])
133+
134+ func $f0_2 ($a,$i) = if (($i >= $s))
135+ then $a
136+ else throw("List size exceeds 5")
137+
138+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
139+ }
140+ makeString(userNfts, ",")
141+ }
142+
143+
117144 @Callable(i)
118145 func getStatsREADONLY () = {
119146 let apr = calcTokenApr()
120147 let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
121148 let totalNftStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
122149 $Tuple2(nil, makeString(["%d%d%d", toString(apr), toString(totalTokenStaked), toString(totalNftStaked)], SEPARATOR))
123150 }
124151
125152
126153
127154 @Callable(i)
128155 func getStatsByUserREADONLY (user) = {
129- let $t039804579 = if ((user == ""))
130- then $Tuple4(0, 0, 0, 0)
131- else {
132- let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
133- let $t042174313 = claimCalc(user)
134- let userNewInterest = $t042174313._1
135- let claimAmountAvailable = $t042174313._2
136- let userTokenStaked = $t042174313._3
137- let totalTokenStaked = $t042174313._4
138- let $t043204421 = claimCalcNft(user)
139- let userNewInterestNFT = $t043204421._1
140- let claimAmountAvailableNFT = $t043204421._2
141- let userNFTStaked = $t043204421._3
142- let totalNFTStaked = $t043204421._4
143- let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
144- $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
145- }
146- let userTokenBalance = $t039804579._1
147- let userTokenStaked = $t039804579._2
148- let claimAmountAvailable = $t039804579._3
149- let claimAmountAvailableNFT = $t039804579._4
150- $Tuple2(nil, makeString(["%d%d%d%d", toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT)], SEPARATOR))
156+ let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
157+ let $t044944590 = claimCalc(user)
158+ let userNewInterest = $t044944590._1
159+ let claimAmountAvailable = $t044944590._2
160+ let userTokenStaked = $t044944590._3
161+ let totalTokenStaked = $t044944590._4
162+ let $t045934694 = claimCalcNft(user)
163+ let userNewInterestNFT = $t045934694._1
164+ let claimAmountAvailableNFT = $t045934694._2
165+ let userNFTStaked = $t045934694._3
166+ let totalNFTStaked = $t045934694._4
167+ let userTokenBalance = assetBalance(userAddr, fromBase58String(tokenId))
168+ let userNfts = getUserStakedNFT(user)
169+ $Tuple2(nil, makeString(["%d%d%d%d%s", toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT), userNfts], SEPARATOR))
151170 }
152171
153172
154173
155174 @Callable(i)
156175 func getUserStatsREADONLY (user) = {
157176 let apr = calcTokenApr()
158- let $t048905489 = if ((user == ""))
177+ let $t051395738 = if ((user == ""))
159178 then $Tuple4(0, 0, 0, 0)
160179 else {
161180 let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
162- let $t051275223 = claimCalc(user)
163- let userNewInterest = $t051275223._1
164- let claimAmountAvailable = $t051275223._2
165- let userTokenStaked = $t051275223._3
166- let totalTokenStaked = $t051275223._4
167- let $t052305331 = claimCalcNft(user)
168- let userNewInterestNFT = $t052305331._1
169- let claimAmountAvailableNFT = $t052305331._2
170- let userNFTStaked = $t052305331._3
171- let totalNFTStaked = $t052305331._4
181+ let $t053765472 = claimCalc(user)
182+ let userNewInterest = $t053765472._1
183+ let claimAmountAvailable = $t053765472._2
184+ let userTokenStaked = $t053765472._3
185+ let totalTokenStaked = $t053765472._4
186+ let $t054795580 = claimCalcNft(user)
187+ let userNewInterestNFT = $t054795580._1
188+ let claimAmountAvailableNFT = $t054795580._2
189+ let userNFTStaked = $t054795580._3
190+ let totalNFTStaked = $t054795580._4
172191 let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
173192 $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
174193 }
175- let userTokenBalance = $t048905489._1
176- let userTokenStaked = $t048905489._2
177- let claimAmountAvailable = $t048905489._3
178- let claimAmountAvailableNFT = $t048905489._4
194+ let userTokenBalance = $t051395738._1
195+ let userTokenStaked = $t051395738._2
196+ let claimAmountAvailable = $t051395738._3
197+ let claimAmountAvailableNFT = $t051395738._4
179198 $Tuple2(nil, makeString(["%d%d%d%d%d", toString(apr), toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT)], SEPARATOR))
180199 }
181200
182201
183202
184203 @Callable(i)
185204 func init (tokenId,adm1Pub,adm2Pub,adm3Pub,toNFTPercent) = valueOrElse(isSelfCall(i), if (isDefined(getString(this, kTokenid)))
186205 then throw("DApp already inited")
187206 else if (!(isDefined(assetInfo(fromBase58String(tokenId)))))
188207 then throw("asset id is not correct asset id")
189208 else if ((size(fromBase58String(adm1Pub)) != 32))
190209 then throw("group1Admin1PubKey is not correct")
191210 else if ((size(fromBase58String(adm2Pub)) != 32))
192211 then throw("group1Admin1PubKey is not correct")
193212 else if ((size(fromBase58String(adm3Pub)) != 32))
194213 then throw("group1Admin1PubKey is not correct")
195214 else [StringEntry(kTokenid, tokenId), StringEntry(kAdmin1PK, adm1Pub), StringEntry(kAdmin2PK, adm2Pub), StringEntry(kAdmin3PK, adm3Pub), IntegerEntry(kPersentForNFT, toNFTPercent)])
196215
197216
198217
199218 @Callable(i)
200219 func stake () = valueOrElse(isActive(), if ((size(i.payments) != 1))
201220 then throw("One payment expected")
202221 else {
203- let $t066926767 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
204- let pmtAmount = $t066926767._1
205- let pmtAssetId = $t066926767._2
222+ let $t069417016 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
223+ let pmtAmount = $t069417016._1
224+ let pmtAssetId = $t069417016._2
206225 if ((pmtAssetId != fromBase58String(tokenId)))
207226 then throw("Wrong payment asset")
208227 else {
209228 let user = toString(i.caller)
210- let $t068886984 = claimCalc(user)
211- let userNewInterest = $t068886984._1
212- let claimAmountAvailable = $t068886984._2
213- let userTokenStaked = $t068886984._3
214- let totalTokenStaked = $t068886984._4
229+ let $t071377233 = claimCalc(user)
230+ let userNewInterest = $t071377233._1
231+ let claimAmountAvailable = $t071377233._2
232+ let userTokenStaked = $t071377233._3
233+ let totalTokenStaked = $t071377233._4
215234 [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked + pmtAmount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked + pmtAmount))]
216235 }
217236 })
218237
219238
220239
221240 @Callable(i)
222241 func unstake (amount) = valueOrElse(isActive(), {
223242 let user = toString(i.caller)
224243 if ((0 >= amount))
225244 then throw("Amount must be greater than 0")
226245 else {
227- let $t074227518 = claimCalc(user)
228- let userNewInterest = $t074227518._1
229- let claimAmountAvailable = $t074227518._2
230- let userTokenStaked = $t074227518._3
231- let totalTokenStaked = $t074227518._4
246+ let $t076717767 = claimCalc(user)
247+ let userNewInterest = $t076717767._1
248+ let claimAmountAvailable = $t076717767._2
249+ let userTokenStaked = $t076717767._3
250+ let totalTokenStaked = $t076717767._4
232251 if ((amount > userTokenStaked))
233252 then throw("You can't unstake more than staked")
234253 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked - amount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked - amount)), ScriptTransfer(i.caller, amount, fromBase58String(tokenId))]
235254 }
236255 })
237256
238257
239258
240259 @Callable(i)
241260 func claim () = valueOrElse(isActive(), {
242261 let user = toString(i.caller)
243- let $t080248120 = claimCalc(user)
244- let userNewInterest = $t080248120._1
245- let claimAmountAvailable = $t080248120._2
246- let userTokenStaked = $t080248120._3
247- let totalTokenStaked = $t080248120._4
248- let $t081238224 = claimCalcNft(user)
249- let userNewInterestNFT = $t081238224._1
250- let claimAmountAvailableNFT = $t081238224._2
251- let userNFTStaked = $t081238224._3
252- let totalNFTStaked = $t081238224._4
262+ let $t082738369 = claimCalc(user)
263+ let userNewInterest = $t082738369._1
264+ let claimAmountAvailable = $t082738369._2
265+ let userTokenStaked = $t082738369._3
266+ let totalTokenStaked = $t082738369._4
267+ let $t083728473 = claimCalcNft(user)
268+ let userNewInterestNFT = $t083728473._1
269+ let claimAmountAvailableNFT = $t083728473._2
270+ let userNFTStaked = $t083728473._3
271+ let totalNFTStaked = $t083728473._4
253272 if (((claimAmountAvailable + claimAmountAvailableNFT) == 0))
254273 then throw("Nothing to claim")
255274 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), 0), IntegerEntry((user + kNFTUserInterest), userNewInterestNFT), IntegerEntry((user + kNFTUserAvailableClaim), 0), ScriptTransfer(i.caller, (claimAmountAvailable + claimAmountAvailableNFT), fromBase58String(tokenId))]
256275 })
257276
258277
259278
260279 @Callable(i)
261280 func stakeNFT () = valueOrElse(isActive(), if ((size(i.payments) != 1))
262281 then throw("One payment expected")
263282 else {
264- let $t087808855 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
265- let pmtAmount = $t087808855._1
266- let pmtAssetId = $t087808855._2
283+ let $t090299104 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
284+ let pmtAmount = $t090299104._1
285+ let pmtAssetId = $t090299104._2
267286 let pmtAssetIdStr = assetIdToStr(pmtAssetId)
268287 if (!(isDefined(getString(this, (pmtAssetIdStr + kNFTCreated)))))
269288 then throw("Wrong nft asset")
270289 else {
271290 let user = toString(i.caller)
272- let $t090369131 = claimCalcNft(user)
273- let userNewInterest = $t090369131._1
274- let claimAmountAvailable = $t090369131._2
275- let userNFTStaked = $t090369131._3
276- let totalNFTStaked = $t090369131._4
291+ let $t092859380 = claimCalcNft(user)
292+ let userNewInterest = $t092859380._1
293+ let claimAmountAvailable = $t092859380._2
294+ let userNFTStaked = $t092859380._3
295+ let totalNFTStaked = $t092859380._4
277296 [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked + 1)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked + 1)), BooleanEntry((((user + "_") + pmtAssetIdStr) + kuserNFTStakedId), true)]
278297 }
279298 })
280299
281300
282301
283302 @Callable(i)
284303 func unstakeNFT (id) = valueOrElse(isActive(), {
285304 let user = toString(i.caller)
286305 if (isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId))))
287306 then throw("You didn't staked")
288307 else {
289- let $t096689763 = claimCalcNft(user)
290- let userNewInterest = $t096689763._1
291- let claimAmountAvailable = $t096689763._2
292- let userNFTStaked = $t096689763._3
293- let totalNFTStaked = $t096689763._4
308+ let $t0991710012 = claimCalcNft(user)
309+ let userNewInterest = $t0991710012._1
310+ let claimAmountAvailable = $t0991710012._2
311+ let userNFTStaked = $t0991710012._3
312+ let totalNFTStaked = $t0991710012._4
294313 [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked - 1)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked - 1)), DeleteEntry((((user + "_") + id) + kuserNFTStakedId)), ScriptTransfer(i.caller, 1, fromBase58String(id))]
295314 }
296315 })
297316
298317
299318
300319 @Callable(i)
301320 func issueNFT (userAddr,name,descr) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), {
302321 let uAddr = valueOrErrorMessage(addressFromString(userAddr), "Wrong user address")
303322 let issue = Issue(name, descr, 1, 0, false)
304323 let nftId = calculateAssetId(issue)
305324 let nftList = valueOrElse(getString(this, kNFTCreatedList), "")
306325 let newNftList = (nftList + (if ((nftList != ""))
307326 then (SEPARATOR + toBase58String(nftId))
308327 else ("" + toBase58String(nftId))))
309328 [issue, StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), StringEntry(kNFTCreatedList, newNftList), ScriptTransfer(uAddr, 1, nftId)]
310329 }))
311330
312331
313332
314333 @Callable(i)
315334 func airdrop () = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if ((size(i.payments) != 1))
316335 then throw("One payment expected")
317336 else {
318- let $t01093311008 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
319- let pmtAmount = $t01093311008._1
320- let pmtAssetId = $t01093311008._2
337+ let $t01118211257 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
338+ let pmtAmount = $t01118211257._1
339+ let pmtAssetId = $t01118211257._2
321340 if ((pmtAssetId != fromBase58String(tokenId)))
322341 then throw("Wrong payment asset")
323342 else {
324343 let percentForNFT = getIntegerValue(this, kPersentForNFT)
325344 let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
326345 let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
327346 let curInterest = valueOrElse(getInteger(this, kInterest), 0)
328347 let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0)
329- let $t01143111635 = if ((totalNFTStaked == 0))
348+ let $t01168011884 = if ((totalNFTStaked == 0))
330349 then $Tuple2(0, pmtAmount)
331350 else {
332351 let nftP = fraction(pmtAmount, min([percentForNFT, (totalNFTStaked * 10)]), 100)
333352 $Tuple2(nftP, (pmtAmount - nftP))
334353 }
335- let pmtNFT = $t01143111635._1
336- let pmtToken = $t01143111635._2
354+ let pmtNFT = $t01168011884._1
355+ let pmtToken = $t01168011884._2
337356 let interestNew = if ((totalTokenStaked > 0))
338357 then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked))
339358 else curInterest
340359 let interestNFTNew = if ((totalNFTStaked > 0))
341360 then (curNFTInterest + (pmtNFT / totalNFTStaked))
342361 else curNFTInterest
343362 [IntegerEntry(kInterest, interestNew), IntegerEntry(kNFTInterest, interestNFTNew), IntegerEntry(kLastAirdrop, pmtAmount)]
344363 }
345364 }))
346365
347366
348367
349368 @Callable(i)
350369 func activate () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActive), true))
351370 then throw("dApp already active")
352371 else [BooleanEntry(kActive, true)])
353372
354373
355374
356375 @Callable(i)
357376 func shutdown () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActive), true)))
358377 then throw("dApp already shutdown")
359378 else [BooleanEntry(kActive, false)])
360379
361380
362381 @Verifier(tx)
363382 func verify () = {
364383 let multiSignedByAdmins = {
365384 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK))
366385 then 1
367386 else 0
368387 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK))
369388 then 1
370389 else 0
371390 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK))
372391 then 1
373392 else 0
374393 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
375394 }
376395 match tx {
377396 case inv: InvokeScriptTransaction =>
378397 let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
379398 let isRightFee = if ((inv.fee == 900000))
380399 then (inv.feeAssetId == unit)
381400 else false
382401 let isInitCall = (inv.function == "init")
383402 let isnoPayments = (size(inv.payments) == 0)
384403 if (if (if (if (isRightFee)
385404 then isInitCall
386405 else false)
387406 then isSelf
388407 else false)
389408 then isnoPayments
390409 else false)
391410 then true
392411 else multiSignedByAdmins
393412 case _ =>
394413 multiSignedByAdmins
395414 }
396415 }
397416

github/deemru/w8io/026f985 
68.47 ms