tx · 5dSyRTeK8fmHAMxrT2jEyWX8uJW41UvbJExcpAsUZGU4

3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4:  -0.01700000 Waves

2023.09.15 16:46 [2756590] smart account 3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4 > SELF 0.00000000 Waves

{ "type": 13, "id": "5dSyRTeK8fmHAMxrT2jEyWX8uJW41UvbJExcpAsUZGU4", "fee": 1700000, "feeAssetId": null, "timestamp": 1694785604355, "version": 2, "chainId": 84, "sender": "3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4", "senderPublicKey": "DU1U4j8FqHUMRr9WgfF3yo67ULEFkjp7dtMWMpjBK1ar", "proofs": [ "5pAnkYsSkFcLuWR5YFd9LXyhQ1s4vEV4i2XxoKAQjYy6vu7QTER6Neq258eHWJhzr412pQTxuXRyf2BCqY1Vd3cz", "53AeZ6HHMoKdmifKskMLMXz145q12f8HCXhuFCHeHmDr5Q1MUeVJspLFXpXwetzUoX7DmM56gRRXibVMfkX5bjj6" ], "script": "base64:BgI0CAISABIDCgEIEgMKAQgSBwoFCAgICAESABIDCgEBEgASABIDCgEIEgUKAwgICBIAEgASACMABlNDQUxFOACAwtcvAA1QRVJDRU5UX1NDQUxFAJBOAAlTRVBBUkFUT1ICAl9fAAlrSW50ZXJlc3QCCGludGVyZXN0AA1rVXNlckludGVyZXN0Ag1fdXNlckludGVyZXN0AA5rVXNlckF2YWlsYWJsZQITX3VzZXJBdmFpbGFibGVDbGFpbQAQa1VzZXJUb2tlblN0YWtlZAIQX3VzZXJUb2tlblN0YWtlZAARa1RvdGFsVG9rZW5TdGFrZWQCEHRvdGFsVG9rZW5TdGFrZWQADGtORlRJbnRlcmVzdAILTkZUSW50ZXJlc3QAEGtORlRVc2VySW50ZXJlc3QCEF9ORlRVc2VySW50ZXJlc3QAFmtORlRVc2VyQXZhaWxhYmxlQ2xhaW0CFl9ORlRVc2VyQXZhaWxhYmxlQ2xhaW0AD2tORlRUb3RhbFN0Y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HViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAgQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EA2ludgUHJG1hdGNoMAQGaXNTZWxmCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BAppc1JpZ2h0RmVlAwkAAAIIBQNpbnYDZmVlAKD3NgkAAAIIBQNpbnYKZmVlQXNzZXRJZAUEdW5pdAcECmlzSW5pdENhbGwJAAACCAUDaW52CGZ1bmN0aW9uAgRpbml0BAxpc25vUGF5bWVudHMJAAACCQCQAwEIBQNpbnYIcGF5bWVudHMAAAMDAwMFCmlzUmlnaHRGZWUFCmlzSW5pdENhbGwHBQZpc1NlbGYHBQxpc25vUGF5bWVudHMHBgUTbXVsdGlTaWduZWRCeUFkbWlucwUTbXVsdGlTaWduZWRCeUFkbWluc4VqVYU=", "height": 2756590, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AKGttLNzSenSUFncf6Fvw7QtGpfed3SZdZLNMWcCH6B3 Next: B6XsqtpfhnLBRPBPkyqoX2gZYPs1Tas714q4N4KJTMPH Diff:
OldNewDifferences
302302 @Callable(i)
303303 func unstakeNFT (id) = valueOrElse(isActive(), {
304304 let user = toString(i.caller)
305- if (isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId))))
305+ if (!(isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId)))))
306306 then throw("You didn't staked")
307307 else {
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
308+ let $t0991810013 = claimCalcNft(user)
309+ let userNewInterest = $t0991810013._1
310+ let claimAmountAvailable = $t0991810013._2
311+ let userNFTStaked = $t0991810013._3
312+ let totalNFTStaked = $t0991810013._4
313313 [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))]
314314 }
315315 })
334334 func airdrop () = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if ((size(i.payments) != 1))
335335 then throw("One payment expected")
336336 else {
337- let $t01118211257 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
338- let pmtAmount = $t01118211257._1
339- let pmtAssetId = $t01118211257._2
337+ let $t01118311258 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
338+ let pmtAmount = $t01118311258._1
339+ let pmtAssetId = $t01118311258._2
340340 if ((pmtAssetId != fromBase58String(tokenId)))
341341 then throw("Wrong payment asset")
342342 else {
345345 let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
346346 let curInterest = valueOrElse(getInteger(this, kInterest), 0)
347347 let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0)
348- let $t01168011884 = if ((totalNFTStaked == 0))
348+ let $t01168111885 = if ((totalNFTStaked == 0))
349349 then $Tuple2(0, pmtAmount)
350350 else {
351351 let nftP = fraction(pmtAmount, min([percentForNFT, (totalNFTStaked * 10)]), 100)
352352 $Tuple2(nftP, (pmtAmount - nftP))
353353 }
354- let pmtNFT = $t01168011884._1
355- let pmtToken = $t01168011884._2
354+ let pmtNFT = $t01168111885._1
355+ let pmtToken = $t01168111885._2
356356 let interestNew = if ((totalTokenStaked > 0))
357357 then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked))
358358 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 func getUserStakedNFT (user) = {
118118 func forNft (uNFT,nftId) = if (isDefined(getBoolean(this, (((user + "_") + nftId) + kuserNFTStakedId))))
119119 then (uNFT :+ nftId)
120120 else uNFT
121121
122122 let nftsStr = valueOrElse(getString(this, kNFTCreatedList), "")
123123 let nftList = if ((nftsStr == ""))
124124 then nil
125125 else split(nftsStr, SEPARATOR)
126126 let userNfts = {
127127 let $l = nftList
128128 let $s = size($l)
129129 let $acc0 = nil
130130 func $f0_1 ($a,$i) = if (($i >= $s))
131131 then $a
132132 else forNft($a, $l[$i])
133133
134134 func $f0_2 ($a,$i) = if (($i >= $s))
135135 then $a
136136 else throw("List size exceeds 5")
137137
138138 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
139139 }
140140 makeString(userNfts, ",")
141141 }
142142
143143
144144 @Callable(i)
145145 func getStatsREADONLY () = {
146146 let apr = calcTokenApr()
147147 let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
148148 let totalNftStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
149149 $Tuple2(nil, makeString(["%d%d%d", toString(apr), toString(totalTokenStaked), toString(totalNftStaked)], SEPARATOR))
150150 }
151151
152152
153153
154154 @Callable(i)
155155 func getStatsByUserREADONLY (user) = {
156156 let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
157157 let $t044944590 = claimCalc(user)
158158 let userNewInterest = $t044944590._1
159159 let claimAmountAvailable = $t044944590._2
160160 let userTokenStaked = $t044944590._3
161161 let totalTokenStaked = $t044944590._4
162162 let $t045934694 = claimCalcNft(user)
163163 let userNewInterestNFT = $t045934694._1
164164 let claimAmountAvailableNFT = $t045934694._2
165165 let userNFTStaked = $t045934694._3
166166 let totalNFTStaked = $t045934694._4
167167 let userTokenBalance = assetBalance(userAddr, fromBase58String(tokenId))
168168 let userNfts = getUserStakedNFT(user)
169169 $Tuple2(nil, makeString(["%d%d%d%d%s", toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT), userNfts], SEPARATOR))
170170 }
171171
172172
173173
174174 @Callable(i)
175175 func getUserStatsREADONLY (user) = {
176176 let apr = calcTokenApr()
177177 let $t051395738 = if ((user == ""))
178178 then $Tuple4(0, 0, 0, 0)
179179 else {
180180 let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address")
181181 let $t053765472 = claimCalc(user)
182182 let userNewInterest = $t053765472._1
183183 let claimAmountAvailable = $t053765472._2
184184 let userTokenStaked = $t053765472._3
185185 let totalTokenStaked = $t053765472._4
186186 let $t054795580 = claimCalcNft(user)
187187 let userNewInterestNFT = $t054795580._1
188188 let claimAmountAvailableNFT = $t054795580._2
189189 let userNFTStaked = $t054795580._3
190190 let totalNFTStaked = $t054795580._4
191191 let userBalance = assetBalance(userAddr, fromBase58String(tokenId))
192192 $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT)
193193 }
194194 let userTokenBalance = $t051395738._1
195195 let userTokenStaked = $t051395738._2
196196 let claimAmountAvailable = $t051395738._3
197197 let claimAmountAvailableNFT = $t051395738._4
198198 $Tuple2(nil, makeString(["%d%d%d%d%d", toString(apr), toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT)], SEPARATOR))
199199 }
200200
201201
202202
203203 @Callable(i)
204204 func init (tokenId,adm1Pub,adm2Pub,adm3Pub,toNFTPercent) = valueOrElse(isSelfCall(i), if (isDefined(getString(this, kTokenid)))
205205 then throw("DApp already inited")
206206 else if (!(isDefined(assetInfo(fromBase58String(tokenId)))))
207207 then throw("asset id is not correct asset id")
208208 else if ((size(fromBase58String(adm1Pub)) != 32))
209209 then throw("group1Admin1PubKey is not correct")
210210 else if ((size(fromBase58String(adm2Pub)) != 32))
211211 then throw("group1Admin1PubKey is not correct")
212212 else if ((size(fromBase58String(adm3Pub)) != 32))
213213 then throw("group1Admin1PubKey is not correct")
214214 else [StringEntry(kTokenid, tokenId), StringEntry(kAdmin1PK, adm1Pub), StringEntry(kAdmin2PK, adm2Pub), StringEntry(kAdmin3PK, adm3Pub), IntegerEntry(kPersentForNFT, toNFTPercent)])
215215
216216
217217
218218 @Callable(i)
219219 func stake () = valueOrElse(isActive(), if ((size(i.payments) != 1))
220220 then throw("One payment expected")
221221 else {
222222 let $t069417016 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
223223 let pmtAmount = $t069417016._1
224224 let pmtAssetId = $t069417016._2
225225 if ((pmtAssetId != fromBase58String(tokenId)))
226226 then throw("Wrong payment asset")
227227 else {
228228 let user = toString(i.caller)
229229 let $t071377233 = claimCalc(user)
230230 let userNewInterest = $t071377233._1
231231 let claimAmountAvailable = $t071377233._2
232232 let userTokenStaked = $t071377233._3
233233 let totalTokenStaked = $t071377233._4
234234 [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked + pmtAmount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked + pmtAmount))]
235235 }
236236 })
237237
238238
239239
240240 @Callable(i)
241241 func unstake (amount) = valueOrElse(isActive(), {
242242 let user = toString(i.caller)
243243 if ((0 >= amount))
244244 then throw("Amount must be greater than 0")
245245 else {
246246 let $t076717767 = claimCalc(user)
247247 let userNewInterest = $t076717767._1
248248 let claimAmountAvailable = $t076717767._2
249249 let userTokenStaked = $t076717767._3
250250 let totalTokenStaked = $t076717767._4
251251 if ((amount > userTokenStaked))
252252 then throw("You can't unstake more than staked")
253253 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked - amount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked - amount)), ScriptTransfer(i.caller, amount, fromBase58String(tokenId))]
254254 }
255255 })
256256
257257
258258
259259 @Callable(i)
260260 func claim () = valueOrElse(isActive(), {
261261 let user = toString(i.caller)
262262 let $t082738369 = claimCalc(user)
263263 let userNewInterest = $t082738369._1
264264 let claimAmountAvailable = $t082738369._2
265265 let userTokenStaked = $t082738369._3
266266 let totalTokenStaked = $t082738369._4
267267 let $t083728473 = claimCalcNft(user)
268268 let userNewInterestNFT = $t083728473._1
269269 let claimAmountAvailableNFT = $t083728473._2
270270 let userNFTStaked = $t083728473._3
271271 let totalNFTStaked = $t083728473._4
272272 if (((claimAmountAvailable + claimAmountAvailableNFT) == 0))
273273 then throw("Nothing to claim")
274274 else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), 0), IntegerEntry((user + kNFTUserInterest), userNewInterestNFT), IntegerEntry((user + kNFTUserAvailableClaim), 0), ScriptTransfer(i.caller, (claimAmountAvailable + claimAmountAvailableNFT), fromBase58String(tokenId))]
275275 })
276276
277277
278278
279279 @Callable(i)
280280 func stakeNFT () = valueOrElse(isActive(), if ((size(i.payments) != 1))
281281 then throw("One payment expected")
282282 else {
283283 let $t090299104 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
284284 let pmtAmount = $t090299104._1
285285 let pmtAssetId = $t090299104._2
286286 let pmtAssetIdStr = assetIdToStr(pmtAssetId)
287287 if (!(isDefined(getString(this, (pmtAssetIdStr + kNFTCreated)))))
288288 then throw("Wrong nft asset")
289289 else {
290290 let user = toString(i.caller)
291291 let $t092859380 = claimCalcNft(user)
292292 let userNewInterest = $t092859380._1
293293 let claimAmountAvailable = $t092859380._2
294294 let userNFTStaked = $t092859380._3
295295 let totalNFTStaked = $t092859380._4
296296 [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked + 1)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked + 1)), BooleanEntry((((user + "_") + pmtAssetIdStr) + kuserNFTStakedId), true)]
297297 }
298298 })
299299
300300
301301
302302 @Callable(i)
303303 func unstakeNFT (id) = valueOrElse(isActive(), {
304304 let user = toString(i.caller)
305- if (isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId))))
305+ if (!(isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId)))))
306306 then throw("You didn't staked")
307307 else {
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
308+ let $t0991810013 = claimCalcNft(user)
309+ let userNewInterest = $t0991810013._1
310+ let claimAmountAvailable = $t0991810013._2
311+ let userNFTStaked = $t0991810013._3
312+ let totalNFTStaked = $t0991810013._4
313313 [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))]
314314 }
315315 })
316316
317317
318318
319319 @Callable(i)
320320 func issueNFT (userAddr,name,descr) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), {
321321 let uAddr = valueOrErrorMessage(addressFromString(userAddr), "Wrong user address")
322322 let issue = Issue(name, descr, 1, 0, false)
323323 let nftId = calculateAssetId(issue)
324324 let nftList = valueOrElse(getString(this, kNFTCreatedList), "")
325325 let newNftList = (nftList + (if ((nftList != ""))
326326 then (SEPARATOR + toBase58String(nftId))
327327 else ("" + toBase58String(nftId))))
328328 [issue, StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), StringEntry(kNFTCreatedList, newNftList), ScriptTransfer(uAddr, 1, nftId)]
329329 }))
330330
331331
332332
333333 @Callable(i)
334334 func airdrop () = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if ((size(i.payments) != 1))
335335 then throw("One payment expected")
336336 else {
337- let $t01118211257 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
338- let pmtAmount = $t01118211257._1
339- let pmtAssetId = $t01118211257._2
337+ let $t01118311258 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
338+ let pmtAmount = $t01118311258._1
339+ let pmtAssetId = $t01118311258._2
340340 if ((pmtAssetId != fromBase58String(tokenId)))
341341 then throw("Wrong payment asset")
342342 else {
343343 let percentForNFT = getIntegerValue(this, kPersentForNFT)
344344 let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0)
345345 let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0)
346346 let curInterest = valueOrElse(getInteger(this, kInterest), 0)
347347 let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0)
348- let $t01168011884 = if ((totalNFTStaked == 0))
348+ let $t01168111885 = if ((totalNFTStaked == 0))
349349 then $Tuple2(0, pmtAmount)
350350 else {
351351 let nftP = fraction(pmtAmount, min([percentForNFT, (totalNFTStaked * 10)]), 100)
352352 $Tuple2(nftP, (pmtAmount - nftP))
353353 }
354- let pmtNFT = $t01168011884._1
355- let pmtToken = $t01168011884._2
354+ let pmtNFT = $t01168111885._1
355+ let pmtToken = $t01168111885._2
356356 let interestNew = if ((totalTokenStaked > 0))
357357 then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked))
358358 else curInterest
359359 let interestNFTNew = if ((totalNFTStaked > 0))
360360 then (curNFTInterest + (pmtNFT / totalNFTStaked))
361361 else curNFTInterest
362362 [IntegerEntry(kInterest, interestNew), IntegerEntry(kNFTInterest, interestNFTNew), IntegerEntry(kLastAirdrop, pmtAmount)]
363363 }
364364 }))
365365
366366
367367
368368 @Callable(i)
369369 func activate () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActive), true))
370370 then throw("dApp already active")
371371 else [BooleanEntry(kActive, true)])
372372
373373
374374
375375 @Callable(i)
376376 func shutdown () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActive), true)))
377377 then throw("dApp already shutdown")
378378 else [BooleanEntry(kActive, false)])
379379
380380
381381 @Verifier(tx)
382382 func verify () = {
383383 let multiSignedByAdmins = {
384384 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK))
385385 then 1
386386 else 0
387387 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK))
388388 then 1
389389 else 0
390390 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK))
391391 then 1
392392 else 0
393393 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
394394 }
395395 match tx {
396396 case inv: InvokeScriptTransaction =>
397397 let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
398398 let isRightFee = if ((inv.fee == 900000))
399399 then (inv.feeAssetId == unit)
400400 else false
401401 let isInitCall = (inv.function == "init")
402402 let isnoPayments = (size(inv.payments) == 0)
403403 if (if (if (if (isRightFee)
404404 then isInitCall
405405 else false)
406406 then isSelf
407407 else false)
408408 then isnoPayments
409409 else false)
410410 then true
411411 else multiSignedByAdmins
412412 case _ =>
413413 multiSignedByAdmins
414414 }
415415 }
416416

github/deemru/w8io/026f985 
75.34 ms