tx · 3mAoJE26HZ7EFzmnqrCC2CZhaHiqSGZrJ11KvmhR8FQ5

3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx:  -0.04000000 Waves

2022.06.07 04:39 [2085282] smart account 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
58.70 ms