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