A monorepo project that provides EVM compatibility for Oraichain's CosmWasm DApps, specifically designed for OraiDEX. This project enables Ethereum-compatible interactions with Oraichain's CosmWasm smart contracts through precompiled modules.
.
├── packages/ # Core packages
│ ├── contracts/ # Solidity smart contracts for EVM compatibility
│ ├── sdk/ # JavaScript/TypeScript SDK for interacting with the contracts
│ └── ui/ # UI components and widget for integration
The contracts package provides Solidity smart contracts that serve as an EVM entry point to interact with CosmWasm contracts on Oraichain.
Key Features:
- Bridging EVM and CosmWasm: Enables EVM-compatible chains to interact with CosmWasm contracts through precompiled modules.
- Token Standards: Implements various token standards for cross-chain compatibility:
ERC20Native
: ERC20 representation of Oraichain native tokensCW20ERC20
: ERC20 interface for CW20 tokens on OraichainNativeERC20
: Maps ERC20 interface to native Oraichain assets
- Precompiled Interfaces: Provides interfaces to Oraichain's precompiled modules:
IWasmd
: Interface for CosmWasm module interactionsIJson
: Helper for JSON parsing and manipulationIAddr
: Address conversion between EVM and Cosmos formatsIBank
: Interface for bank module operationsIAuthz
: Interface for authorization module
- OraiDEX Integration: Includes contracts for interacting with OraiDEX's pools and pairs
The SDK package provides a TypeScript library for developers to interact with the EVM entry point contracts and OraiDEX functionality.
Key Features:
- OSOR (Oraichain Smart Order Router): Optimized routing for token swaps on OraiDEX
- API Client: Simplified HTTP requests with built-in error handling
- CosmWasm Integration: Built-in support for CosmWasm message formats
- Utilities: Helper functions for common operations with Cosmos and EVM compatibility
- TypeScript Support: Full TypeScript support with type definitions
The UI package provides React components for integrating OraiDEX's swap functionality into any EVM-compatible dApp.
Key Features:
- React Components: Reusable UI components for OraiDEX integration
- Widget: Standalone widget for token swapping
- RainbowKit Integration: Wallet connection via RainbowKit
- Responsive Design: Mobile-friendly components using modern UI libraries
- Token Bridging: Use ERC20 representations of Oraichain native tokens on EVM chains.
- Cross-Chain DeFi: Access OraiDEX's liquidity pools from EVM-compatible chains.
- Unified Interface: Build applications that work seamlessly across EVM and Cosmos ecosystems.
- Developer Tools: Leverage the SDK to build custom applications with OraiDEX integration.
The project uses a modern monorepo setup with the following tools:
- pnpm as package manager
- Turborepo for monorepo management
- Changesets for versioning and changelogs
- TypeScript for all packages
- Hardhat and Foundry for smart contract development
pnpm install
pnpm build
pnpm dev:watch
pnpm test
Please refer to CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.