shafu formatter! Solidity ファイルに Shafu コマンドをインストールして実行します。 美しいコードが重要だからです!
@Sabnock66 @lucasmanuel_eth素晴らしい質問です!ここで解説しました
shafu
shafu2025年7月11日
Many people have asked me where my formatting style is from. It all started before I've ever written a single line of Solidity code. I was a Machine Learning Engineer before and I did most things in numpy, pytorch and tensorflow. Don't use tensorflow, but that's for a different time. Most of that code are chains of mathematical operations. This is where I picked up the symmetry thing. Lining up equations just makes it so much easier to read. The symmetry is also just beautiful. @jeremyphoward blog post was also very influential. READ IT! Most of my work was in Jupyter Notebooks. I love JNs. Having illustrations and explanations live directly where my code lives totally makes sense to me. We probably should write Smart Contracts like that. Imagine the Uniswap contract with all its visualizations just on top of the code. Great for people reading it and amazing for auditors. Formatting by hand is also just a great way to re-read code. You can not automate that! Although maybe you could train an LLM on all my contracts and see what happens! If you want to build a shafu formatter lmk! I would fund it. forge fmt --shafu
8.95K