tx · B5w39A7YmPq3WqFgHhMRJt1b4HK9iWwDhSJSnshjksn6

3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx:  -0.01500000 Waves

2022.08.24 20:58 [2198891] smart account 3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx > SELF 0.00000000 Waves

{ "type": 13, "id": "B5w39A7YmPq3WqFgHhMRJt1b4HK9iWwDhSJSnshjksn6", "fee": 1500000, "feeAssetId": null, "timestamp": 1661363863339, "version": 2, "chainId": 84, "sender": "3N9eLqWNqb7jeF383m9qsXEBqpp8qfQmfbx", "senderPublicKey": "5cWdpE4X7mfNkLmxJ389ws6qGZof4fwydqMcqPexhJ7w", "proofs": [ "5GsVFj3gevkuPtnxzXEd1Ur1V39AaSP4kb5AkAM3MqkHDg1H3xX7aLxgGqsgsAE7hZ5mYFKVnmy8s98oRanWV9wV" ], "script": "base64:AAIFAAAAAAAAAE0IAhIHCgUICAgBARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAkSBQoDCAgBEgUKAwEIARIECgIIAQAAACYAAAAADGxvY2tpbmdTdG9yZQUAAAAEdGhpcwAAAAAMc3Rha2luZ1N0b3JlAgAAAAhfUmVzZXJ2ZQAAAAARbWluaW11bUxvY2tBbW91bnQCAAAADl9NaW5Mb2NrQW1vdW50AAAAABFtYXhpbXVtTG9ja0Ftb3VudAIAAAAOX01heExvY2tBbW91bnQAAAAACWFzc2V0TGlzdAUAAAADbmlsAAAAABF1bmxvY2tFbGlnaWJpbGl0eQIAAAAcX0VsaWdpYmxlX3RvX3VubG9ja19hdF9ibG9jawAAAAAMbG9ja2VkQW1vdW50AgAAAA5fQW1vdW50X2xvY2tlZAAAAAALbG9ja2VkQXNzZXQCAAAADV9Bc3NldF9sb2NrZWQAAAAABHVzZXICAAAABV9Vc2VyAAAAAApBUFlfQW1vdW50AgAAAAtfQVBZX2Ftb3VudAAAAAARdG90YWxMb2NrZWRBTW91bnQCA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mhlaWdodAkAASwAAAACCQABpAAAAAEFAAAACGRheXNMZWZ0AgAAABMgZGF5cyBsZWZ0IHRvIGNsYWltAwkAAAAAAAACBQAAAAZjaGVjazEFAAAABmNoZWNrMQQAAAARdHJhbnNmZXJBUFlBbW91bnQJAAP8AAAABAUAAAAOc3Rha2luZ1Jlc2VydmUCAAAAEHRyYW5zZmVySW50ZXJlc3QJAARMAAAAAgUAAAAGdXNlcklkCQAETAAAAAIFAAAACUFQWUFNb3VudAkABEwAAAACCQACWQAAAAEFAAAADHVMb2NrZWRBc3NldAUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAEXRyYW5zZmVyQVBZQW1vdW50BQAAABF0cmFuc2ZlckFQWUFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZ1c2VySWQFAAAADXVMb2NrZWRBbW91bnQJAAJZAAAAAQUAAAAMdUxvY2tlZEFzc2V0CQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACBQAAABJ1QWxyZWFkeUNsYWltZWRLZXkGBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAAaP7wX", "height": 2198891, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E5vs2SijNPsW5C1K6G5URagfuFz5C3tUXDXAxXoTBLbe Next: 5rzWM8EVPDSaRZX1EyBF2SWXeSi9AWBr4X3svSEMjaS1 Diff:
OldNewDifferences
3333
3434 let BlockPerDay = 1440
3535
36+let oneDayLockperiod = 1
37+
38+let sevenDaysLockPeriod = 7
39+
40+let fourteenDaysLockePeriod = 14
41+
3642 let thirtyDaysLockPeriod = 30
3743
3844 let sixtyDaysLockPeriod = 60
3945
4046 let ninetyDaysLockPeriod = 90
41-
42-let oneDayLockperiod = 1
4347
4448 func getI (key) = getInteger(this, key)
4549
8589
8690
8791 func daysToBlocks (days) = if ((days != oneDayLockperiod))
88- then if ((days != thirtyDaysLockPeriod))
89- then if ((days != sixtyDaysLockPeriod))
90- then if ((days != ninetyDaysLockPeriod))
91- then throw("invalid locking period")
92+ then if ((days != sevenDaysLockPeriod))
93+ then if ((days != fourteenDaysLockePeriod))
94+ then if ((days != thirtyDaysLockPeriod))
95+ then if ((days != sixtyDaysLockPeriod))
96+ then if ((days != ninetyDaysLockPeriod))
97+ then throw("invalid locking period")
98+ else (((days + 2) * BlockPerDay) + height)
99+ else (((days + 2) * BlockPerDay) + height)
92100 else (((days + 2) * BlockPerDay) + height)
93101 else (((days + 2) * BlockPerDay) + height)
94102 else (((days + 2) * BlockPerDay) + height)
105113
106114 func writeConstString (key,value) = if (!(isDefined(getS(key))))
107115 then writeStr(key, value)
108- else throw(("already initialized " + key))
116+ else throw(("already initialized: " + key))
109117
110118
111119 func writeConstInteger (key,value) = if (!(isDefined(getS(key))))
112120 then writeInt(key, value)
113- else throw(("already initialized " + key))
121+ else throw(("already initialized: " + key))
114122
115123
116124 func adminOnly (i) = {
339347 let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified")
340348 let check3 = throwIf(if ((minToStake > amountToStake))
341349 then true
342- else (amountToStake > maxToStake), "staking amount is out of range for the selected asset")
350+ else (amountToStake > maxToStake), "staking amount is out of range")
343351 if ((check3 == check3))
344352 then {
345353 let uTotalLocked = (userId + totalLockedAMount)
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
36+let oneDayLockperiod = 1
37+
38+let sevenDaysLockPeriod = 7
39+
40+let fourteenDaysLockePeriod = 14
41+
3642 let thirtyDaysLockPeriod = 30
3743
3844 let sixtyDaysLockPeriod = 60
3945
4046 let ninetyDaysLockPeriod = 90
41-
42-let oneDayLockperiod = 1
4347
4448 func getI (key) = getInteger(this, key)
4549
4650
4751 func getS (key) = getString(this, key)
4852
4953
5054 func getIV (key) = value(getInteger(this, key))
5155
5256
5357 func getSV (key) = value(getString(this, key))
5458
5559
5660 func throwIf (condition,error) = if (condition)
5761 then throw(error)
5862 else true
5963
6064
6165 func throwOrReturnI (val,error) = match val {
6266 case val: Int =>
6367 val
6468 case _ =>
6569 throw(error)
6670 }
6771
6872
6973 func throwOrReturnS (val,error) = match val {
7074 case val: String =>
7175 val
7276 case _ =>
7377 throw(error)
7478 }
7579
7680
7781 func writeInt (key,value) = if ((0 > value))
7882 then throw(((("writing negative value " + toString(value)) + " for key ") + key))
7983 else IntegerEntry(key, value)
8084
8185
8286 func writeStr (key,value) = if ((" " == value))
8387 then throw(("writing an empty string " + value))
8488 else StringEntry(key, value)
8589
8690
8791 func daysToBlocks (days) = if ((days != oneDayLockperiod))
88- then if ((days != thirtyDaysLockPeriod))
89- then if ((days != sixtyDaysLockPeriod))
90- then if ((days != ninetyDaysLockPeriod))
91- then throw("invalid locking period")
92+ then if ((days != sevenDaysLockPeriod))
93+ then if ((days != fourteenDaysLockePeriod))
94+ then if ((days != thirtyDaysLockPeriod))
95+ then if ((days != sixtyDaysLockPeriod))
96+ then if ((days != ninetyDaysLockPeriod))
97+ then throw("invalid locking period")
98+ else (((days + 2) * BlockPerDay) + height)
99+ else (((days + 2) * BlockPerDay) + height)
92100 else (((days + 2) * BlockPerDay) + height)
93101 else (((days + 2) * BlockPerDay) + height)
94102 else (((days + 2) * BlockPerDay) + height)
95103 else (((days + 2) * BlockPerDay) + height)
96104
97105
98106 func blocksToDays (blocksLeft) = if ((0 >= blocksLeft))
99107 then 0
100108 else {
101109 let daysleft = (blocksLeft / BlockPerDay)
102110 daysleft
103111 }
104112
105113
106114 func writeConstString (key,value) = if (!(isDefined(getS(key))))
107115 then writeStr(key, value)
108- else throw(("already initialized " + key))
116+ else throw(("already initialized: " + key))
109117
110118
111119 func writeConstInteger (key,value) = if (!(isDefined(getS(key))))
112120 then writeInt(key, value)
113- else throw(("already initialized " + key))
121+ else throw(("already initialized: " + key))
114122
115123
116124 func adminOnly (i) = {
117125 let inputAddress = toBase58String(i.caller.bytes)
118126 let otherAdmin = (admin + inputAddress)
119127 match getS(admin) {
120128 case a: String =>
121129 if ((inputAddress != getS(admin)))
122130 then throw("unauthorized")
123131 else true
124132 case _ =>
125133 match getS(otherAdmin) {
126134 case b: String =>
127135 if ((inputAddress != getS(otherAdmin)))
128136 then throw("unauthorized")
129137 else true
130138 case _ =>
131139 throw("unauthorizd")
132140 }
133141 }
134142 }
135143
136144
137145 func writeConfigValue (key,data) = match data {
138146 case data: String =>
139147 writeConstString(key, data)
140148 case data: Int =>
141149 writeConstInteger(key, data)
142150 case _ =>
143151 throw("unsupported config type")
144152 }
145153
146154
147155 func incrementEntryIndex (key) = {
148156 let uIndex = getI(key)
149157 if (isDefined(uIndex))
150158 then (value(uIndex) + 1)
151159 else 0
152160 }
153161
154162
155163 @Callable(i)
156164 func addAsset (AssetTicker,AssetID,AssetReserve,AssetMinimumLockAmount,AssetMaximumLockAmount) = {
157165 let check = adminOnly(i)
158166 if ((check == check))
159167 then {
160168 let aStakingStore = (AssetTicker + stakingStore)
161169 let aMinimumLockAmount = (AssetTicker + minimumLockAmount)
162170 let aMaximumLockAmount = (AssetTicker + maximumLockAmount)
163171 let checkMinMax = if ((AssetMaximumLockAmount > AssetMinimumLockAmount))
164172 then [writeConstInteger(aMinimumLockAmount, AssetMinimumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMaximumLockAmount)]
165173 else [writeConstInteger(aMinimumLockAmount, AssetMaximumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMinimumLockAmount)]
166174 ([writeConstString(AssetTicker, AssetID), writeConstString(aStakingStore, AssetReserve)] ++ checkMinMax)
167175 }
168176 else throw("Strict value is not equal to itself.")
169177 }
170178
171179
172180
173181 @Callable(i)
174182 func deleteAsset (AssetTicker) = {
175183 let check = adminOnly(i)
176184 if ((check == check))
177185 then {
178186 let assetID = throwOrReturnS(getS(AssetTicker), (("asset with ticker " + AssetTicker) + " not found"))
179187 if ((assetID == assetID))
180188 then [DeleteEntry(AssetTicker), DeleteEntry((AssetTicker + minimumLockAmount)), DeleteEntry((AssetTicker + maximumLockAmount)), DeleteEntry((AssetTicker + stakingStore))]
181189 else throw("Strict value is not equal to itself.")
182190 }
183191 else throw("Strict value is not equal to itself.")
184192 }
185193
186194
187195
188196 @Callable(i)
189197 func _getAssetIdByTicker (AssetTicker) = {
190198 let check = adminOnly(i)
191199 if ((check == check))
192200 then {
193201 let a = throwOrReturnS(getS(AssetTicker), "asset not found")
194202 $Tuple2(nil, a)
195203 }
196204 else throw("Strict value is not equal to itself.")
197205 }
198206
199207
200208
201209 @Callable(i)
202210 func init (AdminAddress) = {
203211 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
204212 [writeConstString(admin, toString(adminAddr))]
205213 }
206214
207215
208216
209217 @Callable(i)
210218 func _deleteEntry (key) = {
211219 let check = adminOnly(i)
212220 if ((check == check))
213221 then [DeleteEntry(key)]
214222 else throw("Strict value is not equal to itself.")
215223 }
216224
217225
218226
219227 @Callable(i)
220228 func addAdmin (AdminAddress) = {
221229 let check = adminOnly(i)
222230 if ((check == check))
223231 then {
224232 let adminAddr = valueOrErrorMessage(addressFromString(AdminAddress), "invalid address")
225233 let newAdmin = (admin + toString(adminAddr))
226234 [writeConstString(newAdmin, AdminAddress)]
227235 }
228236 else throw("Strict value is not equal to itself.")
229237 }
230238
231239
232240
233241 @Callable(i)
234242 func changeMainAdmin (newAddress) = {
235243 let checks = adminOnly(i)
236244 if ((checks == checks))
237245 then {
238246 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
239247 let del = DeleteEntry(admin)
240248 if ((del == del))
241249 then [writeConstString(admin, toString(adminAddr))]
242250 else throw("Strict value is not equal to itself.")
243251 }
244252 else throw("Strict value is not equal to itself.")
245253 }
246254
247255
248256
249257 @Callable(i)
250258 func updateOtherAdminAddress (newAddress) = {
251259 let checks = adminOnly(i)
252260 if ((checks == checks))
253261 then {
254262 let adminAddr = valueOrErrorMessage(addressFromString(newAddress), "invalid address")
255263 let caller = toString(i.caller)
256264 let otherAdmin = (admin + caller)
257265 let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found")
258266 if ((checkOldAddress == checkOldAddress))
259267 then {
260268 let delAddress = DeleteEntry(otherAdmin)
261269 if ((delAddress == delAddress))
262270 then [writeConstString(otherAdmin, toString(adminAddr))]
263271 else throw("Strict value is not equal to itself.")
264272 }
265273 else throw("Strict value is not equal to itself.")
266274 }
267275 else throw("Strict value is not equal to itself.")
268276 }
269277
270278
271279
272280 @Callable(i)
273281 func removeOtherAdmin (address) = {
274282 let checks = adminOnly(i)
275283 if ((checks == checks))
276284 then {
277285 let adminAddr = valueOrErrorMessage(addressFromString(address), "invalid address")
278286 let otherAddress = (admin + toString(adminAddr))
279287 let delAdmin = DeleteEntry(otherAddress)
280288 if ((delAdmin == delAdmin))
281289 then nil
282290 else throw("Strict value is not equal to itself.")
283291 }
284292 else throw("Strict value is not equal to itself.")
285293 }
286294
287295
288296
289297 @Callable(i)
290298 func updateConfigValue (key,data) = {
291299 let checks = adminOnly(i)
292300 if ((checks == checks))
293301 then {
294302 let del = DeleteEntry(key)
295303 if ((del == del))
296304 then [writeConfigValue(key, data)]
297305 else throw("Strict value is not equal to itself.")
298306 }
299307 else throw("Strict value is not equal to itself.")
300308 }
301309
302310
303311
304312 @Callable(i)
305313 func _getDaysLeftToClaim (userAddress,AssetTicker,EntryIndex) = {
306314 let check0 = adminOnly(i)
307315 if ((check0 == check0))
308316 then {
309317 let check1 = valueOrErrorMessage(addressFromString(userAddress), "invalid address")
310318 if ((check1 == check1))
311319 then {
312320 let uEntryIndex = ((("_" + AssetTicker) + "_") + toString(EntryIndex))
313321 let uUnlockEligibility = ((userAddress + uEntryIndex) + unlockEligibility)
314322 let uBlocksLeft = valueOrErrorMessage(getI(uUnlockEligibility), ("no entry for " + userAddress))
315323 let uBlocksToDays = blocksToDays((uBlocksLeft - height))
316324 $Tuple2(nil, uBlocksToDays)
317325 }
318326 else throw("Strict value is not equal to itself.")
319327 }
320328 else throw("Strict value is not equal to itself.")
321329 }
322330
323331
324332
325333 @Callable(i)
326334 func Lock (LockPeriod,AssetTicker,EntryIndex) = {
327335 let check1 = throwIf((1 != size(i.payments)), "attach amount you want to lock")
328336 if ((check1 == check1))
329337 then {
330338 let assetValue = valueOrErrorMessage(i.payments[0].assetId, "no assetId for the attached asset")
331339 let asset = toBase58String(assetValue)
332340 let check2 = throwIf((getS(AssetTicker) != asset), "asset not supported")
333341 if ((check2 == check2))
334342 then {
335343 let lockPeriod = LockPeriod
336344 let userId = toBase58String(i.caller.bytes)
337345 let amountToStake = i.payments[0].amount
338346 let minToStake = throwOrReturnI(getI((AssetTicker + minimumLockAmount)), "internal error: minimum stacking amount not specified")
339347 let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified")
340348 let check3 = throwIf(if ((minToStake > amountToStake))
341349 then true
342- else (amountToStake > maxToStake), "staking amount is out of range for the selected asset")
350+ else (amountToStake > maxToStake), "staking amount is out of range")
343351 if ((check3 == check3))
344352 then {
345353 let uTotalLocked = (userId + totalLockedAMount)
346354 let uSumTotal = if (!(isDefined(getI(uTotalLocked))))
347355 then 0
348356 else (amountToStake + value(getI(uTotalLocked)))
349357 let check4 = throwIf((uSumTotal > maxToStake), "you have maxed out your quota")
350358 if ((check4 == check4))
351359 then {
352360 let uEntryToString = toString(EntryIndex)
353361 let uEntry = ((("_" + AssetTicker) + "_") + uEntryToString)
354362 let uUserEntryKey = (userId + uEntry)
355363 let uUserId = ((userId + uEntry) + user)
356364 let uAsset = ((userId + uEntry) + lockedAsset)
357365 let uLockingPeriod = ((userId + uEntry) + lockingPeriod)
358366 let uLockedAmount = ((userId + uEntry) + lockedAmount)
359367 let uAPY = ((userId + uEntry) + APY_Amount)
360368 let uUnlockEligibility = ((userId + uEntry) + unlockEligibility)
361369 let uAlreadyClaimed = ((userId + uEntry) + alreadyClaimed)
362370 let StoredAPY = invoke(Address(fromBase58String(getSV(admin))), "getAPYAmount", [userId, AssetTicker, EntryIndex], nil)
363371 let APY = match StoredAPY {
364372 case c: Int =>
365373 c
366374 case _ =>
367375 throw(("could not get the APY amount for " + userId))
368376 }
369377 [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)]
370378 }
371379 else throw("Strict value is not equal to itself.")
372380 }
373381 else throw("Strict value is not equal to itself.")
374382 }
375383 else throw("Strict value is not equal to itself.")
376384 }
377385 else throw("Strict value is not equal to itself.")
378386 }
379387
380388
381389
382390 @Callable(i)
383391 func Claim (AssetTicker,EntryIndex) = {
384392 let userId = toString(i.caller)
385393 let asset = valueOrErrorMessage(getS(AssetTicker), "invalid asset")
386394 if ((asset == asset))
387395 then {
388396 let uEntry = ((("_" + AssetTicker) + "_") + toString(EntryIndex))
389397 let uUserID = valueOrErrorMessage(getS(((userId + uEntry) + user)), ("no entry found for user " + userId))
390398 if ((uUserID == uUserID))
391399 then {
392400 let uLockedAsset = valueOrErrorMessage(getS(((userId + uEntry) + lockedAsset)), "asset not locked by user")
393401 let uAlreadyClaimedKey = ((userId + uEntry) + alreadyClaimed)
394402 let check0 = throwIf((valueOrErrorMessage(getBoolean(uAlreadyClaimedKey), "cannot ascertain claimability") == true), (("user + " + userId) + " already claimed"))
395403 if ((check0 == check0))
396404 then {
397405 let uLockedAmount = getIV(((userId + uEntry) + lockedAmount))
398406 let stakingReserve = addressFromStringValue(throwOrReturnS(getS((AssetTicker + stakingStore)), "internal error: no reserve found"))
399407 let APYAMount = getIV(((userId + uEntry) + APY_Amount))
400408 let period = getIV(((userId + uEntry) + unlockEligibility))
401409 let blocksLeft = if ((0 >= (period - height)))
402410 then 0
403411 else (period - height)
404412 let daysLeft = blocksToDays(blocksLeft)
405413 let check1 = throwIf((period > height), (toString(daysLeft) + " days left to claim"))
406414 if ((check1 == check1))
407415 then {
408416 let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, fromBase58String(uLockedAsset)], nil)
409417 if ((transferAPYAmount == transferAPYAmount))
410418 then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, fromBase58String(uLockedAsset)), BooleanEntry(uAlreadyClaimedKey, true)]
411419 else throw("Strict value is not equal to itself.")
412420 }
413421 else throw("Strict value is not equal to itself.")
414422 }
415423 else throw("Strict value is not equal to itself.")
416424 }
417425 else throw("Strict value is not equal to itself.")
418426 }
419427 else throw("Strict value is not equal to itself.")
420428 }
421429
422430

github/deemru/w8io/169f3d6 
79.48 ms