tx · 4Uj4ncgiqGfZhhkv3D1GSeyXxdomW7vYVmv4kwESQjCi

3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx:  -0.10000000 Waves

2022.06.04 01:43 [2080782] smart account 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx > SELF 0.00000000 Waves

{ "type": 13, "id": "4Uj4ncgiqGfZhhkv3D1GSeyXxdomW7vYVmv4kwESQjCi", "fee": 10000000, "feeAssetId": null, "timestamp": 1654296209784, "version": 2, "chainId": 84, "sender": "3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx", "senderPublicKey": "5cWdpE4X7mfNkLmxJ389ws6qGZof4fwydqMcqPexhJ7w", "proofs": [ "5hGtTuj1JGKbBBK7VMaBGLf88AyQ9vn1r82aVmemh4uMa1tLPZB1VCBqM4zsxWx87R5A2zr2hfH1XrsvW1oEguM7" ], "script": "base64:AAIFAAAAAAAAAEAIAhIHCgUICAgBARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICRIDCgEIEgUKAwEIARIDCgEIAAAAIwAAAAAMbG9ja2luZ1N0b3JlBQAAAAR0aGlzAAAAAAxzdGFraW5nU3RvcmUCAAAACF9SZXNlcnZlAAAAABFtaW5pbXVtTG9ja0Ftb3VudAIAAAAOX01pbkxvY2tBbW91bnQAAAAAEW1heGltdW1Mb2NrQW1vdW50AgAAAA5fTWF4TG9ja0Ftb3VudAAAAAAJYXNzZXRMaXN0BQAAAANuaWwAAAAAEXVubG9ja0VsaWdpYmlsaXR5AgAAABxfRWxpZ2libGVfdG9fdW5sb2NrX2F0X2Jsb2NrAAAAAAxsb2NrZWRBbW91bnQCAAAADl9BbW91bnRfbG9ja2VkAAAAAAtsb2NrZWRBc3NldAIAAAANX0Fzc2V0X2xvY2tlZAAAAAAEdXNlcgIAAAAFX1VzZXIAAAAACkFQWV9BbW91bnQCAAAAC19BUFlfYW1vdW50AAAAABF0b3RhbExvY2tlZEFNb3VudAIAAAAUX1Rvd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AAAAAAAAACQAAZQAAAAIFAAAABnBlcmlvZAUAAAAGaGVpZ2h0BAAAAAhkYXlzTGVmdAkBAAAADGJsb2Nrc1RvRGF5cwAAAAEFAAAACmJsb2Nrc0xlZnQEAAAABmNoZWNrMQkBAAAAB3Rocm93SWYAAAACCQAAZgAAAAIFAAAABnBlcmlvZAUAAAAGaGVpZ2h0CQABLAAAAAIJAAGkAAAAAQUAAAAIZGF5c0xlZnQCAAAAGC8xMDAwIGRheXMgbGVmdCB0byBjbGFpbQMJAAAAAAAAAgUAAAAGY2hlY2sxBQAAAAZjaGVjazEEAAAAEXRyYW5zZmVyQVBZQW1vdW50CQAD/AAAAAQFAAAADnN0YWtpbmdSZXNlcnZlAgAAABB0cmFuc2ZlckludGVyZXN0CQAETAAAAAIFAAAABnVzZXJJZAkABEwAAAACBQAAAAlBUFlBTW91bnQJAARMAAAAAgkAAZsAAAABBQAAAAZ1QXNzZXQFAAAAA25pbAUAAAADbmlsAwkAAAAAAAACBQAAABF0cmFuc2ZlckFQWUFtb3VudAUAAAARdHJhbnNmZXJBUFlBbW91bnQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGdXNlcklkBQAAAA11TG9ja2VkQW1vdW50CQABmwAAAAEFAAAABnVBc3NldAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAASdUFscmVhZHlDbGFpbWVkS2V5BgUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAOWhiBg=", "height": 2080782, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ge5EbvWYkiC6PsyTeFcgj3y8w9e7Cwe7JJRCbn4ws7cf Next: EqZRZNqBABiYPE4aVKL42L9oKt6rxUZ7Md5H2CJPaA6G Diff:
OldNewDifferences
168168
169169
170170 @Callable(i)
171-func init (AdminAddress) = [writeConstString(admin, toString(addressFromStringValue(AdminAddress)))]
171+func init (AdminAddress) = {
172+ let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
173+[writeConstString(admin, toString(adminAddr))]
174+ }
172175
173176
174177
177180 let check = adminOnly(i)
178181 if ((check == check))
179182 then {
180- let newAdmin = (admin + AdminAddress)
183+ let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
184+ let newAdmin = (admin + toString(adminAddr))
181185 [writeConstString(newAdmin, AdminAddress)]
182186 }
183187 else throw("Strict value is not equal to itself.")
186190
187191
188192 @Callable(i)
189-func changeMainAdmin (address) = {
193+func changeMainAdmin (newAddress) = {
190194 let checks = adminOnly(i)
191195 if ((checks == checks))
192196 then {
197+ let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
193198 let del = DeleteEntry(admin)
194199 if ((del == del))
195- then [writeConstString(admin, address)]
200+ then [writeConstString(admin, toString(adminAddr))]
196201 else throw("Strict value is not equal to itself.")
197202 }
198203 else throw("Strict value is not equal to itself.")
201206
202207
203208 @Callable(i)
204-func updateOtherAdminAddress (address) = {
209+func updateOtherAdminAddress (newAddress) = {
205210 let checks = adminOnly(i)
206211 if ((checks == checks))
207212 then {
213+ let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
208214 let caller = toString(i.caller)
209215 let otherAdmin = (admin + caller)
210216 let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found")
212218 then {
213219 let delAddress = DeleteEntry(otherAdmin)
214220 if ((delAddress == delAddress))
215- then [writeConstString(otherAdmin, address)]
221+ then [writeConstString(otherAdmin, toString(adminAddr))]
216222 else throw("Strict value is not equal to itself.")
217223 }
218224 else throw("Strict value is not equal to itself.")
227233 let checks = adminOnly(i)
228234 if ((checks == checks))
229235 then {
230- let otherAddress = (admin + address)
236+ let adminAddr = valueOrErrorMessage(addressFromString(address), "invalid address")
237+ let otherAddress = (admin + toString(adminAddr))
231238 let delAdmin = DeleteEntry(otherAddress)
232239 if ((delAdmin == delAdmin))
233240 then nil
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))
116116 if (if ((AdminAddress != valueOrElse(getS(admin), "not an admin")))
117117 then true
118118 else (AdminAddress != valueOrElse(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)
158158 func getAssetIdByTicker (AssetTicker) = {
159159 let check = adminOnly(i)
160160 if ((check == check))
161161 then {
162162 let a = throwOrReturnS(getS(AssetTicker), "asset not found")
163163 $Tuple2(nil, a)
164164 }
165165 else throw("Strict value is not equal to itself.")
166166 }
167167
168168
169169
170170 @Callable(i)
171-func init (AdminAddress) = [writeConstString(admin, toString(addressFromStringValue(AdminAddress)))]
171+func init (AdminAddress) = {
172+ let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
173+[writeConstString(admin, toString(adminAddr))]
174+ }
172175
173176
174177
175178 @Callable(i)
176179 func addAdmin (AdminAddress) = {
177180 let check = adminOnly(i)
178181 if ((check == check))
179182 then {
180- let newAdmin = (admin + AdminAddress)
183+ let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
184+ let newAdmin = (admin + toString(adminAddr))
181185 [writeConstString(newAdmin, AdminAddress)]
182186 }
183187 else throw("Strict value is not equal to itself.")
184188 }
185189
186190
187191
188192 @Callable(i)
189-func changeMainAdmin (address) = {
193+func changeMainAdmin (newAddress) = {
190194 let checks = adminOnly(i)
191195 if ((checks == checks))
192196 then {
197+ let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
193198 let del = DeleteEntry(admin)
194199 if ((del == del))
195- then [writeConstString(admin, address)]
200+ then [writeConstString(admin, toString(adminAddr))]
196201 else throw("Strict value is not equal to itself.")
197202 }
198203 else throw("Strict value is not equal to itself.")
199204 }
200205
201206
202207
203208 @Callable(i)
204-func updateOtherAdminAddress (address) = {
209+func updateOtherAdminAddress (newAddress) = {
205210 let checks = adminOnly(i)
206211 if ((checks == checks))
207212 then {
213+ let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
208214 let caller = toString(i.caller)
209215 let otherAdmin = (admin + caller)
210216 let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found")
211217 if ((checkOldAddress == checkOldAddress))
212218 then {
213219 let delAddress = DeleteEntry(otherAdmin)
214220 if ((delAddress == delAddress))
215- then [writeConstString(otherAdmin, address)]
221+ then [writeConstString(otherAdmin, toString(adminAddr))]
216222 else throw("Strict value is not equal to itself.")
217223 }
218224 else throw("Strict value is not equal to itself.")
219225 }
220226 else throw("Strict value is not equal to itself.")
221227 }
222228
223229
224230
225231 @Callable(i)
226232 func removeOtherAdmin (address) = {
227233 let checks = adminOnly(i)
228234 if ((checks == checks))
229235 then {
230- let otherAddress = (admin + address)
236+ let adminAddr = valueOrErrorMessage(addressFromString(address), "invalid address")
237+ let otherAddress = (admin + toString(adminAddr))
231238 let delAdmin = DeleteEntry(otherAddress)
232239 if ((delAdmin == delAdmin))
233240 then nil
234241 else throw("Strict value is not equal to itself.")
235242 }
236243 else throw("Strict value is not equal to itself.")
237244 }
238245
239246
240247
241248 @Callable(i)
242249 func updateConfigValue (key,data) = {
243250 let checks = adminOnly(i)
244251 if ((checks == checks))
245252 then {
246253 let del = DeleteEntry(key)
247254 if ((del == del))
248255 then [writeConfigValue(key, data)]
249256 else throw("Strict value is not equal to itself.")
250257 }
251258 else throw("Strict value is not equal to itself.")
252259 }
253260
254261
255262
256263 @Callable(i)
257264 func getDaysLeftToClaim (userAddress) = {
258265 let check0 = adminOnly(i)
259266 if ((check0 == check0))
260267 then {
261268 let check1 = valueOrErrorMessage(addressFromString(userAddress), "invalid address")
262269 if ((check1 == check1))
263270 then {
264271 let uEntryIndex = ("_" + toString(throwOrReturnI(getI((userAddress + entryIndex)), ("no entry found for " + userAddress))))
265272 let uUnlockEligibility = ((userAddress + uEntryIndex) + unlockEligibility)
266273 let uBlocks = throwOrReturnI(getI(uUnlockEligibility), "internal error")
267274 let uBlocksToDays = daysToBlocks((height - uBlocks))
268275 $Tuple2(nil, uBlocksToDays)
269276 }
270277 else throw("Strict value is not equal to itself.")
271278 }
272279 else throw("Strict value is not equal to itself.")
273280 }
274281
275282
276283
277284 @Callable(i)
278285 func Lock (LockPeriod,AssetTicker,APY) = {
279286 let check1 = throwIf((1 != size(i.payments)), "attach amount you want to lock")
280287 if ((check1 == check1))
281288 then {
282289 let asset = toBase58String(value(i.payments[0].assetId))
283290 let check2 = throwIf((getS(AssetTicker) != asset), "asset not supported")
284291 if ((check2 == check2))
285292 then {
286293 let lockPeriod = LockPeriod
287294 let userId = toString(i.caller)
288295 let amountToStake = i.payments[0].amount
289296 let minToStake = throwOrReturnI(getI((AssetTicker + minimumLockAmount)), "internal error: minimum stacking amount not specified")
290297 let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified")
291298 let check3 = throwIf(if ((minToStake > amountToStake))
292299 then true
293300 else (amountToStake > maxToStake), "staking amount is out of range")
294301 if ((check3 == check3))
295302 then {
296303 let uTotalLocked = (userId + totalLockedAMount)
297304 let uSumTotal = if (!(isDefined(getI(uTotalLocked))))
298305 then 0
299306 else (amountToStake + value(getI(uTotalLocked)))
300307 let check4 = throwIf((uSumTotal > maxToStake), "you have maxed out your quota")
301308 if ((check4 == check4))
302309 then {
303310 let uEntryIndex = ((userId + AssetTicker) + entryIndex)
304311 let uIncrEntryIndex = incrementEntryIndex(uEntryIndex)
305312 let uEntryToString = ((("_" + AssetTicker) + "_") + toString(uIncrEntryIndex))
306313 let uUserId = ((userId + uEntryToString) + user)
307314 let uAsset = ((userId + uEntryToString) + lockedAsset)
308315 let uLockingPeriod = ((userId + uEntryToString) + lockingPeriod)
309316 let uLockedAmount = ((userId + uEntryToString) + lockedAmount)
310317 let uAPY = ((userId + uEntryToString) + APY_Amount)
311318 let uUnlockEligibility = ((userId + uEntryToString) + unlockEligibility)
312319 let uAlreadyClaimed = ((userId + uEntryToString) + alreadyClaimed)
313320 [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)]
314321 }
315322 else throw("Strict value is not equal to itself.")
316323 }
317324 else throw("Strict value is not equal to itself.")
318325 }
319326 else throw("Strict value is not equal to itself.")
320327 }
321328 else throw("Strict value is not equal to itself.")
322329 }
323330
324331
325332
326333 @Callable(i)
327334 func Claim (AssetTicker) = {
328335 let userId = toString(i.caller)
329336 let uEntryIndex = ((("_" + AssetTicker) + "_") + toString(throwOrReturnI(getI(((userId + AssetTicker) + entryIndex)), "no entry found for user")))
330337 let uAlreadyClaimedKey = ((userId + uEntryIndex) + alreadyClaimed)
331338 let check0 = throwIf((valueOrErrorMessage(getBoolean(uAlreadyClaimedKey), "cannot ascertain claimability") == true), (("user + " + userId) + " already claimed"))
332339 if ((check0 == check0))
333340 then {
334341 let uAsset = getSV(((userId + uEntryIndex) + lockedAsset))
335342 let uLockedAmount = getIV(((userId + uEntryIndex) + lockedAmount))
336343 let stakingReserve = addressFromStringValue(throwOrReturnS(getS((AssetTicker + stakingStore)), "internal error: no reserve found"))
337344 let APYAMount = getIV(((userId + uEntryIndex) + APY_Amount))
338345 let period = getIV(((userId + uEntryIndex) + unlockEligibility))
339346 let blocksLeft = if ((0 >= (period - height)))
340347 then 0
341348 else (period - height)
342349 let daysLeft = blocksToDays(blocksLeft)
343350 let check1 = throwIf((period > height), (toString(daysLeft) + "/1000 days left to claim"))
344351 if ((check1 == check1))
345352 then {
346353 let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, toBytes(uAsset)], nil)
347354 if ((transferAPYAmount == transferAPYAmount))
348355 then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, toBytes(uAsset)), BooleanEntry(uAlreadyClaimedKey, true)]
349356 else throw("Strict value is not equal to itself.")
350357 }
351358 else throw("Strict value is not equal to itself.")
352359 }
353360 else throw("Strict value is not equal to itself.")
354361 }
355362
356363

github/deemru/w8io/169f3d6 
69.70 ms