tx · E5vs2SijNPsW5C1K6G5URagfuFz5C3tUXDXAxXoTBLbe

3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx:  -0.01500000 Waves

2022.08.15 22:39 [2186012] smart account 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
77.42 ms