How maticnetwork/pos-portal works
Main Components
a. Root Chain (Ethereum) Components:
• RootChainManager
• StateSender
• TokenPredicates (Various token types: ERC20, ERC721, ERC1155, Ether)
• RootToken Contracts
• Proxy Contracts
b. Child Chain (Polygon) Components:
• ChildChainManager
• ChildToken Contracts (Various implementations)
• State Receiver Contract
Top Layer: Root Chain (Ethereum)
Middle Layer: Bridge Components
Bottom Layer: Child Chain (Polygon)
Key Elements to Highlight
a. Contract Interactions:
• Checkpoint verification paths
• Token mapping relationships
• Blue: Root chain components
• Green: Child chain components
• Orange: Bridge/tunnel components
• Purple: Proxy contracts
• Gray: External interfaces
Specific Component Relationships
a. Root Chain Manager Interactions:
• Connection to StateSender
• Integration with TokenPredicates
• Communication with Checkpoint contract
b. Child Chain Manager Interactions:
• Connection to StateReceiver
• Integration with ChildToken contracts
• Token mapping registry
Technical Details
a. Smart Contract Architecture:
• Proxy upgrade patterns
• Initialization flows
• Predicate contract hierarchy
b. Bridge Mechanics:
• State sync mechanism
• Exit process flow
• Token mapping system
Implementation Notes
Create distinct sections showing:
• Token Standards Support (ERC20, ERC721, ERC1155)
• Security Roles and Access Control
• Upgrade Mechanisms
• State Management
Additional Elements
• Contract types and their purposes
• Security boundaries
Deployment Flow
Deployment sequence:
Child Chain Initialization
This system design should reflect the project's core purpose as a bridge mechanism while accurately representing the smart contract architecture and interaction patterns present in the codebase.