tx · EAdvzzmBtUyshwxbECnqyAVPPqin7LdNatUhPRF2rCR7 3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS: -0.01000000 Waves 2023.11.10 16:04 [2837283] smart account 3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS > SELF 0.00000000 Waves
{ "type": 13, "id": "EAdvzzmBtUyshwxbECnqyAVPPqin7LdNatUhPRF2rCR7", "fee": 1000000, "feeAssetId": null, "timestamp": 1699621503414, "version": 2, "chainId": 84, "sender": "3N4r7DNT8t9WqaQWr8or1Hakm4AJfVDk6mS", "senderPublicKey": "CMMtdSwXAf6tvNvyJDrdC5VGmRkcXU5CqmsapxKNPhLu", "proofs": [ "5TigyWVP7re3gPHv3jPx5xQzRchfg7RpcLz3ia4ZdhCjgLrgHh81S1fpStC1tcDVqKqUw5jqtL5yu3sr3rUScdSf" ], "script": "base64:BgI5CAISBgoECAgBARIDCgEIEgASABIECgIICBIDCgEIEgMKAQgSAwoBARIDCgEBEgASAwoBARIDCgEIGQADU0VQAgJfXwAHZmVlUmFuawCQTgAJd3hBc3NldElkASB6bQLDKkAdN6wf+7trwy200VZFDNDd29aFKJLgHB2a4wAKc2J0QXNzZXRJZAEg7b51XE58aMp9lj9uI5FGnnl/9BHmO+37TVRB3Im5ctkADXdhdmVzRXhjaGFuZ2UBGgFU/Dsuc5FpNxWwmLp+YyVh+q94Okzod8AfABVjbGFpbVd4UmV3YXJkQ29udHJhY3QBGgFU/Dsuc5FpNxWwmLp+YyVh+q94Okzod8AfABBpc0NvbnN0cnVjdGVkS2V5Ag5pc19jb25zdHJ1Y3RlZAAPYWRtaW5BZGRyZXNzS2V5Ag1hZG1pbl9hZGRyZXNzAA5zYld4QXNzZXRJZEtleQIOc2Jfd3hfYXNzZXRfaWQACmxwUG9vbHNLZXkCCGxwX3Bvb2xzABdhZGRpdGlvbmFsUmV3YXJkUG9vbEtleQIWYWRkaXRpb25hbF9yZXdhcmRfcG9vbAAaYWRkaXRpb25hbFJld2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UCBQdjbGFpbWVkBRJzYnRTdGFrZVBvb2xBbW91bnQFGmFkZGl0aW9uYWxSZXdhcmRQb29sQW1vdW50CQDOCAIJAM4IAgkAzggCBRBzYnRSZXdhcmRBY3Rpb25zBRNzYnRTdGFrZVBvb2xBY3Rpb25zBRxhZGRpdGlvbmFsUmV3YXJkc1Bvb2xBY3Rpb25zCQDMCAIJAQxJbnRlZ2VyRW50cnkCBRtzYnRTdGFrZVBvb2xUb3RhbENsYWltZWRLZXkJAGQCBRhzYnRTdGFrZVBvb2xUb3RhbENsYWltZWQFEnNidFN0YWtlUG9vbEFtb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQtwb29sQWRkcmVzcwULcG9vbENsYWltZWQFCXd4QXNzZXRJZAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAFSMhzc=", "height": 2837283, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CmtxmCYWtcJeupfrW2k3w5DFiMHnF2u77qdv9DoTLM5a Next: none Diff:
Old | New | Differences | |
---|---|---|---|
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(i) | |
116 | - | func changeSBTPoolAddress (address) = [StringEntry( | |
116 | + | func changeSBTPoolAddress (address) = [StringEntry(sbtStakePoolKey, address)] | |
117 | 117 | ||
118 | 118 | ||
119 | 119 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let feeRank = 10000 | |
7 | 7 | ||
8 | 8 | let wxAssetId = base58'9Eu9de5GPPgLzY16bevCaxF4rFr4jA9wqyTfqcjksU82' | |
9 | 9 | ||
10 | 10 | let sbtAssetId = base58'H144sePa8bNCDFTzZNkUnk6QMz387T2ruKPMQ5DJ3DyS' | |
11 | 11 | ||
12 | 12 | let wavesExchange = base58'3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok' | |
13 | 13 | ||
14 | 14 | let claimWxRewardContract = base58'3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok' | |
15 | 15 | ||
16 | 16 | let isConstructedKey = "is_constructed" | |
17 | 17 | ||
18 | 18 | let adminAddressKey = "admin_address" | |
19 | 19 | ||
20 | 20 | let sbWxAssetIdKey = "sb_wx_asset_id" | |
21 | 21 | ||
22 | 22 | let lpPoolsKey = "lp_pools" | |
23 | 23 | ||
24 | 24 | let additionalRewardPoolKey = "additional_reward_pool" | |
25 | 25 | ||
26 | 26 | let additionalRewardPoolFeeKey = "additional_reward_pool_fee" | |
27 | 27 | ||
28 | 28 | let sbtStakePoolKey = "sbt_stake_pool" | |
29 | 29 | ||
30 | 30 | let sbtStakePoolFeeKey = "sbt_stake_pool_fee" | |
31 | 31 | ||
32 | 32 | let sbtStakePoolTotalClaimedKey = "sbt_stake_pool_total_claimed" | |
33 | 33 | ||
34 | 34 | let totalWXLockedKey = "total_wx_locked" | |
35 | 35 | ||
36 | 36 | let initialSBTTokensAmountKey = "initial_SBT_tokens_amount" | |
37 | 37 | ||
38 | 38 | let baseSBTTokenAmountForOneRewardTokenKey = "base_SBT_token_amount_for_one_reward_token" | |
39 | 39 | ||
40 | 40 | func asPayment (v) = match v { | |
41 | 41 | case p: AttachedPayment => | |
42 | 42 | p | |
43 | 43 | case _ => | |
44 | 44 | throw("fail to cast into AttachedPayment") | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func asByteVector (v) = match v { | |
49 | 49 | case p: ByteVector => | |
50 | 50 | p | |
51 | 51 | case _ => | |
52 | 52 | throw("fail to cast into ByteVector") | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func asInt (val) = match val { | |
57 | 57 | case valInt: Int => | |
58 | 58 | valInt | |
59 | 59 | case _ => | |
60 | 60 | throw("fail to cast into Int") | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func asAddressString (address) = match addressFromString(address) { | |
65 | 65 | case a: Address => | |
66 | 66 | toString(a) | |
67 | 67 | case _ => | |
68 | 68 | throw("fail to cast into Address String") | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func calculateCurrentRewardSBTAmount (rewardTokenCount) = { | |
73 | 73 | let baseSBTTokenAmountForOneRewardToken = getIntegerValue(this, baseSBTTokenAmountForOneRewardTokenKey) | |
74 | 74 | let initialSBTTokensAmount = getIntegerValue(this, initialSBTTokensAmountKey) | |
75 | 75 | let currentSBTTokensBalance = assetBalance(this, sbtAssetId) | |
76 | 76 | if ((currentSBTTokensBalance == 0)) | |
77 | 77 | then 0 | |
78 | 78 | else { | |
79 | 79 | let currentSBTTokenAmountForOneRewardToken = fraction(baseSBTTokenAmountForOneRewardToken, currentSBTTokensBalance, initialSBTTokensAmount) | |
80 | 80 | let amountSBT = (rewardTokenCount * currentSBTTokenAmountForOneRewardToken) | |
81 | 81 | if ((amountSBT > currentSBTTokensBalance)) | |
82 | 82 | then currentSBTTokensBalance | |
83 | 83 | else amountSBT | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func isAuthorizedPool (pool) = { | |
89 | 89 | let checkedPool = asAddressString(pool) | |
90 | 90 | let lpPools = getStringValue(lpPoolsKey) | |
91 | 91 | contains(lpPools, checkedPool) | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getPoolData (pool) = if (!(isAuthorizedPool(pool))) | |
96 | 96 | then throw("Not authorized pool") | |
97 | 97 | else { | |
98 | 98 | let poolLpToken = getStringValue(addressFromStringValue(pool), "token") | |
99 | 99 | let wavesExchangePoolAddress = addressFromStringValue(getStringValue(pool)) | |
100 | 100 | $Tuple2(poolLpToken, wavesExchangePoolAddress) | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | @Callable(i) | |
105 | 105 | func constructor (adminAddress,sbtStakePool,initialSBTTokensAmount,sbtTokensForOneRewardToken) = if (isDefined(getBoolean(isConstructedKey))) | |
106 | 106 | then throw("Constructor can be called one time") | |
107 | 107 | else { | |
108 | 108 | let sbWx = Issue("testSbWX", "", 0, 8, true, unit, 0) | |
109 | 109 | let assetId = calculateAssetId(sbWx) | |
110 | 110 | [sbWx, StringEntry(sbWxAssetIdKey, toBase58String(assetId)), StringEntry(adminAddressKey, asAddressString(adminAddress)), StringEntry(sbtStakePoolKey, asAddressString(sbtStakePool)), IntegerEntry(sbtStakePoolFeeKey, 1400), IntegerEntry(sbtStakePoolTotalClaimedKey, 0), StringEntry(lpPoolsKey, ""), StringEntry(additionalRewardPoolKey, ""), IntegerEntry(additionalRewardPoolFeeKey, 600), BooleanEntry(isConstructedKey, true), IntegerEntry(totalWXLockedKey, 0), IntegerEntry(initialSBTTokensAmountKey, initialSBTTokensAmount), IntegerEntry(baseSBTTokenAmountForOneRewardTokenKey, sbtTokensForOneRewardToken)] | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(i) | |
116 | - | func changeSBTPoolAddress (address) = [StringEntry( | |
116 | + | func changeSBTPoolAddress (address) = [StringEntry(sbtStakePoolKey, address)] | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(i) | |
121 | 121 | func mintSbWx () = if ((size(i.payments) != 1)) | |
122 | 122 | then throw("One Payment expected") | |
123 | 123 | else { | |
124 | 124 | let payment = asPayment(i.payments[0]) | |
125 | 125 | let amount = payment.amount | |
126 | 126 | if (if ((payment.assetId != wxAssetId)) | |
127 | 127 | then true | |
128 | 128 | else (0 >= amount)) | |
129 | 129 | then throw("Wrong Asset id or amount") | |
130 | 130 | else { | |
131 | 131 | let totalWXLocked = getIntegerValue(totalWXLockedKey) | |
132 | 132 | let sbWxAssetId = getStringValue(sbWxAssetIdKey) | |
133 | 133 | let wavesExchangeInfo = invoke(Address(wavesExchange), "userMaxDurationREADONLY", nil, nil) | |
134 | 134 | if ((wavesExchangeInfo == wavesExchangeInfo)) | |
135 | 135 | then match wavesExchangeInfo { | |
136 | 136 | case tuple: (String, Int) => | |
137 | 137 | let functionName = tuple._1 | |
138 | 138 | let maxLockDuration = tuple._2 | |
139 | 139 | let result = invoke(Address(wavesExchange), functionName, [maxLockDuration], [payment]) | |
140 | 140 | if ((result == result)) | |
141 | 141 | then { | |
142 | 142 | let sbWx = fromBase58String(sbWxAssetId) | |
143 | 143 | [Reissue(sbWx, amount, true), ScriptTransfer(Address(i.caller.bytes), amount, sbWx), IntegerEntry(totalWXLockedKey, (totalWXLocked + amount))] | |
144 | 144 | } | |
145 | 145 | else throw("Strict value is not equal to itself.") | |
146 | 146 | case _ => | |
147 | 147 | throw("FATAL: Inconsistent data") | |
148 | 148 | } | |
149 | 149 | else throw("Strict value is not equal to itself.") | |
150 | 150 | } | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | ||
155 | 155 | @Callable(i) | |
156 | 156 | func claimWxStakingRewards () = { | |
157 | 157 | let currentWxOnContract = assetBalance(this, wxAssetId) | |
158 | 158 | if ((currentWxOnContract == currentWxOnContract)) | |
159 | 159 | then { | |
160 | 160 | let claimResult = invoke(Address(claimWxRewardContract), "claimReward", nil, nil) | |
161 | 161 | if ((claimResult == claimResult)) | |
162 | 162 | then { | |
163 | 163 | let newWxOnContract = assetBalance(this, wxAssetId) | |
164 | 164 | let claimed = (newWxOnContract - currentWxOnContract) | |
165 | 165 | if ((claimed == 0)) | |
166 | 166 | then throw("Nothing to claim") | |
167 | 167 | else { | |
168 | 168 | let sbtStakePoolTotalClaimed = getIntegerValue(sbtStakePoolTotalClaimedKey) | |
169 | 169 | [IntegerEntry(sbtStakePoolTotalClaimedKey, (sbtStakePoolTotalClaimed + claimed)), ScriptTransfer(addressFromStringValue(getStringValue(sbtStakePoolKey)), claimed, wxAssetId)] | |
170 | 170 | } | |
171 | 171 | } | |
172 | 172 | else throw("Strict value is not equal to itself.") | |
173 | 173 | } | |
174 | 174 | else throw("Strict value is not equal to itself.") | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | ||
179 | 179 | @Callable(i) | |
180 | 180 | func addPool (address,wavesExchangePoolAddress) = if ((toBase58String(i.caller.bytes) != getStringValue(adminAddressKey))) | |
181 | 181 | then throw("Only Admin can call this function") | |
182 | 182 | else { | |
183 | 183 | let lpPools = getStringValue(lpPoolsKey) | |
184 | 184 | if (isAuthorizedPool(address)) | |
185 | 185 | then throw("Pool already added") | |
186 | 186 | else { | |
187 | 187 | let newPools = if ((size(lpPools) == 0)) | |
188 | 188 | then address | |
189 | 189 | else ((lpPools + SEP) + address) | |
190 | 190 | [StringEntry(lpPoolsKey, newPools), StringEntry(asAddressString(address), asAddressString(wavesExchangePoolAddress))] | |
191 | 191 | } | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | ||
196 | 196 | @Callable(i) | |
197 | 197 | func removePool (address) = if ((toBase58String(i.caller.bytes) != getStringValue(adminAddressKey))) | |
198 | 198 | then throw("Only Admin can call this function") | |
199 | 199 | else { | |
200 | 200 | let lpPools = getStringValue(lpPoolsKey) | |
201 | 201 | if (!(isAuthorizedPool(address))) | |
202 | 202 | then throw("Pool not found") | |
203 | 203 | else { | |
204 | 204 | let poolsArray = split_4C(lpPools, SEP) | |
205 | 205 | let poolIndex = asInt(indexOf(poolsArray, address)) | |
206 | 206 | let newPools = makeString_2C(removeByIndex(poolsArray, poolIndex), SEP) | |
207 | 207 | ([StringEntry(lpPoolsKey, newPools), DeleteEntry(address)] ++ (if ((getStringValue(additionalRewardPoolKey) == address)) | |
208 | 208 | then [StringEntry(additionalRewardPoolKey, "")] | |
209 | 209 | else nil)) | |
210 | 210 | } | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | ||
215 | 215 | @Callable(i) | |
216 | 216 | func setAdditionalRewardsPool (address) = if ((toBase58String(i.caller.bytes) != getStringValue(adminAddressKey))) | |
217 | 217 | then throw("Only Admin can call this function") | |
218 | 218 | else if (!(isAuthorizedPool(address))) | |
219 | 219 | then throw("Only authorized pool can be added as additional reward pool") | |
220 | 220 | else [StringEntry(additionalRewardPoolKey, address)] | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | ||
224 | 224 | @Callable(i) | |
225 | 225 | func setAdditionalRewardsPoolFee (fee) = if ((toBase58String(i.caller.bytes) != getStringValue(adminAddressKey))) | |
226 | 226 | then throw("Only Admin can call this function") | |
227 | 227 | else if ((fee > 2000)) | |
228 | 228 | then throw("Fee can't be bigger than 20%") | |
229 | 229 | else if ((0 > fee)) | |
230 | 230 | then throw("Fee can't be negative") | |
231 | 231 | else [IntegerEntry(additionalRewardPoolFeeKey, fee)] | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | ||
235 | 235 | @Callable(i) | |
236 | 236 | func setSbtPoolFee (fee) = if ((toBase58String(i.caller.bytes) != getStringValue(adminAddressKey))) | |
237 | 237 | then throw("Only Admin can call this function") | |
238 | 238 | else if ((fee > 2000)) | |
239 | 239 | then throw("Fee can't be bigger than 20%") | |
240 | 240 | else if ((0 > fee)) | |
241 | 241 | then throw("Fee can't be negative") | |
242 | 242 | else [IntegerEntry(sbtStakePoolFeeKey, fee)] | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | ||
246 | 246 | @Callable(i) | |
247 | 247 | func stakePoolLps () = if ((size(i.payments) != 1)) | |
248 | 248 | then throw("One Payment expected") | |
249 | 249 | else { | |
250 | 250 | let poolData = getPoolData(toBase58String(i.caller.bytes)) | |
251 | 251 | let poolLpToken = poolData._1 | |
252 | 252 | let wavesExchangePoolAddress = poolData._2 | |
253 | 253 | let payment = asPayment(i.payments[0]) | |
254 | 254 | if (if ((payment.assetId != fromBase58String(poolLpToken))) | |
255 | 255 | then true | |
256 | 256 | else (0 >= payment.amount)) | |
257 | 257 | then throw("Wrong LP Asset id or amount") | |
258 | 258 | else { | |
259 | 259 | let result = invoke(wavesExchangePoolAddress, "stake", nil, [payment]) | |
260 | 260 | if ((result == result)) | |
261 | 261 | then nil | |
262 | 262 | else throw("Strict value is not equal to itself.") | |
263 | 263 | } | |
264 | 264 | } | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
268 | 268 | @Callable(i) | |
269 | 269 | func withdrawPoolLps (amount) = { | |
270 | 270 | let poolData = getPoolData(toBase58String(i.caller.bytes)) | |
271 | 271 | let poolLpToken = poolData._1 | |
272 | 272 | let wavesExchangePoolAddress = poolData._2 | |
273 | 273 | let result = invoke(wavesExchangePoolAddress, "unstake", [poolLpToken, amount], nil) | |
274 | 274 | if ((result == result)) | |
275 | 275 | then [ScriptTransfer(Address(i.caller.bytes), amount, fromBase58String(poolLpToken))] | |
276 | 276 | else throw("Strict value is not equal to itself.") | |
277 | 277 | } | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | ||
281 | 281 | @Callable(i) | |
282 | 282 | func claimPoolRewards (pool) = { | |
283 | 283 | let poolAddress = addressFromStringValue(pool) | |
284 | 284 | let poolData = getPoolData(pool) | |
285 | 285 | let poolLpToken = poolData._1 | |
286 | 286 | let wavesExchangePoolAddress = poolData._2 | |
287 | 287 | let currentWXOnContract = assetBalance(this, wxAssetId) | |
288 | 288 | if ((currentWXOnContract == currentWXOnContract)) | |
289 | 289 | then { | |
290 | 290 | let claimResult = invoke(wavesExchangePoolAddress, "claimWX", [poolLpToken], nil) | |
291 | 291 | if ((claimResult == claimResult)) | |
292 | 292 | then { | |
293 | 293 | let newWXOnContract = assetBalance(this, wxAssetId) | |
294 | 294 | let claimed = (newWXOnContract - currentWXOnContract) | |
295 | 295 | if ((claimed == 0)) | |
296 | 296 | then throw("Nothing to claim") | |
297 | 297 | else { | |
298 | 298 | let sbtRewardAmount = calculateCurrentRewardSBTAmount(claimed) | |
299 | 299 | let sbtRewardActions = if ((sbtRewardAmount == 0)) | |
300 | 300 | then nil | |
301 | 301 | else [ScriptTransfer(poolAddress, sbtRewardAmount, sbtAssetId)] | |
302 | 302 | let sbtStakePool = addressFromStringValue(getStringValue(sbtStakePoolKey)) | |
303 | 303 | let sbtStakePoolFee = getIntegerValue(sbtStakePoolFeeKey) | |
304 | 304 | let sbtStakePoolTotalClaimed = getIntegerValue(sbtStakePoolTotalClaimedKey) | |
305 | 305 | let sbtStakePoolAmount = fraction(claimed, sbtStakePoolFee, feeRank, HALFUP) | |
306 | 306 | let sbtStakePoolActions = if ((sbtStakePoolAmount == 0)) | |
307 | 307 | then nil | |
308 | 308 | else [ScriptTransfer(sbtStakePool, sbtStakePoolAmount, wxAssetId)] | |
309 | 309 | let additionalRewardPool = getStringValue(additionalRewardPoolKey) | |
310 | 310 | let additionalRewardPoolFree = getIntegerValue(additionalRewardPoolFeeKey) | |
311 | 311 | let additionalRewardPoolAmount = if ((size(additionalRewardPool) == 0)) | |
312 | 312 | then 0 | |
313 | 313 | else if ((additionalRewardPool != pool)) | |
314 | 314 | then fraction(claimed, additionalRewardPoolFree, feeRank, HALFUP) | |
315 | 315 | else 0 | |
316 | 316 | let additionalRewardsPoolActions = if ((additionalRewardPoolAmount == 0)) | |
317 | 317 | then nil | |
318 | 318 | else [ScriptTransfer(addressFromStringValue(additionalRewardPool), additionalRewardPoolAmount, wxAssetId)] | |
319 | 319 | let poolClaimed = ((claimed - sbtStakePoolAmount) - additionalRewardPoolAmount) | |
320 | 320 | (((sbtRewardActions ++ sbtStakePoolActions) ++ additionalRewardsPoolActions) ++ [IntegerEntry(sbtStakePoolTotalClaimedKey, (sbtStakePoolTotalClaimed + sbtStakePoolAmount)), ScriptTransfer(poolAddress, poolClaimed, wxAssetId)]) | |
321 | 321 | } | |
322 | 322 | } | |
323 | 323 | else throw("Strict value is not equal to itself.") | |
324 | 324 | } | |
325 | 325 | else throw("Strict value is not equal to itself.") | |
326 | 326 | } | |
327 | 327 | ||
328 | 328 |
github/deemru/w8io/169f3d6 64.43 ms ◑