Try it Live
Run AccessList examples in the interactive playground
Conceptual Guide - For API reference and method documentation, see AccessList API.
What Are Access Lists?
An access list is an array of items, where each item specifies:- A contract address (20 bytes)
- A list of storage keys (32 bytes each) within that address
Why Access Lists Exist
Before EIP-2929 (Berlin hard fork), all storage accesses cost the same amount of gas. After EIP-2929, the EVM tracks which addresses and storage slots have been accessed during a transaction:- Cold access - First time accessing an address/slot: expensive
- Warm access - Already accessed in this transaction: cheap
Gas Mechanics
Access Costs Without Access List
| Operation | First Access (Cold) | Subsequent Access (Warm) |
|---|---|---|
| Account access | 2,600 gas | 100 gas |
| Storage read (SLOAD) | 2,100 gas | 100 gas |
| Storage write (SSTORE) | 20,000+ gas | 2,900+ gas |
Access List Costs
Including items in an access list costs upfront gas:| Item Type | Cost per Item |
|---|---|
| Address | 2,400 gas |
| Storage key | 1,900 gas |
Savings Calculation
Each item you include converts one cold access to a warm access:| Access Type | Cold Cost | Warm Cost | Savings |
|---|---|---|---|
| Address | 2,600 | 100 | 2,500 gas |
| Storage key | 2,100 | 100 | 2,000 gas |
- You access the same slot multiple times in one transaction
- The 100 gas per-item savings multiplied by number of accesses exceeds the upfront cost
Structure and Examples
Creating an Access List
Adding Multiple Addresses
Querying Access Lists
Complete Example: Gas Savings Calculation
Here’s a real-world example analyzing whether an access list saves gas:When Access Lists Help: Batch Operations
Access lists become beneficial when you access the same slots multiple times:When to Use Access Lists
Good Use Cases
- Batch operations with repeated storage access
- Multi-contract DeFi transactions
- Flash loan liquidations
Poor Use Cases
- Simple transfers - Single SLOAD/SSTORE operations
- Already-warm storage - Slots accessed earlier in same block
- Single-contract calls - Not enough repeated access to benefit
- Small operations - Upfront cost exceeds potential savings
Trade-offs
Advantages
- Predictable gas costs - All accesses are warm, no surprises
- Savings in complex transactions - Multi-access operations benefit
- Required for some EIPs - EIP-1559 transactions support access lists
Disadvantages
- Upfront cost - 2,400 gas per address, 1,900 per key
- Rarely break even - Most transactions don’t access slots enough times
- Complexity - Must calculate storage slots correctly
- Maintenance burden - Storage layouts change between contract versions
Visual: Gas Cost Comparison
Scenario: Reading a storage slot N times in one transaction| Accesses (N) | Without List | With List | Net Savings |
|---|---|---|---|
| 1 | 2,100 | 1,900 + 100 = 2,000 | +100 ✓ |
| 5 | 2,100 + 400 = 2,500 | 1,900 + 500 = 2,400 | +100 ✓ |
| 10 | 2,100 + 900 = 3,000 | 1,900 + 1,000 = 2,900 | +100 ✓ |
| 50 | 2,100 + 4,900 = 7,000 | 1,900 + 5,000 = 6,900 | +100 ✓ |
Calculating Storage Slots
To build an access list, you need to know which storage slots will be accessed. For Solidity contracts:@ethersproject/abi or viem to calculate storage slots rather than implementing this manually.
Deduplication
Always deduplicate before using an access list:Merging Access Lists
Combine multiple access lists for complex operations:Resources
- EIP-2930: Optional Access Lists - Access list specification
- EIP-2929: Gas Cost Increases for State Access - Cold vs warm access costs
- EIP-1559: Fee Market Change - Transaction type supporting access lists
- Ethereum Yellow Paper - Formal EVM specification
Next Steps
- Overview - API reference and complete method listing
- Gas Optimization - Deep dive on cost analysis
- Usage Patterns - Real-world examples
- Transaction - Using access lists in transactions

