I’m excited to join the @cyfrin family to create educational content for Cyfrin Updraft.
Our vision of a secure, on-chain world begins with great developer education.
I look forward to supporting more developers to learn, grow, and thrive in smart contract development.
Fast Fourier Transform explained
Used in ZKSTARK
Notes and Python code🐍
github.com/t4sk/notes?tab=re…
1. Intro
2. Definitions
3. Algorithm
4. Tree example
5. Butterfly example 1
6. Butterfly example 2
7. Bit reversal - optimization
Adding liquidity to Uniswap V2, what is the change in liquidity?👇
Liquidity delta for Uniswap V3 will be explained in the future.
Drawn with excalidraw.com/
More notes
github.com/t4sk/notes/tree/m…
On 2023/05/20 at 07:25:11 UTC, Tornado Cash governance effectively ceased to exist. Through a malicious proposal, an attacker granted themselves 1,200,000 votes. As this is more than the ~700,000 legitimate votes, they now have full control.
openchain.xyz/trace/ethereum…
Flash accounting in Uni V4 makes flash loans with 0% fees possible
Flash loan 100 USDC
PoolManager.unlock
└YourContract.unlockCallback
├PoolManager.take(USDC, 100)
├PoolManager.sync(USDC)
├USDC.transfer(PoolManager, 100)
└PoolManager.settle()
I spent 10 minutes looking for Uniswap V4 ETH/USDT pool address💀
It doesn't exist.
All V4 pools are in a single contract.
Here is how to get pool info.
1. Get pool id (Hover next to ETH/USDT)
2. Call StateView.getSlot0 + paste pool id
etherscan.io/address/0x7ffe4…
How (a&b) + (a^b)/2 calculates the average
(a&b)*2 + (a^b) = a + b
Hence
(a&b) + (a^b)/2 = (a + b)/2
Why (a&b)*2 + (a^b) = a + b
a&b = 1s both in a and b
a^b = 1s exclusively in a or b
(a&b)*2
1s are in both a and b so multiply by 2
code
github.com/t4sk/notes/blob/m…
If you're having problem minting USDC on Foundry using deal. Here is the temporary fix👇
Steps to manually mint USDC
1. Get masterMinter
2. Prank masterMinter and call configureMinter
3. Call mint
Arbitrage ETH on Uniswap V3 RETH/ETH pool
1. Swap ETH to rETH on Uniswap V3
2. Burn rETH on RocketPool to redeem ETH
Why it works?
- rETH generally increases in value over time
- Increase in value of rETH is not reflected on Uniswap pool unless an arbitraguer steps in
Why does Uniswap V3 call this variable slot0?🤔
Because it's the first state variable which is store in the 0th slot of the storage.💡
github.com/Uniswap/v3-core/b…
Idea for making solidity contracts more secure.
1. Sprinkle your code with asserts
2. Stripe it away with the compiler for production build
Example (not tested)
Failing asserts crash the program in unit and fuzz tests.
When PROD = true, compiler + optimizer removes Dev.check
Deploy simple contract to zkSync 2.0 testnet
1. Compile contract
2. Bridge Goerli ETH to zkSync
3. Deploy contract
github.com/t4sk/hello-l2/tre…
Message me for Goerli Testnet ETH
Funny scam🤣 Watch out
1. Create Github PR with scam message
2. Tag targets
3. Scam message will be emailed to targets from GitHub
Be careful not to click on any link💀
@github