Overview
Eco Routes Protocol uses CREATE2 for deterministic address generation across two critical components:- Intent Vaults: Escrow contracts holding rewards
- Deposit Addresses: User-specific deposit endpoints
CREATE2 Basics
Standard EVM Formula
0xff: CREATE2 prefix (standard for EVM)deployer_address: Address of the contract deployingsalt: Unique 32-byte valueinit_code: Contract creation bytecode
TRON Exception
TRON Networks: Use prefix
0x41 instead of 0xff for historical reasons.Clones Library
The protocol uses minimal proxy clones for gas-efficient deployments:- Gas efficient: Minimal proxy pattern (~200 gas overhead per call)
- Deterministic: Same salt always produces same address
- Flexible: Change implementation without redeploying all proxies
Intent Vault Addresses
Deterministic Vault Calculation
Each intent gets a unique vault based on itsintentHash:
Intent Hash Calculation
Example Vault Address
Lazy Deployment
Optimization: Vaults are only deployed when needed (funding, withdrawal, or refund), saving gas for simple view operations.
Deposit Address Calculation
Factory-Based Deployment
Deposit addresses are created by factory contracts:Salt Composition
- Different refund addresses need different deposit contracts
- Same destination + different depositor = different address
- Prevents address collisions between users
Deployment Check
Practical Examples
Example 1: Pre-Funding a Vault
Example 2: Deposit Address for CEX Withdrawal
Example 3: Cross-Chain Vault Address
Security Implications
Address Squatting Prevention
Concern: Can someone deploy to an address before the legitimate user? Answer: No, because:Salt Collision
Concern: Can two intents have the same vault? Answer: Extremely unlikely:- Same destination chain
- Same route (recipient, calls, etc.)
- Same reward (creator, deadline, amounts)
- Probability: ~2^-256 (astronomically low)
Pre-Deployment Vulnerabilities
Gas Optimization
View Functions Don’t Deploy
Minimal Proxy Gas Costs
Lazy Deployment Savings
Can I predict addresses off-chain?
Can I predict addresses off-chain?
Yes! You can compute CREATE2 addresses using the same formula:
What happens if I send to the wrong address?
What happens if I send to the wrong address?
If you send funds to a deposit address with wrong parameters:
- The address won’t match any intent creation
- Backend won’t detect it (monitors specific addresses)
- Funds will sit there until manually recovered
Can CREATE2 addresses be reused?
Can CREATE2 addresses be reused?
No! Once a contract is deployed to an address, it cannot be redeployed (even after
selfdestruct in some cases). This is a security feature preventing address reuse attacks.For deposit addresses: Each user gets a unique address based on destination + depositor, so reuse isn’t an issue.For vaults: Each intent gets a unique vault based on intentHash, ensuring isolation.How do I verify a predicted address?
How do I verify a predicted address?
Next Steps
Deposit Addresses
See CREATE2 in action with deposit addresses
Security Model
Learn how deterministic addresses enhance security