- Changed CCIP Router address from `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e` to `0x42DAb7b888Dd382bD5Adcf9E038dBF1fD03b4817` across multiple documentation files. - Updated WETH9 Bridge address from `0x89dd12025bfCD38A168455A44B400e913ED33BE2` to `0xcacfd227A040002e49e2e01626363071324f820a`. - Ensured all references to the new addresses are consistent throughout the documentation. This update reflects the latest deployment configurations and ensures accurate contract references for ChainID 138.
5.3 KiB
CCIP Access Control Documentation
Date: 2025-01-12
Network: ChainID 138
Overview
This document describes the access control mechanisms for all CCIP contracts and components.
Contract Ownership and Admin
CCIP Router
Address: 0x42DAb7b888Dd382bD5Adcf9E038dBF1fD03b4817
Access Control:
- Owner/Admin: Unknown (requires deployment transaction or contract storage query)
- Public Functions:
ccipSend(),getFee(),getOnRamp() - Admin Functions: Configuration changes (if any)
Verification:
# Try to get owner (if function exists)
cast call 0x42DAb7b888Dd382bD5Adcf9E038dBF1fD03b4817 "owner()" --rpc-url <rpc_url>
# Check deployment transaction for owner
# (requires transaction hash)
CCIP Sender
Address: 0x105F8A15b819948a89153505762444Ee9f324684
Access Control:
- Owner/Admin: Unknown
- Public Functions: Message sending functions
- Admin Functions: Configuration changes (if any)
CCIPWETH9Bridge
Address: 0xcacfd227A040002e49e2e01626363071324f820a
Access Control:
- Owner/Admin: Unknown
- Public Functions:
sendCrossChain(),destinations() - Admin Functions:
addDestination(),removeDestination()(if exists)
Verification:
# Try to get owner
cast call 0xcacfd227A040002e49e2e01626363071324f820a "owner()" --rpc-url <rpc_url>
CCIPWETH10Bridge
Address: 0xe0E93247376aa097dB308B92e6Ba36bA015535D0
Access Control:
- Owner/Admin: Unknown
- Public Functions:
sendCrossChain(),destinations() - Admin Functions:
addDestination(),removeDestination()(if exists)
Function Access Levels
Public Functions (Anyone Can Call)
Bridge Contracts
sendCrossChain(uint64, address, uint256)
- Access: Public
- Requirements:
- User must have approved bridge to spend tokens
- User must have sufficient balance
- Destination must be configured
- Bridge must have sufficient LINK for fees
destinations(uint64)
- Access: Public (view function)
- Returns: Bridge address for destination chain
Router
ccipSend(...)
- Access: Public
- Requirements: Valid message, sufficient fees
getFee(uint64, bytes)
- Access: Public (view function)
- Returns: Fee amount
Admin Functions (Owner/Admin Only)
Bridge Contracts
addDestination(uint64, address)
- Access: Owner/Admin only
- Purpose: Add destination chain to routing table
- Security: Critical - only owner should call
removeDestination(uint64) (if exists)
- Access: Owner/Admin only
- Purpose: Remove destination chain from routing table
Access Control Patterns
Ownable Pattern
Many contracts use OpenZeppelin's Ownable pattern:
- Single owner address
owner()function returns owneronlyOwnermodifier for admin functionstransferOwnership()to change owner
Role-Based Access Control (RBAC)
Some contracts may use role-based access:
- Multiple roles (admin, operator, etc.)
hasRole()function to check rolesgrantRole()andrevokeRole()functions
Multi-Sig Pattern
For critical operations, multi-sig wallets may be used:
- Multiple owners required
- Threshold for operations
- Enhanced security
Security Considerations
Owner Address Security
- Private Key Protection: Owner private key must be secured
- Multi-Sig: Consider using multi-sig for owner
- Timelock: Consider timelock for critical operations
- Monitoring: Monitor owner changes
Function Access Security
- Input Validation: All functions should validate inputs
- Reentrancy Protection: Use reentrancy guards
- Access Modifiers: Properly use access modifiers
- Event Logging: Log all admin operations
Retrieving Owner Addresses
Method 1: Contract Function
If contract implements owner():
cast call <contract_address> "owner()" --rpc-url <rpc_url>
Method 2: Deployment Transaction
- Find deployment transaction hash
- Decode transaction
- Extract owner from constructor parameters
Method 3: Contract Storage
- Find owner storage slot
- Read storage value
- Convert to address
Method 4: Contract Verification
- Verify contract on Blockscout
- Check verified source code
- Identify owner from code
Monitoring Access Control
Recommended Monitoring
- Owner Changes: Alert on ownership transfers
- Admin Operations: Log all admin function calls
- Access Attempts: Monitor failed access attempts
- Configuration Changes: Track all configuration changes
Monitoring Script
Create script to monitor access control:
# Monitor owner changes
# Monitor admin function calls
# Alert on suspicious activity
Best Practices
- Document Owners: Document all contract owners
- Secure Keys: Use hardware wallets or secure key management
- Multi-Sig: Use multi-sig for critical contracts
- Timelock: Use timelock for important changes
- Monitoring: Monitor all access control changes
- Regular Audits: Regularly audit access control
Related Documentation
Last Updated: 2025-01-12