tx · 4ipPRY1tfDjXYHf3RgACkpV6xWnLcAF4ihmfxhQifYmQ

3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4:  -0.01700000 Waves

2023.09.14 14:45 [2755024] smart account 3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4 > SELF 0.00000000 Waves

{ "type": 13, "id": "4ipPRY1tfDjXYHf3RgACkpV6xWnLcAF4ihmfxhQifYmQ", "fee": 1700000, "feeAssetId": null, "timestamp": 1694691902755, "version": 2, "chainId": 84, "sender": "3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4", "senderPublicKey": "DU1U4j8FqHUMRr9WgfF3yo67ULEFkjp7dtMWMpjBK1ar", "proofs": [ "2SX7ZDA4H35xzGukWoh3XqkqAzNoVsYdCXpRtKcAWcdwG4SBAhx6aCKBvs28uNciN3S5Yb2ji5LEnJuD3LpMwKvq", "47vxZCw1Sg5jnse9PD7EoyUw7cvbER6nXS4bHWzE6qGx8V3NJ367kSMKmGUb9ZKNJMi5vfQuMr5usmzzduRbTg4q" ], "script": "base64:BgI0CAISABIDCgEIEgMKAQgSBwoFCAgICAESABIDCgEBEgASABIDCgEIEgUKAwgICBIAEgASACIABlNDQUxFOACAwtcvAA1QRVJDRU5UX1NDQUxFAJBOAAlTRVBBUkFUT1ICAl9fAAlrSW50ZXJlc3QCCGludGVyZXN0AA1rVXNlckludGVyZXN0Ag1fdXNlckludGVyZXN0AA5rVXNlckF2YWlsYWJsZQITX3VzZXJBdmFpbGFibGVDbGFpbQAQa1VzZXJUb2tlblN0YWtlZAIQX3VzZXJUb2tlblN0YWtlZAARa1RvdGFsVG9rZW5TdGFrZWQCEHRvdGFsVG9rZW5TdGFrZWQADGtORlRJbnRlcmVzdAILTkZUSW50ZXJlc3QAEGtORlRVc2VySW50ZXJlc3QCEF9ORlRVc2VySW50ZXJlc3QAFmtORlRVc2VyQXZhaWxhYmxlQ2xhaW0CFl9ORlRVc2VyQXZhaWxhYmxlQ2xhaW0AD2tORlRUb3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AAAwMDAwUKaXNSaWdodEZlZQUKaXNJbml0Q2FsbAcFBmlzU2VsZgcFDGlzbm9QYXltZW50cwcGBRNtdWx0aVNpZ25lZEJ5QWRtaW5zBRNtdWx0aVNpZ25lZEJ5QWRtaW5zE7CWmQ==", "height": 2755024, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: XPeLieLgFx5Htg62rhiuVn2b6WPxHBUJ2Qa2Gf8uZEc Next: AKGttLNzSenSUFncf6Fvw7QtGpfed3SZdZLNMWcCH6B3 Diff:
OldNewDifferences
115115
116116
117117 @Callable(i)
118-func getUserStatsREADONLY (user) = {
118+func getStatsREADONLY () = {
119119 let apr = calcTokenApr()
120- let $t036294228 = if ((user == ""))
120+ let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
121+ let totalNftStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
122+ $Tuple2(nil, makeString(["%d%d%d", toString(apr), toString(totalTokenStaked), toString(totalNftStaked)], SEPARATOR))
123+ }
124+
125+
126+
127+@Callable(i)
128+func getStatsByUserREADONLY (user) = {
129+ let $t039804579 = if ((user == ""))
121130 then $Tuple4(0, 0, 0, 0)
122131 else {
123132 let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
124- let $t038663962 = claimCalc(user)
125- let userNewInterest = $t038663962._1
126- let claimAmountAvailable = $t038663962._2
127- let userTokenStaked = $t038663962._3
128- let totalTokenStaked = $t038663962._4
129- let $t039694070 = claimCalcNft(user)
130- let userNewInterestNFT = $t039694070._1
131- let claimAmountAvailableNFT = $t039694070._2
132- let userNFTStaked = $t039694070._3
133- let totalNFTStaked = $t039694070._4
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
134143 let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
135144 $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
136145 }
137- let userTokenBalance = $t036294228._1
138- let userTokenStaked = $t036294228._2
139- let claimAmountAvailable = $t036294228._3
140- let claimAmountAvailableNFT = $t036294228._4
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))
151+ }
152+
153+
154+
155+@Callable(i)
156+func getUserStatsREADONLY (user) = {
157+ let apr = calcTokenApr()
158+ let $t048905489 = if ((user == ""))
159+ then $Tuple4(0, 0, 0, 0)
160+ else {
161+ 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
172+ let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
173+ $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
174+ }
175+ let userTokenBalance = $t048905489._1
176+ let userTokenStaked = $t048905489._2
177+ let claimAmountAvailable = $t048905489._3
178+ let claimAmountAvailableNFT = $t048905489._4
141179 $Tuple2(nil, makeString(["%d%d%d%d%d", toString(apr), toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT)], SEPARATOR))
142180 }
143181
162200 func stake () = valueOrElse(isActive(), if ((size(i.payments) != 1))
163201 then throw("One payment expected")
164202 else {
165- let $t054315506 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
166- let pmtAmount = $t054315506._1
167- let pmtAssetId = $t054315506._2
203+ let $t066926767 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
204+ let pmtAmount = $t066926767._1
205+ let pmtAssetId = $t066926767._2
168206 if ((pmtAssetId != fromBase58String(tokenId)))
169207 then throw("Wrong payment asset")
170208 else {
171209 let user = toString(i.caller)
172- let $t056275723 = claimCalc(user)
173- let userNewInterest = $t056275723._1
174- let claimAmountAvailable = $t056275723._2
175- let userTokenStaked = $t056275723._3
176- let totalTokenStaked = $t056275723._4
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
177215 [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked + pmtAmount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked + pmtAmount))]
178216 }
179217 })
186224 if ((0 >= amount))
187225 then throw("Amount must be greater than 0")
188226 else {
189- let $t061616257 = claimCalc(user)
190- let userNewInterest = $t061616257._1
191- let claimAmountAvailable = $t061616257._2
192- let userTokenStaked = $t061616257._3
193- let totalTokenStaked = $t061616257._4
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
194232 if ((amount > userTokenStaked))
195233 then throw("You can't unstake more than staked")
196234 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked - amount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked - amount)), ScriptTransfer(i.caller, amount, fromBase58String(tokenId))]
202240 @Callable(i)
203241 func claim () = valueOrElse(isActive(), {
204242 let user = toString(i.caller)
205- let $t067636859 = claimCalc(user)
206- let userNewInterest = $t067636859._1
207- let claimAmountAvailable = $t067636859._2
208- let userTokenStaked = $t067636859._3
209- let totalTokenStaked = $t067636859._4
210- let $t068626963 = claimCalcNft(user)
211- let userNewInterestNFT = $t068626963._1
212- let claimAmountAvailableNFT = $t068626963._2
213- let userNFTStaked = $t068626963._3
214- let totalNFTStaked = $t068626963._4
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
215253 if (((claimAmountAvailable + claimAmountAvailableNFT) == 0))
216254 then throw("Nothing to claim")
217255 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), 0), IntegerEntry((user + kNFTUserInterest), userNewInterestNFT), IntegerEntry((user + kNFTUserAvailableClaim), 0), ScriptTransfer(i.caller, (claimAmountAvailable + claimAmountAvailableNFT), fromBase58String(tokenId))]
223261 func stakeNFT () = valueOrElse(isActive(), if ((size(i.payments) != 1))
224262 then throw("One payment expected")
225263 else {
226- let $t075197594 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
227- let pmtAmount = $t075197594._1
228- let pmtAssetId = $t075197594._2
264+ let $t087808855 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
265+ let pmtAmount = $t087808855._1
266+ let pmtAssetId = $t087808855._2
229267 let pmtAssetIdStr = assetIdToStr(pmtAssetId)
230268 if (!(isDefined(getString(this, (pmtAssetIdStr + kNFTCreated)))))
231269 then throw("Wrong nft asset")
232270 else {
233271 let user = toString(i.caller)
234- let $t077757870 = claimCalcNft(user)
235- let userNewInterest = $t077757870._1
236- let claimAmountAvailable = $t077757870._2
237- let userNFTStaked = $t077757870._3
238- let totalNFTStaked = $t077757870._4
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
239277 [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked + 1)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked + 1)), BooleanEntry((((user + "_") + pmtAssetIdStr) + kuserNFTStakedId), true)]
240278 }
241279 })
248286 if (isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId))))
249287 then throw("You didn't staked")
250288 else {
251- let $t084078502 = claimCalcNft(user)
252- let userNewInterest = $t084078502._1
253- let claimAmountAvailable = $t084078502._2
254- let userNFTStaked = $t084078502._3
255- let totalNFTStaked = $t084078502._4
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
256294 [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))]
257295 }
258296 })
266304 let nftId = calculateAssetId(issue)
267305 let nftList = valueOrElse(getString(this, kNFTCreatedList), "")
268306 let newNftList = (nftList + (if ((nftList != ""))
269- then SEPARATOR
307+ then (SEPARATOR + toBase58String(nftId))
270308 else ("" + toBase58String(nftId))))
271309 [issue, StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), StringEntry(kNFTCreatedList, newNftList), ScriptTransfer(uAddr, 1, nftId)]
272310 }))
277315 func airdrop () = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if ((size(i.payments) != 1))
278316 then throw("One payment expected")
279317 else {
280- let $t096479722 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
281- let pmtAmount = $t096479722._1
282- let pmtAssetId = $t096479722._2
318+ let $t01093311008 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
319+ let pmtAmount = $t01093311008._1
320+ let pmtAssetId = $t01093311008._2
283321 if ((pmtAssetId != fromBase58String(tokenId)))
284322 then throw("Wrong payment asset")
285323 else {
288326 let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
289327 let curInterest = valueOrElse(getInteger(this, kInterest), 0)
290328 let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0)
291- let $t01014510349 = if ((totalNFTStaked == 0))
329+ let $t01143111635 = if ((totalNFTStaked == 0))
292330 then $Tuple2(0, pmtAmount)
293331 else {
294332 let nftP = fraction(pmtAmount, min([percentForNFT, (totalNFTStaked * 10)]), 100)
295333 $Tuple2(nftP, (pmtAmount - nftP))
296334 }
297- let pmtNFT = $t01014510349._1
298- let pmtToken = $t01014510349._2
335+ let pmtNFT = $t01143111635._1
336+ let pmtToken = $t01143111635._2
299337 let interestNew = if ((totalTokenStaked > 0))
300338 then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked))
301339 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
117117 @Callable(i)
118-func getUserStatsREADONLY (user) = {
118+func getStatsREADONLY () = {
119119 let apr = calcTokenApr()
120- let $t036294228 = if ((user == ""))
120+ let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
121+ let totalNftStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
122+ $Tuple2(nil, makeString(["%d%d%d", toString(apr), toString(totalTokenStaked), toString(totalNftStaked)], SEPARATOR))
123+ }
124+
125+
126+
127+@Callable(i)
128+func getStatsByUserREADONLY (user) = {
129+ let $t039804579 = if ((user == ""))
121130 then $Tuple4(0, 0, 0, 0)
122131 else {
123132 let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
124- let $t038663962 = claimCalc(user)
125- let userNewInterest = $t038663962._1
126- let claimAmountAvailable = $t038663962._2
127- let userTokenStaked = $t038663962._3
128- let totalTokenStaked = $t038663962._4
129- let $t039694070 = claimCalcNft(user)
130- let userNewInterestNFT = $t039694070._1
131- let claimAmountAvailableNFT = $t039694070._2
132- let userNFTStaked = $t039694070._3
133- let totalNFTStaked = $t039694070._4
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
134143 let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
135144 $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
136145 }
137- let userTokenBalance = $t036294228._1
138- let userTokenStaked = $t036294228._2
139- let claimAmountAvailable = $t036294228._3
140- let claimAmountAvailableNFT = $t036294228._4
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))
151+ }
152+
153+
154+
155+@Callable(i)
156+func getUserStatsREADONLY (user) = {
157+ let apr = calcTokenApr()
158+ let $t048905489 = if ((user == ""))
159+ then $Tuple4(0, 0, 0, 0)
160+ else {
161+ 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
172+ let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
173+ $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
174+ }
175+ let userTokenBalance = $t048905489._1
176+ let userTokenStaked = $t048905489._2
177+ let claimAmountAvailable = $t048905489._3
178+ let claimAmountAvailableNFT = $t048905489._4
141179 $Tuple2(nil, makeString(["%d%d%d%d%d", toString(apr), toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT)], SEPARATOR))
142180 }
143181
144182
145183
146184 @Callable(i)
147185 func init (tokenId,adm1Pub,adm2Pub,adm3Pub,toNFTPercent) = valueOrElse(isSelfCall(i), if (isDefined(getString(this, kTokenid)))
148186 then throw("DApp already inited")
149187 else if (!(isDefined(assetInfo(fromBase58String(tokenId)))))
150188 then throw("asset id is not correct asset id")
151189 else if ((size(fromBase58String(adm1Pub)) != 32))
152190 then throw("group1Admin1PubKey is not correct")
153191 else if ((size(fromBase58String(adm2Pub)) != 32))
154192 then throw("group1Admin1PubKey is not correct")
155193 else if ((size(fromBase58String(adm3Pub)) != 32))
156194 then throw("group1Admin1PubKey is not correct")
157195 else [StringEntry(kTokenid, tokenId), StringEntry(kAdmin1PK, adm1Pub), StringEntry(kAdmin2PK, adm2Pub), StringEntry(kAdmin3PK, adm3Pub), IntegerEntry(kPersentForNFT, toNFTPercent)])
158196
159197
160198
161199 @Callable(i)
162200 func stake () = valueOrElse(isActive(), if ((size(i.payments) != 1))
163201 then throw("One payment expected")
164202 else {
165- let $t054315506 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
166- let pmtAmount = $t054315506._1
167- let pmtAssetId = $t054315506._2
203+ let $t066926767 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
204+ let pmtAmount = $t066926767._1
205+ let pmtAssetId = $t066926767._2
168206 if ((pmtAssetId != fromBase58String(tokenId)))
169207 then throw("Wrong payment asset")
170208 else {
171209 let user = toString(i.caller)
172- let $t056275723 = claimCalc(user)
173- let userNewInterest = $t056275723._1
174- let claimAmountAvailable = $t056275723._2
175- let userTokenStaked = $t056275723._3
176- let totalTokenStaked = $t056275723._4
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
177215 [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked + pmtAmount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked + pmtAmount))]
178216 }
179217 })
180218
181219
182220
183221 @Callable(i)
184222 func unstake (amount) = valueOrElse(isActive(), {
185223 let user = toString(i.caller)
186224 if ((0 >= amount))
187225 then throw("Amount must be greater than 0")
188226 else {
189- let $t061616257 = claimCalc(user)
190- let userNewInterest = $t061616257._1
191- let claimAmountAvailable = $t061616257._2
192- let userTokenStaked = $t061616257._3
193- let totalTokenStaked = $t061616257._4
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
194232 if ((amount > userTokenStaked))
195233 then throw("You can't unstake more than staked")
196234 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked - amount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked - amount)), ScriptTransfer(i.caller, amount, fromBase58String(tokenId))]
197235 }
198236 })
199237
200238
201239
202240 @Callable(i)
203241 func claim () = valueOrElse(isActive(), {
204242 let user = toString(i.caller)
205- let $t067636859 = claimCalc(user)
206- let userNewInterest = $t067636859._1
207- let claimAmountAvailable = $t067636859._2
208- let userTokenStaked = $t067636859._3
209- let totalTokenStaked = $t067636859._4
210- let $t068626963 = claimCalcNft(user)
211- let userNewInterestNFT = $t068626963._1
212- let claimAmountAvailableNFT = $t068626963._2
213- let userNFTStaked = $t068626963._3
214- let totalNFTStaked = $t068626963._4
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
215253 if (((claimAmountAvailable + claimAmountAvailableNFT) == 0))
216254 then throw("Nothing to claim")
217255 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), 0), IntegerEntry((user + kNFTUserInterest), userNewInterestNFT), IntegerEntry((user + kNFTUserAvailableClaim), 0), ScriptTransfer(i.caller, (claimAmountAvailable + claimAmountAvailableNFT), fromBase58String(tokenId))]
218256 })
219257
220258
221259
222260 @Callable(i)
223261 func stakeNFT () = valueOrElse(isActive(), if ((size(i.payments) != 1))
224262 then throw("One payment expected")
225263 else {
226- let $t075197594 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
227- let pmtAmount = $t075197594._1
228- let pmtAssetId = $t075197594._2
264+ let $t087808855 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
265+ let pmtAmount = $t087808855._1
266+ let pmtAssetId = $t087808855._2
229267 let pmtAssetIdStr = assetIdToStr(pmtAssetId)
230268 if (!(isDefined(getString(this, (pmtAssetIdStr + kNFTCreated)))))
231269 then throw("Wrong nft asset")
232270 else {
233271 let user = toString(i.caller)
234- let $t077757870 = claimCalcNft(user)
235- let userNewInterest = $t077757870._1
236- let claimAmountAvailable = $t077757870._2
237- let userNFTStaked = $t077757870._3
238- let totalNFTStaked = $t077757870._4
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
239277 [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked + 1)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked + 1)), BooleanEntry((((user + "_") + pmtAssetIdStr) + kuserNFTStakedId), true)]
240278 }
241279 })
242280
243281
244282
245283 @Callable(i)
246284 func unstakeNFT (id) = valueOrElse(isActive(), {
247285 let user = toString(i.caller)
248286 if (isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId))))
249287 then throw("You didn't staked")
250288 else {
251- let $t084078502 = claimCalcNft(user)
252- let userNewInterest = $t084078502._1
253- let claimAmountAvailable = $t084078502._2
254- let userNFTStaked = $t084078502._3
255- let totalNFTStaked = $t084078502._4
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
256294 [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))]
257295 }
258296 })
259297
260298
261299
262300 @Callable(i)
263301 func issueNFT (userAddr,name,descr) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), {
264302 let uAddr = valueOrErrorMessage(addressFromString(userAddr), "Wrong user address")
265303 let issue = Issue(name, descr, 1, 0, false)
266304 let nftId = calculateAssetId(issue)
267305 let nftList = valueOrElse(getString(this, kNFTCreatedList), "")
268306 let newNftList = (nftList + (if ((nftList != ""))
269- then SEPARATOR
307+ then (SEPARATOR + toBase58String(nftId))
270308 else ("" + toBase58String(nftId))))
271309 [issue, StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), StringEntry(kNFTCreatedList, newNftList), ScriptTransfer(uAddr, 1, nftId)]
272310 }))
273311
274312
275313
276314 @Callable(i)
277315 func airdrop () = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if ((size(i.payments) != 1))
278316 then throw("One payment expected")
279317 else {
280- let $t096479722 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
281- let pmtAmount = $t096479722._1
282- let pmtAssetId = $t096479722._2
318+ let $t01093311008 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
319+ let pmtAmount = $t01093311008._1
320+ let pmtAssetId = $t01093311008._2
283321 if ((pmtAssetId != fromBase58String(tokenId)))
284322 then throw("Wrong payment asset")
285323 else {
286324 let percentForNFT = getIntegerValue(this, kPersentForNFT)
287325 let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
288326 let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
289327 let curInterest = valueOrElse(getInteger(this, kInterest), 0)
290328 let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0)
291- let $t01014510349 = if ((totalNFTStaked == 0))
329+ let $t01143111635 = if ((totalNFTStaked == 0))
292330 then $Tuple2(0, pmtAmount)
293331 else {
294332 let nftP = fraction(pmtAmount, min([percentForNFT, (totalNFTStaked * 10)]), 100)
295333 $Tuple2(nftP, (pmtAmount - nftP))
296334 }
297- let pmtNFT = $t01014510349._1
298- let pmtToken = $t01014510349._2
335+ let pmtNFT = $t01143111635._1
336+ let pmtToken = $t01143111635._2
299337 let interestNew = if ((totalTokenStaked > 0))
300338 then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked))
301339 else curInterest
302340 let interestNFTNew = if ((totalNFTStaked > 0))
303341 then (curNFTInterest + (pmtNFT / totalNFTStaked))
304342 else curNFTInterest
305343 [IntegerEntry(kInterest, interestNew), IntegerEntry(kNFTInterest, interestNFTNew), IntegerEntry(kLastAirdrop, pmtAmount)]
306344 }
307345 }))
308346
309347
310348
311349 @Callable(i)
312350 func activate () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActive), true))
313351 then throw("dApp already active")
314352 else [BooleanEntry(kActive, true)])
315353
316354
317355
318356 @Callable(i)
319357 func shutdown () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActive), true)))
320358 then throw("dApp already shutdown")
321359 else [BooleanEntry(kActive, false)])
322360
323361
324362 @Verifier(tx)
325363 func verify () = {
326364 let multiSignedByAdmins = {
327365 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK))
328366 then 1
329367 else 0
330368 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK))
331369 then 1
332370 else 0
333371 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK))
334372 then 1
335373 else 0
336374 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
337375 }
338376 match tx {
339377 case inv: InvokeScriptTransaction =>
340378 let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
341379 let isRightFee = if ((inv.fee == 900000))
342380 then (inv.feeAssetId == unit)
343381 else false
344382 let isInitCall = (inv.function == "init")
345383 let isnoPayments = (size(inv.payments) == 0)
346384 if (if (if (if (isRightFee)
347385 then isInitCall
348386 else false)
349387 then isSelf
350388 else false)
351389 then isnoPayments
352390 else false)
353391 then true
354392 else multiSignedByAdmins
355393 case _ =>
356394 multiSignedByAdmins
357395 }
358396 }
359397

github/deemru/w8io/026f985 
75.44 ms