tx · 8T6vEMJpsX79mNPztRcnRGziBV7db3ebeAQgRM93bTb9 3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4: -0.05000000 Waves 2023.08.28 09:56 [2730190] smart account 3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4 > SELF 0.00000000 Waves
{ "type": 13, "id": "8T6vEMJpsX79mNPztRcnRGziBV7db3ebeAQgRM93bTb9", "fee": 5000000, "feeAssetId": null, "timestamp": 1693205821882, "version": 2, "chainId": 84, "sender": "3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4", "senderPublicKey": "DU1U4j8FqHUMRr9WgfF3yo67ULEFkjp7dtMWMpjBK1ar", "proofs": [ "3iVrrEp4kRu1moNYASzgrDZr8cR9QFxE9r8KvRgkLdRKrraWEZVnnzCSSHkXuR3bsQhmKSDEW4E1g5HszvXpPg1", "4hy8Kwx6Q6Ji1gve1kf6urB7ByEuvixFHPhiH2k1owTD5RZ9dzhCSXKiuD3cZtdbCGS2BkdzVp9Hqz8hxvfHBnvZ" ], "script": "base64:BgImCAISBwoFCAgICAESABIDCgEBEgASABIDCgEIEgASBQoDCAgIEgAbAAZTQ0FMRTgAgMLXLwAJa0ludGVyZXN0AghpbnRlcmVzdAANa1VzZXJJbnRlcmVzdAINX3VzZXJJbnRlcmVzdAAOa1VzZXJBdmFpbGFibGUCE191c2VyQXZhaWxhYmxlQ2xhaW0AEGtVc2VyVG9rZW5TdGFrZWQCEF91c2VyVG9rZW5TdGFrZWQAEWtUb3RhbFRva2VuU3Rha2VkAhB0b3RhbFRva2VuU3Rha2VkAAxrTkZUSW50ZXJlc3QCC05GVEludGVyZXN0ABBrTkZUVXNlckludGVyZXN0AhBfTkZUVXNlckludGVyZXN0ABZrTkZUVXNlckF2YWlsYWJsZUNsYWltAhZfTkZUVXNlckF2YWlsYWJsZUNsYWltAA9rTkZUVG90YWxTdGFrZWQCDk5GVFRvdGFsU3Rha2VkAA5rdXNlck5GVFN0YWtlZAIOX3VzZXJORlRTd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V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFCGFkbWluMlBLAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUIYWRtaW4zUEsAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBANpbnYFByRtYXRjaDAEBmlzU2VsZgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQKaXNSaWdodEZlZQMJAAACCAUDaW52A2ZlZQCg9zYJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHBAppc0luaXRDYWxsCQAAAggFA2ludghmdW5jdGlvbgIEaW5pdAQMaXNub1BheW1lbnRzCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAADAwMDBQppc1JpZ2h0RmVlBQppc0luaXRDYWxsBwUGaXNTZWxmBwUMaXNub1BheW1lbnRzBwYFE211bHRpU2lnbmVkQnlBZG1pbnMFE211bHRpU2lnbmVkQnlBZG1pbnPlenIK", "height": 2730190, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J5SDjSBRijMgCTmtGHGSL1xvahTHYiUBVjDSDLS1kHLB Next: JCcveBURngrSofoCxyUV2Ki6TcFZu1x6FkUHCdQXfdt7 Diff:
Old | New | Differences | |
---|---|---|---|
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(i) | |
91 | - | func init (tokenId,adm1Pub,adm2Pub,adm3Pub,toNFTPercent) = valueOrElse(isSelfCall(i), if ( | |
92 | - | then throw(" | |
93 | - | else if (( | |
94 | - | then throw(" | |
95 | - | else if ((size(fromBase58String( | |
91 | + | func init (tokenId,adm1Pub,adm2Pub,adm3Pub,toNFTPercent) = valueOrElse(isSelfCall(i), if (isDefined(getString(this, kTokenid))) | |
92 | + | then throw("DApp already inited") | |
93 | + | else if (!(isDefined(assetInfo(fromBase58String(tokenId))))) | |
94 | + | then throw("asset id is not correct asset id") | |
95 | + | else if ((size(fromBase58String(adm1Pub)) != 32)) | |
96 | 96 | then throw("group1Admin1PubKey is not correct") | |
97 | - | else if ((size(fromBase58String( | |
97 | + | else if ((size(fromBase58String(adm2Pub)) != 32)) | |
98 | 98 | then throw("group1Admin1PubKey is not correct") | |
99 | - | else [StringEntry(kTokenid, tokenId), StringEntry(kAdmin1PK, adm1Pub), StringEntry(kAdmin2PK, adm2Pub), StringEntry(kAdmin3PK, adm3Pub), IntegerEntry(kPersentForNFT, toNFTPercent)]) | |
99 | + | else if ((size(fromBase58String(adm3Pub)) != 32)) | |
100 | + | then throw("group1Admin1PubKey is not correct") | |
101 | + | else [StringEntry(kTokenid, tokenId), StringEntry(kAdmin1PK, adm1Pub), StringEntry(kAdmin2PK, adm2Pub), StringEntry(kAdmin3PK, adm3Pub), IntegerEntry(kPersentForNFT, toNFTPercent)]) | |
100 | 102 | ||
101 | 103 | ||
102 | 104 | ||
104 | 106 | func stake () = if ((size(i.payments) != 1)) | |
105 | 107 | then throw("One payment expected") | |
106 | 108 | else { | |
107 | - | let $ | |
108 | - | let pmtAmount = $ | |
109 | - | let pmtAssetId = $ | |
109 | + | let $t036953770 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
110 | + | let pmtAmount = $t036953770._1 | |
111 | + | let pmtAssetId = $t036953770._2 | |
110 | 112 | if ((pmtAssetId != fromBase58String(tokenId))) | |
111 | 113 | then throw("Wrong payment asset") | |
112 | 114 | else { | |
113 | 115 | let user = toString(i.caller) | |
114 | - | let $ | |
115 | - | let userNewInterest = $ | |
116 | - | let claimAmountAvailable = $ | |
117 | - | let userTokenStaked = $ | |
118 | - | let totalTokenStaked = $ | |
116 | + | let $t038913987 = claimCalc(user) | |
117 | + | let userNewInterest = $t038913987._1 | |
118 | + | let claimAmountAvailable = $t038913987._2 | |
119 | + | let userTokenStaked = $t038913987._3 | |
120 | + | let totalTokenStaked = $t038913987._4 | |
119 | 121 | [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked + pmtAmount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked + pmtAmount))] | |
120 | 122 | } | |
121 | 123 | } | |
128 | 130 | if ((0 >= amount)) | |
129 | 131 | then throw("Amount must be greater than 0") | |
130 | 132 | else { | |
131 | - | let $ | |
132 | - | let userNewInterest = $ | |
133 | - | let claimAmountAvailable = $ | |
134 | - | let userTokenStaked = $ | |
135 | - | let totalTokenStaked = $ | |
133 | + | let $t044014497 = claimCalc(user) | |
134 | + | let userNewInterest = $t044014497._1 | |
135 | + | let claimAmountAvailable = $t044014497._2 | |
136 | + | let userTokenStaked = $t044014497._3 | |
137 | + | let totalTokenStaked = $t044014497._4 | |
136 | 138 | if ((amount > userTokenStaked)) | |
137 | 139 | then throw("You can't unstake more than staked") | |
138 | 140 | else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked - amount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked - amount))] | |
144 | 146 | @Callable(i) | |
145 | 147 | func claim () = { | |
146 | 148 | let user = toString(i.caller) | |
147 | - | let $ | |
148 | - | let userNewInterest = $ | |
149 | - | let claimAmountAvailable = $ | |
150 | - | let userTokenStaked = $ | |
151 | - | let totalTokenStaked = $ | |
149 | + | let $t049135009 = claimCalc(user) | |
150 | + | let userNewInterest = $t049135009._1 | |
151 | + | let claimAmountAvailable = $t049135009._2 | |
152 | + | let userTokenStaked = $t049135009._3 | |
153 | + | let totalTokenStaked = $t049135009._4 | |
152 | 154 | if ((claimAmountAvailable == 0)) | |
153 | 155 | then throw("Nothing to claim") | |
154 | 156 | else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), 0), ScriptTransfer(i.caller, claimAmountAvailable, fromBase58String(tokenId))] | |
160 | 162 | func stakeNFT () = if ((size(i.payments) != 0)) | |
161 | 163 | then throw("One payment expected") | |
162 | 164 | else { | |
163 | - | let $ | |
164 | - | let pmtAmount = $ | |
165 | - | let pmtAssetId = $ | |
165 | + | let $t053745449 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
166 | + | let pmtAmount = $t053745449._1 | |
167 | + | let pmtAssetId = $t053745449._2 | |
166 | 168 | let pmtAssetIdStr = assetIdToStr(pmtAssetId) | |
167 | 169 | if (!(isDefined(getString(this, (pmtAssetIdStr + kNFTCreated))))) | |
168 | 170 | then throw("Wrong nft asset") | |
169 | 171 | else { | |
170 | 172 | let user = toString(i.caller) | |
171 | - | let $ | |
172 | - | let userNewInterest = $ | |
173 | - | let claimAmountAvailable = $ | |
174 | - | let userNFTStaked = $ | |
175 | - | let totalNFTStaked = $ | |
173 | + | let $t056305725 = claimCalcNft(user) | |
174 | + | let userNewInterest = $t056305725._1 | |
175 | + | let claimAmountAvailable = $t056305725._2 | |
176 | + | let userNFTStaked = $t056305725._3 | |
177 | + | let totalNFTStaked = $t056305725._4 | |
176 | 178 | [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked + pmtAmount)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked + pmtAmount)), IntegerEntry((((user + "_") + pmtAssetIdStr) + kuserNFTStakedId), 1)] | |
177 | 179 | } | |
178 | 180 | } | |
185 | 187 | if (isDefined(getString(this, (((user + id) + "_") + kuserNFTStakedId)))) | |
186 | 188 | then throw("You didn't staked") | |
187 | 189 | else { | |
188 | - | let $ | |
189 | - | let userNewInterest = $ | |
190 | - | let claimAmountAvailable = $ | |
191 | - | let userNFTStaked = $ | |
192 | - | let totalNFTStaked = $ | |
190 | + | let $t062506345 = claimCalcNft(user) | |
191 | + | let userNewInterest = $t062506345._1 | |
192 | + | let claimAmountAvailable = $t062506345._2 | |
193 | + | let userNFTStaked = $t062506345._3 | |
194 | + | let totalNFTStaked = $t062506345._4 | |
193 | 195 | [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))] | |
194 | 196 | } | |
195 | 197 | } | |
199 | 201 | @Callable(i) | |
200 | 202 | func claimNFT () = { | |
201 | 203 | let user = toString(i.caller) | |
202 | - | let $ | |
203 | - | let userNewInterest = $ | |
204 | - | let claimAmountAvailable = $ | |
205 | - | let userNFTStaked = $ | |
206 | - | let totalNFTStaked = $ | |
204 | + | let $t067796874 = claimCalcNft(user) | |
205 | + | let userNewInterest = $t067796874._1 | |
206 | + | let claimAmountAvailable = $t067796874._2 | |
207 | + | let userNFTStaked = $t067796874._3 | |
208 | + | let totalNFTStaked = $t067796874._4 | |
207 | 209 | if ((claimAmountAvailable == 0)) | |
208 | 210 | then throw("Nothing to claim") | |
209 | 211 | else [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), 0), ScriptTransfer(i.caller, claimAmountAvailable, fromBase58String(tokenId))] | |
216 | 218 | let uAddr = valueOrErrorMessage(addressFromString(userAddr), "Wrong user address") | |
217 | 219 | let issue = Issue(name, descr, 1, 1, false) | |
218 | 220 | let nftId = calculateAssetId(issue) | |
219 | - | [StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), ScriptTransfer(uAddr, 1, nftId)] | |
221 | + | [issue, StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), ScriptTransfer(uAddr, 1, nftId)] | |
220 | 222 | }) | |
221 | 223 | ||
222 | 224 | ||
225 | 227 | func airdrop () = valueOrElse(isAdminCall(i), if ((size(i.payments) != 1)) | |
226 | 228 | then throw("One payment expected") | |
227 | 229 | else { | |
228 | - | let $ | |
229 | - | let pmtAmount = $ | |
230 | - | let pmtAssetId = $ | |
230 | + | let $t076747749 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
231 | + | let pmtAmount = $t076747749._1 | |
232 | + | let pmtAssetId = $t076747749._2 | |
231 | 233 | if ((pmtAssetId != fromBase58String(tokenId))) | |
232 | 234 | then throw("Wrong payment asset") | |
233 | 235 | else { | |
236 | 238 | let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0) | |
237 | 239 | let curInterest = valueOrElse(getInteger(this, kInterest), 0) | |
238 | 240 | let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0) | |
239 | - | let $ | |
241 | + | let $t081728347 = if ((totalNFTStaked == 0)) | |
240 | 242 | then $Tuple2(0, pmtAmount) | |
241 | 243 | else { | |
242 | 244 | let nftP = fraction(pmtAmount, percentForNFT, 100) | |
243 | 245 | $Tuple2(nftP, (pmtAmount - nftP)) | |
244 | 246 | } | |
245 | - | let pmtNFT = $ | |
246 | - | let pmtToken = $ | |
247 | + | let pmtNFT = $t081728347._1 | |
248 | + | let pmtToken = $t081728347._2 | |
247 | 249 | let interestNew = if ((totalTokenStaked > 0)) | |
248 | 250 | then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked)) | |
249 | 251 | 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 kInterest = "interest" | |
7 | 7 | ||
8 | 8 | let kUserInterest = "_userInterest" | |
9 | 9 | ||
10 | 10 | let kUserAvailable = "_userAvailableClaim" | |
11 | 11 | ||
12 | 12 | let kUserTokenStaked = "_userTokenStaked" | |
13 | 13 | ||
14 | 14 | let kTotalTokenStaked = "totalTokenStaked" | |
15 | 15 | ||
16 | 16 | let kNFTInterest = "NFTInterest" | |
17 | 17 | ||
18 | 18 | let kNFTUserInterest = "_NFTUserInterest" | |
19 | 19 | ||
20 | 20 | let kNFTUserAvailableClaim = "_NFTUserAvailableClaim" | |
21 | 21 | ||
22 | 22 | let kNFTTotalStaked = "NFTTotalStaked" | |
23 | 23 | ||
24 | 24 | let kuserNFTStaked = "_userNFTStaked" | |
25 | 25 | ||
26 | 26 | let kuserNFTStakedId = "_userNFTStakedId" | |
27 | 27 | ||
28 | 28 | let kNFTCreated = "_NFTCreated" | |
29 | 29 | ||
30 | 30 | let kTokenid = "tokenId" | |
31 | 31 | ||
32 | 32 | let kPersentForNFT = "percentForNFT" | |
33 | 33 | ||
34 | 34 | let kAdmin1PK = "admin_pub_1" | |
35 | 35 | ||
36 | 36 | let kAdmin2PK = "admin_pub_2" | |
37 | 37 | ||
38 | 38 | let kAdmin3PK = "admin_pub_3" | |
39 | 39 | ||
40 | 40 | let admin1PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin1PK), "Can't get admin1PK")) | |
41 | 41 | ||
42 | 42 | let admin2PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin2PK), "Can't get admin2PK")) | |
43 | 43 | ||
44 | 44 | let admin3PK = fromBase58String(valueOrErrorMessage(getString(this, kAdmin3PK), "Can't get operatorPK")) | |
45 | 45 | ||
46 | 46 | let tokenId = valueOrErrorMessage(getString(this, kTokenid), "Can't get staking token") | |
47 | 47 | ||
48 | 48 | func isAdminCall (i) = if (containsElement([admin1PK, admin2PK, admin3PK], i.callerPublicKey)) | |
49 | 49 | then unit | |
50 | 50 | else throw("Only admin can call this function") | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func isSelfCall (i) = if ((i.caller == this)) | |
54 | 54 | then unit | |
55 | 55 | else throw("Only contract itself can call this function") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func assetIdToStr (assetId) = match assetId { | |
59 | 59 | case id: ByteVector => | |
60 | 60 | toBase58String(id) | |
61 | 61 | case waves: Unit => | |
62 | 62 | "WAVES" | |
63 | 63 | case _ => | |
64 | 64 | throw("Not Asset id") | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func claimCalc (user) = { | |
69 | 69 | let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0) | |
70 | 70 | let curInterest = valueOrElse(getInteger(this, kInterest), 0) | |
71 | 71 | let availableForClaim = valueOrElse(getInteger(this, (user + kUserAvailable)), 0) | |
72 | 72 | let userInterest = valueOrElse(getInteger(this, (user + kUserInterest)), curInterest) | |
73 | 73 | let userTokenStaked = valueOrElse(getInteger(this, (user + kUserTokenStaked)), 0) | |
74 | 74 | let claimAmount = fraction(userTokenStaked, (curInterest - userInterest), SCALE8) | |
75 | 75 | $Tuple4(curInterest, (claimAmount + availableForClaim), userTokenStaked, totalTokenStaked) | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func claimCalcNft (user) = { | |
80 | 80 | let totalNftStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0) | |
81 | 81 | let curInterest = valueOrElse(getInteger(this, kNFTInterest), 0) | |
82 | 82 | let availableForClaim = valueOrElse(getInteger(this, (user + kNFTUserAvailableClaim)), 0) | |
83 | 83 | let userInterest = valueOrElse(getInteger(this, (user + kNFTUserInterest)), curInterest) | |
84 | 84 | let userNftStaked = valueOrElse(getInteger(this, (user + kuserNFTStaked)), 0) | |
85 | 85 | let claimAmount = fraction(userNftStaked, (curInterest - userInterest), SCALE8) | |
86 | 86 | $Tuple4(curInterest, (claimAmount + availableForClaim), userNftStaked, totalNftStaked) | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(i) | |
91 | - | func init (tokenId,adm1Pub,adm2Pub,adm3Pub,toNFTPercent) = valueOrElse(isSelfCall(i), if ( | |
92 | - | then throw(" | |
93 | - | else if (( | |
94 | - | then throw(" | |
95 | - | else if ((size(fromBase58String( | |
91 | + | func init (tokenId,adm1Pub,adm2Pub,adm3Pub,toNFTPercent) = valueOrElse(isSelfCall(i), if (isDefined(getString(this, kTokenid))) | |
92 | + | then throw("DApp already inited") | |
93 | + | else if (!(isDefined(assetInfo(fromBase58String(tokenId))))) | |
94 | + | then throw("asset id is not correct asset id") | |
95 | + | else if ((size(fromBase58String(adm1Pub)) != 32)) | |
96 | 96 | then throw("group1Admin1PubKey is not correct") | |
97 | - | else if ((size(fromBase58String( | |
97 | + | else if ((size(fromBase58String(adm2Pub)) != 32)) | |
98 | 98 | then throw("group1Admin1PubKey is not correct") | |
99 | - | else [StringEntry(kTokenid, tokenId), StringEntry(kAdmin1PK, adm1Pub), StringEntry(kAdmin2PK, adm2Pub), StringEntry(kAdmin3PK, adm3Pub), IntegerEntry(kPersentForNFT, toNFTPercent)]) | |
99 | + | else if ((size(fromBase58String(adm3Pub)) != 32)) | |
100 | + | then throw("group1Admin1PubKey is not correct") | |
101 | + | else [StringEntry(kTokenid, tokenId), StringEntry(kAdmin1PK, adm1Pub), StringEntry(kAdmin2PK, adm2Pub), StringEntry(kAdmin3PK, adm3Pub), IntegerEntry(kPersentForNFT, toNFTPercent)]) | |
100 | 102 | ||
101 | 103 | ||
102 | 104 | ||
103 | 105 | @Callable(i) | |
104 | 106 | func stake () = if ((size(i.payments) != 1)) | |
105 | 107 | then throw("One payment expected") | |
106 | 108 | else { | |
107 | - | let $ | |
108 | - | let pmtAmount = $ | |
109 | - | let pmtAssetId = $ | |
109 | + | let $t036953770 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
110 | + | let pmtAmount = $t036953770._1 | |
111 | + | let pmtAssetId = $t036953770._2 | |
110 | 112 | if ((pmtAssetId != fromBase58String(tokenId))) | |
111 | 113 | then throw("Wrong payment asset") | |
112 | 114 | else { | |
113 | 115 | let user = toString(i.caller) | |
114 | - | let $ | |
115 | - | let userNewInterest = $ | |
116 | - | let claimAmountAvailable = $ | |
117 | - | let userTokenStaked = $ | |
118 | - | let totalTokenStaked = $ | |
116 | + | let $t038913987 = claimCalc(user) | |
117 | + | let userNewInterest = $t038913987._1 | |
118 | + | let claimAmountAvailable = $t038913987._2 | |
119 | + | let userTokenStaked = $t038913987._3 | |
120 | + | let totalTokenStaked = $t038913987._4 | |
119 | 121 | [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked + pmtAmount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked + pmtAmount))] | |
120 | 122 | } | |
121 | 123 | } | |
122 | 124 | ||
123 | 125 | ||
124 | 126 | ||
125 | 127 | @Callable(i) | |
126 | 128 | func unstake (amount) = { | |
127 | 129 | let user = toString(i.caller) | |
128 | 130 | if ((0 >= amount)) | |
129 | 131 | then throw("Amount must be greater than 0") | |
130 | 132 | else { | |
131 | - | let $ | |
132 | - | let userNewInterest = $ | |
133 | - | let claimAmountAvailable = $ | |
134 | - | let userTokenStaked = $ | |
135 | - | let totalTokenStaked = $ | |
133 | + | let $t044014497 = claimCalc(user) | |
134 | + | let userNewInterest = $t044014497._1 | |
135 | + | let claimAmountAvailable = $t044014497._2 | |
136 | + | let userTokenStaked = $t044014497._3 | |
137 | + | let totalTokenStaked = $t044014497._4 | |
136 | 138 | if ((amount > userTokenStaked)) | |
137 | 139 | then throw("You can't unstake more than staked") | |
138 | 140 | else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), claimAmountAvailable), IntegerEntry((user + kUserTokenStaked), (userTokenStaked - amount)), IntegerEntry(kTotalTokenStaked, (totalTokenStaked - amount))] | |
139 | 141 | } | |
140 | 142 | } | |
141 | 143 | ||
142 | 144 | ||
143 | 145 | ||
144 | 146 | @Callable(i) | |
145 | 147 | func claim () = { | |
146 | 148 | let user = toString(i.caller) | |
147 | - | let $ | |
148 | - | let userNewInterest = $ | |
149 | - | let claimAmountAvailable = $ | |
150 | - | let userTokenStaked = $ | |
151 | - | let totalTokenStaked = $ | |
149 | + | let $t049135009 = claimCalc(user) | |
150 | + | let userNewInterest = $t049135009._1 | |
151 | + | let claimAmountAvailable = $t049135009._2 | |
152 | + | let userTokenStaked = $t049135009._3 | |
153 | + | let totalTokenStaked = $t049135009._4 | |
152 | 154 | if ((claimAmountAvailable == 0)) | |
153 | 155 | then throw("Nothing to claim") | |
154 | 156 | else [IntegerEntry((user + kUserInterest), userNewInterest), IntegerEntry((user + kUserAvailable), 0), ScriptTransfer(i.caller, claimAmountAvailable, fromBase58String(tokenId))] | |
155 | 157 | } | |
156 | 158 | ||
157 | 159 | ||
158 | 160 | ||
159 | 161 | @Callable(i) | |
160 | 162 | func stakeNFT () = if ((size(i.payments) != 0)) | |
161 | 163 | then throw("One payment expected") | |
162 | 164 | else { | |
163 | - | let $ | |
164 | - | let pmtAmount = $ | |
165 | - | let pmtAssetId = $ | |
165 | + | let $t053745449 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
166 | + | let pmtAmount = $t053745449._1 | |
167 | + | let pmtAssetId = $t053745449._2 | |
166 | 168 | let pmtAssetIdStr = assetIdToStr(pmtAssetId) | |
167 | 169 | if (!(isDefined(getString(this, (pmtAssetIdStr + kNFTCreated))))) | |
168 | 170 | then throw("Wrong nft asset") | |
169 | 171 | else { | |
170 | 172 | let user = toString(i.caller) | |
171 | - | let $ | |
172 | - | let userNewInterest = $ | |
173 | - | let claimAmountAvailable = $ | |
174 | - | let userNFTStaked = $ | |
175 | - | let totalNFTStaked = $ | |
173 | + | let $t056305725 = claimCalcNft(user) | |
174 | + | let userNewInterest = $t056305725._1 | |
175 | + | let claimAmountAvailable = $t056305725._2 | |
176 | + | let userNFTStaked = $t056305725._3 | |
177 | + | let totalNFTStaked = $t056305725._4 | |
176 | 178 | [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), claimAmountAvailable), IntegerEntry((user + kuserNFTStaked), (userNFTStaked + pmtAmount)), IntegerEntry(kNFTTotalStaked, (totalNFTStaked + pmtAmount)), IntegerEntry((((user + "_") + pmtAssetIdStr) + kuserNFTStakedId), 1)] | |
177 | 179 | } | |
178 | 180 | } | |
179 | 181 | ||
180 | 182 | ||
181 | 183 | ||
182 | 184 | @Callable(i) | |
183 | 185 | func unstakeNFT (id) = { | |
184 | 186 | let user = toString(i.caller) | |
185 | 187 | if (isDefined(getString(this, (((user + id) + "_") + kuserNFTStakedId)))) | |
186 | 188 | then throw("You didn't staked") | |
187 | 189 | else { | |
188 | - | let $ | |
189 | - | let userNewInterest = $ | |
190 | - | let claimAmountAvailable = $ | |
191 | - | let userNFTStaked = $ | |
192 | - | let totalNFTStaked = $ | |
190 | + | let $t062506345 = claimCalcNft(user) | |
191 | + | let userNewInterest = $t062506345._1 | |
192 | + | let claimAmountAvailable = $t062506345._2 | |
193 | + | let userNFTStaked = $t062506345._3 | |
194 | + | let totalNFTStaked = $t062506345._4 | |
193 | 195 | [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))] | |
194 | 196 | } | |
195 | 197 | } | |
196 | 198 | ||
197 | 199 | ||
198 | 200 | ||
199 | 201 | @Callable(i) | |
200 | 202 | func claimNFT () = { | |
201 | 203 | let user = toString(i.caller) | |
202 | - | let $ | |
203 | - | let userNewInterest = $ | |
204 | - | let claimAmountAvailable = $ | |
205 | - | let userNFTStaked = $ | |
206 | - | let totalNFTStaked = $ | |
204 | + | let $t067796874 = claimCalcNft(user) | |
205 | + | let userNewInterest = $t067796874._1 | |
206 | + | let claimAmountAvailable = $t067796874._2 | |
207 | + | let userNFTStaked = $t067796874._3 | |
208 | + | let totalNFTStaked = $t067796874._4 | |
207 | 209 | if ((claimAmountAvailable == 0)) | |
208 | 210 | then throw("Nothing to claim") | |
209 | 211 | else [IntegerEntry((user + kNFTUserInterest), userNewInterest), IntegerEntry((user + kNFTUserAvailableClaim), 0), ScriptTransfer(i.caller, claimAmountAvailable, fromBase58String(tokenId))] | |
210 | 212 | } | |
211 | 213 | ||
212 | 214 | ||
213 | 215 | ||
214 | 216 | @Callable(i) | |
215 | 217 | func issueNFT (userAddr,name,descr) = valueOrElse(isAdminCall(i), { | |
216 | 218 | let uAddr = valueOrErrorMessage(addressFromString(userAddr), "Wrong user address") | |
217 | 219 | let issue = Issue(name, descr, 1, 1, false) | |
218 | 220 | let nftId = calculateAssetId(issue) | |
219 | - | [StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), ScriptTransfer(uAddr, 1, nftId)] | |
221 | + | [issue, StringEntry((toBase58String(nftId) + kNFTCreated), userAddr), ScriptTransfer(uAddr, 1, nftId)] | |
220 | 222 | }) | |
221 | 223 | ||
222 | 224 | ||
223 | 225 | ||
224 | 226 | @Callable(i) | |
225 | 227 | func airdrop () = valueOrElse(isAdminCall(i), if ((size(i.payments) != 1)) | |
226 | 228 | then throw("One payment expected") | |
227 | 229 | else { | |
228 | - | let $ | |
229 | - | let pmtAmount = $ | |
230 | - | let pmtAssetId = $ | |
230 | + | let $t076747749 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
231 | + | let pmtAmount = $t076747749._1 | |
232 | + | let pmtAssetId = $t076747749._2 | |
231 | 233 | if ((pmtAssetId != fromBase58String(tokenId))) | |
232 | 234 | then throw("Wrong payment asset") | |
233 | 235 | else { | |
234 | 236 | let percentForNFT = getIntegerValue(this, kPersentForNFT) | |
235 | 237 | let totalTokenStaked = valueOrElse(getInteger(this, kTotalTokenStaked), 0) | |
236 | 238 | let totalNFTStaked = valueOrElse(getInteger(this, kNFTTotalStaked), 0) | |
237 | 239 | let curInterest = valueOrElse(getInteger(this, kInterest), 0) | |
238 | 240 | let curNFTInterest = valueOrElse(getInteger(this, kNFTInterest), 0) | |
239 | - | let $ | |
241 | + | let $t081728347 = if ((totalNFTStaked == 0)) | |
240 | 242 | then $Tuple2(0, pmtAmount) | |
241 | 243 | else { | |
242 | 244 | let nftP = fraction(pmtAmount, percentForNFT, 100) | |
243 | 245 | $Tuple2(nftP, (pmtAmount - nftP)) | |
244 | 246 | } | |
245 | - | let pmtNFT = $ | |
246 | - | let pmtToken = $ | |
247 | + | let pmtNFT = $t081728347._1 | |
248 | + | let pmtToken = $t081728347._2 | |
247 | 249 | let interestNew = if ((totalTokenStaked > 0)) | |
248 | 250 | then (curInterest + fraction(pmtToken, SCALE8, totalTokenStaked)) | |
249 | 251 | else curInterest | |
250 | 252 | let interestNFTNew = if ((totalNFTStaked > 0)) | |
251 | 253 | then (curNFTInterest + fraction(pmtNFT, SCALE8, totalNFTStaked)) | |
252 | 254 | else curNFTInterest | |
253 | 255 | [IntegerEntry(kInterest, interestNew), IntegerEntry(kNFTInterest, interestNFTNew)] | |
254 | 256 | } | |
255 | 257 | }) | |
256 | 258 | ||
257 | 259 | ||
258 | 260 | @Verifier(tx) | |
259 | 261 | func verify () = { | |
260 | 262 | let multiSignedByAdmins = { | |
261 | 263 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK)) | |
262 | 264 | then 1 | |
263 | 265 | else 0 | |
264 | 266 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK)) | |
265 | 267 | then 1 | |
266 | 268 | else 0 | |
267 | 269 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK)) | |
268 | 270 | then 1 | |
269 | 271 | else 0 | |
270 | 272 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
271 | 273 | } | |
272 | 274 | match tx { | |
273 | 275 | case inv: InvokeScriptTransaction => | |
274 | 276 | let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
275 | 277 | let isRightFee = if ((inv.fee == 900000)) | |
276 | 278 | then (inv.feeAssetId == unit) | |
277 | 279 | else false | |
278 | 280 | let isInitCall = (inv.function == "init") | |
279 | 281 | let isnoPayments = (size(inv.payments) == 0) | |
280 | 282 | if (if (if (if (isRightFee) | |
281 | 283 | then isInitCall | |
282 | 284 | else false) | |
283 | 285 | then isSelf | |
284 | 286 | else false) | |
285 | 287 | then isnoPayments | |
286 | 288 | else false) | |
287 | 289 | then true | |
288 | 290 | else multiSignedByAdmins | |
289 | 291 | case _ => | |
290 | 292 | multiSignedByAdmins | |
291 | 293 | } | |
292 | 294 | } | |
293 | 295 |
github/deemru/w8io/026f985 78.56 ms ◑