tx · 8TL7MJR3bjA7z8dBVhz92xPAALa6gmutpB2t73WuGBmf

3MrNa3KKYBiosWiN4NMxJKERRtAWi8Ny9QY:  -0.01500000 Waves

2022.09.26 03:51 [2245409] smart account 3MrNa3KKYBiosWiN4NMxJKERRtAWi8Ny9QY > SELF 0.00000000 Waves

{ "type": 13, "id": "8TL7MJR3bjA7z8dBVhz92xPAALa6gmutpB2t73WuGBmf", "fee": 1500000, "feeAssetId": null, "timestamp": 1664153522389, "version": 2, "chainId": 84, "sender": "3MrNa3KKYBiosWiN4NMxJKERRtAWi8Ny9QY", "senderPublicKey": "AcDSZVzDQTVsumAAwEQdT8iWi8xHRjLNJJ53MzYzk4m7", "proofs": [ "ukx57sx26oPnQSDNUPhBc5pvfzignmCHe2yJUjKFsjo2kWbkw2PTc51BD2hUgGNR5uxoCxgcN4Y1GCKPo4ujg2a" ], "script": "base64:AAIFAAAAAAAAAE0IAhIHCgUICAgBARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAkSBQoDCAgBEgUKAwEIARIECgIIAQAAACcAAAAADGxvY2tpbmdTdG9yZQUAAAAEdGhpcwAAAAAMc3Rha2luZ1N0b3JlAgAAAAhfUmVzZXJ2ZQAAAAARbWluaW11bUxvY2tBbW91bnQCAAAADl9NaW5Mb2NrQW1vdW50AAAAABFtYXhpbXVtTG9ja0Ftb3VudAIAAAAOX01heExvY2tBbW91bnQAAAAACWFzc2V0TGlzdAUAAAADbmlsAAAAABF1bmxvY2tFbGlnaWJpbGl0eQIAAAAcX0VsaWdpYmxlX3RvX3VubG9ja19hdF9ibG9jawAAAAAMbG9ja2VkQW1vdW50AgAAAA5fQW1vdW50X2xvY2tlZAAAAAALbG9ja2VkQXNzZXQCAAAADV9Bc3NldF9sb2NrZWQAAAAABHVzZXICAAAABV9Vc2VyAAAAAApBUFlfQW1vdW50AgAAAAtfQVBZX2Ftb3VudAAAAAARdG90YWxMb2NrZWRBTW91bnQC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HJ5AAAAAgUAAAASdUFscmVhZHlDbGFpbWVkS2V5BgUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAJSWgvw==", "height": 2245409, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3WFqjmC1p7r7gB5JPebca23QHmL3qGkvPDyHKgTfxqm4 Next: DoHAufXWSN35MoL68QBUnV2nwV297cHVD6U1Lo9YfiSp Diff:
OldNewDifferences
416416 if ((check1 == check1))
417417 then {
418418 let uTotalLocked = (userId + totalLockedAMount)
419- let sumTotalLeft = (getIV(uTotalLocked) - uLockedAmount)
419+ let sumTotal = (getIV(uTotalLocked) - uLockedAmount)
420+ let sumTotalLeft = if ((0 >= sumTotal))
421+ then 0
422+ else sumTotal
420423 let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, fromBase58String(uLockedAsset)], nil)
421424 if ((transferAPYAmount == transferAPYAmount))
422425 then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, fromBase58String(uLockedAsset)), writeConstInteger(uTotalLocked, sumTotalLeft), BooleanEntry(uAlreadyClaimedKey, true)]
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 oneDayLockperiod = 1
3737
3838 let sevenDaysLockPeriod = 7
3939
4040 let fourteenDaysLockePeriod = 14
4141
4242 let thirtyDaysLockPeriod = 30
4343
4444 let sixtyDaysLockPeriod = 60
4545
4646 let ninetyDaysLockPeriod = 90
4747
4848 let validityBlocks = 360
4949
5050 func getI (key) = getInteger(this, key)
5151
5252
5353 func getS (key) = getString(this, key)
5454
5555
5656 func getIV (key) = value(getInteger(this, key))
5757
5858
5959 func getSV (key) = value(getString(this, key))
6060
6161
6262 func throwIf (condition,error) = if (condition)
6363 then throw(error)
6464 else true
6565
6666
6767 func throwOrReturnI (val,error) = match val {
6868 case val: Int =>
6969 val
7070 case _ =>
7171 throw(error)
7272 }
7373
7474
7575 func throwOrReturnS (val,error) = match val {
7676 case val: String =>
7777 val
7878 case _ =>
7979 throw(error)
8080 }
8181
8282
8383 func writeInt (key,value) = if ((0 > value))
8484 then throw(((("writing negative value " + toString(value)) + " for key ") + key))
8585 else IntegerEntry(key, value)
8686
8787
8888 func writeStr (key,value) = if ((" " == value))
8989 then throw(("writing an empty string " + value))
9090 else StringEntry(key, value)
9191
9292
9393 func daysToBlocks (days) = if ((days != oneDayLockperiod))
9494 then if ((days != sevenDaysLockPeriod))
9595 then if ((days != fourteenDaysLockePeriod))
9696 then if ((days != thirtyDaysLockPeriod))
9797 then if ((days != sixtyDaysLockPeriod))
9898 then if ((days != ninetyDaysLockPeriod))
9999 then throw("invalid locking period")
100100 else (((days * BlockPerDay) + validityBlocks) + height)
101101 else (((days * BlockPerDay) + validityBlocks) + height)
102102 else (((days * BlockPerDay) + validityBlocks) + height)
103103 else (((days * BlockPerDay) + validityBlocks) + height)
104104 else (((days * BlockPerDay) + validityBlocks) + height)
105105 else (((days * BlockPerDay) + validityBlocks) + height)
106106
107107
108108 func blocksToDays (blocksLeft) = if ((0 >= blocksLeft))
109109 then 0
110110 else {
111111 let daysleft = fraction(blocksLeft, 1000, BlockPerDay, CEILING)
112112 daysleft
113113 }
114114
115115
116116 func writeConstString (key,value) = if (!(isDefined(getS(key))))
117117 then writeStr(key, value)
118118 else throw((" entry already initialized: " + key))
119119
120120
121121 func writeConstInteger (key,value) = if (!(isDefined(getS(key))))
122122 then writeInt(key, value)
123123 else throw((" entry already initialized: " + key))
124124
125125
126126 func adminOnly (i) = {
127127 let inputAddress = toBase58String(i.caller.bytes)
128128 let otherAdmin = (admin + inputAddress)
129129 match getS(admin) {
130130 case a: String =>
131131 if ((inputAddress != getS(admin)))
132132 then throw("unauthorized")
133133 else true
134134 case _ =>
135135 match getS(otherAdmin) {
136136 case b: String =>
137137 if ((inputAddress != getS(otherAdmin)))
138138 then throw("unauthorized")
139139 else true
140140 case _ =>
141141 throw("unauthorizd")
142142 }
143143 }
144144 }
145145
146146
147147 func writeConfigValue (key,data) = match data {
148148 case data: String =>
149149 writeConstString(key, data)
150150 case data: Int =>
151151 writeConstInteger(key, data)
152152 case _ =>
153153 throw("unsupported config type")
154154 }
155155
156156
157157 func incrementEntryIndex (key) = {
158158 let uIndex = getI(key)
159159 if (isDefined(uIndex))
160160 then (value(uIndex) + 1)
161161 else 0
162162 }
163163
164164
165165 @Callable(i)
166166 func addAsset (AssetTicker,AssetID,AssetReserve,AssetMinimumLockAmount,AssetMaximumLockAmount) = {
167167 let check = adminOnly(i)
168168 if ((check == check))
169169 then {
170170 let aStakingStore = (AssetTicker + stakingStore)
171171 let aMinimumLockAmount = (AssetTicker + minimumLockAmount)
172172 let aMaximumLockAmount = (AssetTicker + maximumLockAmount)
173173 let checkMinMax = if ((AssetMaximumLockAmount > AssetMinimumLockAmount))
174174 then [writeConstInteger(aMinimumLockAmount, AssetMinimumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMaximumLockAmount)]
175175 else [writeConstInteger(aMinimumLockAmount, AssetMaximumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMinimumLockAmount)]
176176 ([writeConstString(AssetTicker, AssetID), writeConstString(aStakingStore, AssetReserve)] ++ checkMinMax)
177177 }
178178 else throw("Strict value is not equal to itself.")
179179 }
180180
181181
182182
183183 @Callable(i)
184184 func deleteAsset (AssetTicker) = {
185185 let check = adminOnly(i)
186186 if ((check == check))
187187 then {
188188 let assetID = throwOrReturnS(getS(AssetTicker), (("asset with ticker " + AssetTicker) + " not found"))
189189 if ((assetID == assetID))
190190 then [DeleteEntry(AssetTicker), DeleteEntry((AssetTicker + minimumLockAmount)), DeleteEntry((AssetTicker + maximumLockAmount)), DeleteEntry((AssetTicker + stakingStore))]
191191 else throw("Strict value is not equal to itself.")
192192 }
193193 else throw("Strict value is not equal to itself.")
194194 }
195195
196196
197197
198198 @Callable(i)
199199 func _getAssetIdByTicker (AssetTicker) = {
200200 let check = adminOnly(i)
201201 if ((check == check))
202202 then {
203203 let a = throwOrReturnS(getS(AssetTicker), "asset not found")
204204 $Tuple2(nil, a)
205205 }
206206 else throw("Strict value is not equal to itself.")
207207 }
208208
209209
210210
211211 @Callable(i)
212212 func init (AdminAddress) = {
213213 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
214214 [writeConstString(admin, toString(adminAddr))]
215215 }
216216
217217
218218
219219 @Callable(i)
220220 func _deleteEntry (key) = {
221221 let check = adminOnly(i)
222222 if ((check == check))
223223 then [DeleteEntry(key)]
224224 else throw("Strict value is not equal to itself.")
225225 }
226226
227227
228228
229229 @Callable(i)
230230 func addAdmin (AdminAddress) = {
231231 let check = adminOnly(i)
232232 if ((check == check))
233233 then {
234234 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
235235 let newAdmin = (admin + toString(adminAddr))
236236 [writeConstString(newAdmin, AdminAddress)]
237237 }
238238 else throw("Strict value is not equal to itself.")
239239 }
240240
241241
242242
243243 @Callable(i)
244244 func changeMainAdmin (newAddress) = {
245245 let checks = adminOnly(i)
246246 if ((checks == checks))
247247 then {
248248 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
249249 let del = DeleteEntry(admin)
250250 if ((del == del))
251251 then [writeConstString(admin, toString(adminAddr))]
252252 else throw("Strict value is not equal to itself.")
253253 }
254254 else throw("Strict value is not equal to itself.")
255255 }
256256
257257
258258
259259 @Callable(i)
260260 func updateOtherAdminAddress (newAddress) = {
261261 let checks = adminOnly(i)
262262 if ((checks == checks))
263263 then {
264264 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
265265 let caller = toString(i.caller)
266266 let otherAdmin = (admin + caller)
267267 let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found")
268268 if ((checkOldAddress == checkOldAddress))
269269 then {
270270 let delAddress = DeleteEntry(otherAdmin)
271271 if ((delAddress == delAddress))
272272 then [writeConstString(otherAdmin, toString(adminAddr))]
273273 else throw("Strict value is not equal to itself.")
274274 }
275275 else throw("Strict value is not equal to itself.")
276276 }
277277 else throw("Strict value is not equal to itself.")
278278 }
279279
280280
281281
282282 @Callable(i)
283283 func removeOtherAdmin (address) = {
284284 let checks = adminOnly(i)
285285 if ((checks == checks))
286286 then {
287287 let adminAddr = valueOrErrorMessage(addressFromString(address), "invalid address")
288288 let otherAddress = (admin + toString(adminAddr))
289289 let delAdmin = DeleteEntry(otherAddress)
290290 if ((delAdmin == delAdmin))
291291 then nil
292292 else throw("Strict value is not equal to itself.")
293293 }
294294 else throw("Strict value is not equal to itself.")
295295 }
296296
297297
298298
299299 @Callable(i)
300300 func updateConfigValue (key,data) = {
301301 let checks = adminOnly(i)
302302 if ((checks == checks))
303303 then {
304304 let del = DeleteEntry(key)
305305 if ((del == del))
306306 then [writeConfigValue(key, data)]
307307 else throw("Strict value is not equal to itself.")
308308 }
309309 else throw("Strict value is not equal to itself.")
310310 }
311311
312312
313313
314314 @Callable(i)
315315 func _getDaysLeftToClaim (userAddress,AssetTicker,EntryIndex) = {
316316 let check0 = adminOnly(i)
317317 if ((check0 == check0))
318318 then {
319319 let check1 = valueOrErrorMessage(addressFromString(userAddress), "invalid address")
320320 if ((check1 == check1))
321321 then {
322322 let uEntryIndex = ((("_" + AssetTicker) + "_") + toString(EntryIndex))
323323 let uUnlockEligibility = ((userAddress + uEntryIndex) + unlockEligibility)
324324 let uBlocksLeft = valueOrErrorMessage(getI(uUnlockEligibility), ("no entry for " + userAddress))
325325 let uBlocksToDays = blocksToDays((uBlocksLeft - height))
326326 $Tuple2(nil, uBlocksToDays)
327327 }
328328 else throw("Strict value is not equal to itself.")
329329 }
330330 else throw("Strict value is not equal to itself.")
331331 }
332332
333333
334334
335335 @Callable(i)
336336 func Lock (LockPeriod,AssetTicker,EntryIndex) = {
337337 let check1 = throwIf((1 != size(i.payments)), "attach amount you want to lock")
338338 if ((check1 == check1))
339339 then {
340340 let assetValue = valueOrErrorMessage(i.payments[0].assetId, "no assetId for the attached asset")
341341 let asset = toBase58String(assetValue)
342342 let check2 = throwIf((getS(AssetTicker) != asset), "asset not supported")
343343 if ((check2 == check2))
344344 then {
345345 let lockPeriod = LockPeriod
346346 let userId = toBase58String(i.caller.bytes)
347347 let amountToStake = i.payments[0].amount
348348 let minToStake = throwOrReturnI(getI((AssetTicker + minimumLockAmount)), "internal error: minimum stacking amount not specified")
349349 let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified")
350350 let check3 = throwIf(if ((minToStake > amountToStake))
351351 then true
352352 else (amountToStake > maxToStake), "staking amount is out of range")
353353 if ((check3 == check3))
354354 then {
355355 let uTotalLocked = (userId + totalLockedAMount)
356356 let uSumTotal = if (!(isDefined(getI(uTotalLocked))))
357357 then 0
358358 else (amountToStake + value(getI(uTotalLocked)))
359359 let check4 = throwIf((uSumTotal > maxToStake), "you have maxed out your quota")
360360 if ((check4 == check4))
361361 then {
362362 let uEntryToString = toString(EntryIndex)
363363 let uEntry = ((("_" + AssetTicker) + "_") + uEntryToString)
364364 let uUserEntryKey = (userId + uEntry)
365365 let uUserId = ((userId + uEntry) + user)
366366 let uAsset = ((userId + uEntry) + lockedAsset)
367367 let uLockingPeriod = ((userId + uEntry) + lockingPeriod)
368368 let uLockedAmount = ((userId + uEntry) + lockedAmount)
369369 let uAPY = ((userId + uEntry) + APY_Amount)
370370 let uUnlockEligibility = ((userId + uEntry) + unlockEligibility)
371371 let uAlreadyClaimed = ((userId + uEntry) + alreadyClaimed)
372372 let StoredAPY = invoke(Address(fromBase58String(getSV(admin))), "getAPYAmount", [userId, AssetTicker, EntryIndex], nil)
373373 let APY = match StoredAPY {
374374 case c: Int =>
375375 c
376376 case _ =>
377377 throw(("could not get the APY amount for " + userId))
378378 }
379379 [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)]
380380 }
381381 else throw("Strict value is not equal to itself.")
382382 }
383383 else throw("Strict value is not equal to itself.")
384384 }
385385 else throw("Strict value is not equal to itself.")
386386 }
387387 else throw("Strict value is not equal to itself.")
388388 }
389389
390390
391391
392392 @Callable(i)
393393 func Claim (AssetTicker,EntryIndex) = {
394394 let userId = toString(i.caller)
395395 let asset = valueOrErrorMessage(getS(AssetTicker), "invalid asset")
396396 if ((asset == asset))
397397 then {
398398 let uEntry = ((("_" + AssetTicker) + "_") + toString(EntryIndex))
399399 let uUserID = valueOrErrorMessage(getS(((userId + uEntry) + user)), ("no entry found for user " + userId))
400400 if ((uUserID == uUserID))
401401 then {
402402 let uLockedAsset = valueOrErrorMessage(getS(((userId + uEntry) + lockedAsset)), "asset not locked by user")
403403 let uAlreadyClaimedKey = ((userId + uEntry) + alreadyClaimed)
404404 let check0 = throwIf((valueOrErrorMessage(getBoolean(uAlreadyClaimedKey), "cannot ascertain claimability") == true), (("user + " + userId) + " already claimed"))
405405 if ((check0 == check0))
406406 then {
407407 let uLockedAmount = getIV(((userId + uEntry) + lockedAmount))
408408 let stakingReserve = addressFromStringValue(throwOrReturnS(getS((AssetTicker + stakingStore)), "internal error: no reserve found"))
409409 let APYAMount = getIV(((userId + uEntry) + APY_Amount))
410410 let period = getIV(((userId + uEntry) + unlockEligibility))
411411 let blocksLeft = if ((0 >= (period - height)))
412412 then 0
413413 else (period - height)
414414 let daysLeft = blocksToDays(blocksLeft)
415415 let check1 = throwIf((period > height), (("(" + toString(daysLeft)) + "/1000) days left to claim"))
416416 if ((check1 == check1))
417417 then {
418418 let uTotalLocked = (userId + totalLockedAMount)
419- let sumTotalLeft = (getIV(uTotalLocked) - uLockedAmount)
419+ let sumTotal = (getIV(uTotalLocked) - uLockedAmount)
420+ let sumTotalLeft = if ((0 >= sumTotal))
421+ then 0
422+ else sumTotal
420423 let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, fromBase58String(uLockedAsset)], nil)
421424 if ((transferAPYAmount == transferAPYAmount))
422425 then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, fromBase58String(uLockedAsset)), writeConstInteger(uTotalLocked, sumTotalLeft), BooleanEntry(uAlreadyClaimedKey, true)]
423426 else throw("Strict value is not equal to itself.")
424427 }
425428 else throw("Strict value is not equal to itself.")
426429 }
427430 else throw("Strict value is not equal to itself.")
428431 }
429432 else throw("Strict value is not equal to itself.")
430433 }
431434 else throw("Strict value is not equal to itself.")
432435 }
433436
434437

github/deemru/w8io/026f985 
52.58 ms