Integration Overview
Welcome to the deBridge Protocol integration guide. This section will help you integrate cross-chain functionality into your application.What Can You Build?
With deBridge Protocol, you can:Cross-Chain Bridges
Build custom bridges for assets and NFTs with full control over logic and parameters
Multi-Chain dApps
Create applications that span multiple chains with seamless user experience
Cross-Chain DeFi
Enable lending, borrowing, swapping, and yield farming across different blockchains
Composable Protocols
Build protocols that interact with other protocols across chains
Prerequisites
Before integrating deBridge, ensure you have:Technical Requirements
Development Environment
- Solidity ^0.8.7 or higher
- Hardhat, Foundry, or Truffle
- Node.js v16+ for scripts
- Git for version control
Blockchain Knowledge
- Understanding of EVM and smart contracts
- Experience with cross-chain concepts
- Familiarity with proxy patterns
- Knowledge of signature verification
Dependencies
Install required packages:- npm
- yarn
Integration Patterns
deBridge supports multiple integration patterns:1. Direct Integration
Call DeBridgeGate contract directly from your application. Best For: Simple asset transfers, basic cross-chain operationsExample: Direct Integration
2. Cross-Chain Calls
Send messages and execute contract calls on destination chains. Best For: Cross-chain interactions, composable protocolsExample: Cross-Chain Call
3. BridgeAppBase Pattern
Inherit from a base contract that handles cross-chain communication. Best For: Complex applications, multiple cross-chain operationsExample: BridgeAppBase Pattern
DeBridgeGate Contract Addresses
Connect to DeBridgeGate on supported chains:- Mainnets
- Testnets
Key Interfaces
Import the main interfaces you’ll need:IDeBridgeGate
contracts/interfaces/IDeBridgeGate.sol
ICallProxy
contracts/interfaces/ICallProxy.sol
Integration Checklist
Before going live, ensure you’ve completed:Contract Development
- Implement integration pattern
- Add error handling
- Handle fallback scenarios
- Implement access controls
- Add event emissions
Testing
- Unit tests for all functions
- Integration tests on testnets
- Test failure scenarios
- Test with different fee configurations
- Load testing if applicable
Security
- Code review completed
- Audit by reputable firm
- Verify CallProxy sender
- Implement reentrancy guards
- Add pause mechanism
Deployment
- Deploy on testnets first
- Verify on block explorers
- Test end-to-end flow
- Prepare deployment scripts
- Document configuration
Common Integration Scenarios
Scenario 1: Simple Token Bridge
Users can bridge tokens between chains:Scenario 2: Cross-Chain Swap
Bridge tokens and execute swap on destination:Scenario 3: Cross-Chain Governance
Execute governance decisions across chains:Error Handling
Handle common errors gracefully:Example: Error Handling
Testing Strategy
Unit Tests
Example: Unit Test
Integration Tests
Test on actual testnets with real DeBridgeGate contracts.Resources
Sending Assets
Detailed guide on implementing asset transfers
Cross-Chain Calls
Learn to execute contract calls across chains
BridgeAppBase
Advanced pattern for complex applications
GitHub Examples
Browse example contracts and implementations
Get Help
Need assistance with your integration?- Discord: discord.com/invite/debridge
- GitHub: github.com/debridge-finance
- Documentation: docs.debridge.finance
- Twitter: @DebridgeFinance