tx · HyCJCJ92SvpdMnEz1pHjNMfMuMzqRQVxg6sf3JzdSJ7Z 3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy: -0.14000000 Waves 2021.11.09 11:46 [1783242] smart account 3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy > SELF 0.00000000 Waves
{ "type": 13, "id": "HyCJCJ92SvpdMnEz1pHjNMfMuMzqRQVxg6sf3JzdSJ7Z", "fee": 14000000, "feeAssetId": null, "timestamp": 1636447588761, "version": 2, "chainId": 84, "sender": "3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy", "senderPublicKey": "9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq", "proofs": [ "5JfZmb5WPrgHQasu2u5r2LHBYN7X1SisRyGYKAEVRHbUJaAherqeoQ2aRa9GjUykWXQ7xpPYLVrQ4Lc33FrKbSum", "u3LFqVWnd8aYvhsR5orpLk1yFJgr3Pz4192jyZWpsWPv4UYZQbf1h2rdUoAbt68cQG5ER11xYpm1kqdJDJuyG4Q" ], "script": "base64:AAIFAAAAAAAAABwIAhIECgIBARIDCgEBEgASAwoBARIAEgASABIAAAAAHwAAAAAMYWRtaW5QdWJLZXkxAQAAACB8WGt7UsWljWcca/SparQip5nE5Sy5e44NxDRBaM1QeAAAAAAMYWRtaW5QdWJLZXkyAQAAACB8WGt7UsWljWcca/SparQip5nE5Sy5e44NxDRBaM1QeAAAAAAMYWRtaW5QdWJLZXkzAQAAACB8WGt7UsWljWcca/SparQip5nE5Sy5e44NxDRBaM1QeAAAAAAUYWRtaW5QdWJLZXlTdGFydFN0b3ABAAAAIHxYa3tSxaWNZxxr9KlqtCKnmcTlLLl7jg3ENEFozVB4AAAAAAlrZXlBY3RpdmUCAAAABmFjdGl2ZQAAAAAIa2V5Q2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAAxrZXlWb3RlU3RhcnQCAAAAEXZvdGVfc3RhcnRfaGVpZ2h0AAAAAAprZXlWb3RlRW5kAgAAA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taW5QdWJLZXkyU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEFAAAADGFkbWluUHViS2V5MgAAAAAAAAAAAQAAAAAAAAAAAAQAAAASYWRtaW5QdWJLZXkzU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIFAAAADGFkbWluUHViS2V5MwAAAAAAAAAAAQAAAAAAAAAAAAkAAGcAAAACCQAAZAAAAAIJAABkAAAAAgUAAAASYWRtaW5QdWJLZXkxU2lnbmVkBQAAABJhZG1pblB1YktleTJTaWduZWQFAAAAEmFkbWluUHViS2V5M1NpZ25lZAAAAAAAAAAAAqmPw9I=", "height": 1783242, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8hEkaQ57fL34xsMdQrjtxk81VUcB1pHAs7aXdqnmsoSg Next: 5Pr1BmBhTsQdA7JAYoMNFChWYyErv53DDnvmnBZ6XNg6 Diff:
Old | New | Differences | |
---|---|---|---|
102 | 102 | then throw("DApp is inactive at this moment") | |
103 | 103 | else if (!(containsElement([adminPubKeyStartStop], i.callerPublicKey))) | |
104 | 104 | then throw("Only admin can call this function") | |
105 | - | else [IntegerEntry(keyVoteStart, start), IntegerEntry(keyVoteEnd, end), IntegerEntry(keyTotalVoted, 0), IntegerEntry(keyTotalYesVoted, 0), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_yes_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_no_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_height"), DeleteEntry("3MtKR6Jr6tAT3ixw2AXFxwQQdYMhxz4sVn7_ENNO_vote_yes_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote"), DeleteEntry("total_ENNO_vote"), DeleteEntry("total_ENNO_vote_share")] | |
105 | + | else [IntegerEntry(keyVoteStart, start), IntegerEntry(keyVoteEnd, end), IntegerEntry(keyTotalVoted, 0), IntegerEntry(keyTotalYesVoted, 0), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_yes_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_no_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_height"), DeleteEntry("3MtKR6Jr6tAT3ixw2AXFxwQQdYMhxz4sVn7_ENNO_vote_yes_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote"), DeleteEntry("total_ENNO_vote"), DeleteEntry("total_ENNO_vote_share"), DeleteEntry("total_ENNO_vote_no")] | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | ||
142 | 142 | func lockENNO () = if (!(isActive)) | |
143 | 143 | then throw("DApp is inactive at this moment") | |
144 | 144 | else { | |
145 | - | let $ | |
146 | - | let pmtAmount = $ | |
147 | - | let pmtAssetId = $ | |
145 | + | let $t053515426 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
146 | + | let pmtAmount = $t053515426._1 | |
147 | + | let pmtAssetId = $t053515426._2 | |
148 | 148 | if ((pmtAssetId != ENNO)) | |
149 | 149 | then throw("Incorrect payment assetId only Enno Cash is allowed.") | |
150 | 150 | else { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
9 | 9 | ||
10 | 10 | let adminPubKeyStartStop = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
11 | 11 | ||
12 | 12 | let keyActive = "active" | |
13 | 13 | ||
14 | 14 | let keyCause = "shutdown_cause" | |
15 | 15 | ||
16 | 16 | let keyVoteStart = "vote_start_height" | |
17 | 17 | ||
18 | 18 | let keyVoteEnd = "vote_end_height" | |
19 | 19 | ||
20 | 20 | let keyVoteYes = "yes_amount" | |
21 | 21 | ||
22 | 22 | let keyUserENNOVoted = "_ENNO_vote" | |
23 | 23 | ||
24 | 24 | let keyUserENNOVotedHeight = "_ENNO_vote_height" | |
25 | 25 | ||
26 | 26 | let keyUserENNOVotedValue = "_ENNO_vote_value" | |
27 | 27 | ||
28 | 28 | let keyUserENNOVotedYESValue = "_ENNO_vote_yes_share" | |
29 | 29 | ||
30 | 30 | let keyTotalYesVoted = "total_ENNO_vote_yes" | |
31 | 31 | ||
32 | 32 | let keyUserENNOLocked = "_ENNO_amount" | |
33 | 33 | ||
34 | 34 | let keyTotalENNOLocked = "total_ENNO_amount" | |
35 | 35 | ||
36 | 36 | let keyTotalVoted = "total_ENNO_vote" | |
37 | 37 | ||
38 | 38 | let keyUserENNOClaimedAmount = "_ENNO_claimed_amount" | |
39 | 39 | ||
40 | 40 | let keyUserENNOLastClaimedAmount = "_ENNO_last_claimed_amount" | |
41 | 41 | ||
42 | 42 | let keyUserENNOLockedTag = "share_" | |
43 | 43 | ||
44 | 44 | let isActive = valueOrElse(getBoolean(this, keyActive), true) | |
45 | 45 | ||
46 | 46 | let shareData = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
47 | 47 | ||
48 | 48 | let ENNO = base58'6TmLfry3GRQoVSaesGSnp6NtZKveYgEopTLsjaGgXoso' | |
49 | 49 | ||
50 | 50 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func getUserENNOLocked (user) = valueOrElse(getInteger(this, (toString(user) + keyUserENNOLocked)), 0) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getTotalENNOLocked () = valueOrElse(getInteger(this, keyTotalENNOLocked), 0) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getUserVoteData (user,key) = valueOrElse(getInteger(this, (toString(user) + key)), 0) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getVal (key) = valueOrElse(getInteger(this, key), 0) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getCallerShare (caller) = { | |
66 | 66 | let callerShare = getInteger(addressFromPublicKey(shareData), (keyUserENNOLockedTag + toString(caller))) | |
67 | 67 | let callerShareAmount = match callerShare { | |
68 | 68 | case share: Int => | |
69 | 69 | share | |
70 | 70 | case share: Unit => | |
71 | 71 | throw("Only governance qualifiers can call this function.") | |
72 | 72 | case _ => | |
73 | 73 | throw("Match error") | |
74 | 74 | } | |
75 | 75 | callerShareAmount | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getClaimedAmount (caller) = { | |
80 | 80 | let callerWithdrawn = getInteger(this, (toString(caller) + keyUserENNOClaimedAmount)) | |
81 | 81 | let callerWithdrawnAmount = match callerWithdrawn { | |
82 | 82 | case share: Int => | |
83 | 83 | share | |
84 | 84 | case share: Unit => | |
85 | 85 | 0 | |
86 | 86 | case _ => | |
87 | 87 | throw("Match error") | |
88 | 88 | } | |
89 | 89 | callerWithdrawnAmount | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func setShare (amount) = { | |
94 | 94 | let deltaHeight = (getVal(keyVoteEnd) - height) | |
95 | 95 | let share = fraction(amount, deltaHeight, 100000000) | |
96 | 96 | share | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | @Callable(i) | |
101 | 101 | func initVote (start,end) = if (!(isActive)) | |
102 | 102 | then throw("DApp is inactive at this moment") | |
103 | 103 | else if (!(containsElement([adminPubKeyStartStop], i.callerPublicKey))) | |
104 | 104 | then throw("Only admin can call this function") | |
105 | - | else [IntegerEntry(keyVoteStart, start), IntegerEntry(keyVoteEnd, end), IntegerEntry(keyTotalVoted, 0), IntegerEntry(keyTotalYesVoted, 0), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_yes_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_no_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_height"), DeleteEntry("3MtKR6Jr6tAT3ixw2AXFxwQQdYMhxz4sVn7_ENNO_vote_yes_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote"), DeleteEntry("total_ENNO_vote"), DeleteEntry("total_ENNO_vote_share")] | |
105 | + | else [IntegerEntry(keyVoteStart, start), IntegerEntry(keyVoteEnd, end), IntegerEntry(keyTotalVoted, 0), IntegerEntry(keyTotalYesVoted, 0), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_yes_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_no_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote_height"), DeleteEntry("3MtKR6Jr6tAT3ixw2AXFxwQQdYMhxz4sVn7_ENNO_vote_yes_share"), DeleteEntry("3N1ygWjGRDx6Wmva87krushRi2wfRe1WAps_ENNO_vote"), DeleteEntry("total_ENNO_vote"), DeleteEntry("total_ENNO_vote_share"), DeleteEntry("total_ENNO_vote_no")] | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | ||
109 | 109 | @Callable(i) | |
110 | 110 | func vote (voteAmount) = if (!(isActive)) | |
111 | 111 | then throw("DApp is inactive at this moment") | |
112 | 112 | else if ((getVal(keyVoteStart) > height)) | |
113 | 113 | then throw("Voting has not started yet.") | |
114 | 114 | else if ((height > getVal(keyVoteEnd))) | |
115 | 115 | then throw("Voting has already ended.") | |
116 | 116 | else { | |
117 | 117 | let totalYes = getVal(keyTotalYesVoted) | |
118 | 118 | let userVotedYes = getUserVoteData(i.caller, keyUserENNOVotedYESValue) | |
119 | 119 | let userENNOVoted = getUserVoteData(i.caller, keyUserENNOVoted) | |
120 | 120 | let userENNOLocked = getUserVoteData(i.caller, keyUserENNOLocked) | |
121 | 121 | let userENNOVotedNew = (userENNOVoted + voteAmount) | |
122 | 122 | if ((0 > userENNOVotedNew)) | |
123 | 123 | then throw("Vote amount is more than available.") | |
124 | 124 | else { | |
125 | 125 | let availableVote = (userENNOLocked - userENNOVoted) | |
126 | 126 | let userVoteValue = setShare(voteAmount) | |
127 | 127 | if ((voteAmount > availableVote)) | |
128 | 128 | then throw("Vote amount is more than available.") | |
129 | 129 | else { | |
130 | 130 | let userENNOVotedNewShare = (userVotedYes + userVoteValue) | |
131 | 131 | let newTotalYesVoted = (totalYes + userENNOVotedNewShare) | |
132 | 132 | let totalENNOVoted = getVal(keyTotalVoted) | |
133 | 133 | let totalENNOVotedNew = (totalENNOVoted + userVoteValue) | |
134 | 134 | [IntegerEntry((toString(i.caller) + keyUserENNOVotedYESValue), userENNOVotedNewShare), IntegerEntry((toString(i.caller) + keyUserENNOVoted), userENNOVotedNew), IntegerEntry(keyTotalVoted, totalENNOVotedNew), IntegerEntry(keyTotalYesVoted, newTotalYesVoted)] | |
135 | 135 | } | |
136 | 136 | } | |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | 141 | @Callable(i) | |
142 | 142 | func lockENNO () = if (!(isActive)) | |
143 | 143 | then throw("DApp is inactive at this moment") | |
144 | 144 | else { | |
145 | - | let $ | |
146 | - | let pmtAmount = $ | |
147 | - | let pmtAssetId = $ | |
145 | + | let $t053515426 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
146 | + | let pmtAmount = $t053515426._1 | |
147 | + | let pmtAssetId = $t053515426._2 | |
148 | 148 | if ((pmtAssetId != ENNO)) | |
149 | 149 | then throw("Incorrect payment assetId only Enno Cash is allowed.") | |
150 | 150 | else { | |
151 | 151 | let userENNOLocked = getUserENNOLocked(i.caller) | |
152 | 152 | let userENNOLockedNew = (userENNOLocked + pmtAmount) | |
153 | 153 | let totalENNOLocked = getTotalENNOLocked() | |
154 | 154 | let totalENNOLockedNew = (totalENNOLocked + pmtAmount) | |
155 | 155 | [IntegerEntry((toString(i.caller) + keyUserENNOLocked), userENNOLockedNew), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew)] | |
156 | 156 | } | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | ||
161 | 161 | @Callable(i) | |
162 | 162 | func withdrawENNO (withdrawAmount) = if (!(isActive)) | |
163 | 163 | then throw("DApp is inactive at this moment") | |
164 | 164 | else if ((0 >= withdrawAmount)) | |
165 | 165 | then throw("withdrawAmount <= 0") | |
166 | 166 | else { | |
167 | 167 | let totalENNOLocked = getTotalENNOLocked() | |
168 | 168 | let userENNOLocked = getUserENNOLocked(i.caller) | |
169 | 169 | if ((withdrawAmount > totalENNOLocked)) | |
170 | 170 | then throw("withdrawAmount is more than available to withdraw") | |
171 | 171 | else if ((withdrawAmount > userENNOLocked)) | |
172 | 172 | then throw("You are trying to unstake more than you have staked.") | |
173 | 173 | else { | |
174 | 174 | let totalENNOLockedNew = (totalENNOLocked - withdrawAmount) | |
175 | 175 | let userENNOamountNew = (userENNOLocked - withdrawAmount) | |
176 | 176 | [IntegerEntry((toString(i.caller) + keyUserENNOLocked), userENNOamountNew), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew), ScriptTransfer(i.caller, withdrawAmount, ENNO)] | |
177 | 177 | } | |
178 | 178 | } | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | ||
182 | 182 | @Callable(i) | |
183 | 183 | func claimAndWithdrawENNO () = if (!(isActive)) | |
184 | 184 | then throw("DApp is inactive at this moment") | |
185 | 185 | else { | |
186 | 186 | let userShare = getCallerShare(i.originCaller) | |
187 | 187 | let userClaimedAmount = getClaimedAmount(i.originCaller) | |
188 | 188 | let claimAmount = (userShare - userClaimedAmount) | |
189 | 189 | let totalENNOLocked = getTotalENNOLocked() | |
190 | 190 | if ((claimAmount > totalENNOLocked)) | |
191 | 191 | then throw("claimAmount is more than available to withdraw") | |
192 | 192 | else if ((0 >= claimAmount)) | |
193 | 193 | then throw("Claim amount must be bigger than 0") | |
194 | 194 | else { | |
195 | 195 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
196 | 196 | [IntegerEntry((toString(i.originCaller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.originCaller) + keyUserENNOLastClaimedAmount), claimAmount), ScriptTransfer(i.originCaller, claimAmount, ENNO)] | |
197 | 197 | } | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | ||
202 | 202 | @Callable(i) | |
203 | 203 | func claimAndStakeENNO () = if (!(isActive)) | |
204 | 204 | then throw("DApp is inactive at this moment") | |
205 | 205 | else { | |
206 | 206 | let userShare = getCallerShare(i.originCaller) | |
207 | 207 | let userClaimedAmount = getClaimedAmount(i.originCaller) | |
208 | 208 | let claimAmount = (userShare - userClaimedAmount) | |
209 | 209 | if ((0 >= claimAmount)) | |
210 | 210 | then throw("Claim amount must be bigger than 0") | |
211 | 211 | else { | |
212 | 212 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
213 | 213 | let userENNOLocked = getUserENNOLocked(i.originCaller) | |
214 | 214 | let userENNOLockedNew = (userENNOLocked + claimAmount) | |
215 | 215 | let totalENNOLocked = getTotalENNOLocked() | |
216 | 216 | let totalENNOLockedNew = (totalENNOLocked + claimAmount) | |
217 | 217 | [IntegerEntry((toString(i.originCaller) + keyUserENNOLocked), userENNOLockedNew), IntegerEntry((toString(i.originCaller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.originCaller) + keyUserENNOLastClaimedAmount), claimAmount), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew)] | |
218 | 218 | } | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func shutdown () = if (!(isActive)) | |
225 | 225 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
226 | 226 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
227 | 227 | then throw("Only admin can call this function") | |
228 | 228 | else suspend("Paused by admin") | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | ||
232 | 232 | @Callable(i) | |
233 | 233 | func activate () = if (isActive) | |
234 | 234 | then throw("DApp is already active") | |
235 | 235 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
236 | 236 | then throw("Only admin can call this function") | |
237 | 237 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
238 | 238 | ||
239 | 239 | ||
240 | 240 | @Verifier(tx) | |
241 | 241 | func verify () = { | |
242 | 242 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
243 | 243 | then 1 | |
244 | 244 | else 0 | |
245 | 245 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
246 | 246 | then 1 | |
247 | 247 | else 0 | |
248 | 248 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
249 | 249 | then 1 | |
250 | 250 | else 0 | |
251 | 251 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
252 | 252 | } | |
253 | 253 |
github/deemru/w8io/026f985 40.18 ms ◑