Low-level exploration of EVM execution context, storage behavior, and proxy architectures.
- Delegatecall vs Call
- Execution context and
msg.sender - Storage layout and slot behavior
- Storage collision vulnerabilities
- Proxy pattern (fallback + delegatecall)
- Minimal proxy (EIP-1167 clones)
Same function call.
Different execution context.
Different storage outcome.
call→ modifies target contract storagedelegatecall→ modifies caller contract storage
Mismatched storage layouts:
- same slot
- different meaning
Result:
- critical state overwrite (
owner)
User interacts with proxy.
- proxy forwards calldata
- implementation executes logic
- state is stored in proxy
Factory deploys lightweight proxy instances.
- shared implementation
- isolated storage per instance
- cheap deployment
Delegatecall executes external code using the caller’s storage.
Storage layout must be consistent across contracts.
- Code lives in implementation
- State lives in proxy
- Execution context defines where state changes
Same code.
Different storage.
Completely different system behavior.