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