tx · HASquYzsp6mEWWo8A4sNK3mUwksrkuL9FgDCbjAVHeYX 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx: -0.01500000 Waves 2022.08.29 14:38 [2205696] smart account 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx > SELF 0.00000000 Waves
{ "type": 13, "id": "HASquYzsp6mEWWo8A4sNK3mUwksrkuL9FgDCbjAVHeYX", "fee": 1500000, "feeAssetId": null, "timestamp": 1661773102401, "version": 2, "chainId": 84, "sender": "3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx", "senderPublicKey": "5cWdpE4X7mfNkLmxJ389ws6qGZof4fwydqMcqPexhJ7w", "proofs": [ "5eddjMxz61yBXH7Qqqyx9w3BrGNHHZ2eNMHCbUMbNvjPFFAkfnDYKgxRMPZSHV6qijCnkakwB1JbdbNJAyiLk4aW" ], "script": "base64:AAIFAAAAAAAAAE0IAhIHCgUICAgBARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAkSBQoDCAgBEgUKAwEIARIECgIIAQAAACYAAAAADGxvY2tpbmdTdG9yZQUAAAAEdGhpcwAAAAAMc3Rha2luZ1N0b3JlAgAAAAhfUmVzZXJ2ZQAAAAARbWluaW11bUxvY2tBbW91bnQCAAAADl9NaW5Mb2NrQW1vdW50AAAAABFtYXhpbXVtTG9ja0Ftb3VudAIAAAAOX01heExvY2tBbW91bnQAAAAACWFzc2V0TGlzdAUAAAADbmlsAAAAABF1bmxvY2tFbGlnaWJpbGl0eQIAAAAcX0VsaWdpYmxlX3RvX3VubG9ja19hdF9ibG9jawAAAAAMbG9ja2VkQW1vdW50AgAAAA5fQW1vdW50X2xvY2tlZAAAAAALbG9ja2VkQXNzZXQCAAAADV9Bc3NldF9sb2NrZWQAAAAABHVzZXICAAAABV9Vc2VyAAAAAApBUFlfQW1vdW50AgAAAAtfQVBZX2Ftb3VudAAAAAARdG90YWxMb2NrZWRBTW91bnQCAA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AZgAAAAIFAAAABnBlcmlvZAUAAAAGaGVpZ2h0CQABLAAAAAIJAAGkAAAAAQUAAAAIZGF5c0xlZnQCAAAAGC8xMDAwIGRheXMgbGVmdCB0byBjbGFpbQMJAAAAAAAAAgUAAAAGY2hlY2sxBQAAAAZjaGVjazEEAAAAEXRyYW5zZmVyQVBZQW1vdW50CQAD/AAAAAQFAAAADnN0YWtpbmdSZXNlcnZlAgAAABB0cmFuc2ZlckludGVyZXN0CQAETAAAAAIFAAAABnVzZXJJZAkABEwAAAACBQAAAAlBUFlBTW91bnQJAARMAAAAAgkAAlkAAAABBQAAAAx1TG9ja2VkQXNzZXQFAAAAA25pbAUAAAADbmlsAwkAAAAAAAACBQAAABF0cmFuc2ZlckFQWUFtb3VudAUAAAARdHJhbnNmZXJBUFlBbW91bnQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGdXNlcklkBQAAAA11TG9ja2VkQW1vdW50CQACWQAAAAEFAAAADHVMb2NrZWRBc3NldAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAASdUFscmVhZHlDbGFpbWVkS2V5BgUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAv6tcow==", "height": 2205696, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5rzWM8EVPDSaRZX1EyBF2SWXeSi9AWBr4X3svSEMjaS1 Next: 5PP831n9Rd8c3ovSTfk3fXrxmor4csJCiiCtgcXcrN9c Diff:
Old | New | Differences | |
---|---|---|---|
106 | 106 | func blocksToDays (blocksLeft) = if ((0 >= blocksLeft)) | |
107 | 107 | then 0 | |
108 | 108 | else { | |
109 | - | let daysleft = (blocksLeft / BlockPerDay) | |
110 | - | | |
109 | + | let daysleft = ((blocksLeft / BlockPerDay) * 1000) | |
110 | + | daysleft | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lockingStore = this | |
5 | 5 | ||
6 | 6 | let stakingStore = "_Reserve" | |
7 | 7 | ||
8 | 8 | let minimumLockAmount = "_MinLockAmount" | |
9 | 9 | ||
10 | 10 | let maximumLockAmount = "_MaxLockAmount" | |
11 | 11 | ||
12 | 12 | let assetList = nil | |
13 | 13 | ||
14 | 14 | let unlockEligibility = "_Eligible_to_unlock_at_block" | |
15 | 15 | ||
16 | 16 | let lockedAmount = "_Amount_locked" | |
17 | 17 | ||
18 | 18 | let lockedAsset = "_Asset_locked" | |
19 | 19 | ||
20 | 20 | let user = "_User" | |
21 | 21 | ||
22 | 22 | let APY_Amount = "_APY_amount" | |
23 | 23 | ||
24 | 24 | let totalLockedAMount = "_Total_Locked_Amount" | |
25 | 25 | ||
26 | 26 | let lockingPeriod = "_Days_locked" | |
27 | 27 | ||
28 | 28 | let entryIndex = "_Entry_Index" | |
29 | 29 | ||
30 | 30 | let alreadyClaimed = "_Already_Claimed" | |
31 | 31 | ||
32 | 32 | let admin = "admin_" | |
33 | 33 | ||
34 | 34 | let BlockPerDay = 1440 | |
35 | 35 | ||
36 | 36 | let oneDayLockperiod = 1 | |
37 | 37 | ||
38 | 38 | let sevenDaysLockPeriod = 7 | |
39 | 39 | ||
40 | 40 | let fourteenDaysLockePeriod = 14 | |
41 | 41 | ||
42 | 42 | let thirtyDaysLockPeriod = 30 | |
43 | 43 | ||
44 | 44 | let sixtyDaysLockPeriod = 60 | |
45 | 45 | ||
46 | 46 | let ninetyDaysLockPeriod = 90 | |
47 | 47 | ||
48 | 48 | func getI (key) = getInteger(this, key) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getS (key) = getString(this, key) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getIV (key) = value(getInteger(this, key)) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getSV (key) = value(getString(this, key)) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func throwIf (condition,error) = if (condition) | |
61 | 61 | then throw(error) | |
62 | 62 | else true | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func throwOrReturnI (val,error) = match val { | |
66 | 66 | case val: Int => | |
67 | 67 | val | |
68 | 68 | case _ => | |
69 | 69 | throw(error) | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func throwOrReturnS (val,error) = match val { | |
74 | 74 | case val: String => | |
75 | 75 | val | |
76 | 76 | case _ => | |
77 | 77 | throw(error) | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func writeInt (key,value) = if ((0 > value)) | |
82 | 82 | then throw(((("writing negative value " + toString(value)) + " for key ") + key)) | |
83 | 83 | else IntegerEntry(key, value) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func writeStr (key,value) = if ((" " == value)) | |
87 | 87 | then throw(("writing an empty string " + value)) | |
88 | 88 | else StringEntry(key, value) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func daysToBlocks (days) = if ((days != oneDayLockperiod)) | |
92 | 92 | then if ((days != sevenDaysLockPeriod)) | |
93 | 93 | then if ((days != fourteenDaysLockePeriod)) | |
94 | 94 | then if ((days != thirtyDaysLockPeriod)) | |
95 | 95 | then if ((days != sixtyDaysLockPeriod)) | |
96 | 96 | then if ((days != ninetyDaysLockPeriod)) | |
97 | 97 | then throw("invalid locking period") | |
98 | 98 | else (((days + 2) * BlockPerDay) + height) | |
99 | 99 | else (((days + 2) * BlockPerDay) + height) | |
100 | 100 | else (((days + 2) * BlockPerDay) + height) | |
101 | 101 | else (((days + 2) * BlockPerDay) + height) | |
102 | 102 | else (((days + 2) * BlockPerDay) + height) | |
103 | 103 | else (((days + 2) * BlockPerDay) + height) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func blocksToDays (blocksLeft) = if ((0 >= blocksLeft)) | |
107 | 107 | then 0 | |
108 | 108 | else { | |
109 | - | let daysleft = (blocksLeft / BlockPerDay) | |
110 | - | | |
109 | + | let daysleft = ((blocksLeft / BlockPerDay) * 1000) | |
110 | + | daysleft | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func writeConstString (key,value) = if (!(isDefined(getS(key)))) | |
115 | 115 | then writeStr(key, value) | |
116 | 116 | else throw(("already initialized: " + key)) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func writeConstInteger (key,value) = if (!(isDefined(getS(key)))) | |
120 | 120 | then writeInt(key, value) | |
121 | 121 | else throw(("already initialized: " + key)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func adminOnly (i) = { | |
125 | 125 | let inputAddress = toBase58String(i.caller.bytes) | |
126 | 126 | let otherAdmin = (admin + inputAddress) | |
127 | 127 | match getS(admin) { | |
128 | 128 | case a: String => | |
129 | 129 | if ((inputAddress != getS(admin))) | |
130 | 130 | then throw("unauthorized") | |
131 | 131 | else true | |
132 | 132 | case _ => | |
133 | 133 | match getS(otherAdmin) { | |
134 | 134 | case b: String => | |
135 | 135 | if ((inputAddress != getS(otherAdmin))) | |
136 | 136 | then throw("unauthorized") | |
137 | 137 | else true | |
138 | 138 | case _ => | |
139 | 139 | throw("unauthorizd") | |
140 | 140 | } | |
141 | 141 | } | |
142 | 142 | } | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func writeConfigValue (key,data) = match data { | |
146 | 146 | case data: String => | |
147 | 147 | writeConstString(key, data) | |
148 | 148 | case data: Int => | |
149 | 149 | writeConstInteger(key, data) | |
150 | 150 | case _ => | |
151 | 151 | throw("unsupported config type") | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func incrementEntryIndex (key) = { | |
156 | 156 | let uIndex = getI(key) | |
157 | 157 | if (isDefined(uIndex)) | |
158 | 158 | then (value(uIndex) + 1) | |
159 | 159 | else 0 | |
160 | 160 | } | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | @Callable(i) | |
164 | 164 | func addAsset (AssetTicker,AssetID,AssetReserve,AssetMinimumLockAmount,AssetMaximumLockAmount) = { | |
165 | 165 | let check = adminOnly(i) | |
166 | 166 | if ((check == check)) | |
167 | 167 | then { | |
168 | 168 | let aStakingStore = (AssetTicker + stakingStore) | |
169 | 169 | let aMinimumLockAmount = (AssetTicker + minimumLockAmount) | |
170 | 170 | let aMaximumLockAmount = (AssetTicker + maximumLockAmount) | |
171 | 171 | let checkMinMax = if ((AssetMaximumLockAmount > AssetMinimumLockAmount)) | |
172 | 172 | then [writeConstInteger(aMinimumLockAmount, AssetMinimumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMaximumLockAmount)] | |
173 | 173 | else [writeConstInteger(aMinimumLockAmount, AssetMaximumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMinimumLockAmount)] | |
174 | 174 | ([writeConstString(AssetTicker, AssetID), writeConstString(aStakingStore, AssetReserve)] ++ checkMinMax) | |
175 | 175 | } | |
176 | 176 | else throw("Strict value is not equal to itself.") | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | ||
181 | 181 | @Callable(i) | |
182 | 182 | func deleteAsset (AssetTicker) = { | |
183 | 183 | let check = adminOnly(i) | |
184 | 184 | if ((check == check)) | |
185 | 185 | then { | |
186 | 186 | let assetID = throwOrReturnS(getS(AssetTicker), (("asset with ticker " + AssetTicker) + " not found")) | |
187 | 187 | if ((assetID == assetID)) | |
188 | 188 | then [DeleteEntry(AssetTicker), DeleteEntry((AssetTicker + minimumLockAmount)), DeleteEntry((AssetTicker + maximumLockAmount)), DeleteEntry((AssetTicker + stakingStore))] | |
189 | 189 | else throw("Strict value is not equal to itself.") | |
190 | 190 | } | |
191 | 191 | else throw("Strict value is not equal to itself.") | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | ||
196 | 196 | @Callable(i) | |
197 | 197 | func _getAssetIdByTicker (AssetTicker) = { | |
198 | 198 | let check = adminOnly(i) | |
199 | 199 | if ((check == check)) | |
200 | 200 | then { | |
201 | 201 | let a = throwOrReturnS(getS(AssetTicker), "asset not found") | |
202 | 202 | $Tuple2(nil, a) | |
203 | 203 | } | |
204 | 204 | else throw("Strict value is not equal to itself.") | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | ||
209 | 209 | @Callable(i) | |
210 | 210 | func init (AdminAddress) = { | |
211 | 211 | let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address") | |
212 | 212 | [writeConstString(admin, toString(adminAddr))] | |
213 | 213 | } | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | ||
217 | 217 | @Callable(i) | |
218 | 218 | func _deleteEntry (key) = { | |
219 | 219 | let check = adminOnly(i) | |
220 | 220 | if ((check == check)) | |
221 | 221 | then [DeleteEntry(key)] | |
222 | 222 | else throw("Strict value is not equal to itself.") | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | ||
227 | 227 | @Callable(i) | |
228 | 228 | func addAdmin (AdminAddress) = { | |
229 | 229 | let check = adminOnly(i) | |
230 | 230 | if ((check == check)) | |
231 | 231 | then { | |
232 | 232 | let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address") | |
233 | 233 | let newAdmin = (admin + toString(adminAddr)) | |
234 | 234 | [writeConstString(newAdmin, AdminAddress)] | |
235 | 235 | } | |
236 | 236 | else throw("Strict value is not equal to itself.") | |
237 | 237 | } | |
238 | 238 | ||
239 | 239 | ||
240 | 240 | ||
241 | 241 | @Callable(i) | |
242 | 242 | func changeMainAdmin (newAddress) = { | |
243 | 243 | let checks = adminOnly(i) | |
244 | 244 | if ((checks == checks)) | |
245 | 245 | then { | |
246 | 246 | let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address") | |
247 | 247 | let del = DeleteEntry(admin) | |
248 | 248 | if ((del == del)) | |
249 | 249 | then [writeConstString(admin, toString(adminAddr))] | |
250 | 250 | else throw("Strict value is not equal to itself.") | |
251 | 251 | } | |
252 | 252 | else throw("Strict value is not equal to itself.") | |
253 | 253 | } | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | ||
257 | 257 | @Callable(i) | |
258 | 258 | func updateOtherAdminAddress (newAddress) = { | |
259 | 259 | let checks = adminOnly(i) | |
260 | 260 | if ((checks == checks)) | |
261 | 261 | then { | |
262 | 262 | let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address") | |
263 | 263 | let caller = toString(i.caller) | |
264 | 264 | let otherAdmin = (admin + caller) | |
265 | 265 | let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found") | |
266 | 266 | if ((checkOldAddress == checkOldAddress)) | |
267 | 267 | then { | |
268 | 268 | let delAddress = DeleteEntry(otherAdmin) | |
269 | 269 | if ((delAddress == delAddress)) | |
270 | 270 | then [writeConstString(otherAdmin, toString(adminAddr))] | |
271 | 271 | else throw("Strict value is not equal to itself.") | |
272 | 272 | } | |
273 | 273 | else throw("Strict value is not equal to itself.") | |
274 | 274 | } | |
275 | 275 | else throw("Strict value is not equal to itself.") | |
276 | 276 | } | |
277 | 277 | ||
278 | 278 | ||
279 | 279 | ||
280 | 280 | @Callable(i) | |
281 | 281 | func removeOtherAdmin (address) = { | |
282 | 282 | let checks = adminOnly(i) | |
283 | 283 | if ((checks == checks)) | |
284 | 284 | then { | |
285 | 285 | let adminAddr = valueOrErrorMessage(addressFromString(address), "invalid address") | |
286 | 286 | let otherAddress = (admin + toString(adminAddr)) | |
287 | 287 | let delAdmin = DeleteEntry(otherAddress) | |
288 | 288 | if ((delAdmin == delAdmin)) | |
289 | 289 | then nil | |
290 | 290 | else throw("Strict value is not equal to itself.") | |
291 | 291 | } | |
292 | 292 | else throw("Strict value is not equal to itself.") | |
293 | 293 | } | |
294 | 294 | ||
295 | 295 | ||
296 | 296 | ||
297 | 297 | @Callable(i) | |
298 | 298 | func updateConfigValue (key,data) = { | |
299 | 299 | let checks = adminOnly(i) | |
300 | 300 | if ((checks == checks)) | |
301 | 301 | then { | |
302 | 302 | let del = DeleteEntry(key) | |
303 | 303 | if ((del == del)) | |
304 | 304 | then [writeConfigValue(key, data)] | |
305 | 305 | else throw("Strict value is not equal to itself.") | |
306 | 306 | } | |
307 | 307 | else throw("Strict value is not equal to itself.") | |
308 | 308 | } | |
309 | 309 | ||
310 | 310 | ||
311 | 311 | ||
312 | 312 | @Callable(i) | |
313 | 313 | func _getDaysLeftToClaim (userAddress,AssetTicker,EntryIndex) = { | |
314 | 314 | let check0 = adminOnly(i) | |
315 | 315 | if ((check0 == check0)) | |
316 | 316 | then { | |
317 | 317 | let check1 = valueOrErrorMessage(addressFromString(userAddress), "invalid address") | |
318 | 318 | if ((check1 == check1)) | |
319 | 319 | then { | |
320 | 320 | let uEntryIndex = ((("_" + AssetTicker) + "_") + toString(EntryIndex)) | |
321 | 321 | let uUnlockEligibility = ((userAddress + uEntryIndex) + unlockEligibility) | |
322 | 322 | let uBlocksLeft = valueOrErrorMessage(getI(uUnlockEligibility), ("no entry for " + userAddress)) | |
323 | 323 | let uBlocksToDays = blocksToDays((uBlocksLeft - height)) | |
324 | 324 | $Tuple2(nil, uBlocksToDays) | |
325 | 325 | } | |
326 | 326 | else throw("Strict value is not equal to itself.") | |
327 | 327 | } | |
328 | 328 | else throw("Strict value is not equal to itself.") | |
329 | 329 | } | |
330 | 330 | ||
331 | 331 | ||
332 | 332 | ||
333 | 333 | @Callable(i) | |
334 | 334 | func Lock (LockPeriod,AssetTicker,EntryIndex) = { | |
335 | 335 | let check1 = throwIf((1 != size(i.payments)), "attach amount you want to lock") | |
336 | 336 | if ((check1 == check1)) | |
337 | 337 | then { | |
338 | 338 | let assetValue = valueOrErrorMessage(i.payments[0].assetId, "no assetId for the attached asset") | |
339 | 339 | let asset = toBase58String(assetValue) | |
340 | 340 | let check2 = throwIf((getS(AssetTicker) != asset), "asset not supported") | |
341 | 341 | if ((check2 == check2)) | |
342 | 342 | then { | |
343 | 343 | let lockPeriod = LockPeriod | |
344 | 344 | let userId = toBase58String(i.caller.bytes) | |
345 | 345 | let amountToStake = i.payments[0].amount | |
346 | 346 | let minToStake = throwOrReturnI(getI((AssetTicker + minimumLockAmount)), "internal error: minimum stacking amount not specified") | |
347 | 347 | let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified") | |
348 | 348 | let check3 = throwIf(if ((minToStake > amountToStake)) | |
349 | 349 | then true | |
350 | 350 | else (amountToStake > maxToStake), "staking amount is out of range") | |
351 | 351 | if ((check3 == check3)) | |
352 | 352 | then { | |
353 | 353 | let uTotalLocked = (userId + totalLockedAMount) | |
354 | 354 | let uSumTotal = if (!(isDefined(getI(uTotalLocked)))) | |
355 | 355 | then 0 | |
356 | 356 | else (amountToStake + value(getI(uTotalLocked))) | |
357 | 357 | let check4 = throwIf((uSumTotal > maxToStake), "you have maxed out your quota") | |
358 | 358 | if ((check4 == check4)) | |
359 | 359 | then { | |
360 | 360 | let uEntryToString = toString(EntryIndex) | |
361 | 361 | let uEntry = ((("_" + AssetTicker) + "_") + uEntryToString) | |
362 | 362 | let uUserEntryKey = (userId + uEntry) | |
363 | 363 | let uUserId = ((userId + uEntry) + user) | |
364 | 364 | let uAsset = ((userId + uEntry) + lockedAsset) | |
365 | 365 | let uLockingPeriod = ((userId + uEntry) + lockingPeriod) | |
366 | 366 | let uLockedAmount = ((userId + uEntry) + lockedAmount) | |
367 | 367 | let uAPY = ((userId + uEntry) + APY_Amount) | |
368 | 368 | let uUnlockEligibility = ((userId + uEntry) + unlockEligibility) | |
369 | 369 | let uAlreadyClaimed = ((userId + uEntry) + alreadyClaimed) | |
370 | 370 | let StoredAPY = invoke(Address(fromBase58String(getSV(admin))), "getAPYAmount", [userId, AssetTicker, EntryIndex], nil) | |
371 | 371 | let APY = match StoredAPY { | |
372 | 372 | case c: Int => | |
373 | 373 | c | |
374 | 374 | case _ => | |
375 | 375 | throw(("could not get the APY amount for " + userId)) | |
376 | 376 | } | |
377 | 377 | [writeConstInteger(uUserEntryKey, EntryIndex), writeConstString(uUserId, userId), writeConstString(uAsset, asset), writeConstInteger(uLockingPeriod, lockPeriod), writeConstInteger(uLockedAmount, i.payments[0].amount), writeConstInteger(uTotalLocked, uSumTotal), writeConstInteger(uUnlockEligibility, daysToBlocks(LockPeriod)), writeConstInteger(uAPY, APY), BooleanEntry(uAlreadyClaimed, false)] | |
378 | 378 | } | |
379 | 379 | else throw("Strict value is not equal to itself.") | |
380 | 380 | } | |
381 | 381 | else throw("Strict value is not equal to itself.") | |
382 | 382 | } | |
383 | 383 | else throw("Strict value is not equal to itself.") | |
384 | 384 | } | |
385 | 385 | else throw("Strict value is not equal to itself.") | |
386 | 386 | } | |
387 | 387 | ||
388 | 388 | ||
389 | 389 | ||
390 | 390 | @Callable(i) | |
391 | 391 | func Claim (AssetTicker,EntryIndex) = { | |
392 | 392 | let userId = toString(i.caller) | |
393 | 393 | let asset = valueOrErrorMessage(getS(AssetTicker), "invalid asset") | |
394 | 394 | if ((asset == asset)) | |
395 | 395 | then { | |
396 | 396 | let uEntry = ((("_" + AssetTicker) + "_") + toString(EntryIndex)) | |
397 | 397 | let uUserID = valueOrErrorMessage(getS(((userId + uEntry) + user)), ("no entry found for user " + userId)) | |
398 | 398 | if ((uUserID == uUserID)) | |
399 | 399 | then { | |
400 | 400 | let uLockedAsset = valueOrErrorMessage(getS(((userId + uEntry) + lockedAsset)), "asset not locked by user") | |
401 | 401 | let uAlreadyClaimedKey = ((userId + uEntry) + alreadyClaimed) | |
402 | 402 | let check0 = throwIf((valueOrErrorMessage(getBoolean(uAlreadyClaimedKey), "cannot ascertain claimability") == true), (("user + " + userId) + " already claimed")) | |
403 | 403 | if ((check0 == check0)) | |
404 | 404 | then { | |
405 | 405 | let uLockedAmount = getIV(((userId + uEntry) + lockedAmount)) | |
406 | 406 | let stakingReserve = addressFromStringValue(throwOrReturnS(getS((AssetTicker + stakingStore)), "internal error: no reserve found")) | |
407 | 407 | let APYAMount = getIV(((userId + uEntry) + APY_Amount)) | |
408 | 408 | let period = getIV(((userId + uEntry) + unlockEligibility)) | |
409 | 409 | let blocksLeft = if ((0 >= (period - height))) | |
410 | 410 | then 0 | |
411 | 411 | else (period - height) | |
412 | 412 | let daysLeft = blocksToDays(blocksLeft) | |
413 | 413 | let check1 = throwIf((period > height), (toString(daysLeft) + "/1000 days left to claim")) | |
414 | 414 | if ((check1 == check1)) | |
415 | 415 | then { | |
416 | 416 | let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, fromBase58String(uLockedAsset)], nil) | |
417 | 417 | if ((transferAPYAmount == transferAPYAmount)) | |
418 | 418 | then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, fromBase58String(uLockedAsset)), BooleanEntry(uAlreadyClaimedKey, true)] | |
419 | 419 | else throw("Strict value is not equal to itself.") | |
420 | 420 | } | |
421 | 421 | else throw("Strict value is not equal to itself.") | |
422 | 422 | } | |
423 | 423 | else throw("Strict value is not equal to itself.") | |
424 | 424 | } | |
425 | 425 | else throw("Strict value is not equal to itself.") | |
426 | 426 | } | |
427 | 427 | else throw("Strict value is not equal to itself.") | |
428 | 428 | } | |
429 | 429 | ||
430 | 430 |
github/deemru/w8io/169f3d6 46.24 ms ◑