tx · 3deVgrG3KMRJogWR3AzhGSgfayWS75pvBwBooXshataT

3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx:  -0.10000000 Waves

2022.06.04 08:03 [2081162] smart account 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx > SELF 0.00000000 Waves

{ "type": 13, "id": "3deVgrG3KMRJogWR3AzhGSgfayWS75pvBwBooXshataT", "fee": 10000000, "feeAssetId": null, "timestamp": 1654319010604, "version": 2, "chainId": 84, "sender": "3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx", "senderPublicKey": "5cWdpE4X7mfNkLmxJ389ws6qGZof4fwydqMcqPexhJ7w", "proofs": [ "466aQkd4LPjcASzdz3MBKXNdhCCJjseSonkw6ut89YmTKt57cjVXYZfoqHAhk5DqjXnwpMNgR5heGwDnRftajVhF" ], "script": "base64:AAIFAAAAAAAAAEoIAhIHCgUICAgBARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAkSAwoBCBIFCgMBCAESAwoBCAAAACMAAAAADGxvY2tpbmdTdG9yZQUAAAAEdGhpcwAAAAAMc3Rha2luZ1N0b3JlAgAAAAhfUmVzZXJ2ZQAAAAARbWluaW11bUxvY2tBbW91bnQCAAAADl9NaW5Mb2NrQW1vdW50AAAAABFtYXhpbXVtTG9ja0Ftb3VudAIAAAAOX01heExvY2tBbW91bnQAAAAACWFzc2V0TGlzdAUAAAADbmlsAAAAABF1bmxvY2tFbGlnaWJpbGl0eQIAAAAcX0VsaWdpYmxlX3RvX3VubG9ja19hdF9ibG9jawAAAAAMbG9ja2VkQW1vdW50AgAAAA5fQW1vdW50X2xvY2tlZAAAAAALbG9ja2VkQXNzZXQCAAAADV9Bc3NldF9sb2NrZWQAAAAABHVzZXICAAAABV9Vc2VyAAAAAApBUFlfQW1vdW50AgAAAAtfQVBZX2Ftb3VudAAAAAARdG90YWxMb2NrZWRBTW91bnQCAAAAFF9Ub3RhbF9Mb2N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AANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAR/9HJQ==", "height": 2081162, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BAJaPp8jksvP3wAYsXpH4kyqQfH4YuQQBpVNSTBDvuDt Next: 3WWDMfPow81FkoH7UPPg55BWBydrAQnEpmwjBAKnMMs2 Diff:
OldNewDifferences
113113 func adminOnly (i) = {
114114 let AdminAddress = toString(i.caller)
115115 let otherAdminAddress = (admin + toString(i.caller))
116- if (if ((AdminAddress != valueOrErrorMessage(getS(admin), "not an admin")))
116+ if (if ((AdminAddress != getSV(admin)))
117117 then true
118- else (AdminAddress != valueOrErrorMessage(getS(otherAdminAddress), "not an admin")))
118+ else (AdminAddress != getSV(otherAdminAddress)))
119119 then throw("unauthorized")
120120 else true
121121 }
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 AdminAddress = toString(i.caller)
115115 let otherAdminAddress = (admin + toString(i.caller))
116- if (if ((AdminAddress != valueOrErrorMessage(getS(admin), "not an admin")))
116+ if (if ((AdminAddress != getSV(admin)))
117117 then true
118- else (AdminAddress != valueOrErrorMessage(getS(otherAdminAddress), "not an admin")))
118+ else (AdminAddress != getSV(otherAdminAddress)))
119119 then throw("unauthorized")
120120 else true
121121 }
122122
123123
124124 func writeConfigValue (key,data) = match data {
125125 case data: String =>
126126 writeConstString(key, data)
127127 case data: Int =>
128128 writeConstInteger(key, data)
129129 case _ =>
130130 throw("unsupported config type")
131131 }
132132
133133
134134 func incrementEntryIndex (key) = {
135135 let uIndex = getI(key)
136136 if (isDefined(uIndex))
137137 then (value(uIndex) + 1)
138138 else 0
139139 }
140140
141141
142142 @Callable(i)
143143 func addAsset (AssetTicker,AssetID,AssetReserve,AssetMinimumLockAmount,AssetMaximumLockAmount) = {
144144 let check = adminOnly(i)
145145 if ((check == check))
146146 then {
147147 let aStakingStore = (AssetTicker + stakingStore)
148148 let aMinimumLockAmount = (AssetTicker + minimumLockAmount)
149149 let aMaximumLockAmount = (AssetTicker + maximumLockAmount)
150150 let checkMinMax = if ((AssetMaximumLockAmount > AssetMinimumLockAmount))
151151 then [writeConstInteger(aMinimumLockAmount, AssetMinimumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMaximumLockAmount)]
152152 else [writeConstInteger(aMinimumLockAmount, AssetMaximumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMinimumLockAmount)]
153153 ([writeConstString(AssetTicker, AssetID), writeConstString(aStakingStore, AssetReserve)] ++ checkMinMax)
154154 }
155155 else throw("Strict value is not equal to itself.")
156156 }
157157
158158
159159
160160 @Callable(i)
161161 func deleteAsset (AssetTicker) = {
162162 let check = adminOnly(i)
163163 if ((check == check))
164164 then {
165165 let assetID = throwOrReturnS(getS(AssetTicker), (("asset with ticker " + AssetTicker) + "not found"))
166166 if ((assetID == assetID))
167167 then [DeleteEntry(AssetTicker), DeleteEntry((AssetTicker + minimumLockAmount)), DeleteEntry((AssetTicker + maximumLockAmount)), DeleteEntry((AssetTicker + stakingStore))]
168168 else throw("Strict value is not equal to itself.")
169169 }
170170 else throw("Strict value is not equal to itself.")
171171 }
172172
173173
174174
175175 @Callable(i)
176176 func getAssetIdByTicker (AssetTicker) = {
177177 let check = adminOnly(i)
178178 if ((check == check))
179179 then {
180180 let a = throwOrReturnS(getS(AssetTicker), "asset not found")
181181 $Tuple2(nil, a)
182182 }
183183 else throw("Strict value is not equal to itself.")
184184 }
185185
186186
187187
188188 @Callable(i)
189189 func init (AdminAddress) = {
190190 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
191191 [writeConstString(admin, toString(adminAddr))]
192192 }
193193
194194
195195
196196 @Callable(i)
197197 func _deleteEntry (key) = {
198198 let check = adminOnly(i)
199199 if ((check == check))
200200 then [DeleteEntry(key)]
201201 else throw("Strict value is not equal to itself.")
202202 }
203203
204204
205205
206206 @Callable(i)
207207 func addAdmin (AdminAddress) = {
208208 let check = adminOnly(i)
209209 if ((check == check))
210210 then {
211211 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
212212 let newAdmin = (admin + toString(adminAddr))
213213 [writeConstString(newAdmin, AdminAddress)]
214214 }
215215 else throw("Strict value is not equal to itself.")
216216 }
217217
218218
219219
220220 @Callable(i)
221221 func changeMainAdmin (newAddress) = {
222222 let checks = adminOnly(i)
223223 if ((checks == checks))
224224 then {
225225 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
226226 let del = DeleteEntry(admin)
227227 if ((del == del))
228228 then [writeConstString(admin, toString(adminAddr))]
229229 else throw("Strict value is not equal to itself.")
230230 }
231231 else throw("Strict value is not equal to itself.")
232232 }
233233
234234
235235
236236 @Callable(i)
237237 func updateOtherAdminAddress (newAddress) = {
238238 let checks = adminOnly(i)
239239 if ((checks == checks))
240240 then {
241241 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
242242 let caller = toString(i.caller)
243243 let otherAdmin = (admin + caller)
244244 let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found")
245245 if ((checkOldAddress == checkOldAddress))
246246 then {
247247 let delAddress = DeleteEntry(otherAdmin)
248248 if ((delAddress == delAddress))
249249 then [writeConstString(otherAdmin, toString(adminAddr))]
250250 else throw("Strict value is not equal to itself.")
251251 }
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 removeOtherAdmin (address) = {
261261 let checks = adminOnly(i)
262262 if ((checks == checks))
263263 then {
264264 let adminAddr = valueOrErrorMessage(addressFromString(address), "invalid address")
265265 let otherAddress = (admin + toString(adminAddr))
266266 let delAdmin = DeleteEntry(otherAddress)
267267 if ((delAdmin == delAdmin))
268268 then nil
269269 else throw("Strict value is not equal to itself.")
270270 }
271271 else throw("Strict value is not equal to itself.")
272272 }
273273
274274
275275
276276 @Callable(i)
277277 func updateConfigValue (key,data) = {
278278 let checks = adminOnly(i)
279279 if ((checks == checks))
280280 then {
281281 let del = DeleteEntry(key)
282282 if ((del == del))
283283 then [writeConfigValue(key, data)]
284284 else throw("Strict value is not equal to itself.")
285285 }
286286 else throw("Strict value is not equal to itself.")
287287 }
288288
289289
290290
291291 @Callable(i)
292292 func getDaysLeftToClaim (userAddress) = {
293293 let check0 = adminOnly(i)
294294 if ((check0 == check0))
295295 then {
296296 let check1 = valueOrErrorMessage(addressFromString(userAddress), "invalid address")
297297 if ((check1 == check1))
298298 then {
299299 let uEntryIndex = ("_" + toString(throwOrReturnI(getI((userAddress + entryIndex)), ("no entry found for " + userAddress))))
300300 let uUnlockEligibility = ((userAddress + uEntryIndex) + unlockEligibility)
301301 let uBlocks = throwOrReturnI(getI(uUnlockEligibility), "internal error")
302302 let uBlocksToDays = daysToBlocks((height - uBlocks))
303303 $Tuple2(nil, uBlocksToDays)
304304 }
305305 else throw("Strict value is not equal to itself.")
306306 }
307307 else throw("Strict value is not equal to itself.")
308308 }
309309
310310
311311
312312 @Callable(i)
313313 func Lock (LockPeriod,AssetTicker,APY) = {
314314 let check1 = throwIf((1 != size(i.payments)), "attach amount you want to lock")
315315 if ((check1 == check1))
316316 then {
317317 let asset = toBase58String(value(i.payments[0].assetId))
318318 let check2 = throwIf((getS(AssetTicker) != asset), "asset not supported")
319319 if ((check2 == check2))
320320 then {
321321 let lockPeriod = LockPeriod
322322 let userId = toString(i.caller)
323323 let amountToStake = i.payments[0].amount
324324 let minToStake = throwOrReturnI(getI((AssetTicker + minimumLockAmount)), "internal error: minimum stacking amount not specified")
325325 let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified")
326326 let check3 = throwIf(if ((minToStake > amountToStake))
327327 then true
328328 else (amountToStake > maxToStake), "staking amount is out of range")
329329 if ((check3 == check3))
330330 then {
331331 let uTotalLocked = (userId + totalLockedAMount)
332332 let uSumTotal = if (!(isDefined(getI(uTotalLocked))))
333333 then 0
334334 else (amountToStake + value(getI(uTotalLocked)))
335335 let check4 = throwIf((uSumTotal > maxToStake), "you have maxed out your quota")
336336 if ((check4 == check4))
337337 then {
338338 let uEntryIndex = ((userId + AssetTicker) + entryIndex)
339339 let uIncrEntryIndex = incrementEntryIndex(uEntryIndex)
340340 let uEntryToString = ((("_" + AssetTicker) + "_") + toString(uIncrEntryIndex))
341341 let uUserId = ((userId + uEntryToString) + user)
342342 let uAsset = ((userId + uEntryToString) + lockedAsset)
343343 let uLockingPeriod = ((userId + uEntryToString) + lockingPeriod)
344344 let uLockedAmount = ((userId + uEntryToString) + lockedAmount)
345345 let uAPY = ((userId + uEntryToString) + APY_Amount)
346346 let uUnlockEligibility = ((userId + uEntryToString) + unlockEligibility)
347347 let uAlreadyClaimed = ((userId + uEntryToString) + alreadyClaimed)
348348 [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)]
349349 }
350350 else throw("Strict value is not equal to itself.")
351351 }
352352 else throw("Strict value is not equal to itself.")
353353 }
354354 else throw("Strict value is not equal to itself.")
355355 }
356356 else throw("Strict value is not equal to itself.")
357357 }
358358
359359
360360
361361 @Callable(i)
362362 func Claim (AssetTicker) = {
363363 let userId = toString(i.caller)
364364 let uEntryIndex = ((("_" + AssetTicker) + "_") + toString(throwOrReturnI(getI(((userId + AssetTicker) + entryIndex)), "no entry found for user")))
365365 let uAlreadyClaimedKey = ((userId + uEntryIndex) + alreadyClaimed)
366366 let check0 = throwIf((valueOrErrorMessage(getBoolean(uAlreadyClaimedKey), "cannot ascertain claimability") == true), (("user + " + userId) + " already claimed"))
367367 if ((check0 == check0))
368368 then {
369369 let uAsset = getSV(((userId + uEntryIndex) + lockedAsset))
370370 let uLockedAmount = getIV(((userId + uEntryIndex) + lockedAmount))
371371 let stakingReserve = addressFromStringValue(throwOrReturnS(getS((AssetTicker + stakingStore)), "internal error: no reserve found"))
372372 let APYAMount = getIV(((userId + uEntryIndex) + APY_Amount))
373373 let period = getIV(((userId + uEntryIndex) + unlockEligibility))
374374 let blocksLeft = if ((0 >= (period - height)))
375375 then 0
376376 else (period - height)
377377 let daysLeft = blocksToDays(blocksLeft)
378378 let check1 = throwIf((period > height), (toString(daysLeft) + "/1000 days left to claim"))
379379 if ((check1 == check1))
380380 then {
381381 let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, toBytes(uAsset)], nil)
382382 if ((transferAPYAmount == transferAPYAmount))
383383 then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, toBytes(uAsset)), BooleanEntry(uAlreadyClaimedKey, true)]
384384 else throw("Strict value is not equal to itself.")
385385 }
386386 else throw("Strict value is not equal to itself.")
387387 }
388388 else throw("Strict value is not equal to itself.")
389389 }
390390
391391

github/deemru/w8io/026f985 
52.09 ms