Паттерн Декоратор — специальный способ организации модулей в программе, который позволяет подставить какую-то новую функцию прямо в середину цепочки вызовов, тем самым чуть-чуть подкорректировав поведение.
Например, в реальном мире очки для чтения это декоратор. Вы ставите их между вашими глазами и текстом. Глобально взаимодействие ваших глаз и текста не меняется: отражённые световые лучи от страницы книги попадают в ваши зрачки, что с очками, что без них. Но очки располагаются посередине: они принимают лучи на вход и преломляют их, передавая дальше вам в глаза уже изменёнными.
Важной особенностью является тот факт, что очки можно снять. Они не требуют ни модификации вашего тела, ни модификации книги. Вообще никакие условия не нужны, кроме наличия самих очков. А если вы в линзах, то внешний наблюдатель может даже этого не знать.
Класс-декоратор должен быть спроектирован так, чтобы не требовать никаких изменений в объектах, с которыми он работает. Его можно отключить, чаще всего буквально закомментировав одну строку.
В примере ниже программа выведет текст "Привет, мир, в натуре.", и вот это дополнение в конце как раз дописано декоратором. Можно убрать или закомментировать подчёркнутую строчку, не трогая остальной код, для всех внешних вызовов сигнатуры останутся теми же самыми, но выводиться будет уже просто "Привет, мир".
В декораторы можно прятать логику, которую буквально навешивают поверх основной функции программы. Например, проверку прав на выполнение операции. Перевод на другой язык, логирование, поддержку обратной совместимости при обновлении и так далее.
#dev
#FTX
Суд отклонил запрос SBF на новый процесс
Федеральный судья отказал Сэму Бэнкману-Фриду в проведении нового судебного разбирательства.
В решении суд прямо раскритиковал аргументы защиты, назвав их «дико конспирологическими».
Запрос SBF был связан с попыткой оспорить вынесенный ранее приговор по делу FTX, но суд не нашел оснований для пересмотра.
FTX Executives Get Reduced Prison Sentences
⚖️ Former FTX executives Ryan Salame and Caroline Ellison have had their prison sentences reduced. Salame will serve until March 2031, a year less than initially sentenced. Ellison's term is cut by three months, allowing her to be released in July 2026. Speculations suggest these reductions may stem from cooperation with authorities against Sam Bankman-Fried. For more details, visit ForkLog.
#FTX#Crypto#VC
#FTX merges #SOL
The bankrupt exchange withdrew $160 million worth of coins from stacking a couple of days ago and this morning brought $30 million on the exchange
We can see that #Bitcoin has generally been increasingly dominant over the past few years. Since the #FTX Collapse in November 2022, #BTC has increased its market cap dominance from 38.9% to 49.8%.
On the other hand, #ETH has maintained its market cap dominance, ranging from 18.9% to 18.2%. It is mainly Altcoins that have lost market share in the crypto markets with their market cap dominance dropping from 28.3% to 24.2%, while Stablecoins have also decreased their share from 13.9% to 7.8%.
By Crypto Australia
🚨🚨#FTX and #Alameda transferred out $38.5M worth of 7 assets to exchanges ~6hrs ago:
• 750,000 $SOL ($31.2M)
• 325,501 $ENS ($2.76M)
• 10.1M $GMT ($2.22M)
• 642,702 $LDO ($1.26M)
• 288,211 $APE ($410K)
• 127,407 $BADGER ($365K)
• 555,342 $BNT ($323K)
Overall, as of Nov 8, #FTX and #Alameda have transferred out $350M worth of 36 assets to exchanges.
👉 More details: https://platform.spotonchain.ai/signal-details/ftx-and-alameda-research-further-moved-altcoins-to-exchanges-4711
$400M theft, FTX bankruptcy & fried leadership! 😱 Scary preview of crypto chaos or cautionary tale? Stay alert, traders! 📈#CryptoNews#FTX#Trading#Cryptocurrency
📈BTC price at the time of this post: $43095
👉Continue reading
🚨#FTX and #Alameda Research just deposited 44.19M $CRO ($4.17M) to #Coinbase ~20 mins ago.
Overall, FTX and Alameda have deposited 13.99M worth of $ETH, $CRO, $MATH, $MPL, and $BLZ to Coinbase in the past 2 weeks.
👉 More details: https://platform.spotonchain.ai/en/signal-details/ftx-and-alameda-moved-cro-to-coinbase-prime-16235
📰 NEWS
😨 .Sentiment: The cryptocurrency market is experiencing a historical level of fear.
🟤 Mt Gox transferred over 47,000 BTC to another wallet late on Thursday evening, according to Arkham Intelligence. This is happening before his upcoming return of $9 billion worth of bitcoins to creditors.
Over the past 24 hours, 232,804 traders have been liquidated, the total amount of liquidations amounted to $672.22 million.
💥 This is the largest #BTC liquidation event since the collapse of #FTX.
Galaxy Research Director: Mt.Gox bitcoins will be stored in the long term, not sold. Details:
Alex Thorne suggested that this transaction (at ~47K) It was transferred to one of the distribution agents. If this is true, we may see more such transfers totaling about 100,000, unless the custodian reconfigures the internal wallets unnecessarily, as was done on May 27. I still believe that Mt.Gox bitcoins are more likely to be stored in the long term rather than sold
💰Over the past month, 500 thousand new tokens have been created on #Solana.
📢 .The Hamilton crypto startup has issued tokenized U.S. Treasury bonds on bitcoin's second-tier blockchains. Hamilton U.S. T-Bills (HUST) bonds are available on Stacks, Core and BoB L2 networks.
‼️ Nate Geraci, president of The ETF Store, wrote that he does not rule out the launch of the #Solana spot #ETF around this time next year.
After being dormant for 5 years, a whale deposited 1,000 $BTC ($67.64M) into #Bitfinex, making a profit of $38.35M
The whale initially withdrew this $BTC for $29.28M from #Bitstamp and #FTX.
https://intel.arkm.com/explorer/address/3C9hNKdbBe6aR7sdkoXCQwFF1RakBUsziY
https://x.com/OnchainLens/status/2025167951964635250
Follow @onchainlens for more onchain updates
Two institutions #Celsius and #FTX moved out a total of $59.06M in 6 assets to CEX in the past 8 hours!
1. Celsius further moved 22,500 $ETH ($50.78M) to #Coinbase at $2,257 ~8 hours ago.
➡️ Now, Celsius only holds around 39,969 $ETH ($90.9M) in address 0xdb3.
👉 More details here
2. FTX and Alameda Research moved out $8.28M in 6 assets, including $ETH, $OKB, $MTL, $PROM, $YFII, and $CREAM in the past 2 hours.
➡️ Overall, FTX and Alameda Research have moved out $707M worth of 91 tokens since October 24, 2023.
👉 More details here
Want to be updated with latest whale movements? Follow @spotonchain and visit us via https://platform.spotonchain.ai/en