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