tx · E9gAqUH1Z8mkHbm3WA7PuJ6LcJtfqf8YPasCL2gwpmhC 3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J: -0.02600000 Waves 2023.03.28 08:06 [2509362] smart account 3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J > SELF 0.00000000 Waves
{ "type": 13, "id": "E9gAqUH1Z8mkHbm3WA7PuJ6LcJtfqf8YPasCL2gwpmhC", "fee": 2600000, "feeAssetId": null, "timestamp": 1679980015157, "version": 2, "chainId": 84, "sender": "3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J", "senderPublicKey": "4DthuG3xjZV9WtZ34Y66AummdAr67wRzwWsVQL4y2bob", "proofs": [ "2Tmi8dyQFbpAvzB4THBTzQLfHMUyiCKzthTXTnHgkqF3ohce7qb6wBt9bEANHYTJoXSAnEDrPLeboDaMYWpXgNXu", "2gtdfcKWrzgyvg3MyKXePxFCSLFN2rTFhJTMheEoSr9wMp2d5MExHZorWazuf35mNVAjYKB8vSFZsCVzFmq4GNjE", "Ek96kTTw64dRGyo6N1nZb3p9mt8gDMMspzeGd8WVUK6DW1X1QEzP5RJnnWoKewzQTNgU8pXqCpZwmTaNobv89yB" ], "script": "base64:BgIpCAISBwoFCAgBAQgSABIDCgEBEgASABIAEgMKAQgSBAoCCAESBAoCCAFUAAlzZXBhcmF0b3ICAl9fAANTRVACAl9fAAVNVUxUNgDAhD0ABU1VTFQ4AIDC1y8ABk1VTFRYNgkAtgIBBQVNVUxUNgAGTVVMVFg4CQC2AgEFBU1VTFQ4AAdNVUxUWDE4CQC2AgEAgICQu7rWrfANAApXQVZFU0lEU1RSAgVXQVZFUwAHV0FWRVNJRAkA2QQBBQpXQVZFU0lEU1RSAAlEQVlNSUxMSVMAgLiZKQAJTUFYQkFTS0VUAAkAGUlkeENvbnRyb2xDZmdOZXV0cmlub0RhcHAAAQAYSWR4Q29udHJvbENmZ0F1Y3Rpb25EYXBwAAIAFElkeENvbnRyb2xDZmdScGREYXBwA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QMCBRBwdWJLZXlBZG1pbnNMaXN0AAIAAQAAAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAwkA2QQBCQCRAwIFEHB1YktleUFkbWluc0xpc3QAAwACAAAJAGcCBQVjb3VudAADPesTaA==", "height": 2509362, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 54vbnaqZsxsDCEAu2RsW9izsjHKAH2ihSHeffkvyVwd2 Next: CZpLBavoeneH3HLSnD9uSZ7bVcrixZpQdVx1hGbFCk8v Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let MULT6 = 1000000 | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let MULTX6 = toBigInt(MULT6) | |
13 | 13 | ||
14 | 14 | let MULTX8 = toBigInt(MULT8) | |
15 | 15 | ||
16 | 16 | let MULTX18 = toBigInt(1000000000000000000) | |
17 | 17 | ||
18 | 18 | let WAVESIDSTR = "WAVES" | |
19 | 19 | ||
20 | 20 | let WAVESID = fromBase58String(WAVESIDSTR) | |
21 | 21 | ||
22 | 22 | let DAYMILLIS = 86400000 | |
23 | 23 | ||
24 | 24 | let MAXBASKET = 9 | |
25 | 25 | ||
26 | 26 | let IdxControlCfgNeutrinoDapp = 1 | |
27 | 27 | ||
28 | 28 | let IdxControlCfgAuctionDapp = 2 | |
29 | 29 | ||
30 | 30 | let IdxControlCfgRpdDapp = 3 | |
31 | 31 | ||
32 | 32 | let IdxControlCfgMathDapp = 4 | |
33 | 33 | ||
34 | 34 | let IdxControlCfgLiquidationDapp = 5 | |
35 | 35 | ||
36 | 36 | let IdxControlCfgRestDapp = 6 | |
37 | 37 | ||
38 | 38 | let IdxControlCfgNodeRegistryDapp = 7 | |
39 | 39 | ||
40 | 40 | let IdxControlCfgNsbtStakingDapp = 8 | |
41 | 41 | ||
42 | 42 | let IdxControlCfgMediatorDapp = 9 | |
43 | 43 | ||
44 | 44 | let IdxControlCfgGovernanceDapp = 13 | |
45 | 45 | ||
46 | 46 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyControlAddress () = "%s%s__config__controlAddress" | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyControlCfg () = "%s__controlConfig" | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
62 | 62 | ||
63 | 63 | let controlCfg = readControlCfgOrFail(controlContract) | |
64 | 64 | ||
65 | 65 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
66 | 66 | ||
67 | 67 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
68 | 68 | ||
69 | 69 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
70 | 70 | ||
71 | 71 | let govContract = getContractAddressOrFail(controlCfg, IdxControlCfgGovernanceDapp) | |
72 | 72 | ||
73 | 73 | func keyBondAsset () = "bond_asset_id" | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func keyUserGnsbtReleaseTime (userAddr) = ("%s%s_userGnsbtReleaseTime__" + userAddr) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func keyNeutrinoContractAddress () = "%s__neutrinoContractAddress" | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func keyMathContractAddress () = "%s__mathContract" | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func keyMinLockAmount () = "%s__minLockAmount" | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func keyHalfLife () = "%s__halfLife" | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "amount"], separator) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "start"], separator) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func keyHistoryRecord (type,userAddress,txId) = makeString(["%s%s%s%s", "history", type, toString(userAddress), toBase58String(txId)], separator) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func keyLockParamTotalAmount () = makeString(["%s%s", "stats", "activeTotalLocked"], separator) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func keyStatsLocksCount () = makeString(["%s%s", "stats", "locksCount"], separator) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func keyStatsUsersCount () = makeString(["%s%s", "stats", "activeUsersCount"], separator) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func keyStatsDepositAmtByDay (timestamp) = makeString(["%s%s%d", "stats", "depositAmtByDay", toString(timestamp)], separator) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func keyStatsDepositAmtTotals () = makeString(["%s%s%d", "stats", "depositAmtTotals"], separator) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func keyNextPeriod () = "%s__nextPeriod" | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func keySupportedRewardAssets () = "supportedRewardAssets" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func keyDepositNumLast () = makeString(["%s%s%s", "dep", "lastNum"], separator) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func keyUserRewardFromDepositNum (userAddress) = makeString(["%s%s%s", "userRwdFromDepNum", userAddress], separator) | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func keyRewardPerNsbtSumAt (depositNum,tkn) = makeString(["%s%d", "rwdPerNsbtSumByDepNum", toString(depositNum), tkn], separator) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func keyReward (userAddress,tkn) = makeString(["%s%s%s", "rwd", userAddress, tkn], separator) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func keyClaimed (userAddress,tkn) = makeString(["%s%s%s", "clm", userAddress, tkn], separator) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func keyNotDistributedReward (tkn) = makeString(["%s%s", "notDistributed", tkn], separator) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func toX18 (origVal,origMult) = fraction(toBigInt(origVal), MULTX18, origMult) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined")) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func toAddressOrFail (addressStr) = valueOrErrorMessage(addressFromString(addressStr), ("couldn't parse passed addressStr=" + addressStr)) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func toAssetVect (assetStr) = if ((assetStr == WAVESIDSTR)) | |
158 | 158 | then unit | |
159 | 159 | else fromBase58String(assetStr) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func asInt (val) = match val { | |
163 | 163 | case valInt: Int => | |
164 | 164 | valInt | |
165 | 165 | case _ => | |
166 | 166 | throw("fail to cast into Int") | |
167 | 167 | } | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func formatHistoryRecord (oldAmount,oldStart,newAmount,newStart) = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(oldAmount), toString(oldStart), toString(newAmount), toString(newStart)], separator) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | func formatClaimHistoryRecord (user,claimedRewards) = makeString(["%s%d%d%s", user, toString(lastBlock.height), toString(lastBlock.timestamp), claimedRewards], separator) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func HistoryRecordEntry (type,userAddress,txId,oldAmount,oldStart,newAmount,newStart) = StringEntry(keyHistoryRecord(type, userAddress, txId), formatHistoryRecord(oldAmount, oldStart, newAmount, newStart)) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func ClaimHistoryEntry (userAddress,txId,claimedRewards) = StringEntry(keyHistoryRecord("claim", userAddress, txId), formatClaimHistoryRecord(toString(userAddress), claimedRewards)) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func StatsResult (totalLockedInc,lockCountInc,usersCountInc) = { | |
183 | 183 | let locksCount = getIntOrZero(keyStatsLocksCount()) | |
184 | 184 | let usersCount = getIntOrZero(keyStatsUsersCount()) | |
185 | 185 | let totalAmount = getIntOrZero(keyLockParamTotalAmount()) | |
186 | 186 | let totalAmountNew = (totalAmount + totalLockedInc) | |
187 | 187 | $Tuple3([IntegerEntry(keyStatsLocksCount(), (locksCount + lockCountInc)), IntegerEntry(keyStatsUsersCount(), (usersCount + usersCountInc)), IntegerEntry(keyLockParamTotalAmount(), totalAmountNew)], totalAmount, totalAmountNew) | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | func LockParamsEntry (userAddress,amount,start) = [IntegerEntry(keyLockParamUserAmount(userAddress), amount), IntegerEntry(keyLockParamStartBlock(userAddress), start)] | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func getParamsOrFail () = $Tuple3(fromBase58String(getStringValue(neutrinoContract, keyBondAsset())), getIntOrFail(keyMinLockAmount()), getIntOrFail(keyHalfLife())) | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func isActiveUser (userAddress) = (getIntOrElse(keyLockParamUserAmount(userAddress), 0) > 0) | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func getUserParamsOrUnit (userAddress) = if (isActiveUser(userAddress)) | |
201 | 201 | then $Tuple3(false, getIntOrFail(keyLockParamUserAmount(userAddress)), getIntOrFail(keyLockParamStartBlock(userAddress))) | |
202 | 202 | else unit | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func getUserParamsOrFail (userAddress) = valueOrErrorMessage(getUserParamsOrUnit(userAddress), (("User " + toString(userAddress)) + " is not defined")) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | let supportedAssetsStr = getStrOrElse(keySupportedRewardAssets(), "") | |
209 | 209 | ||
210 | 210 | let supportedAssetsList = split(supportedAssetsStr, "_") | |
211 | 211 | ||
212 | 212 | func calcReward (userAddress,assetId,stakedAmountX,depositNumUser,depositNumLast) = { | |
213 | 213 | let rewardPerNsbtSumLastKEY = keyRewardPerNsbtSumAt(depositNumLast, assetId) | |
214 | 214 | let sumLastX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, assetId), "0")) | |
215 | 215 | let sumUserX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumUser, assetId), "0")) | |
216 | 216 | let rewardDynamicPart = toInt(fraction((sumLastX18 - sumUserX18), stakedAmountX, MULTX18)) | |
217 | 217 | let rewardCachedPartKEY = keyReward(userAddress, assetId) | |
218 | 218 | let rewardCachedPart = getIntOrElse(rewardCachedPartKEY, 0) | |
219 | 219 | $Tuple4((rewardCachedPart + rewardDynamicPart), rewardCachedPart, rewardDynamicPart, rewardCachedPartKEY) | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func toStartOfDay (timestamp) = ((timestamp / DAYMILLIS) * DAYMILLIS) | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func findElementPosition (src,element,sep) = { | |
227 | 227 | let elementStart = valueOrErrorMessage(indexOf(src, element), ((("there is no substring " + element) + " in ") + src)) | |
228 | 228 | if ((elementStart == 0)) | |
229 | 229 | then 0 | |
230 | 230 | else { | |
231 | 231 | let left = take(src, elementStart) | |
232 | 232 | (size(split(left, sep)) - 1) | |
233 | 233 | } | |
234 | 234 | } | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | let DepositTotalsPREFIX = "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d" | |
238 | 238 | ||
239 | 239 | let defaultTotalsDATA = (DepositTotalsPREFIX + "__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0") | |
240 | 240 | ||
241 | 241 | func padList (in) = { | |
242 | 242 | let currSize = (size(in) - 1) | |
243 | 243 | func listPadder (acc,idx) = if ((currSize > idx)) | |
244 | 244 | then acc | |
245 | 245 | else (acc :+ "0") | |
246 | 246 | ||
247 | 247 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
248 | 248 | let $s = size($l) | |
249 | 249 | let $acc0 = in | |
250 | 250 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
251 | 251 | then $a | |
252 | 252 | else listPadder($a, $l[$i]) | |
253 | 253 | ||
254 | 254 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
255 | 255 | then $a | |
256 | 256 | else throw("List size exceeds 18") | |
257 | 257 | ||
258 | 258 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
259 | 259 | } | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func padString (in) = { | |
263 | 263 | let currSize = (size(split_4C(in, SEP)) - 1) | |
264 | 264 | func strPadder (acc,idx) = if ((currSize > idx)) | |
265 | 265 | then acc | |
266 | 266 | else (acc + "__0") | |
267 | 267 | ||
268 | 268 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
269 | 269 | let $s = size($l) | |
270 | 270 | let $acc0 = in | |
271 | 271 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
272 | 272 | then $a | |
273 | 273 | else strPadder($a, $l[$i]) | |
274 | 274 | ||
275 | 275 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
276 | 276 | then $a | |
277 | 277 | else throw("List size exceeds 18") | |
278 | 278 | ||
279 | 279 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
280 | 280 | } | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | func RewardEntries (isNewUser,userAddress,stakedAmount) = { | |
284 | 284 | let stakedAmountX = toBigInt(stakedAmount) | |
285 | 285 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddress) | |
286 | 286 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
287 | 287 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
288 | 288 | func forEachAssetCacheUserReward (accum,asset) = { | |
289 | 289 | let $t01026010395 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
290 | 290 | let rewardTotal = $t01026010395._1 | |
291 | 291 | let cached = $t01026010395._2 | |
292 | 292 | let dynamic = $t01026010395._3 | |
293 | 293 | let rewardCachedPartKEY = $t01026010395._4 | |
294 | 294 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
295 | 295 | } | |
296 | 296 | ||
297 | 297 | if (if ((depositNumLast == -1)) | |
298 | 298 | then (depositNumUser == -1) | |
299 | 299 | else false) | |
300 | 300 | then nil | |
301 | 301 | else if (if ((depositNumLast == -1)) | |
302 | 302 | then (depositNumUser > -1) | |
303 | 303 | else false) | |
304 | 304 | then throw("invalid depositNumLast and depositNumUser state") | |
305 | 305 | else if (if ((depositNumLast > -1)) | |
306 | 306 | then (depositNumUser >= -1) | |
307 | 307 | else false) | |
308 | 308 | then if (isNewUser) | |
309 | 309 | then [IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)] | |
310 | 310 | else ({ | |
311 | 311 | let $l = supportedAssetsList | |
312 | 312 | let $s = size($l) | |
313 | 313 | let $acc0 = nil | |
314 | 314 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
315 | 315 | then $a | |
316 | 316 | else forEachAssetCacheUserReward($a, $l[$i]) | |
317 | 317 | ||
318 | 318 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
319 | 319 | then $a | |
320 | 320 | else throw("List size exceeds 9") | |
321 | 321 | ||
322 | 322 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
323 | 323 | } :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) | |
324 | 324 | else throw(((("uncovered condition: depositNumLast=" + toString(depositNumLast)) + " depositNumUser=") + toString(depositNumUser))) | |
325 | 325 | } | |
326 | 326 | ||
327 | 327 | ||
328 | 328 | func IncrementNotDistributedRewardEntry (tkn,amountInc) = { | |
329 | 329 | let notDistributedRewardKEY = keyNotDistributedReward(tkn) | |
330 | 330 | let notDistributedReward = getIntOrElse(notDistributedRewardKEY, 0) | |
331 | 331 | IntegerEntry(notDistributedRewardKEY, (notDistributedReward + amountInc)) | |
332 | 332 | } | |
333 | 333 | ||
334 | 334 | ||
335 | 335 | func commonClaim (userAddress,i) = { | |
336 | 336 | let userAddressStr = toString(userAddress) | |
337 | 337 | if ((size(i.payments) > 0)) | |
338 | 338 | then throw("payments are not accepted") | |
339 | 339 | else { | |
340 | 340 | let $t01333613441 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
341 | 341 | let isNewUser = $t01333613441._1 | |
342 | 342 | let stakedAmount = $t01333613441._2 | |
343 | 343 | let stakingStart = $t01333613441._3 | |
344 | 344 | let stakedAmountX = toBigInt(stakedAmount) | |
345 | 345 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
346 | 346 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
347 | 347 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
348 | 348 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
349 | 349 | let $t01381213950 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
350 | 350 | let rewardTotal = $t01381213950._1 | |
351 | 351 | let cached = $t01381213950._2 | |
352 | 352 | let dynamic = $t01381213950._3 | |
353 | 353 | let rewardCachedPartKEY = $t01381213950._4 | |
354 | 354 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
355 | 355 | let $t01401014047 = accum | |
356 | 356 | let data = $t01401014047._1 | |
357 | 357 | let claimedAmtByAsset = $t01401014047._2 | |
358 | 358 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
359 | 359 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
360 | 360 | if ((0 >= rewardTotal)) | |
361 | 361 | then $Tuple2(data, claimedAmtByAssetNew) | |
362 | 362 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
363 | 363 | } | |
364 | 364 | ||
365 | 365 | let $t01450714620 = { | |
366 | 366 | let $l = supportedAssetsList | |
367 | 367 | let $s = size($l) | |
368 | 368 | let $acc0 = $Tuple2(nil, "") | |
369 | 369 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
370 | 370 | then $a | |
371 | 371 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
372 | 372 | ||
373 | 373 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
374 | 374 | then $a | |
375 | 375 | else throw("List size exceeds 9") | |
376 | 376 | ||
377 | 377 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
378 | 378 | } | |
379 | 379 | let transfers = $t01450714620._1 | |
380 | 380 | let claimedAmtByAssetResult = $t01450714620._2 | |
381 | 381 | if ((0 >= size(transfers))) | |
382 | 382 | then $Tuple2(nil, 0) | |
383 | 383 | else $Tuple2(((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))), size(transfers)) | |
384 | 384 | } | |
385 | 385 | } | |
386 | 386 | ||
387 | 387 | ||
388 | 388 | @Callable(i) | |
389 | 389 | func constructorV1 (neutrinoContractAddress,mathContractAddress,minLockAmount,halfLife,supportedRewardAssets) = if ((i.caller != this)) | |
390 | 390 | then throw("Permission denied") | |
391 | 391 | else [StringEntry(keyNeutrinoContractAddress(), neutrinoContractAddress), StringEntry(keyMathContractAddress(), mathContractAddress), IntegerEntry(keyMinLockAmount(), minLockAmount), IntegerEntry(keyHalfLife(), halfLife), StringEntry(keySupportedRewardAssets(), supportedRewardAssets)] | |
392 | 392 | ||
393 | 393 | ||
394 | 394 | ||
395 | 395 | @Callable(i) | |
396 | 396 | func stake () = { | |
397 | 397 | let $t01547115533 = getParamsOrFail() | |
398 | 398 | let bondAssetId = $t01547115533._1 | |
399 | 399 | let minLockAmount = $t01547115533._2 | |
400 | 400 | let halfLife = $t01547115533._3 | |
401 | 401 | if ((size(i.payments) != 1)) | |
402 | 402 | then throw("Invalid payments size") | |
403 | 403 | else { | |
404 | 404 | let payment = i.payments[0] | |
405 | 405 | let amount = payment.amount | |
406 | 406 | let invalidAssetMessage = (("Invalid asset. " + toBase58String(bondAssetId)) + " is expected") | |
407 | 407 | let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage) | |
408 | 408 | if ((assetId != bondAssetId)) | |
409 | 409 | then throw(invalidAssetMessage) | |
410 | 410 | else { | |
411 | 411 | let userAddress = i.caller | |
412 | 412 | let userAddressStr = toString(i.caller) | |
413 | 413 | let $t01607516182 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, -1)) | |
414 | 414 | let isNewUser = $t01607516182._1 | |
415 | 415 | let lockAmount = $t01607516182._2 | |
416 | 416 | let lockStartHeight = $t01607516182._3 | |
417 | 417 | let mergedAmount = if (isNewUser) | |
418 | 418 | then amount | |
419 | 419 | else (amount + lockAmount) | |
420 | 420 | let mergedStartHeight = if (isNewUser) | |
421 | 421 | then height | |
422 | 422 | else asInt(invoke(mathContract, "mergeStakesREADONLY", [amount, height, lockAmount, lockStartHeight, halfLife], nil)) | |
423 | 423 | if ((minLockAmount > mergedAmount)) | |
424 | 424 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
425 | 425 | else { | |
426 | 426 | let $t01654316645 = StatsResult(amount, 1, if (isNewUser) | |
427 | 427 | then 1 | |
428 | 428 | else 0) | |
429 | 429 | let statsEntries = $t01654316645._1 | |
430 | 430 | let totalStaked = $t01654316645._2 | |
431 | 431 | let totalStakedNew = $t01654316645._3 | |
432 | 432 | ((([HistoryRecordEntry("stake", userAddress, i.transactionId, lockAmount, lockStartHeight, mergedAmount, mergedStartHeight)] ++ RewardEntries(isNewUser, userAddressStr, lockAmount)) ++ LockParamsEntry(userAddress, mergedAmount, mergedStartHeight)) ++ statsEntries) | |
433 | 433 | } | |
434 | 434 | } | |
435 | 435 | } | |
436 | 436 | } | |
437 | 437 | ||
438 | 438 | ||
439 | 439 | ||
440 | 440 | @Callable(i) | |
441 | 441 | func unstake (amount) = if ((size(i.payments) != 0)) | |
442 | 442 | then throw("unstake doesn't require any payment") | |
443 | 443 | else { | |
444 | 444 | let userAddress = i.caller | |
445 | 445 | let userAddressStr = toString(userAddress) | |
446 | 446 | let $t01713117193 = getParamsOrFail() | |
447 | 447 | let bondAssetId = $t01713117193._1 | |
448 | 448 | let minLockAmount = $t01713117193._2 | |
449 | 449 | let halfLife = $t01713117193._3 | |
450 | 450 | let $t01719617270 = getUserParamsOrFail(userAddress) | |
451 | 451 | let isNewUser = $t01719617270._1 | |
452 | 452 | let lockAmount = $t01719617270._2 | |
453 | 453 | let lockStart = $t01719617270._3 | |
454 | 454 | if ((0 >= lockAmount)) | |
455 | 455 | then throw("Nothing to unstake") | |
456 | 456 | else if ((amount > lockAmount)) | |
457 | 457 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(lockAmount))) | |
458 | 458 | else { | |
459 | 459 | let t = value(blockInfoByHeight(height)).timestamp | |
460 | 460 | let releaseTime = valueOrElse(getInteger(govContract, keyUserGnsbtReleaseTime(userAddressStr)), 0) | |
461 | 461 | if ((releaseTime >= t)) | |
462 | 462 | then throw(("Your gNsbt are taking part in voting, cannot unstake until " + toString(releaseTime))) | |
463 | 463 | else { | |
464 | 464 | let comissionAmount = asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [amount, lockStart, halfLife], nil)) | |
465 | 465 | let $t01791118065 = StatsResult(-(amount), if ((amount == lockAmount)) | |
466 | 466 | then -1 | |
467 | 467 | else 0, if ((amount == lockAmount)) | |
468 | 468 | then -1 | |
469 | 469 | else 0) | |
470 | 470 | let statsEntries = $t01791118065._1 | |
471 | 471 | let totalStaked = $t01791118065._2 | |
472 | 472 | let totalStakedNew = $t01791118065._3 | |
473 | 473 | ((([ScriptTransfer(userAddress, (amount - comissionAmount), bondAssetId), ScriptTransfer(auctionContract, comissionAmount, bondAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, lockAmount, lockStart, (lockAmount - amount), lockStart)] ++ RewardEntries(false, userAddressStr, lockAmount)) ++ LockParamsEntry(userAddress, (lockAmount - amount), lockStart)) ++ statsEntries) | |
474 | 474 | } | |
475 | 475 | } | |
476 | 476 | } | |
477 | 477 | ||
478 | 478 | ||
479 | 479 | ||
480 | 480 | @Callable(i) | |
481 | 481 | func deposit () = { | |
482 | 482 | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
483 | 483 | if ((0 > totalStaked)) | |
484 | 484 | then throw("TODO: case is not supported") | |
485 | 485 | else { | |
486 | 486 | let depositNumLastKEY = keyDepositNumLast() | |
487 | 487 | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
488 | 488 | let depositNumNew = (depositNumLast + 1) | |
489 | 489 | let totalsKEY = keyStatsDepositAmtTotals() | |
490 | 490 | let byDayKEY = keyStatsDepositAmtByDay(toStartOfDay(lastBlock.timestamp)) | |
491 | 491 | let currTotals = padList(split(valueOrElse(getString(totalsKEY), defaultTotalsDATA), SEP)) | |
492 | 492 | func dep (acc,pmt) = { | |
493 | 493 | let amount = pmt.amount | |
494 | 494 | let pmtAssetIdStr = toBase58String(valueOrElse(pmt.assetId, WAVESID)) | |
495 | 495 | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
496 | 496 | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
497 | 497 | else if ((totalStaked == 0)) | |
498 | 498 | then $Tuple4((acc._1 :+ IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount)), (acc._2 :+ pmtAssetIdStr), (acc._3 :+ toBigInt(0)), (acc._4 :+ amount)) | |
499 | 499 | else { | |
500 | 500 | let rewardPerNsbtX18 = fraction(toBigInt(amount), MULTX18, toBigInt(totalStaked)) | |
501 | 501 | $Tuple4(acc._1, (acc._2 :+ pmtAssetIdStr), (acc._3 :+ rewardPerNsbtX18), (acc._4 :+ amount)) | |
502 | 502 | } | |
503 | 503 | } | |
504 | 504 | ||
505 | 505 | let pmtsResult = { | |
506 | 506 | let $l = i.payments | |
507 | 507 | let $s = size($l) | |
508 | 508 | let $acc0 = $Tuple4(nil, nil, nil, nil) | |
509 | 509 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
510 | 510 | then $a | |
511 | 511 | else dep($a, $l[$i]) | |
512 | 512 | ||
513 | 513 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
514 | 514 | then $a | |
515 | 515 | else throw("List size exceeds 10") | |
516 | 516 | ||
517 | 517 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
518 | 518 | } | |
519 | 519 | func refreshRewardUpdateTotals (accum,nextAsset) = { | |
520 | 520 | let k = accum._3 | |
521 | 521 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
522 | 522 | let idx = indexOf(pmtsResult._2, nextAsset) | |
523 | 523 | let sum = if (isDefined(idx)) | |
524 | 524 | then { | |
525 | 525 | let j = value(idx) | |
526 | 526 | let statsDelta = pmtsResult._4[j] | |
527 | 527 | $Tuple2(toString((parseBigIntValue(sumLastStr) + pmtsResult._3[j])), toString((parseIntValue(currTotals[(k + 1)]) + statsDelta))) | |
528 | 528 | } | |
529 | 529 | else $Tuple2(sumLastStr, currTotals[(k + 1)]) | |
530 | 530 | $Tuple3((accum._1 :+ StringEntry(keyRewardPerNsbtSumAt(depositNumNew, nextAsset), sum._1)), ((accum._2 + SEP) + sum._2), (k + 1)) | |
531 | 531 | } | |
532 | 532 | ||
533 | 533 | let assetsResult = { | |
534 | 534 | let $l = supportedAssetsList | |
535 | 535 | let $s = size($l) | |
536 | 536 | let $acc0 = $Tuple3(nil, DepositTotalsPREFIX, 0) | |
537 | 537 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
538 | 538 | then $a | |
539 | 539 | else refreshRewardUpdateTotals($a, $l[$i]) | |
540 | 540 | ||
541 | 541 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
542 | 542 | then $a | |
543 | 543 | else throw("List size exceeds 9") | |
544 | 544 | ||
545 | 545 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
546 | 546 | } | |
547 | 547 | let totals = padString(assetsResult._2) | |
548 | 548 | $Tuple2(((((pmtsResult._1 ++ assetsResult._1) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) :+ StringEntry(totalsKEY, totals)) :+ StringEntry(byDayKEY, totals)), depositNumNew) | |
549 | 549 | } | |
550 | 550 | } | |
551 | 551 | ||
552 | 552 | ||
553 | 553 | ||
554 | 554 | @Callable(i) | |
555 | 555 | func claimRewards () = commonClaim(i.caller, i) | |
556 | 556 | ||
557 | 557 | ||
558 | 558 | ||
559 | 559 | @Callable(i) | |
560 | 560 | func claimRewardsByOriginCaller () = commonClaim(i.originCaller, i) | |
561 | 561 | ||
562 | 562 | ||
563 | 563 | ||
564 | 564 | @Callable(i) | |
565 | 565 | func unclaimedRewardsREADONLY (userAddressStr) = { | |
566 | 566 | func forEachAssetZeroReward (accum,asset) = ((accum + makeString([asset, "0", "0"], ":")) + "_") | |
567 | 567 | ||
568 | 568 | let unclaimedRewardStr = if ((userAddressStr == "")) | |
569 | 569 | then { | |
570 | 570 | let $l = supportedAssetsList | |
571 | 571 | let $s = size($l) | |
572 | 572 | let $acc0 = "" | |
573 | 573 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
574 | 574 | then $a | |
575 | 575 | else forEachAssetZeroReward($a, $l[$i]) | |
576 | 576 | ||
577 | 577 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
578 | 578 | then $a | |
579 | 579 | else throw("List size exceeds 9") | |
580 | 580 | ||
581 | 581 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
582 | 582 | } | |
583 | 583 | else { | |
584 | 584 | let userAddress = addressFromStringValue(userAddressStr) | |
585 | 585 | let $t02191422019 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
586 | 586 | let isNewUser = $t02191422019._1 | |
587 | 587 | let stakedAmount = $t02191422019._2 | |
588 | 588 | let stakingStart = $t02191422019._3 | |
589 | 589 | let stakedAmountX = toBigInt(stakedAmount) | |
590 | 590 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
591 | 591 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
592 | 592 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
593 | 593 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
594 | 594 | let $t02236522503 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
595 | 595 | let rewardTotal = $t02236522503._1 | |
596 | 596 | let cached = $t02236522503._2 | |
597 | 597 | let dynamic = $t02236522503._3 | |
598 | 598 | let rewardCachedPartKEY = $t02236522503._4 | |
599 | 599 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
600 | 600 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
601 | 601 | } | |
602 | 602 | ||
603 | 603 | let $l = supportedAssetsList | |
604 | 604 | let $s = size($l) | |
605 | 605 | let $acc0 = "" | |
606 | 606 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
607 | 607 | then $a | |
608 | 608 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
609 | 609 | ||
610 | 610 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
611 | 611 | then $a | |
612 | 612 | else throw("List size exceeds 9") | |
613 | 613 | ||
614 | 614 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
615 | 615 | } | |
616 | 616 | $Tuple2(nil, dropRight(unclaimedRewardStr, 1)) | |
617 | 617 | } | |
618 | 618 | ||
619 | 619 | ||
620 | 620 | ||
621 | 621 | @Callable(i) | |
622 | 622 | func nsbtUnstakingSYSREADONLY (userAddressStrOrEmpty,unstakeAmtP) = { | |
623 | 623 | let resultArray = if ((userAddressStrOrEmpty == "")) | |
624 | 624 | then [0, 0, 0, 0] | |
625 | 625 | else { | |
626 | 626 | let userAddress = addressFromStringValue(userAddressStrOrEmpty) | |
627 | 627 | let cfgDATA = getParamsOrFail() | |
628 | 628 | let nsbtAssetId = cfgDATA._1 | |
629 | 629 | let minLockAmount = cfgDATA._2 | |
630 | 630 | let halfLife = cfgDATA._3 | |
631 | 631 | let userDATA = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
632 | 632 | let isNewUser = userDATA._1 | |
633 | 633 | let stakedAmount = userDATA._2 | |
634 | 634 | let lockStart = userDATA._3 | |
635 | 635 | let unstakeAmt = if ((unstakeAmtP > stakedAmount)) | |
636 | 636 | then stakedAmount | |
637 | 637 | else unstakeAmtP | |
638 | 638 | let stakedAmountNEW = (stakedAmount - unstakeAmt) | |
639 | 639 | let comissionAmount = if ((unstakeAmt == 0)) | |
640 | 640 | then 0 | |
641 | 641 | else asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [unstakeAmt, lockStart, halfLife], nil)) | |
642 | 642 | let receiveAmount = (unstakeAmt - comissionAmount) | |
643 | 643 | [stakedAmount, stakedAmountNEW, receiveAmount, comissionAmount] | |
644 | 644 | } | |
645 | 645 | $Tuple2(nil, resultArray) | |
646 | 646 | } | |
647 | 647 | ||
648 | 648 | ||
649 | 649 | ||
650 | 650 | @Callable(i) | |
651 | 651 | func nsbtStakingSYSREADONLY (userAddressStr,nsbtDiff) = { | |
652 | 652 | let totalNsbtAmt = getIntOrElse(keyLockParamTotalAmount(), 0) | |
653 | 653 | if ((userAddressStr == "")) | |
654 | 654 | then $Tuple2(nil, [0, totalNsbtAmt, 0]) | |
655 | 655 | else { | |
656 | 656 | let userAddress = toAddressOrFail(userAddressStr) | |
657 | 657 | let $t02418124285 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
658 | 658 | let isNewUser = $t02418124285._1 | |
659 | 659 | let userNsbtAmt = $t02418124285._2 | |
660 | 660 | let stakingStart = $t02418124285._3 | |
661 | 661 | $Tuple2(nil, [userNsbtAmt, totalNsbtAmt, stakingStart]) | |
662 | 662 | } | |
663 | 663 | } | |
664 | 664 | ||
665 | 665 | ||
666 | 666 | @Verifier(tx) | |
667 | 667 | func verify () = { | |
668 | 668 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
669 | 669 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
670 | 670 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
671 | 671 | then 1 | |
672 | 672 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
673 | 673 | then 1 | |
674 | 674 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
675 | 675 | then 1 | |
676 | 676 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
677 | 677 | then 2 | |
678 | 678 | else 0)) | |
679 | 679 | (count >= 3) | |
680 | 680 | } | |
681 | 681 |
github/deemru/w8io/169f3d6 91.22 ms ◑