How base/contracts works
This repository contains Base’s smart-contract system and supporting scripts. Its principal user-facing workflow is a transaction or withdrawal moving between Base and Ethereum: the L1 portal handles deposits and withdrawals, L2 contracts pass messages and assets, and proof/dispute contracts support withdrawal finalization. Separate system-configuration and fee components support chain operation. The README identifies the repository as Base contracts but does not document contract-level call paths, and the sampled source excerpts cover tooling rather than these Solidity contracts; therefore the domain connections below are dashed and unverified.
Main entry points: OptimismPortal2.sol Optimism Portal · DisputeGameFactory.sol Dispute Game Factory · L1StandardBridge.sol L1 Standard Bridge · L2CrossDomainMessenger.sol L2 Messenger
Components 24
L1 Portal
- Optimism Portal
src/L1/OptimismPortal2.sol - Resource Metering
src/L1/ResourceMetering.sol
Withdrawal Proofs
- Dispute Game Factory
src/L1/proofs/DisputeGameFactory.sol - Anchor State
src/L1/proofs/AnchorStateRegistry.sol - Aggregate Verifier
src/L1/proofs/AggregateVerifier.sol - Verifier
src/L1/proofs/Verifier.sol - TEE Verifier
src/L1/proofs/tee/TEEVerifier.sol - ZK Verifier
src/L1/proofs/zk/ZKVerifier.sol
Cross-Chain Messaging
- Cross-Domain Messenger
src/universal/CrossDomainMessenger.sol - L1 Messenger
src/L1/L1CrossDomainMessenger.sol - L2 Messenger
src/L2/L2CrossDomainMessenger.sol - L2 Message Passer
src/L2/L2ToL1MessagePasser.sol
Bridges and Tokens
- Standard Bridge
src/universal/StandardBridge.sol - L1 Standard Bridge
src/L1/L1StandardBridge.sol - L2 Standard Bridge
src/L2/L2StandardBridge.sol - ERC721 Bridge
src/universal/ERC721Bridge.sol - Mintable ERC20
src/universal/OptimismMintableERC20.sol
Chain Operations
- System Config
src/L1/SystemConfig.sol - L1 Block Data
src/L2/L1Block.sol - Gas Price Oracle
src/L2/GasPriceOracle.sol - Fee Vaults
src/L2/FeeVault.sol - Protocol Versions
src/L1/ProtocolVersions.sol
Other components
- User
- Ethereum
Connections 24
- User → Optimism Portal: initiates deposit
- Optimism Portal → Ethereum: posts transaction
- Ethereum → Optimism Portal: proves withdrawal
- Optimism Portal → Dispute Game Factory: opens dispute
- Dispute Game Factory → Anchor State: checks anchor
- Dispute Game Factory → Verifier: requests verification
- Aggregate Verifier → Verifier: aggregates proofs
- TEE Verifier → Aggregate Verifier: provides proof
- ZK Verifier → Aggregate Verifier: provides proof
- User → L1 Messenger: sends message
- L1 Messenger → Cross-Domain Messenger: uses shared logic
- L2 Messenger → Cross-Domain Messenger: uses shared logic
- L2 Messenger → L2 Message Passer: records withdrawal
- User → L1 Standard Bridge: bridges assets
- L1 Standard Bridge → Standard Bridge: uses shared bridge
- L2 Standard Bridge → Standard Bridge: uses shared bridge
- L1 Standard Bridge → L2 Standard Bridge: coordinates transfer
- ERC721 Bridge → L1 Messenger: sends bridge messages
- ERC721 Bridge → L2 Messenger: sends bridge messages
- Mintable ERC20 → L2 Standard Bridge: represents bridged token
- System Config → Optimism Portal: configures portal
- L1 Block Data → Gas Price Oracle: supplies L1 data
- Gas Price Oracle → Fee Vaults: supports fee accounting
- User → Protocol Versions: queries versions