felipe retweeted
As an auditor, it's crucial to know the ERC20 approve vulnerability.
It's a sneaky exploit that can be used to manipulate transaction ordering and double spend allowance.
In this 🧵, I'll share tips on identifying and protecting against this exploit during your audits.
felipe retweeted
Random Solidity tips:
1️⃣ Use "type(uint256).max" instead of "uint256(-1)"
2️⃣ Surround code with {} to avoid "stack too deep"
3️⃣ Skip tuple vars with commas: "uint a, , ,"
4️⃣ Swap vars in one line: "(a,b)=(b,a)"
5️⃣ Use "assert" and get built-in formal verification with SMTChecker




