Browse all Smart Contract Security articles.
16 min read
Invariant Testing in Foundry Introduction In this article, we will discuss invariants and how to perform an invariant test on Solidity smart contracts using Foundry test suites. Invariant testing is...
7 min read
The interest rate model of Aave V3 and Compound V2 Interest rates in TradFi (traditional finance) are largely determined by central banks and influenced by market factors. In contrast, DeFi interest...
3 min read
The Fallback Extension Pattern The fallback-extension pattern is a simple way to circumvent the 24 KB smart contract size limit. Suppose we have functions and in our primary contract and wish to add...
6 min read
EIP 1967 Storage Slots for Proxies EIP 1967 is a standard for where to store information that proxy contracts need to execute. Both the UUPS (Universal Upgradeable Proxy Standard) and the Transparent...
12 min read
The staking algorithm of SushiSwap MasterChef and Synthetix The MasterChef and Synthetix staking algorithms distribute a fixed reward pool among stakers according to their time-weighted contributions...
5 min read
The second preimage attack for Merkle Trees in Solidity The _second preimage attack_ in Merkle trees can happen when an intermediate node in a Merkle tree is presented as a leaf. The name of this...
4 min read
How Chainlink Price Feeds Work Chainlink price oracles are smart contracts with public view functions that return the price of a particular asset denominated in USD. Off-chain nodes collect the...
8 min read
Layer 2 Calldata Gas Optimization Update for mid 2024: As of the Dencun upgrade, calldata optimization doesn't have as much of an impact since the transactions on most L2s are stored on blobs,...
11 min read
DeFi Lending: Liquidations and Collateral In TradFi, when someone defaults on a loan, the creditor has the right to seize assets or garnish wages. In DeFi, when someone defaults on a loan it isn’t...
7 min read
Solidity Gasleft Introduction The purpose of this article is to describe the behavior of the Solidity function and its uses. It is a built-in function that is used to check the remaining gas during a...
12 min read
Ethereum smart contract creation code This article explains what happens at the bytecode level when an Ethereum smart contract is constructed and how the constructor arguments are interpreted. Table...
21 min read
Mastering Solidity: Master the Computer Science Fundamentals First !put in the reps text with a punch bag I hate computer science! I'll spare you the traditional arguments for why you should study...