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:BgI0CAISABIDCgEIEgMKAQgSBwoFCAgICAESABIDCgEBEgASABIDCgEIEgUKAwgICBIAEgASACMABlNDQUxFOACAwtcvAA1QRVJDRU5UX1NDQUxFAJBOAAlTRVBBUkFUT1ICAl9fAAlrSW50ZXJlc3QCCGludGVyZXN0AA1rVXNlckludGVyZXN0Ag1fdXNlckludGVyZXN0AA5rVXNlckF2YWlsYWJsZQITX3VzZXJBdmFpbGFibGVDbGFpbQAQa1VzZXJUb2tlblN0YWtlZAIQX3VzZXJUb2tlblN0YWtlZAARa1RvdGFsVG9rZW5TdGFrZWQCEHRvdGFsVG9rZW5TdGFrZWQADGtORlRJbnRlcmVzdAILTkZUSW50ZXJlc3QAEGtORlRVc2VySW50ZXJlc3QCEF9ORlRVc2VySW50ZXJlc3QAFmtORlRVc2VyQXZhaWxhYmxlQ2xhaW0CFl9ORlRVc2VyQXZhaWxhYmxlQ2xhaW0AD2tORlRUb3RhbFN0YW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ViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAgQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EA2ludgUHJG1hdGNoMAQGaXNTZWxmCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BAppc1JpZ2h0RmVlAwkAAAIIBQNpbnYDZmVlAKD3NgkAAAIIBQNpbnYKZmVlQXNzZXRJZAUEdW5pdAcECmlzSW5pdENhbGwJAAACCAUDaW52CGZ1bmN0aW9uAgRpbml0BAxpc25vUGF5bWVudHMJAAACCQCQAwEIBQNpbnYIcGF5bWVudHMAAAMDAwMFCmlzUmlnaHRGZWUFCmlzSW5pdENhbGwHBQZpc1NlbGYHBQxpc25vUGF5bWVudHMHBgUTbXVsdGlTaWduZWRCeUFkbWlucwUTbXVsdGlTaWduZWRCeUFkbWluc4VqVYU=", "height": 2756590, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AKGttLNzSenSUFncf6Fvw7QtGpfed3SZdZLNMWcCH6B3 Next: B6XsqtpfhnLBRPBPkyqoX2gZYPs1Tas714q4N4KJTMPH Diff:
Old | New | Differences | |
---|---|---|---|
302 | 302 | @Callable(i) | |
303 | 303 | func unstakeNFT (id) = valueOrElse(isActive(), { | |
304 | 304 | let user = toString(i.caller) | |
305 | - | if (isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId)))) | |
305 | + | if (!(isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId))))) | |
306 | 306 | then throw("You didn't staked") | |
307 | 307 | else { | |
308 | - | let $ | |
309 | - | let userNewInterest = $ | |
310 | - | let claimAmountAvailable = $ | |
311 | - | let userNFTStaked = $ | |
312 | - | let totalNFTStaked = $ | |
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 | |
313 | 313 | [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))] | |
314 | 314 | } | |
315 | 315 | }) | |
334 | 334 | func airdrop () = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if ((size(i.payments) != 1)) | |
335 | 335 | then throw("One payment expected") | |
336 | 336 | else { | |
337 | - | let $ | |
338 | - | let pmtAmount = $ | |
339 | - | let pmtAssetId = $ | |
337 | + | let $t01118311258 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
338 | + | let pmtAmount = $t01118311258._1 | |
339 | + | let pmtAssetId = $t01118311258._2 | |
340 | 340 | if ((pmtAssetId != fromBase58String(tokenId))) | |
341 | 341 | then throw("Wrong payment asset") | |
342 | 342 | else { | |
345 | 345 | let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0) | |
346 | 346 | let curInterest = valueOrElse(getInteger(this, kInterest), 0) | |
347 | 347 | let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0) | |
348 | - | let $ | |
348 | + | let $t01168111885 = if ((totalNFTStaked == 0)) | |
349 | 349 | then $Tuple2(0, pmtAmount) | |
350 | 350 | else { | |
351 | 351 | let nftP = fraction(pmtAmount, min([percentForNFT, (totalNFTStaked * 10)]), 100) | |
352 | 352 | $Tuple2(nftP, (pmtAmount - nftP)) | |
353 | 353 | } | |
354 | - | let pmtNFT = $ | |
355 | - | let pmtToken = $ | |
354 | + | let pmtNFT = $t01168111885._1 | |
355 | + | let pmtToken = $t01168111885._2 | |
356 | 356 | let interestNew = if ((totalTokenStaked > 0)) | |
357 | 357 | then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked)) | |
358 | 358 | else curInterest |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 100000000 | |
5 | 5 | ||
6 | 6 | let PERCENT_SCALE = 10000 | |
7 | 7 | ||
8 | 8 | let SEPARATOR = "__" | |
9 | 9 | ||
10 | 10 | let kInterest = "interest" | |
11 | 11 | ||
12 | 12 | let kUserInterest = "_userInterest" | |
13 | 13 | ||
14 | 14 | let kUserAvailable = "_userAvailableClaim" | |
15 | 15 | ||
16 | 16 | let kUserTokenStaked = "_userTokenStaked" | |
17 | 17 | ||
18 | 18 | let kTotalTokenStaked = "totalTokenStaked" | |
19 | 19 | ||
20 | 20 | let kNFTInterest = "NFTInterest" | |
21 | 21 | ||
22 | 22 | let kNFTUserInterest = "_NFTUserInterest" | |
23 | 23 | ||
24 | 24 | let kNFTUserAvailableClaim = "_NFTUserAvailableClaim" | |
25 | 25 | ||
26 | 26 | let kNFTTotalStaked = "NFTTotalStaked" | |
27 | 27 | ||
28 | 28 | let kuserNFTStaked = "_userNFTStaked" | |
29 | 29 | ||
30 | 30 | let kuserNFTStakedId = "_userNFTStakedId" | |
31 | 31 | ||
32 | 32 | let kNFTCreated = "_NFTCreated" | |
33 | 33 | ||
34 | 34 | let kLastAirdrop = "_lastAirdrop" | |
35 | 35 | ||
36 | 36 | let kTokenid = "tokenId" | |
37 | 37 | ||
38 | 38 | let kPersentForNFT = "percentForNFT" | |
39 | 39 | ||
40 | 40 | let kNFTCreatedList = "nftCreatedList" | |
41 | 41 | ||
42 | 42 | let kActive = "active" | |
43 | 43 | ||
44 | 44 | let kAdmin1PK = "admin_pub_1" | |
45 | 45 | ||
46 | 46 | let kAdmin2PK = "admin_pub_2" | |
47 | 47 | ||
48 | 48 | let kAdmin3PK = "admin_pub_3" | |
49 | 49 | ||
50 | 50 | let admin1PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin1PK), "Can't get admin1PK")) | |
51 | 51 | ||
52 | 52 | let admin2PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin2PK), "Can't get admin2PK")) | |
53 | 53 | ||
54 | 54 | let admin3PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin3PK), "Can't get operatorPK")) | |
55 | 55 | ||
56 | 56 | let tokenId = valueOrErrorMessage(getString(this, kTokenid), "Can't get staking token") | |
57 | 57 | ||
58 | 58 | func isAdminCall (i) = if (containsElement([admin1PK, admin2PK, admin3PK], i.callerPublicKey)) | |
59 | 59 | then unit | |
60 | 60 | else throw("Only admin can call this function") | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func isSelfCall (i) = if ((i.caller == this)) | |
64 | 64 | then unit | |
65 | 65 | else throw("Only contract itself can call this function") | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func isActive () = if (valueOrElse(getBoolean(this, kActive), true)) | |
69 | 69 | then unit | |
70 | 70 | else throw("DApp is inactive at this moment") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func assetIdToStr (assetId) = match assetId { | |
74 | 74 | case id: ByteVector => | |
75 | 75 | toBase58String(id) | |
76 | 76 | case waves: Unit => | |
77 | 77 | "WAVES" | |
78 | 78 | case _ => | |
79 | 79 | throw("Not Asset id") | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func claimCalc (user) = { | |
84 | 84 | let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0) | |
85 | 85 | let curInterest = valueOrElse(getInteger(this, kInterest), 0) | |
86 | 86 | let availableForClaim = valueOrElse(getInteger(this, (user + kUserAvailable)), 0) | |
87 | 87 | let userInterest = valueOrElse(getInteger(this, (user + kUserInterest)), curInterest) | |
88 | 88 | let userTokenStaked = valueOrElse(getInteger(this, (user + kUserTokenStaked)), 0) | |
89 | 89 | let claimAmount = fraction(userTokenStaked, (curInterest - userInterest), SCALE8) | |
90 | 90 | $Tuple4(curInterest, (claimAmount + availableForClaim), userTokenStaked, totalTokenStaked) | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func claimCalcNft (user) = { | |
95 | 95 | let totalNftStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0) | |
96 | 96 | let curInterest = valueOrElse(getInteger(this, kNFTInterest), 0) | |
97 | 97 | let availableForClaim = valueOrElse(getInteger(this, (user + kNFTUserAvailableClaim)), 0) | |
98 | 98 | let userInterest = valueOrElse(getInteger(this, (user + kNFTUserInterest)), curInterest) | |
99 | 99 | let userNftStaked = valueOrElse(getInteger(this, (user + kuserNFTStaked)), 0) | |
100 | 100 | let claimAmount = (userNftStaked * (curInterest - userInterest)) | |
101 | 101 | $Tuple4(curInterest, (claimAmount + availableForClaim), userNftStaked, totalNftStaked) | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func calcTokenApr () = { | |
106 | 106 | let lastAirdrop = valueOrElse(getInteger(this, kLastAirdrop), 0) | |
107 | 107 | let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0) | |
108 | 108 | let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0) | |
109 | 109 | let percentForNFT = getIntegerValue(this, kPersentForNFT) | |
110 | 110 | let tokenAirdrop = if ((totalNFTStaked == 0)) | |
111 | 111 | then lastAirdrop | |
112 | 112 | else fraction(lastAirdrop, min([percentForNFT, (totalNFTStaked * 10)]), 100) | |
113 | 113 | (fraction(tokenAirdrop, PERCENT_SCALE, totalTokenStaked) * 52) | |
114 | 114 | } | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getUserStakedNFT (user) = { | |
118 | 118 | func forNft (uNFT,nftId) = if (isDefined(getBoolean(this, (((user + "_") + nftId) + kuserNFTStakedId)))) | |
119 | 119 | then (uNFT :+ nftId) | |
120 | 120 | else uNFT | |
121 | 121 | ||
122 | 122 | let nftsStr = valueOrElse(getString(this, kNFTCreatedList), "") | |
123 | 123 | let nftList = if ((nftsStr == "")) | |
124 | 124 | then nil | |
125 | 125 | else split(nftsStr, SEPARATOR) | |
126 | 126 | let userNfts = { | |
127 | 127 | let $l = nftList | |
128 | 128 | let $s = size($l) | |
129 | 129 | let $acc0 = nil | |
130 | 130 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
131 | 131 | then $a | |
132 | 132 | else forNft($a, $l[$i]) | |
133 | 133 | ||
134 | 134 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
135 | 135 | then $a | |
136 | 136 | else throw("List size exceeds 5") | |
137 | 137 | ||
138 | 138 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
139 | 139 | } | |
140 | 140 | makeString(userNfts, ",") | |
141 | 141 | } | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | @Callable(i) | |
145 | 145 | func getStatsREADONLY () = { | |
146 | 146 | let apr = calcTokenApr() | |
147 | 147 | let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0) | |
148 | 148 | let totalNftStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0) | |
149 | 149 | $Tuple2(nil, makeString(["%d%d%d", toString(apr), toString(totalTokenStaked), toString(totalNftStaked)], SEPARATOR)) | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | @Callable(i) | |
155 | 155 | func getStatsByUserREADONLY (user) = { | |
156 | 156 | let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address") | |
157 | 157 | let $t044944590 = claimCalc(user) | |
158 | 158 | let userNewInterest = $t044944590._1 | |
159 | 159 | let claimAmountAvailable = $t044944590._2 | |
160 | 160 | let userTokenStaked = $t044944590._3 | |
161 | 161 | let totalTokenStaked = $t044944590._4 | |
162 | 162 | let $t045934694 = claimCalcNft(user) | |
163 | 163 | let userNewInterestNFT = $t045934694._1 | |
164 | 164 | let claimAmountAvailableNFT = $t045934694._2 | |
165 | 165 | let userNFTStaked = $t045934694._3 | |
166 | 166 | let totalNFTStaked = $t045934694._4 | |
167 | 167 | let userTokenBalance = assetBalance(userAddr, fromBase58String(tokenId)) | |
168 | 168 | let userNfts = getUserStakedNFT(user) | |
169 | 169 | $Tuple2(nil, makeString(["%d%d%d%d%s", toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT), userNfts], SEPARATOR)) | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | @Callable(i) | |
175 | 175 | func getUserStatsREADONLY (user) = { | |
176 | 176 | let apr = calcTokenApr() | |
177 | 177 | let $t051395738 = if ((user == "")) | |
178 | 178 | then $Tuple4(0, 0, 0, 0) | |
179 | 179 | else { | |
180 | 180 | let userAddr = valueOrErrorMessage(addressFromString(user), "Wrong user address") | |
181 | 181 | let $t053765472 = claimCalc(user) | |
182 | 182 | let userNewInterest = $t053765472._1 | |
183 | 183 | let claimAmountAvailable = $t053765472._2 | |
184 | 184 | let userTokenStaked = $t053765472._3 | |
185 | 185 | let totalTokenStaked = $t053765472._4 | |
186 | 186 | let $t054795580 = claimCalcNft(user) | |
187 | 187 | let userNewInterestNFT = $t054795580._1 | |
188 | 188 | let claimAmountAvailableNFT = $t054795580._2 | |
189 | 189 | let userNFTStaked = $t054795580._3 | |
190 | 190 | let totalNFTStaked = $t054795580._4 | |
191 | 191 | let userBalance = assetBalance(userAddr, fromBase58String(tokenId)) | |
192 | 192 | $Tuple4(userBalance, userTokenStaked, claimAmountAvailable, claimAmountAvailableNFT) | |
193 | 193 | } | |
194 | 194 | let userTokenBalance = $t051395738._1 | |
195 | 195 | let userTokenStaked = $t051395738._2 | |
196 | 196 | let claimAmountAvailable = $t051395738._3 | |
197 | 197 | let claimAmountAvailableNFT = $t051395738._4 | |
198 | 198 | $Tuple2(nil, makeString(["%d%d%d%d%d", toString(apr), toString(userTokenBalance), toString(userTokenStaked), toString(claimAmountAvailable), toString(claimAmountAvailableNFT)], SEPARATOR)) | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | ||
203 | 203 | @Callable(i) | |
204 | 204 | func init (tokenId,adm1Pub,adm2Pub,adm3Pub,toNFTPercent) = valueOrElse(isSelfCall(i), if (isDefined(getString(this, kTokenid))) | |
205 | 205 | then throw("DApp already inited") | |
206 | 206 | else if (!(isDefined(assetInfo(fromBase58String(tokenId))))) | |
207 | 207 | then throw("asset id is not correct asset id") | |
208 | 208 | else if ((size(fromBase58String(adm1Pub)) != 32)) | |
209 | 209 | then throw("group1Admin1PubKey is not correct") | |
210 | 210 | else if ((size(fromBase58String(adm2Pub)) != 32)) | |
211 | 211 | then throw("group1Admin1PubKey is not correct") | |
212 | 212 | else if ((size(fromBase58String(adm3Pub)) != 32)) | |
213 | 213 | then throw("group1Admin1PubKey is not correct") | |
214 | 214 | else [StringEntry(kTokenid, tokenId), StringEntry(kAdmin1PK, adm1Pub), StringEntry(kAdmin2PK, adm2Pub), StringEntry(kAdmin3PK, adm3Pub), IntegerEntry(kPersentForNFT, toNFTPercent)]) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | ||
218 | 218 | @Callable(i) | |
219 | 219 | func stake () = valueOrElse(isActive(), if ((size(i.payments) != 1)) | |
220 | 220 | then throw("One payment expected") | |
221 | 221 | else { | |
222 | 222 | let $t069417016 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
223 | 223 | let pmtAmount = $t069417016._1 | |
224 | 224 | let pmtAssetId = $t069417016._2 | |
225 | 225 | if ((pmtAssetId != fromBase58String(tokenId))) | |
226 | 226 | then throw("Wrong payment asset") | |
227 | 227 | else { | |
228 | 228 | let user = toString(i.caller) | |
229 | 229 | let $t071377233 = claimCalc(user) | |
230 | 230 | let userNewInterest = $t071377233._1 | |
231 | 231 | let claimAmountAvailable = $t071377233._2 | |
232 | 232 | let userTokenStaked = $t071377233._3 | |
233 | 233 | let totalTokenStaked = $t071377233._4 | |
234 | 234 | [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked + pmtAmount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked + pmtAmount))] | |
235 | 235 | } | |
236 | 236 | }) | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | ||
240 | 240 | @Callable(i) | |
241 | 241 | func unstake (amount) = valueOrElse(isActive(), { | |
242 | 242 | let user = toString(i.caller) | |
243 | 243 | if ((0 >= amount)) | |
244 | 244 | then throw("Amount must be greater than 0") | |
245 | 245 | else { | |
246 | 246 | let $t076717767 = claimCalc(user) | |
247 | 247 | let userNewInterest = $t076717767._1 | |
248 | 248 | let claimAmountAvailable = $t076717767._2 | |
249 | 249 | let userTokenStaked = $t076717767._3 | |
250 | 250 | let totalTokenStaked = $t076717767._4 | |
251 | 251 | if ((amount > userTokenStaked)) | |
252 | 252 | then throw("You can't unstake more than staked") | |
253 | 253 | else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked - amount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked - amount)), ScriptTransfer(i.caller, amount, fromBase58String(tokenId))] | |
254 | 254 | } | |
255 | 255 | }) | |
256 | 256 | ||
257 | 257 | ||
258 | 258 | ||
259 | 259 | @Callable(i) | |
260 | 260 | func claim () = valueOrElse(isActive(), { | |
261 | 261 | let user = toString(i.caller) | |
262 | 262 | let $t082738369 = claimCalc(user) | |
263 | 263 | let userNewInterest = $t082738369._1 | |
264 | 264 | let claimAmountAvailable = $t082738369._2 | |
265 | 265 | let userTokenStaked = $t082738369._3 | |
266 | 266 | let totalTokenStaked = $t082738369._4 | |
267 | 267 | let $t083728473 = claimCalcNft(user) | |
268 | 268 | let userNewInterestNFT = $t083728473._1 | |
269 | 269 | let claimAmountAvailableNFT = $t083728473._2 | |
270 | 270 | let userNFTStaked = $t083728473._3 | |
271 | 271 | let totalNFTStaked = $t083728473._4 | |
272 | 272 | if (((claimAmountAvailable + claimAmountAvailableNFT) == 0)) | |
273 | 273 | then throw("Nothing to claim") | |
274 | 274 | else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), 0), IntegerEntry((user + kNFTUserInterest), userNewInterestNFT), IntegerEntry((user + kNFTUserAvailableClaim), 0), ScriptTransfer(i.caller, (claimAmountAvailable + claimAmountAvailableNFT), fromBase58String(tokenId))] | |
275 | 275 | }) | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | ||
279 | 279 | @Callable(i) | |
280 | 280 | func stakeNFT () = valueOrElse(isActive(), if ((size(i.payments) != 1)) | |
281 | 281 | then throw("One payment expected") | |
282 | 282 | else { | |
283 | 283 | let $t090299104 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
284 | 284 | let pmtAmount = $t090299104._1 | |
285 | 285 | let pmtAssetId = $t090299104._2 | |
286 | 286 | let pmtAssetIdStr = assetIdToStr(pmtAssetId) | |
287 | 287 | if (!(isDefined(getString(this, (pmtAssetIdStr + kNFTCreated))))) | |
288 | 288 | then throw("Wrong nft asset") | |
289 | 289 | else { | |
290 | 290 | let user = toString(i.caller) | |
291 | 291 | let $t092859380 = claimCalcNft(user) | |
292 | 292 | let userNewInterest = $t092859380._1 | |
293 | 293 | let claimAmountAvailable = $t092859380._2 | |
294 | 294 | let userNFTStaked = $t092859380._3 | |
295 | 295 | let totalNFTStaked = $t092859380._4 | |
296 | 296 | [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked + 1)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked + 1)), BooleanEntry((((user + "_") + pmtAssetIdStr) + kuserNFTStakedId), true)] | |
297 | 297 | } | |
298 | 298 | }) | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | ||
302 | 302 | @Callable(i) | |
303 | 303 | func unstakeNFT (id) = valueOrElse(isActive(), { | |
304 | 304 | let user = toString(i.caller) | |
305 | - | if (isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId)))) | |
305 | + | if (!(isDefined(getBoolean(this, (((user + "_") + id) + kuserNFTStakedId))))) | |
306 | 306 | then throw("You didn't staked") | |
307 | 307 | else { | |
308 | - | let $ | |
309 | - | let userNewInterest = $ | |
310 | - | let claimAmountAvailable = $ | |
311 | - | let userNFTStaked = $ | |
312 | - | let totalNFTStaked = $ | |
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 | |
313 | 313 | [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))] | |
314 | 314 | } | |
315 | 315 | }) | |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | 319 | @Callable(i) | |
320 | 320 | func issueNFT (userAddr,name,descr) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), { | |
321 | 321 | let uAddr = valueOrErrorMessage(addressFromString(userAddr), "Wrong user address") | |
322 | 322 | let issue = Issue(name, descr, 1, 0, false) | |
323 | 323 | let nftId = calculateAssetId(issue) | |
324 | 324 | let nftList = valueOrElse(getString(this, kNFTCreatedList), "") | |
325 | 325 | let newNftList = (nftList + (if ((nftList != "")) | |
326 | 326 | then (SEPARATOR + toBase58String(nftId)) | |
327 | 327 | else ("" + toBase58String(nftId)))) | |
328 | 328 | [issue, StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), StringEntry(kNFTCreatedList, newNftList), ScriptTransfer(uAddr, 1, nftId)] | |
329 | 329 | })) | |
330 | 330 | ||
331 | 331 | ||
332 | 332 | ||
333 | 333 | @Callable(i) | |
334 | 334 | func airdrop () = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if ((size(i.payments) != 1)) | |
335 | 335 | then throw("One payment expected") | |
336 | 336 | else { | |
337 | - | let $ | |
338 | - | let pmtAmount = $ | |
339 | - | let pmtAssetId = $ | |
337 | + | let $t01118311258 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
338 | + | let pmtAmount = $t01118311258._1 | |
339 | + | let pmtAssetId = $t01118311258._2 | |
340 | 340 | if ((pmtAssetId != fromBase58String(tokenId))) | |
341 | 341 | then throw("Wrong payment asset") | |
342 | 342 | else { | |
343 | 343 | let percentForNFT = getIntegerValue(this, kPersentForNFT) | |
344 | 344 | let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0) | |
345 | 345 | let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0) | |
346 | 346 | let curInterest = valueOrElse(getInteger(this, kInterest), 0) | |
347 | 347 | let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0) | |
348 | - | let $ | |
348 | + | let $t01168111885 = if ((totalNFTStaked == 0)) | |
349 | 349 | then $Tuple2(0, pmtAmount) | |
350 | 350 | else { | |
351 | 351 | let nftP = fraction(pmtAmount, min([percentForNFT, (totalNFTStaked * 10)]), 100) | |
352 | 352 | $Tuple2(nftP, (pmtAmount - nftP)) | |
353 | 353 | } | |
354 | - | let pmtNFT = $ | |
355 | - | let pmtToken = $ | |
354 | + | let pmtNFT = $t01168111885._1 | |
355 | + | let pmtToken = $t01168111885._2 | |
356 | 356 | let interestNew = if ((totalTokenStaked > 0)) | |
357 | 357 | then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked)) | |
358 | 358 | else curInterest | |
359 | 359 | let interestNFTNew = if ((totalNFTStaked > 0)) | |
360 | 360 | then (curNFTInterest + (pmtNFT / totalNFTStaked)) | |
361 | 361 | else curNFTInterest | |
362 | 362 | [IntegerEntry(kInterest, interestNew), IntegerEntry(kNFTInterest, interestNFTNew), IntegerEntry(kLastAirdrop, pmtAmount)] | |
363 | 363 | } | |
364 | 364 | })) | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | ||
368 | 368 | @Callable(i) | |
369 | 369 | func activate () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActive), true)) | |
370 | 370 | then throw("dApp already active") | |
371 | 371 | else [BooleanEntry(kActive, true)]) | |
372 | 372 | ||
373 | 373 | ||
374 | 374 | ||
375 | 375 | @Callable(i) | |
376 | 376 | func shutdown () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActive), true))) | |
377 | 377 | then throw("dApp already shutdown") | |
378 | 378 | else [BooleanEntry(kActive, false)]) | |
379 | 379 | ||
380 | 380 | ||
381 | 381 | @Verifier(tx) | |
382 | 382 | func verify () = { | |
383 | 383 | let multiSignedByAdmins = { | |
384 | 384 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK)) | |
385 | 385 | then 1 | |
386 | 386 | else 0 | |
387 | 387 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK)) | |
388 | 388 | then 1 | |
389 | 389 | else 0 | |
390 | 390 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK)) | |
391 | 391 | then 1 | |
392 | 392 | else 0 | |
393 | 393 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
394 | 394 | } | |
395 | 395 | match tx { | |
396 | 396 | case inv: InvokeScriptTransaction => | |
397 | 397 | let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
398 | 398 | let isRightFee = if ((inv.fee == 900000)) | |
399 | 399 | then (inv.feeAssetId == unit) | |
400 | 400 | else false | |
401 | 401 | let isInitCall = (inv.function == "init") | |
402 | 402 | let isnoPayments = (size(inv.payments) == 0) | |
403 | 403 | if (if (if (if (isRightFee) | |
404 | 404 | then isInitCall | |
405 | 405 | else false) | |
406 | 406 | then isSelf | |
407 | 407 | else false) | |
408 | 408 | then isnoPayments | |
409 | 409 | else false) | |
410 | 410 | then true | |
411 | 411 | else multiSignedByAdmins | |
412 | 412 | case _ => | |
413 | 413 | multiSignedByAdmins | |
414 | 414 | } | |
415 | 415 | } | |
416 | 416 |
github/deemru/w8io/026f985 75.34 ms ◑