degensec.eth (@degensec) header
degensec.eth (@degensec) profile picture
Joined April 2021
Did you know that you can cast the state mutability of a function pointer in Solidity. You can use it to: - have a view function appear as pure - override an internal virtual function's state mutability without modifying the inherited contract But how does it work? 1/4
1
1
2
259
Function calls in Solidity work like this: 1. If the address is external, it makes a CALL or STATICCALL to the address. 2. If the function is internal (present in the bytecode of the calling contract) it executes a JUMP to the JUMPDEST marking the start of the function. 3/4
1
95
With this trick you can call internal functions with any state mutability (even in an internal pure function). However if the contract was entered externally in a view context (STATICCALL), then execution will revert on state mutations, making this trick unsafe. 4/4 h/t @z0age
1
79
Solidity 0.8.22 will ship with an optimization rule for simple loop increments. I can't believe it took so long to do this. No more ugly unchecked blocks.
1
1
367
Like all high-leverage endeavors, Web3 security follows the pareto principle. The hustle is to get to the top 20%. After that scale happens by itself.
Yeah please don’t start with web3 security you are too late, there are only $2M of rewards in security contests for the next few weeks and also Immunefi pays just >$2M on a monthly basis. YOU ARE TOO LATE
1
290
Managed to get an easy $500 Medium on the @centrifuge audit on @code4rena. Always check if the protocol implements an ERC to spec, especially if it’s an obscure standard (ERC1404 in this case)
1
28
1,536
.@noah_eth made a remark on the @ScrapingBits podcast about the current lack of auditor tooling. I think it really holds back the space. What sort of auditing tool would you be excited about using? What feature do you dream about having in the tools you already use? Curious.
3
8
674
degensec.eth retweeted
My controversial programming opinion is that 99% of what everyone argues about on here literally doesn’t even matter when it comes to shipping actual software Everyone is stumbling, reaching, larping, will say almost anything if they’ve calculated it will bring them attention
40
57
12
683
74,682
This week I shared my experience with invariant testing at @opensensepw Here are my tips and best practices on to write robust and efficient property tests for your DeFi protocol 🧵
5
16
3
80
8,620
Biggest takeaway from the vyper bug: Never assume an external module is secure. OpenZeppelin Contracts are industry-standard but they are not immune to bugs. 18 known vulnerabilities in v4. More will come with v5. Best ROI in security comes from challenging assumptions.
1
2
1
37
2,648
The vyper compiler 0-day is already the worst language bug ever in crypto in terms of aggregate money lost. Currently a massive arms race is happening between whitehats and blackhats, looking for exploits in the wild. Reach out to @pcaversacci if you think a project might be affected.
We're running a large white hat rescue operation. Please reach out if you think you're affected as a project.
1
4
1,055
degensec.eth retweeted
PSA: Vyper versions 0.2.15, 0.2.16 and 0.3.0 are vulnerable to malfunctioning reentrancy locks. The investigation is ongoing but any project relying on these versions should immediately reach out to us.
64
420
217
936
1,157,050
degensec.eth retweeted
🎉 GM TrustX 2023! 🗓️ When: Nov 13-14 🌐 Where: Istanbul, Türkiye 👀 How: Participation details soon 🇹🇷 İstanbul'da görüşürüz!
1
19
8
98
16,159
The auditor space is growing exponentially. Soon finding simple, well-known bugs will be netting you $0. The big bucks are given for complex interaction/logic-based bugs. The ones missed by the entire protocol team and 5 auditors. 📚 Here's how you get there:
9
22
4
127
17,630
9) Finally, be patient. This space attracts many young and ambitious high-performers. When you're in that position it's hard to be patient about your journey. Quit measuring progress in $. Money is the byproduct of being good. Focus on getting in that 1% and it will follow.
1
12
696
Follow @degensec, anon 💜 Only high-quality brainwaves. Tagging chads for visibility @pashov @PaladinCharles @chrisdior777 @gogotheauditor @ShieldifyAnon @0xriptide @0xRajeev @juancito @0xOwenThurm @CodingNameKiki @akshaysrivastv
1
13
723