karma Profile Banner
karma Profile
karma

@0xkarmacoma

Followers
5,142
Following
1,143
Media
423
Statuses
2,620

recovering skeptic // research engineer @a16zcrypto

Joined May 2021
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
Pinned Tweet
@0xkarmacoma
karma
6 months
Here are the main points from my Solidity Summit talk: Symbolic execution is a generic technique that can be used to explore paths in your program Symbolic execution treats your program like a dungeon in an RPG: it explores everything until it finds and defeats the boss. The…
Tweet media one
Tweet media two
Tweet media three
Tweet media four
3
45
206
@0xkarmacoma
karma
2 years
Let's build a smol EVM from scratch: - stack - memory - code buffer - a few instructions - an instruction decoder - a basic fetch-decode-eval loop
18
123
676
@0xkarmacoma
karma
1 year
A bit of exciting personal news 😁 I accepted an offer as a research engineer at ✨ @a16zcrypto ✨ I'm super excited to work with @eddylazzarin 's incredible research, engineering and security teams
56
5
426
@0xkarmacoma
karma
2 years
Let's build a smol EVM from scratch, part 2: - branching instructions - looping and conditionals - jump destination validation - stack manipulation instructions This part is brought to you by @MilkRoadDaily ✌️ 🟩🟩🟩🟩🟩🟨⬜⬜⬜⬜ 77/142 instructions
10
94
410
@0xkarmacoma
karma
2 years
Quick cheat sheet on calldata vs memory function args - calldata args are immutable and more gas efficient - default to calldata args unless you _need_ to mutate the args
Tweet media one
8
49
396
@0xkarmacoma
karma
1 year
just foundry things
Tweet media one
23
26
291
@0xkarmacoma
karma
2 years
gosh I wish there was an easier way to do this
Tweet media one
21
13
276
@0xkarmacoma
karma
2 years
⛽ fun way to run out of gas It attempts to store a 1 bit "very far" in memory (not(0) is 0xffff...ffff), and the memory expansion function has exponential cost, so this consumes trillions of gas units
Tweet media one
9
27
276
@0xkarmacoma
karma
1 year
Introducing SS2ERC721, a new base contract that allows: - minting up to 1200 NFTs to distinct recipients per tx - with >90% gas savings compared to a regular ERC721 (10-12x cheaper) 🤌 How? By using SSTORE2 for the primary recipients of the drop!
Tweet media one
14
38
276
@0xkarmacoma
karma
2 years
gm to everyone who doesn’t hate entire classes of people
7
21
272
@0xkarmacoma
karma
2 years
Corruptions by @dhof have a certain number of iterations that "deep-fry" the rendering. 4139 has 0 iterations (cleanest output) 808 has 1023 iterations (the max) Sheet with the iterations for all token ids:
Tweet media one
Tweet media two
15
24
193
@0xkarmacoma
karma
2 years
I had an amazing time working on distributed systems at @NetflixEng and I will be forever grateful to the great people there, but it is time for me to start a new adventure. Today is my first day as a smart contract engineer at @tryShowtime and I couldn't be more excited 🙌💖
7
11
197
@0xkarmacoma
karma
6 months
every single time
Tweet media one
5
6
183
@0xkarmacoma
karma
2 years
Let's build a smol EVM from scratch, part 3: - calldata - comparison instructions - the Solidity function dispatcher - a kickass script that uses hooks into our interpreter This part is brought to you by @MilkRoadDaily ✌️ 🟩🟩🟩🟩🟩🟩⬜⬜⬜⬜ 85/142 instructions
4
28
178
@0xkarmacoma
karma
6 months
we had fun didn't we
Tweet media one
@solidity_lang
Solidity
6 months
1⃣ Unchecked loop increments: This version release adds an overflow check optimization that auto-generates unchecked arithmetic increment of 'for' loop counters. This new optimization removes the need for unchecked increment patterns in for loop bodies.
2
5
49
5
11
149
@0xkarmacoma
karma
3 years
I hope this gist about the different ways to send Ether in Solidity finds you well
1
20
133
@0xkarmacoma
karma
2 years
A look at the tricks used by @samczsun and the contract that beat him: - tiny handcoded EVM-level contract, no Solidity - no function selector (a single function implements both owner() and solve() based on calldatasize 🤯) - no storage - optimal memory size (3 words)
Tweet media one
@samczsun
samczsun
2 years
gm
Tweet media one
29
10
273
4
15
131
@0xkarmacoma
karma
2 years
I might mess around and take a snapshot of my followers with a .eth address 👀
39
2
125
@0xkarmacoma
karma
7 months
POV: you use formal methods to show the teacher that the homework has NO SOLUTION
Tweet media one
Tweet media two
14
9
121
@0xkarmacoma
karma
1 month
I'm a simple guy, all I want is an EVM memory profiler that looks like defrag.exe. Who is working on this?
Tweet media one
11
7
123
@0xkarmacoma
karma
1 year
🤏 smol deep dive into EVM disassembly, in which we learn to navigate metadata and why bytecode '6142' breaks most disassemblers
4
27
118
@0xkarmacoma
karma
1 year
I feel bad solving this CTF with Halmos, I am number 2 on the leaderboard yet I had no idea that this was a sudoku. It feels like the meta will change and CTFs will adjust to avoid being trivially solvable by automated tooling. In the mean time, let me show you how this works
@fiveoutofnine
⁵⁄₉
1 year
How I implemented Sodoku on-chain for @curta_ctf 's Puzzle #1 : 2 × 4 = 8
Tweet media one
9
21
114
7
9
117
@0xkarmacoma
karma
1 year
I come across a lot of devs who haven't setup git commit signing. It takes 2 min, you should do it. If you don't, anybody can impersonate you on github. If you don't believe me, reply with your github account below and I'll make a silly commit as you 👇
19
12
114
@0xkarmacoma
karma
1 year
ripped jesus
Tweet media one
6
8
110
@0xkarmacoma
karma
1 year
So here I am, playing @fvictorio_nan 's EVM puzzle and I reach a level that includes an XOR to find the right jump value. What am I supposed to do, XOR in my head? No way, mhh mhh Let's use @daejunpark 's Halmos to do the work for us instead. Time to go ✨symbolic✨
Tweet media one
4
19
111
@0xkarmacoma
karma
2 years
*slaps roof of Seaport* this bad boy can fit so much contract code in it
Tweet media one
6
12
107
@0xkarmacoma
karma
2 years
Solidity people are doing crazy gas optimizations Meanwhile some frontends still suggest transactions with a max priority fee set to max fee Example: - this user could have paid 68.2 base fee + 1.5 priority fee = 69.7 gwei - instead they paid 162.1 gwei, 2.3x too high
Tweet media one
2
4
103
@0xkarmacoma
karma
2 months
I'm starting to think that the market is not demanding formal verification this cycle
12
6
104
@0xkarmacoma
karma
3 years
Why you need to pay attention to @darkforest_eth , the most fascinating blockchain game by far 🧵
7
25
96
@0xkarmacoma
karma
2 years
CT: royalties are unenforceable by code @Foundation : I will enforce royalties or die trying
Tweet media one
Tweet media two
Tweet media three
5
7
93
@0xkarmacoma
karma
1 year
it's not a cult-
Tweet media one
1
14
93
@0xkarmacoma
karma
2 years
The Unreasonable Effectiveness of Assembly Code Check out this algorithm for escaping json strings by @optimizoor : - O(n) - no spurious memory copy - only 1 (one) memory allocation - actually respects the json spec by escaping U+0000 to U+001F Just look at it 🤌
Tweet media one
2
9
93
@0xkarmacoma
karma
2 years
Ever wondered what values like msg.sender and tx.gasprice are when you're in a view function? TLDR they can be anything when they're evaluated off-chain, and indeed they vary wildly by provider. Which opens up the possibility to fingerprint when we're evaluated off-chain (🧵)
Tweet media one
3
19
89
@0xkarmacoma
karma
2 years
they don't want you to know this but the key to successful smart contract development is actually to make your contracts as dumb as possible
8
9
84
@0xkarmacoma
karma
10 months
gas golfing is a self-indulgent pleasure that doesn’t matter nearly as much as people think
@mrjasonchoi
Jason Choi
10 months
What’s your unpopular crypto opinion?
Tweet media one
491
82
397
2
1
87
@0xkarmacoma
karma
1 year
why would you write function bodies when you can do this
Tweet media one
18
5
86
@0xkarmacoma
karma
2 years
this will create an unresolved tension that will stay with you all day
Tweet media one
12
8
87
@0xkarmacoma
karma
5 months
Formal verification to the people There is a huge opportunity for applying formal methods to smart contracts: - smart contracts are orders of magnitude less complex than traditional software (no concurrency, exceptions, small ISA, small memory footprint, no network...) - bugs…
Tweet media one
4
9
84
@0xkarmacoma
karma
1 year
my alpha has been leaked
Tweet media one
Tweet media two
6
2
85
@0xkarmacoma
karma
3 years
@RaoulGMI I love that a leader in this space such as yourself is able to: 1. Say I don’t know 2. Stay humble 3. Stay curious Definitely GMI 👏
1
1
79
@0xkarmacoma
karma
4 months
✨ halmos v0.1.10 release ✨ - shared solver instance during path exploration: this is a big one that solves the memory explosion problem many people reported - --match-test and --match-contract options by @agfviggiano 🫡 - friendship ended with python 3.8 - not just PASS/FAIL…
Tweet media one
4
11
78
@0xkarmacoma
karma
6 months
Love the focus on testing at this year's Solidity Summit - dos and don'ts of testing by @lovethewired - BTT structured tests by @PaulRBerg - differential testing by @annascarroll - mutation testing by @ChandrakanaNaN - symbolic testing by @daejunpark and me
3
4
76
@0xkarmacoma
karma
7 months
inside of you there are 2 wolves
Tweet media one
5
3
74
@0xkarmacoma
karma
8 months
oh you're into solidity? name the unspecified evaluation order rules for event parameters
8
8
77
@0xkarmacoma
karma
2 months
a study of return bombing - how to write an effective bomb - how to safely process the revert data
Tweet media one
@Amxx
Hadrien Croubois
2 months
@ricocreditsys @0xkarmacoma If you do a raw call and was to use the result, all the returndata is copied to memory. This makes you vulnerable to returnbombing. AFAIK, try catch limits the returndata size if the return type is « bonded ».
2
0
7
4
7
77
@0xkarmacoma
karma
11 days
you: symbolic execution is slow me:
Tweet media one
3
6
75
@0xkarmacoma
karma
3 years
Messing around with 1-of-1 owned by everyone
Tweet media one
5
3
73
@0xkarmacoma
karma
1 year
Tweet media one
5
3
70
@0xkarmacoma
karma
2 years
Is this a thing that exists? - input: EVM instructions - output: annotated EVM instructions with what the stack layout would look like Right now I'm annotating by hand like an animal, but I could probably build this into smol-evm
Tweet media one
10
5
68
@0xkarmacoma
karma
2 months
try/catch in solidity was a mistake
12
0
67
@0xkarmacoma
karma
2 months
If I see SafeMath along with solc 0.8, I assume one of these: - you copied old code and just bumped solc - you don't know about checked math in recent solc - you know about checked math but think it's good to be extra safe They're all bad reasons
4
1
67
@0xkarmacoma
karma
2 years
@0xpyk this is the Solidity equivalent of trusting banks
2
0
63
@0xkarmacoma
karma
2 years
I had no idea that a deep tech topic such as writing a smol EVM from scratch would resonate with so many people 💖 How are you all liking Notion as the publishing platform?
5
2
60
@0xkarmacoma
karma
2 months
men would rather printf-debug on mainnet than go to therapy
Tweet media one
@PopPunkOnChain
Pop Punk
2 months
2.4 million dollars invested into a pre-sale using a contract where the developer: 1. Didn't even bother removing commented lines of code 2. Is literally console.logging multiple times in most functions on mainnet. We're so back.
Tweet media one
57
24
468
7
3
61
@0xkarmacoma
karma
2 years
any idea why in Solidity we can define errors either at the top level or inside a contract, but events only inside contracts?
Tweet media one
5
4
57
@0xkarmacoma
karma
1 year
mad science 👨‍🔬 minting 1M NFTs to distinct recipients from an open edition 814 transactions 6.35k gas/mint
Tweet media one
6
3
60
@0xkarmacoma
karma
1 month
holy shi
Tweet media one
1
6
60
@0xkarmacoma
karma
7 months
I'll be talking about symbolic execution at the Solidity Summit in Istanbul 🥳
Tweet media one
5
0
59
@0xkarmacoma
karma
5 months
invariant testing or symbolic testing?
Tweet media one
4
1
57
@0xkarmacoma
karma
1 year
we all need more green in our lives
Tweet media one
3
0
54
@0xkarmacoma
karma
2 years
Food for thought: - mining addresses with 4 leading 0 bytes is cheap - can be stored as bytes16 - can pack 2 in the same storage slot Any contract doing this in the wild?
10
1
54
@0xkarmacoma
karma
2 years
EnterpriseCounters.sol - on-chain Inversion-of-Control (IoC) containers - default increment strategy with built-in retries - swappable storage backends - XML-based configuration - access control - logging
13
6
52
@0xkarmacoma
karma
9 months
it's all fun and games until the state explosion
Tweet media one
1
2
54
@0xkarmacoma
karma
20 days
halmos v0.1.11 Adds support for - the ecrecover precompile - the vm.addr(key) and vm.sign(key, digest) cheats - the makeAddr functions from forge-std
Tweet media one
1
4
53
@0xkarmacoma
karma
1 year
What's next? I will support the engineers and founders at @a16zcrypto portfolio companies and turn research into usable open source tools for the working smart contract engineer. Can't wait to get started!
0
0
52
@0xkarmacoma
karma
9 months
devs can have a little formal methods, as an appetizer
Tweet media one
3
0
53
@0xkarmacoma
karma
9 months
TIL 0xEF is considered an invalid code prefix, and trying to create code that starts with 0xEF will revert (EIP-3541) AFAIK all SSTORE2 implementations (OG/solmate/solady) prefix the data with 0x00 so should be safe beware if you roll your own code-as-data solution though 🐉
4
1
51
@0xkarmacoma
karma
2 years
@ExistentialEnso @ciaomack (っ◔◡◔)っ ♥ zoink ♥ It's all yours, enjoy!
9
0
51
@0xkarmacoma
karma
9 months
Here is a fun little test that shows a fundamental difference between fuzzing and symbolic testing. The test accepts two inputs x and y, and checks that if x and y are different then their keccak256 hashes don’t collide.
Tweet media one
3
4
49
@0xkarmacoma
karma
2 years
we gonna need a longer weekend
Tweet media one
2
0
50
@0xkarmacoma
karma
1 year
Tweet media one
@0xkarmacoma
karma
1 year
@saxenism Can we put this idea to rest that ++i is faster than i++? With via_ir = true, they literally compile to the same thing
Tweet media one
3
1
37
4
6
49
@0xkarmacoma
karma
1 year
getting the CTA (comment-to-assembly) ratio just right 👌
Tweet media one
5
0
48
@0xkarmacoma
karma
1 year
Can be solved entirely with the foundry stack: - cast call to retrieve values on chain - chisel to twiddle bits - cast create2 to find interesting addresses - forge script to deploy
@curta_ctf
Curta
1 year
Puzzle #2 : 0xF1A9 by @fiveoutofnine is NOW live! Play at to capture a Flag.
Tweet media one
1
6
21
4
3
49
@0xkarmacoma
karma
4 months
writing tests that can be run by both foundry and halmos takes a little bit of practice but is very satisfying: - for the postconditions, assert() > require() - for the preconditions, vm.assume() > bound() - use test_ as a prefix - avoid other reverts other than the assertions
@DevDacian
Dacian
4 months
💡Easy Stateless Fuzz & Symbolic Test💡 Foundry + Halmos => use the same test contract for both stateless fuzz & symbolic tests. Here is an example from my current private audit where I'm using Halmos to verify a hashing algo produces unique results for the possible input set:
Tweet media one
8
15
116
2
4
47
@0xkarmacoma
karma
4 days
self-own but true: all the best devs I have ever worked with have like 137 followers on here
10
1
74
@0xkarmacoma
karma
2 years
✅ Shipped my first contract in a product - non-upgradable - on-chain sell orders - non-escrow (never takes ownership of your NFTs or ERC20s) - hardcoded 0% commission - supports EIP-2981 royalties - supports payments in multiple ERC20 currencies
@Drakulaapp
Drakula.app 🩸
2 years
Gm everybody! Today, we’re announcing our NFT marketplace at . ✦ Gasless: free minting + listing, no gas fees ✦ Instant royalties via an on-chain royalty standard ✦ Up to 10,000 editions ✦ Eco-friendly NFTs on the @0xPolygon network Live now. More:
Tweet media one
132
335
1K
4
3
48
@0xkarmacoma
karma
1 year
The degen leaving my body as I disclose every trade to the SEC
Tweet media one
7
0
47
@0xkarmacoma
karma
11 months
reverse optimizors: is this the highest gas per byte of code ratio we can possibly get? 465f0351 would consume 2.5e+148 gas on mainnet with just 4 bytes
Tweet media one
7
3
48
@0xkarmacoma
karma
2 years
Sometimes it feels silly adding tests like “only the owner should be able to call X()”, but is it?
@danielvf
Daniel Von Fange
2 years
Drago just got Rekt
Tweet media one
13
10
89
5
2
47
@0xkarmacoma
karma
6 months
boss: you need to tweet more relatable memes me: you're not gonna believe this
Tweet media one
1
6
46
@0xkarmacoma
karma
1 year
Today is my last day at @Showtime_xyz and I couldn't be more proud of the incredibly user-friendly web3 infra we built over the last 18 months. Thank you @AlexMasmej for betting on me as a smart contract eng and being the most wholesome and driven founder in web3!
2
0
45
@0xkarmacoma
karma
1 year
shall we play a game?
Tweet media one
2
6
45
@0xkarmacoma
karma
7 months
describe your job in one equation
Tweet media one
7
2
44
@0xkarmacoma
karma
2 months
@PopPunkOnChain We are not quite back to 2020 console.log levels
Tweet media one
4
2
43
@0xkarmacoma
karma
2 years
how it's going
Tweet media one
4
2
43
@0xkarmacoma
karma
1 month
I said what I said
Tweet media one
1
9
45
@0xkarmacoma
karma
7 months
I'll meet you at the intersection of research and engineering (っ◔◡◔)っ ♥
@solidity_lang
Solidity
7 months
Introducing our 2nd round of speakers for the Solidity Summit! Shoutout to @lovethewired , @annascarroll , @PaulRBerg & @0xkarmacoma for contributing valuable content. This batch focuses on testing, tooling & coding patterns! Learn more 👇🧵
Tweet media one
2
12
81
0
2
42
@0xkarmacoma
karma
9 months
halmos v0.1.2 just released 🎁 - added support for DELEGATECALL, CALLCODE (lol) and CREATE2 - support for struct types as test parameters - library linking is now supported
Tweet media one
1
4
44
@0xkarmacoma
karma
8 months
Tweet media one
4
6
44
@0xkarmacoma
karma
1 month
- OSS - no false positives - integrates with Foundry - we focus on performance and a good devex - write your assertions in Solidity, not a spec language
@nisedo_
nisedo
1 month
@0xkarmacoma Why Halmos over the other FV tools?
1
0
1
4
0
43
@0xkarmacoma
karma
2 years
A guide to Corruption(s) Insight 🔮 Each token has an insight score. At first, it increases linearly with the time passed since the last transfer, roughly 1 point every 2 days. After a month, things get interesting...
@0xkarmacoma
karma
2 years
More Corruptions: they all have insight 1 for now For NFTs not getting transferred, their insight will start increasing in about 2d (10k blocks) Their insight multiplier will start increasing in 34d They will reach max insight multiplier in 833d
Tweet media one
3
1
34
9
4
42
@0xkarmacoma
karma
3 months
reject modernity (forge test --debug) embrace tradition (console2.log("here"))
5
1
39
@0xkarmacoma
karma
2 years
Did Github Copilot just suggest that I set my copyright notice to @DRMacIver ? 😅
Tweet media one
1
9
42