tx · 3WWDMfPow81FkoH7UPPg55BWBydrAQnEpmwjBAKnMMs2

3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx:  -0.10000000 Waves

2022.06.04 08:17 [2081177] smart account 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx > SELF 0.00000000 Waves

{ "type": 13, "id": "3WWDMfPow81FkoH7UPPg55BWBydrAQnEpmwjBAKnMMs2", "fee": 10000000, "feeAssetId": null, "timestamp": 1654319875940, "version": 2, "chainId": 84, "sender": "3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx", "senderPublicKey": "5cWdpE4X7mfNkLmxJ389ws6qGZof4fwydqMcqPexhJ7w", "proofs": [ "2GPPxik9Yv7RKUdRSASUJfNxsLzQiFQVcDBrAEmnrgSZeep4YXgVfKLvpHDyywK6EZuQdt2AUoQ5LpxUgVwFQxCR" ], "script": "base64:AAIFAAAAAAAAAEoIAhIHCgUICAgBARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAkSAwoBCBIFCgMBCAESAwoBCAAAACMAAAAADGxvY2tpbmdTdG9yZQUAAAAEdGhpcwAAAAAMc3Rha2luZ1N0b3JlAgAAAAhfUmVzZXJ2ZQAAAAARbWluaW11bUxvY2tBbW91bnQCAAAADl9NaW5Mb2NrQW1vdW50AAAAABFtYXhpbXVtTG9ja0Ftb3VudAIAAAAOX01heExvY2tBbW91bnQAAAAACWFzc2V0TGlzdAUAAAADbmlsAAAAABF1bmxvY2tFbGlnaWJpbGl0eQIAAAAcX0VsaWdpYmxlX3RvX3VubG9ja19hdF9ibG9jawAAAAAMbG9ja2VkQW1vdW50AgAAAA5fQW1vdW50X2xvY2tlZAAAAAALbG9ja2VkQXNzZXQCAAAADV9Bc3NldF9sb2NrZWQAAAAABHVzZXICAAAABV9Vc2VyAAAAAApBUFlfQW1vdW50AgAAAAtfQVBZX2Ftb3VudAAAAAARdG90YWxMb2NrZWRBTW91bnQCAAAAF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0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABnVzZXJJZAUAAAANdUxvY2tlZEFtb3VudAkAAZsAAAABBQAAAAZ1QXNzZXQJAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAIFAAAAEnVBbHJlYWR5Q2xhaW1lZEtleQYFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAApm7rI", "height": 2081177, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3deVgrG3KMRJogWR3AzhGSgfayWS75pvBwBooXshataT Next: 6kiaSBn4H2gSoA9wMLfRiR8NQzx68UrgKSv6YvJcge2G Diff:
OldNewDifferences
111111
112112
113113 func adminOnly (i) = {
114- let AdminAddress = toString(i.caller)
114+ let AdminAddress = toBase58String(i.caller.bytes)
115115 let otherAdminAddress = (admin + toString(i.caller))
116- if (if ((AdminAddress != getSV(admin)))
116+ if (if ((AdminAddress != valueOrErrorMessage(getS(admin), "not an admin")))
117117 then true
118- else (AdminAddress != getSV(otherAdminAddress)))
118+ else (AdminAddress != valueOrErrorMessage(getS(otherAdminAddress), "not an admin")))
119119 then throw("unauthorized")
120120 else true
121121 }
319319 if ((check2 == check2))
320320 then {
321321 let lockPeriod = LockPeriod
322- let userId = toString(i.caller)
322+ let userId = toBase58String(i.caller.bytes)
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")
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) = {
114- let AdminAddress = toString(i.caller)
114+ let AdminAddress = toBase58String(i.caller.bytes)
115115 let otherAdminAddress = (admin + toString(i.caller))
116- if (if ((AdminAddress != getSV(admin)))
116+ if (if ((AdminAddress != valueOrErrorMessage(getS(admin), "not an admin")))
117117 then true
118- else (AdminAddress != getSV(otherAdminAddress)))
118+ else (AdminAddress != valueOrErrorMessage(getS(otherAdminAddress), "not an admin")))
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
322- let userId = toString(i.caller)
322+ let userId = toBase58String(i.caller.bytes)
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 
48.87 ms