EMPXRouter Contract
The EMPXRouter is the foundation of the system, providing gas-optimized token swapping with intelligent routing across multiple DEX protocols.
Core Concepts
Adapters
Adapters are trusted smart contracts that interface with individual DEX protocols. Each adapter implements standardized query and swap functions, allowing the router to interact with any DEX through a unified interface.
Security Features
- Reentrancy Protection: All swap functions are protected with OpenZeppelin’s
ReentrancyGuard. - Adapter Validation: Only whitelisted adapters can be used, preventing malicious contract interaction.
- Slippage Protection: Minimum output amount checks prevent sandwich attacks and price manipulation.
- Deadline Enforcement: Transaction expiry prevents stale orders from executing.
- Trusted Token List: Maintainer-controlled whitelist ensures only verified tokens are routed.