Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в Python в модуле re.
Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки.
pattern = re.compile(r"(\w+)+")
words = pattern.search(text, re.DOTALL)
А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как.
pattern.search(text, re.DOTALL | re.VERBOSE)
А теперь смотрим исходники, что находится в этих атрибутах?
Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево.
>>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]:
>>>
print(bin(n))
0b1
0b10
0b100
0b1000
0b10000
0b100000
0b1000000
0b10000000
0b100000000
Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули:
000000001
000000010
000000100
000001000
000010000
000100000
001000000
010000000
100000000
Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45
В общем, это пример применения побитовых операций в самом Python.
Теперь вы знаете Python еще немного лучше)
#tricks#regex#libs
#SCR
Scroll торгуется с капитализацией около $8,16 млн
Scroll (SCR), первый проект, который торговался на Binance Premarket, сейчас оценивается всего примерно в $8,16 млн.
За последний год токен упал примерно на 83%.
Контраст особенно заметный на фоне прошлого раунда.
В 2023 году Scroll привлекли $50 млн при оценке $1,8 млрд.
При этом сам проект долго считался одним из самых сильных имен в Ethereum-экосистеме.
Vitalik и Ethereum Foundation не раз позитивно отзывались о Scroll, а сам проект часто называли одним из ориентиров для zkEVM в Ethereum.
🚀 Ethereum Layer 2 Network Scroll Faces Overcharging Issue
Ethereum Layer 2 network Scroll has reportedly overcharged users by more than $50,000 in transaction fees over approximately four days. According to ChainCatcher, this occurred after the Scroll team manually increased two rate multipliers in their gas price oracle six times within six days, each time raising them by 2 to 10 times. This adjustment cumulatively increased the L1 data cost parameter to 1,280 times its original benchmark.
Approximately 139,000 transactions were affected, with the total cost originally estimated at around $280, but users were charged over $50,000. The majority of these transactions were automated by bots. L2BEAT clarified that the overcharging was not due to a sequencer issue but resulted from multiplier adjustments executed through a multi-signature wallet by the team. This incident has raised questions about whether Scroll previously subsidized users with below-cost rates to maintain activity.
Data from DeFiLlama indicates that Scroll's total value locked (TVL) currently stands at $24 million, a significant decline of 96% from its peak of $585 million in October 2024. As of the time of reporting, Scroll has not publicly responded to the issue.
#Ethereum#Layer2#Scroll#Overcharging#GasFees#Blockchain#DeFi#TVL#CryptoNews#TransactionFees#ETH#SCR
🚀 Scroll Users Face Excessive Transaction Fees Due to Multiplier Increases
Scroll users incurred over $50,000 in additional transaction fees following six manual multiplier increases that elevated Layer 1 data charges to 1,280 times the original baseline. According to NS3.AI, L2BEAT reported that approximately 139,000 transactions were impacted over a span of roughly four days, with the baseline cost estimated at around $280. On April 9, the team reduced both multipliers by 160 times. Etherfi Cash bots contributed approximately $35,000 of the excess fees during etherfi's migration to Optimism.
#Scroll#TransactionFees#MultiplierIncrease#Layer1#L2BEAT#NS3AI#Etherfi#Optimism#Crypto#Blockchain#SCR