The Solidity function dispatcher is a tree where:
- Internal nodes perform binary splits.
- Leaf nodes contain up to 4 function selectors, tested linearly.
Protip 1: the `fallback` function's bytecode is generated twice in the bytecode. To reduce bytecode size, wrap the fallback logic in an internal function.
Protip 2: if you have a very frequently used function, make an alias with a `0x00000000` function selector, which makes it the cheapest to lookup.
A 🧵 on how yesterday's @MIM_Spell attack worked. The protocol did everything right. They rounded in the protocol's favour whenever they should but one additional function, meant to only reduce the user's funds, ended up enabling the attack. How?
Find all Uniswap hooks in one place (production-ready or not, you'll find everything here).
Over the last few days at Syntegrity, we did some hacking and brought the awesome Uniswap hook repository to life.
What other features should we add?
Link 👇
how to raise the gas limit, part 2 ⛽⛽
1. the goal = raise the gas limit
2. the approach = use lots of data
3. the focus today = 𝐇𝐈𝐒𝐓𝐎𝐑𝐘 𝐆𝐑𝐎𝐖𝐓𝐇
very excited to release our latest research on the LARGEST + LEAST DISCUSSED factor holding back Ethereum's gas limit
Why do we have "stack too deep" errors? JVM, WASM, CLR are all stack machines too but don't have this issue! Why is EVM different?
I looked under the hood at Solidity codegen to find out. Check out my first post in a series about compiling for the EVM:
https://t.co/DjlaaLpz0m
Let's quickly discuss the latest 3074 competitor, EIP-7702, authored by @VitalikButerin
The spec itself is actually really good, and addresses a key hurdle of 3074 that was the special signing requirements.
You know whats not? Using quantum computing (QC) as a counter-argument, which has been used time-and-time again by so many people without actually proposing a solution forward.
@_prestwich elegantly put it:
`You're hearing: "if QC is an actual concern instead of a political blocker, then we need to be some pretty extreme actions right now". Given that we aren't recommending taking some pretty extreme actions right now it seems unlikely that it's an actual concern, basically bringing up QC is disingenuous unless you're simultaneously advocating starting the migration to post-QC Ethereum right fucking now. Which I'm not saying we shouldn't do, just that the people bringing it up aren't doing so in good faith`
We have a significantly bigger problem (i think), which is QC is going to break modern day crypto, and we have zero efforts (that are progressing fast) on how to migrate away from them.
As it stands today, if crypto breaks, we're all doomed.
All I'm asking today, we actually start pushing the boundary on what an actual migration away from ECDSA is, because all of the 4337 accounts are built using ECDSA keys as the admin key.
Today I'm open sourcing inkmate 🖋️, a set of gas-efficient smart contracts written in Rust 🦀.
inkmate will include core contracts such as ERC20, ERC721, ERC721A to make it easy for developers to deploy efficient Rust contracts on Arbitrum Orbit chains that support Stylus.
Using a private key in the .env file to deploy and test your smart contracts is not safe, even if you put it in .gitignore later!
Foundry lets you do it in the most secure way!
Let's dive deep!