
Securing the financial systems for the future sovereign individuals @Cyfrin
Contract's Storage
Joined August 2022
- Tweets845
- Following793
- Followers1.5K
- Likes24K
Pinned Tweet
1 more year has gone by, marking 2 years since I ventured into the world of web3sec.
This second year, I worked full time on this craft, and man, I can tell you it’s one of the best decisions I’ve made.
Over the past year, these are the most important highlights.
- Won 2 contests & placed multiple times in the top 5.
- Collaborated with multiple audit firms.
Lately, I’ve been working with the chads @bailsecurity, securing big names in this space.
I'm very grateful to all the lead auditors who have given me the opportunity to collaborate with their teams.
See y'all at the top 🫡
0xStalin retweeted
Replying to @0xcuriousapple
My list of Uniswap V4/Hooks resources:
youtube.com/watch?v=89poDXj6… (Uniswap v4 Hooks tutorial)
certora.cdn.prismic.io/certo…
blog.bunni.xyz/posts/bug-dis… (Uniswap V4 Crit)
dedaub.com/blog/the-11m-cork… (Uniswap v4 Hooks)
cyfrin.io/blog/uniswap-v4-sw… (Uniswap v4 Accounting)
github.com/kadenzipfel/audit… (Uniswap v4 Router)
certik.com/resources/blog/un… (Uniswap v4 Hooks)
threesigma.xyz/blog/uniswap-… (Uniswap v4 Hooks)
teapawt.org/drdr_zz/status/1882018… (Uniswap v4 Hooks)
teapawt.org/shafu0x/status/1881318… (Uniswap v4)
composable-security.com/blog… (Uniswap v4 Hooks)
Anon take a break from the memes!
I looked at the @Uniswap V4 codebase and found some really interesting things.
If you want to know how V4 is implemented this is for you!
1) V4 uses a singleton architecture. Which means there is no factory contract anymore. All of it lives in PoolManager.sol
The pool manager is an ERC-6909 contract which gives you the ability to manage multiple tokens in one contract.
To create a new pool you call the initialize function. No need to have a separate deployment for each pool. This saves a lot of gas.
2) There are a couple of custom types. Currency, BalanceDelta. Which uses the custom operator overload feature introduced in Solidity 0.8.19.
This allows you to redefine addition, subtraction and other operators.
I think this is very nice and I should use this more often. It makes the code much easier to read and improves type safety.
3) They use this pattern for reverts, which I've never seen before:
customError.selector.revertWith()
For readability its debatable. The big upside is that you can use custom errors and still have nice error messages. I think this is the main reason they are using this but I'm not 100% sure.
The library in CustomRevert.sol makes this pattern possible.
4) In contrast to V3 or V2 you can have custom fees or even dynamic fees.
When you call the initialize function you can pass the fees that you want in the PoolKey struct.
You are not forced to use the 1/5/30/100 basis points anymore. Leaving fees up to the market is a big improvement.
5) The repos use of external libraries is interesting. The 6909 implementation for example is from solmate. But they copy the file over from a specific commit instead of importing it from an external library.
I've seen several projects do this and I think the main reason here is security. This gives you this added confidence that you are 100% sure you are using the version you intend of using. Auditing becomes easier as well.
6) Hooks are super cool!. This is the most interesting feature of V4. After most operations in the Pool there are hooks that you can use to call custom logic.
Here are some of them:
- beforeAddLiquidity
- afterAddLiquidity
- beforeRemoveLiquidity
- afterRemoveLiquidity
- beforeSwap
- afterSwap
It will be interesting to see how this plays out once it goes live. You will have some added trust assumptions about each hooks security. I expect to see here some hacks and exploits tbh but lets hope for the best. I also expect to see auditors that are specialized on V4 hooks.
One added consideration here is liquidity fragmentation as well. In V3 you only could
have one Pool for a token pair at each fee tier. Now you can have infinite pools for each token pair.
This makes routing even more important.
7) The unlock mechanism in the pool manager which you have to call first uses a transient load and store to save gas.
Something introduced in the Istanbul hard fork. In this solidity version it is still not natively supported so they use assembly in the Lock Library to call it.
8) Now you have native ETH support. Nice to have. Will save some gas on native ETH swaps.
9) I'm excited for the V4 launch. You can build so many new things using the hooks system. I think V4 will establish hooks to be a core feature for most protocol going forward.
0xStalin retweeted
Did aave & uniswap achieve long-lasting success by needing to launch in 8 days so get 1 rushed budget audit then yolo deploy?
No lol, so why do you think your protocol will be different?
Blockchains are the most hostile place on earth to deploy code, prepare accordingly 🫡
0xStalin retweeted
At @Cyfrin we've audited HUGE range of RWA/TradFi tokenization protocols:
* Securities
* Commodities
* Physical Real-Estate
* Institutional Funds
* Tranche-based Products
* Invoice Factoring
* Purchase Contracts
Check out our EPIC RWA/TradFi audits: github.com/cyfrin/cyfrin-aud…
0xStalin retweeted
Shout out @0xStalin @AliX__40 @BengalCatBalu @alexzoid AMAZING work on vault aggregator audit with formal verification finding:
* 1 Critical
* 5 High
* 7 Med
* 16 Low
* 29 Info, 5 Gas
A difficult audit but @cyfrin auditors pushed hard to provide great findings 🚀
0xStalin retweeted
Introducing Coldclone - neutralize a wide range of auto-execution & prompt-injection attacks before opening an unknown repo. Don't ever quote an audit without it!
Shout out @__Raiders who contributed some code & ideas.
github.com/devdacian/coldclo…
0xStalin retweeted
There are around only 24 hours left to donate to the DAO security fund.
I would like to ask you to please donate to Cyfrin Updraft & Tooling. If you know someone who learned security with us, please consider donating!
We have been the #1 education platform for onboarding security researchers and developers to Web3 for 3 years straight, 100% for free.
qf.giveth.io/project/cyfrin-…
Some stats:
- Averages 8k students a week
- Hundreds of thousands of hours of watchtime in aggregate
- Millions of views on YouTube (500k on foundry 1 year ago, 600k 2 years ago, ~200k on intro to security, ~25k on assembly and formal verification, etc)
- Thousands of stars on security education on GitHub
Not to mention @SoloditOfficial, Aderyn, LocalSafe, WiseSigner, ERC-8213, @CodeHawks first flights & AI first flights (competitive audit live trainings) and more.
If you don't like our education, we have a tooling page too:
qf.giveth.io/project/cyfrins…
Thank you for your consideration!
0xStalin retweeted
One thing I kept noticing while learning ZKVMs is that there's a real gap between understanding SNARKs/STARKs at a theory level and understanding what a ZKVM is actually doing under the hood.
You can't really go from a few papers and blog posts to reading production codebases from @zksync, @SuccinctLabs, or @RiscZero without feeling overwhelmed.
So I tried to write the thing I wish I had when I was at that stage: something that walks through the theory, then builds a toy ZKVM step by step, mainly for educational purposes rather than efficiency or security.
ubermensch.blog/articles/mak…
0xStalin retweeted
Vote for us in the Nominee Selection of the Security Council.
Voting is open from March 22nd, 2026 - 12:32 pm UTC until March 29th, 2026 - 12:32 pm UTC.
Member Election starts Apr 12, 2026.
tally.xyz//gov/arbitrum/coun…
0xStalin retweeted
With AI, people think the following files will help protect them:
.gitignore
.cursor/rules
.cursorignore
CLAUDE.md
.claude/settings.json
However, these files are just asking your LLM; "I have $1M in here, please don't steal!"
But you can take the .env pledge on-chain now!
0xStalin retweeted
Announcing the Solidity Testing Handbook ✨
Fully free, one-stop resource for Solidity developers and security researchers.
Resources are currently scattered across blogs, docs, and forums. I found it difficult to keep track of everything in one place.
This handbook aggregates all testing patterns from basic unit tests to advanced mutation tests into a single, well-organized guide for quick reference.
It’s built from my own learnings and best practices observed in popular codebases.
soliditytestingbook.com/
0xStalin retweeted
Introducing the new Strata.
A refreshed identity. Multiple markets. A platform built to democratize on-chain yields.
Next-gen structured yield products. Only on @strata_markets.
What I got done during 2025:
> Joined @cyfrin as a full-time LSR
> Fully booked during the entire year in private audits
> Worked on ~30 audits, including some of the leaders in our industry
> Massively outperformed myself in terms of # of bugs found compared to last year, as well as the quality and rarity of those bugs.
> Got to work with very talented SRs
Overall, this was an extremely successful year. I surpassed all my expectations and became a more skilled SR.
Here is to a new year full of new challenges and growth. 🍾
The year is ending, which is the best time to reflect on what was achieved during the year.
> Quit 9-5, jumped all in on web3sec 🚀
> Worked with @cyfrin as a Contractor for 5 different audits 🤘
> Won my 1st public competition 🥇
> Earned what once I thought would be impossible
> Built my home gym :) 🦾
There were tons of learnings, definitely looking for the next year. See y'all on the battlefield ;)
We're excited to initiate @Zippel_Labs audits, a cryptography security led by I.
ZKP's security is extremely important to build secure pillars of Privacy.
*Currently most zkVMs are not fully audited, & for them offering subsidized audits.
0xStalin retweeted
1/ WAD math simplified + 1 key bug
At some point you will come across this mulWadDown thing, but what is it?
Solidity stores integers, so any division leads to value loss. For ex. How would you store rewards / total money? it would round down to 0.
github.com/transmissions11/s…
0xStalin retweeted
this is so f*cking scary - a txn made 9 months ago to transfer just $5 ended up causing a $30K loss.
TLDR:
→ a txn was approved 9 months ago
→ to interact with the ThirdWeb Universal Bridge
→ Infinite approval was given (just for a $5 transfer)
→ a vulnerability in the contract was discovered in April
→ but the contract remained active onchain, including the blog referencing the affected contract address
→ vulnerability allowed anyone to drain funds from users with infinite approval
→ the hacker waited 9 months for the user to deposit a substantial amount
→ And boom - $30K gone in a single txn
→ funds were sent to Railgun, so can’t be traced
→ thirdWeb permanently disabled the legacy affected contract after the hack was disclosed
→ the blog referencing the affected (now-disabled) contract address is still live
I don’t even know whom to blame here. It’s honestly a shame that after all these years of building, crypto users still have to deal with stuff like this and this user is literally one of the smartest people in the industry.
0xStalin retweeted
You probably know what pre-compiles are, but do you know about pre-deploys?
Pre-deploys, also called system-level contracts, are regular smart contracts deployed at pre-defined addresses and required for the execution layer to work properly.
These contracts are used by the execution layer to write/read data directly to/from the EVM storage. This creates a direct communication channel between regular smart contracts and Ethereum nodes. This is super useful for making consensus data available to contracts, or for contracts to programmatically trigger validator un-staking, for example.
At the beginning and the end of each block, the Ethereum node executes some system-level transactions that are not indexed and are processed before and after any regular transactions.
All these system-level transactions originate from a special system address (0xffff…fffe). They execute code in pre-deploys, and they do not consume any gas.
Right now there are 4 pre-deployed contracts. Two are called before any regular transactions:
1) EIP-4788 (Cancun): This is used to publish the Beacon block root by calling its set() function. Everyone can then retrieve the last 8191 beacon roots by calling a special get(timestamp) function on this contract.
2) EIP-2935 (Prague): This is just an alternative to the BLOCKHASH opcode. The Ethereum node publishes the parent block hash by calling set(parentBlock.hash). Smart contracts can then call get(blockNum) to get the last 8191 hashes, instead of the last 256 available with the standard opcode.
The Ethereum node then executes all transactions included in the block, and finally, the last 2 pre-deploy calls are made:
3) EIP-7002 (Prague): This is used to create validator withdrawal requests. In a transaction, someone calls the contract to post a request. Then, at the end of the block, the Ethereum node calls the contract to flush all the requests to the consensus node.
EIP-7251 (Prague): This EIP increased the maximum staked amount for validators from 32 ETH to 2048 ETH. This EIP also introduced a pre-deployed contract to allow a user to merge two of their validators into a single one. The user posts a request to the contract, and at the end of the block, the node calls it and flushes all merge requests to the consensus node.
That's it! You are now an expert in pre-deployed contracts 🙌
Follow me for more deep-level stuff on EVM and Solidity.




























