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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MAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGdXNlcklkBQAAAA11TG9ja2VkQW1vdW50CQACWQAAAAEFAAAADHVMb2NrZWRBc3NldAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAASdUFscmVhZHlDbGFpbWVkS2V5BgUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAC65jJg==", "height": 2185793, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: dMLjbkmZnzYnawCidJSNLeXrV647NcM8oqbVF7QcwrS Next: E5vs2SijNPsW5C1K6G5URagfuFz5C3tUXDXAxXoTBLbe Diff:
OldNewDifferences
8484 else StringEntry(key, value)
8585
8686
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)
9193 else (((days + 2) * BlockPerDay) + height)
9294 else (((days + 2) * BlockPerDay) + height)
9395 else (((days + 2) * BlockPerDay) + height)
337339 let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified")
338340 let check3 = throwIf(if ((minToStake > amountToStake))
339341 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")
341343 if ((check3 == check3))
342344 then {
343345 let uTotalLocked = (userId + totalLockedAMount)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lockingStore = this
55
66 let stakingStore = "_Reserve"
77
88 let minimumLockAmount = "_MinLockAmount"
99
1010 let maximumLockAmount = "_MaxLockAmount"
1111
1212 let assetList = nil
1313
1414 let unlockEligibility = "_Eligible_to_unlock_at_block"
1515
1616 let lockedAmount = "_Amount_locked"
1717
1818 let lockedAsset = "_Asset_locked"
1919
2020 let user = "_User"
2121
2222 let APY_Amount = "_APY_amount"
2323
2424 let totalLockedAMount = "_Total_Locked_Amount"
2525
2626 let lockingPeriod = "_Days_locked"
2727
2828 let entryIndex = "_Entry_Index"
2929
3030 let alreadyClaimed = "_Already_Claimed"
3131
3232 let admin = "admin_"
3333
3434 let BlockPerDay = 1440
3535
3636 let thirtyDaysLockPeriod = 30
3737
3838 let sixtyDaysLockPeriod = 60
3939
4040 let ninetyDaysLockPeriod = 90
4141
4242 let oneDayLockperiod = 1
4343
4444 func getI (key) = getInteger(this, key)
4545
4646
4747 func getS (key) = getString(this, key)
4848
4949
5050 func getIV (key) = value(getInteger(this, key))
5151
5252
5353 func getSV (key) = value(getString(this, key))
5454
5555
5656 func throwIf (condition,error) = if (condition)
5757 then throw(error)
5858 else true
5959
6060
6161 func throwOrReturnI (val,error) = match val {
6262 case val: Int =>
6363 val
6464 case _ =>
6565 throw(error)
6666 }
6767
6868
6969 func throwOrReturnS (val,error) = match val {
7070 case val: String =>
7171 val
7272 case _ =>
7373 throw(error)
7474 }
7575
7676
7777 func writeInt (key,value) = if ((0 > value))
7878 then throw(((("writing negative value " + toString(value)) + " for key ") + key))
7979 else IntegerEntry(key, value)
8080
8181
8282 func writeStr (key,value) = if ((" " == value))
8383 then throw(("writing an empty string " + value))
8484 else StringEntry(key, value)
8585
8686
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)
9193 else (((days + 2) * BlockPerDay) + height)
9294 else (((days + 2) * BlockPerDay) + height)
9395 else (((days + 2) * BlockPerDay) + height)
9496
9597
9698 func blocksToDays (blocksLeft) = if ((0 >= blocksLeft))
9799 then 0
98100 else {
99101 let daysleft = (blocksLeft / BlockPerDay)
100102 daysleft
101103 }
102104
103105
104106 func writeConstString (key,value) = if (!(isDefined(getS(key))))
105107 then writeStr(key, value)
106108 else throw(("already initialized: " + key))
107109
108110
109111 func writeConstInteger (key,value) = if (!(isDefined(getS(key))))
110112 then writeInt(key, value)
111113 else throw(("already initialized: " + key))
112114
113115
114116 func adminOnly (i) = {
115117 let inputAddress = toBase58String(i.caller.bytes)
116118 let otherAdmin = (admin + inputAddress)
117119 match getS(admin) {
118120 case a: String =>
119121 if ((inputAddress != getS(admin)))
120122 then throw("unauthorized")
121123 else true
122124 case _ =>
123125 match getS(otherAdmin) {
124126 case b: String =>
125127 if ((inputAddress != getS(otherAdmin)))
126128 then throw("unauthorized")
127129 else true
128130 case _ =>
129131 throw("unauthorizd")
130132 }
131133 }
132134 }
133135
134136
135137 func writeConfigValue (key,data) = match data {
136138 case data: String =>
137139 writeConstString(key, data)
138140 case data: Int =>
139141 writeConstInteger(key, data)
140142 case _ =>
141143 throw("unsupported config type")
142144 }
143145
144146
145147 func incrementEntryIndex (key) = {
146148 let uIndex = getI(key)
147149 if (isDefined(uIndex))
148150 then (value(uIndex) + 1)
149151 else 0
150152 }
151153
152154
153155 @Callable(i)
154156 func addAsset (AssetTicker,AssetID,AssetReserve,AssetMinimumLockAmount,AssetMaximumLockAmount) = {
155157 let check = adminOnly(i)
156158 if ((check == check))
157159 then {
158160 let aStakingStore = (AssetTicker + stakingStore)
159161 let aMinimumLockAmount = (AssetTicker + minimumLockAmount)
160162 let aMaximumLockAmount = (AssetTicker + maximumLockAmount)
161163 let checkMinMax = if ((AssetMaximumLockAmount > AssetMinimumLockAmount))
162164 then [writeConstInteger(aMinimumLockAmount, AssetMinimumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMaximumLockAmount)]
163165 else [writeConstInteger(aMinimumLockAmount, AssetMaximumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMinimumLockAmount)]
164166 ([writeConstString(AssetTicker, AssetID), writeConstString(aStakingStore, AssetReserve)] ++ checkMinMax)
165167 }
166168 else throw("Strict value is not equal to itself.")
167169 }
168170
169171
170172
171173 @Callable(i)
172174 func deleteAsset (AssetTicker) = {
173175 let check = adminOnly(i)
174176 if ((check == check))
175177 then {
176178 let assetID = throwOrReturnS(getS(AssetTicker), (("asset with ticker " + AssetTicker) + " not found"))
177179 if ((assetID == assetID))
178180 then [DeleteEntry(AssetTicker), DeleteEntry((AssetTicker + minimumLockAmount)), DeleteEntry((AssetTicker + maximumLockAmount)), DeleteEntry((AssetTicker + stakingStore))]
179181 else throw("Strict value is not equal to itself.")
180182 }
181183 else throw("Strict value is not equal to itself.")
182184 }
183185
184186
185187
186188 @Callable(i)
187189 func _getAssetIdByTicker (AssetTicker) = {
188190 let check = adminOnly(i)
189191 if ((check == check))
190192 then {
191193 let a = throwOrReturnS(getS(AssetTicker), "asset not found")
192194 $Tuple2(nil, a)
193195 }
194196 else throw("Strict value is not equal to itself.")
195197 }
196198
197199
198200
199201 @Callable(i)
200202 func init (AdminAddress) = {
201203 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
202204 [writeConstString(admin, toString(adminAddr))]
203205 }
204206
205207
206208
207209 @Callable(i)
208210 func _deleteEntry (key) = {
209211 let check = adminOnly(i)
210212 if ((check == check))
211213 then [DeleteEntry(key)]
212214 else throw("Strict value is not equal to itself.")
213215 }
214216
215217
216218
217219 @Callable(i)
218220 func addAdmin (AdminAddress) = {
219221 let check = adminOnly(i)
220222 if ((check == check))
221223 then {
222224 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
223225 let newAdmin = (admin + toString(adminAddr))
224226 [writeConstString(newAdmin, AdminAddress)]
225227 }
226228 else throw("Strict value is not equal to itself.")
227229 }
228230
229231
230232
231233 @Callable(i)
232234 func changeMainAdmin (newAddress) = {
233235 let checks = adminOnly(i)
234236 if ((checks == checks))
235237 then {
236238 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
237239 let del = DeleteEntry(admin)
238240 if ((del == del))
239241 then [writeConstString(admin, toString(adminAddr))]
240242 else throw("Strict value is not equal to itself.")
241243 }
242244 else throw("Strict value is not equal to itself.")
243245 }
244246
245247
246248
247249 @Callable(i)
248250 func updateOtherAdminAddress (newAddress) = {
249251 let checks = adminOnly(i)
250252 if ((checks == checks))
251253 then {
252254 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
253255 let caller = toString(i.caller)
254256 let otherAdmin = (admin + caller)
255257 let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found")
256258 if ((checkOldAddress == checkOldAddress))
257259 then {
258260 let delAddress = DeleteEntry(otherAdmin)
259261 if ((delAddress == delAddress))
260262 then [writeConstString(otherAdmin, toString(adminAddr))]
261263 else throw("Strict value is not equal to itself.")
262264 }
263265 else throw("Strict value is not equal to itself.")
264266 }
265267 else throw("Strict value is not equal to itself.")
266268 }
267269
268270
269271
270272 @Callable(i)
271273 func removeOtherAdmin (address) = {
272274 let checks = adminOnly(i)
273275 if ((checks == checks))
274276 then {
275277 let adminAddr = valueOrErrorMessage(addressFromString(address), "invalid address")
276278 let otherAddress = (admin + toString(adminAddr))
277279 let delAdmin = DeleteEntry(otherAddress)
278280 if ((delAdmin == delAdmin))
279281 then nil
280282 else throw("Strict value is not equal to itself.")
281283 }
282284 else throw("Strict value is not equal to itself.")
283285 }
284286
285287
286288
287289 @Callable(i)
288290 func updateConfigValue (key,data) = {
289291 let checks = adminOnly(i)
290292 if ((checks == checks))
291293 then {
292294 let del = DeleteEntry(key)
293295 if ((del == del))
294296 then [writeConfigValue(key, data)]
295297 else throw("Strict value is not equal to itself.")
296298 }
297299 else throw("Strict value is not equal to itself.")
298300 }
299301
300302
301303
302304 @Callable(i)
303305 func _getDaysLeftToClaim (userAddress,AssetTicker,EntryIndex) = {
304306 let check0 = adminOnly(i)
305307 if ((check0 == check0))
306308 then {
307309 let check1 = valueOrErrorMessage(addressFromString(userAddress), "invalid address")
308310 if ((check1 == check1))
309311 then {
310312 let uEntryIndex = ((("_" + AssetTicker) + "_") + toString(EntryIndex))
311313 let uUnlockEligibility = ((userAddress + uEntryIndex) + unlockEligibility)
312314 let uBlocksLeft = valueOrErrorMessage(getI(uUnlockEligibility), ("no entry for " + userAddress))
313315 let uBlocksToDays = blocksToDays((uBlocksLeft - height))
314316 $Tuple2(nil, uBlocksToDays)
315317 }
316318 else throw("Strict value is not equal to itself.")
317319 }
318320 else throw("Strict value is not equal to itself.")
319321 }
320322
321323
322324
323325 @Callable(i)
324326 func Lock (LockPeriod,AssetTicker,EntryIndex) = {
325327 let check1 = throwIf((1 != size(i.payments)), "attach amount you want to lock")
326328 if ((check1 == check1))
327329 then {
328330 let assetValue = valueOrErrorMessage(i.payments[0].assetId, "no assetId for the attached asset")
329331 let asset = toBase58String(assetValue)
330332 let check2 = throwIf((getS(AssetTicker) != asset), "asset not supported")
331333 if ((check2 == check2))
332334 then {
333335 let lockPeriod = LockPeriod
334336 let userId = toBase58String(i.caller.bytes)
335337 let amountToStake = i.payments[0].amount
336338 let minToStake = throwOrReturnI(getI((AssetTicker + minimumLockAmount)), "internal error: minimum stacking amount not specified")
337339 let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified")
338340 let check3 = throwIf(if ((minToStake > amountToStake))
339341 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")
341343 if ((check3 == check3))
342344 then {
343345 let uTotalLocked = (userId + totalLockedAMount)
344346 let uSumTotal = if (!(isDefined(getI(uTotalLocked))))
345347 then 0
346348 else (amountToStake + value(getI(uTotalLocked)))
347349 let check4 = throwIf((uSumTotal > maxToStake), "you have maxed out your quota")
348350 if ((check4 == check4))
349351 then {
350352 let uEntryToString = toString(EntryIndex)
351353 let uEntry = ((("_" + AssetTicker) + "_") + uEntryToString)
352354 let uUserEntryKey = (userId + uEntry)
353355 let uUserId = ((userId + uEntry) + user)
354356 let uAsset = ((userId + uEntry) + lockedAsset)
355357 let uLockingPeriod = ((userId + uEntry) + lockingPeriod)
356358 let uLockedAmount = ((userId + uEntry) + lockedAmount)
357359 let uAPY = ((userId + uEntry) + APY_Amount)
358360 let uUnlockEligibility = ((userId + uEntry) + unlockEligibility)
359361 let uAlreadyClaimed = ((userId + uEntry) + alreadyClaimed)
360362 let StoredAPY = invoke(Address(fromBase58String(getSV(admin))), "getAPYAmount", [userId, AssetTicker, EntryIndex], nil)
361363 let APY = match StoredAPY {
362364 case c: Int =>
363365 c
364366 case _ =>
365367 throw(("could not get the APY amount for " + userId))
366368 }
367369 [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)]
368370 }
369371 else throw("Strict value is not equal to itself.")
370372 }
371373 else throw("Strict value is not equal to itself.")
372374 }
373375 else throw("Strict value is not equal to itself.")
374376 }
375377 else throw("Strict value is not equal to itself.")
376378 }
377379
378380
379381
380382 @Callable(i)
381383 func Claim (AssetTicker,EntryIndex) = {
382384 let userId = toString(i.caller)
383385 let asset = valueOrErrorMessage(getS(AssetTicker), "invalid asset")
384386 if ((asset == asset))
385387 then {
386388 let uEntry = ((("_" + AssetTicker) + "_") + toString(EntryIndex))
387389 let uUserID = valueOrErrorMessage(getS(((userId + uEntry) + user)), ("no entry found for user " + userId))
388390 if ((uUserID == uUserID))
389391 then {
390392 let uLockedAsset = valueOrErrorMessage(getS(((userId + uEntry) + lockedAsset)), "asset not locked by user")
391393 let uAlreadyClaimedKey = ((userId + uEntry) + alreadyClaimed)
392394 let check0 = throwIf((valueOrErrorMessage(getBoolean(uAlreadyClaimedKey), "cannot ascertain claimability") == true), (("user + " + userId) + " already claimed"))
393395 if ((check0 == check0))
394396 then {
395397 let uLockedAmount = getIV(((userId + uEntry) + lockedAmount))
396398 let stakingReserve = addressFromStringValue(throwOrReturnS(getS((AssetTicker + stakingStore)), "internal error: no reserve found"))
397399 let APYAMount = getIV(((userId + uEntry) + APY_Amount))
398400 let period = getIV(((userId + uEntry) + unlockEligibility))
399401 let blocksLeft = if ((0 >= (period - height)))
400402 then 0
401403 else (period - height)
402404 let daysLeft = blocksToDays(blocksLeft)
403405 let check1 = throwIf((period > height), (toString(daysLeft) + " days left to claim"))
404406 if ((check1 == check1))
405407 then {
406408 let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, fromBase58String(uLockedAsset)], nil)
407409 if ((transferAPYAmount == transferAPYAmount))
408410 then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, fromBase58String(uLockedAsset)), BooleanEntry(uAlreadyClaimedKey, true)]
409411 else throw("Strict value is not equal to itself.")
410412 }
411413 else throw("Strict value is not equal to itself.")
412414 }
413415 else throw("Strict value is not equal to itself.")
414416 }
415417 else throw("Strict value is not equal to itself.")
416418 }
417419 else throw("Strict value is not equal to itself.")
418420 }
419421
420422

github/deemru/w8io/169f3d6 
49.00 ms