tx · CHN1X3y47uEBa9hXivL1KLRRac73pdrC68HiFXmp9G9m

3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx:  -0.10000000 Waves

2022.06.04 02:25 [2080823] smart account 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx > SELF 0.00000000 Waves

{ "type": 13, "id": "CHN1X3y47uEBa9hXivL1KLRRac73pdrC68HiFXmp9G9m", "fee": 10000000, "feeAssetId": null, "timestamp": 1654298817827, "version": 2, "chainId": 84, "sender": "3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx", "senderPublicKey": "5cWdpE4X7mfNkLmxJ389ws6qGZof4fwydqMcqPexhJ7w", "proofs": [ "P8X15mTkDePHzFVkE4Dfmmid6ooVvDkTtChsVU9cEnDqASKsdDyCbPepmYssovMQrAKiTxvKtwQinHKCvJECxwd" ], "script": "base64:AAIFAAAAAAAAAEoIAhIHCgUICAgBARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAkSAwoBCBIFCgMBCAESAwoBCAAAACMAAAAADGxvY2tpbmdTdG9yZQUAAAAEdGhpcwAAAAAMc3Rha2luZ1N0b3JlAgAAAAhfUmVzZXJ2ZQAAAAARbWluaW11bUxvY2tBbW91bnQCAAAADl9NaW5Mb2NrQW1vdW50AAAAABFtYXhpbXVtTG9ja0Ftb3VudAIAAAAOX01heExvY2tBbW91bnQAAAAACWFzc2V0TGlzdAUAAAADbmlsAAAAABF1bmxvY2tFbGlnaWJpbGl0eQIAAAAcX0VsaWdpYmxlX3RvX3VubG9ja19hdF9ibG9jawAAAAAMbG9ja2VkQW1vdW50AgAAAA5fQW1vdW50X2xvY2tlZAAAAAALbG9ja2VkQXNzZXQCAAAADV9Bc3NldF9sb2NrZWQAAAAABHVzZXICAAAABV9Vc2VyAAAAAApBUFlfQW1vdW50AgAAAAtfQVBZX2Ftb3VudAAAAAARdG90YWxMb2NrZWRBTW91bnQCAAAAFF9Ub3RhbF9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WlnaHQAAAAAAAAAAAAJAABlAAAAAgUAAAAGcGVyaW9kBQAAAAZoZWlnaHQEAAAACGRheXNMZWZ0CQEAAAAMYmxvY2tzVG9EYXlzAAAAAQUAAAAKYmxvY2tzTGVmdAQAAAAGY2hlY2sxCQEAAAAHdGhyb3dJZgAAAAIJAABmAAAAAgUAAAAGcGVyaW9kBQAAAAZoZWlnaHQJAAEsAAAAAgkAAaQAAAABBQAAAAhkYXlzTGVmdAIAAAAYLzEwMDAgZGF5cyBsZWZ0IHRvIGNsYWltAwkAAAAAAAACBQAAAAZjaGVjazEFAAAABmNoZWNrMQQAAAARdHJhbnNmZXJBUFlBbW91bnQJAAP8AAAABAUAAAAOc3Rha2luZ1Jlc2VydmUCAAAAEHRyYW5zZmVySW50ZXJlc3QJAARMAAAAAgUAAAAGdXNlcklkCQAETAAAAAIFAAAACUFQWUFNb3VudAkABEwAAAACCQABmwAAAAEFAAAABnVBc3NldAUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAEXRyYW5zZmVyQVBZQW1vdW50BQAAABF0cmFuc2ZlckFQWUFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZ1c2VySWQFAAAADXVMb2NrZWRBbW91bnQJAAGbAAAAAQUAAAAGdUFzc2V0CQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACBQAAABJ1QWxyZWFkeUNsYWltZWRLZXkGBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAACso6/A==", "height": 2080823, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2DkezzTDzH2P9UL8sPnEbQTyoHqFuhRXKNe1j34WqXM6 Next: ATY5EkrWutknbRSqoq1rbneebPJ6p1mZRMLDHJde9jPT Diff:
OldNewDifferences
113113 func adminOnly (i) = {
114114 let AdminAddress = toString(i.caller)
115115 let otherAdminAddress = (admin + toString(i.caller))
116- if (if ((AdminAddress != valueOrElse(getS(admin), "not an admin")))
116+ if (if ((AdminAddress != valueOrErrorMessage(getS(admin), "not an admin")))
117117 then true
118- else (AdminAddress != valueOrElse(getS(otherAdminAddress), "not an admin")))
118+ else (AdminAddress != valueOrErrorMessage(getS(otherAdminAddress), "not an admin")))
119119 then throw("unauthorized")
120120 else true
121121 }
155155
156156
157157 @Callable(i)
158+func deleteAsset (AssetTicker) = {
159+ let check = adminOnly(i)
160+ if ((check == check))
161+ then {
162+ let assetID = throwOrReturnS(getS(AssetTicker), (("asset with ticker " + AssetTicker) + "not found"))
163+ if ((assetID == assetID))
164+ then [DeleteEntry(AssetTicker), DeleteEntry((AssetTicker + minimumLockAmount)), DeleteEntry((AssetTicker + maximumLockAmount)), DeleteEntry((AssetTicker + stakingStore))]
165+ else throw("Strict value is not equal to itself.")
166+ }
167+ else throw("Strict value is not equal to itself.")
168+ }
169+
170+
171+
172+@Callable(i)
158173 func getAssetIdByTicker (AssetTicker) = {
159174 let check = adminOnly(i)
160175 if ((check == check))
171186 func init (AdminAddress) = {
172187 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
173188 [writeConstString(admin, toString(adminAddr))]
189+ }
190+
191+
192+
193+@Callable(i)
194+func _deleteEntry (key) = {
195+ let check = adminOnly(i)
196+ if ((check == check))
197+ then [DeleteEntry(key)]
198+ else throw("Strict value is not equal to itself.")
174199 }
175200
176201
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 != valueOrElse(getS(admin), "not an admin")))
116+ if (if ((AdminAddress != valueOrErrorMessage(getS(admin), "not an admin")))
117117 then true
118- else (AdminAddress != valueOrElse(getS(otherAdminAddress), "not an admin")))
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,AssetStakingStore,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 [writeConstString(AssetTicker, AssetID), writeConstString(aStakingStore, AssetStakingStore), writeConstInteger(aMinimumLockAmount, AssetMinimumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMaximumLockAmount)]
151151 }
152152 else throw("Strict value is not equal to itself.")
153153 }
154154
155155
156156
157157 @Callable(i)
158+func deleteAsset (AssetTicker) = {
159+ let check = adminOnly(i)
160+ if ((check == check))
161+ then {
162+ let assetID = throwOrReturnS(getS(AssetTicker), (("asset with ticker " + AssetTicker) + "not found"))
163+ if ((assetID == assetID))
164+ then [DeleteEntry(AssetTicker), DeleteEntry((AssetTicker + minimumLockAmount)), DeleteEntry((AssetTicker + maximumLockAmount)), DeleteEntry((AssetTicker + stakingStore))]
165+ else throw("Strict value is not equal to itself.")
166+ }
167+ else throw("Strict value is not equal to itself.")
168+ }
169+
170+
171+
172+@Callable(i)
158173 func getAssetIdByTicker (AssetTicker) = {
159174 let check = adminOnly(i)
160175 if ((check == check))
161176 then {
162177 let a = throwOrReturnS(getS(AssetTicker), "asset not found")
163178 $Tuple2(nil, a)
164179 }
165180 else throw("Strict value is not equal to itself.")
166181 }
167182
168183
169184
170185 @Callable(i)
171186 func init (AdminAddress) = {
172187 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
173188 [writeConstString(admin, toString(adminAddr))]
189+ }
190+
191+
192+
193+@Callable(i)
194+func _deleteEntry (key) = {
195+ let check = adminOnly(i)
196+ if ((check == check))
197+ then [DeleteEntry(key)]
198+ else throw("Strict value is not equal to itself.")
174199 }
175200
176201
177202
178203 @Callable(i)
179204 func addAdmin (AdminAddress) = {
180205 let check = adminOnly(i)
181206 if ((check == check))
182207 then {
183208 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
184209 let newAdmin = (admin + toString(adminAddr))
185210 [writeConstString(newAdmin, AdminAddress)]
186211 }
187212 else throw("Strict value is not equal to itself.")
188213 }
189214
190215
191216
192217 @Callable(i)
193218 func changeMainAdmin (newAddress) = {
194219 let checks = adminOnly(i)
195220 if ((checks == checks))
196221 then {
197222 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
198223 let del = DeleteEntry(admin)
199224 if ((del == del))
200225 then [writeConstString(admin, toString(adminAddr))]
201226 else throw("Strict value is not equal to itself.")
202227 }
203228 else throw("Strict value is not equal to itself.")
204229 }
205230
206231
207232
208233 @Callable(i)
209234 func updateOtherAdminAddress (newAddress) = {
210235 let checks = adminOnly(i)
211236 if ((checks == checks))
212237 then {
213238 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
214239 let caller = toString(i.caller)
215240 let otherAdmin = (admin + caller)
216241 let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found")
217242 if ((checkOldAddress == checkOldAddress))
218243 then {
219244 let delAddress = DeleteEntry(otherAdmin)
220245 if ((delAddress == delAddress))
221246 then [writeConstString(otherAdmin, toString(adminAddr))]
222247 else throw("Strict value is not equal to itself.")
223248 }
224249 else throw("Strict value is not equal to itself.")
225250 }
226251 else throw("Strict value is not equal to itself.")
227252 }
228253
229254
230255
231256 @Callable(i)
232257 func removeOtherAdmin (address) = {
233258 let checks = adminOnly(i)
234259 if ((checks == checks))
235260 then {
236261 let adminAddr = valueOrErrorMessage(addressFromString(address), "invalid address")
237262 let otherAddress = (admin + toString(adminAddr))
238263 let delAdmin = DeleteEntry(otherAddress)
239264 if ((delAdmin == delAdmin))
240265 then nil
241266 else throw("Strict value is not equal to itself.")
242267 }
243268 else throw("Strict value is not equal to itself.")
244269 }
245270
246271
247272
248273 @Callable(i)
249274 func updateConfigValue (key,data) = {
250275 let checks = adminOnly(i)
251276 if ((checks == checks))
252277 then {
253278 let del = DeleteEntry(key)
254279 if ((del == del))
255280 then [writeConfigValue(key, data)]
256281 else throw("Strict value is not equal to itself.")
257282 }
258283 else throw("Strict value is not equal to itself.")
259284 }
260285
261286
262287
263288 @Callable(i)
264289 func getDaysLeftToClaim (userAddress) = {
265290 let check0 = adminOnly(i)
266291 if ((check0 == check0))
267292 then {
268293 let check1 = valueOrErrorMessage(addressFromString(userAddress), "invalid address")
269294 if ((check1 == check1))
270295 then {
271296 let uEntryIndex = ("_" + toString(throwOrReturnI(getI((userAddress + entryIndex)), ("no entry found for " + userAddress))))
272297 let uUnlockEligibility = ((userAddress + uEntryIndex) + unlockEligibility)
273298 let uBlocks = throwOrReturnI(getI(uUnlockEligibility), "internal error")
274299 let uBlocksToDays = daysToBlocks((height - uBlocks))
275300 $Tuple2(nil, uBlocksToDays)
276301 }
277302 else throw("Strict value is not equal to itself.")
278303 }
279304 else throw("Strict value is not equal to itself.")
280305 }
281306
282307
283308
284309 @Callable(i)
285310 func Lock (LockPeriod,AssetTicker,APY) = {
286311 let check1 = throwIf((1 != size(i.payments)), "attach amount you want to lock")
287312 if ((check1 == check1))
288313 then {
289314 let asset = toBase58String(value(i.payments[0].assetId))
290315 let check2 = throwIf((getS(AssetTicker) != asset), "asset not supported")
291316 if ((check2 == check2))
292317 then {
293318 let lockPeriod = LockPeriod
294319 let userId = toString(i.caller)
295320 let amountToStake = i.payments[0].amount
296321 let minToStake = throwOrReturnI(getI((AssetTicker + minimumLockAmount)), "internal error: minimum stacking amount not specified")
297322 let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified")
298323 let check3 = throwIf(if ((minToStake > amountToStake))
299324 then true
300325 else (amountToStake > maxToStake), "staking amount is out of range")
301326 if ((check3 == check3))
302327 then {
303328 let uTotalLocked = (userId + totalLockedAMount)
304329 let uSumTotal = if (!(isDefined(getI(uTotalLocked))))
305330 then 0
306331 else (amountToStake + value(getI(uTotalLocked)))
307332 let check4 = throwIf((uSumTotal > maxToStake), "you have maxed out your quota")
308333 if ((check4 == check4))
309334 then {
310335 let uEntryIndex = ((userId + AssetTicker) + entryIndex)
311336 let uIncrEntryIndex = incrementEntryIndex(uEntryIndex)
312337 let uEntryToString = ((("_" + AssetTicker) + "_") + toString(uIncrEntryIndex))
313338 let uUserId = ((userId + uEntryToString) + user)
314339 let uAsset = ((userId + uEntryToString) + lockedAsset)
315340 let uLockingPeriod = ((userId + uEntryToString) + lockingPeriod)
316341 let uLockedAmount = ((userId + uEntryToString) + lockedAmount)
317342 let uAPY = ((userId + uEntryToString) + APY_Amount)
318343 let uUnlockEligibility = ((userId + uEntryToString) + unlockEligibility)
319344 let uAlreadyClaimed = ((userId + uEntryToString) + alreadyClaimed)
320345 [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)]
321346 }
322347 else throw("Strict value is not equal to itself.")
323348 }
324349 else throw("Strict value is not equal to itself.")
325350 }
326351 else throw("Strict value is not equal to itself.")
327352 }
328353 else throw("Strict value is not equal to itself.")
329354 }
330355
331356
332357
333358 @Callable(i)
334359 func Claim (AssetTicker) = {
335360 let userId = toString(i.caller)
336361 let uEntryIndex = ((("_" + AssetTicker) + "_") + toString(throwOrReturnI(getI(((userId + AssetTicker) + entryIndex)), "no entry found for user")))
337362 let uAlreadyClaimedKey = ((userId + uEntryIndex) + alreadyClaimed)
338363 let check0 = throwIf((valueOrErrorMessage(getBoolean(uAlreadyClaimedKey), "cannot ascertain claimability") == true), (("user + " + userId) + " already claimed"))
339364 if ((check0 == check0))
340365 then {
341366 let uAsset = getSV(((userId + uEntryIndex) + lockedAsset))
342367 let uLockedAmount = getIV(((userId + uEntryIndex) + lockedAmount))
343368 let stakingReserve = addressFromStringValue(throwOrReturnS(getS((AssetTicker + stakingStore)), "internal error: no reserve found"))
344369 let APYAMount = getIV(((userId + uEntryIndex) + APY_Amount))
345370 let period = getIV(((userId + uEntryIndex) + unlockEligibility))
346371 let blocksLeft = if ((0 >= (period - height)))
347372 then 0
348373 else (period - height)
349374 let daysLeft = blocksToDays(blocksLeft)
350375 let check1 = throwIf((period > height), (toString(daysLeft) + "/1000 days left to claim"))
351376 if ((check1 == check1))
352377 then {
353378 let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, toBytes(uAsset)], nil)
354379 if ((transferAPYAmount == transferAPYAmount))
355380 then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, toBytes(uAsset)), BooleanEntry(uAlreadyClaimedKey, true)]
356381 else throw("Strict value is not equal to itself.")
357382 }
358383 else throw("Strict value is not equal to itself.")
359384 }
360385 else throw("Strict value is not equal to itself.")
361386 }
362387
363388

github/deemru/w8io/169f3d6 
61.57 ms