Developer Guide
Build with Mesh or extend it.
Project Structure
mesh-contracts/
├── Frontend/ # React app
├── relayer/ # Cross-chain service
├── evm_contracts/ # Ethereum contracts
├── sui_contracts/ # Sui contracts
└── docs/ # DocumentationDevelopment Setup
1. Clone and install
git clone https://github.com/ashwanth511/mesh
cd mesh
# Frontend
cd Frontend && npm install
# Relayer
cd ../relayer && npm install2. Install blockchain tools
3. Set up environment
Building and Testing
Frontend:
Contracts:
Relayer:
Key Technologies
Frontend (React):
React 18 with TypeScript
Wagmi for Ethereum wallets
Sui SDK for Sui wallets
Vite for building
Ethereum (Solidity):
Foundry development framework
OpenZeppelin security libraries
1inch Fusion+ integration
ethers.js for interaction
Sui (Move):
Move programming language
Sui SDK for JavaScript
Generic contract design
Capability-based security
Relayer (TypeScript):
Node.js backend service
Event-driven architecture
Cross-chain coordination
Secret management
Extending Mesh
Add new token pairs:
Deploy contracts for new tokens
Update relayer configuration
Add token info to frontend
Test with small amounts
Modify swap logic:
Update smart contracts
Deploy new versions
Update relayer to handle changes
Test thoroughly
Build integrations:
Use Mesh contracts in your app
Connect to relayer API
Handle swap events
Provide user interface
API Reference
Smart Contract Functions:
Relayer Events:
SwapCreated
SwapFilled
SwapCompleted
SwapCancelled
Best Practices
Security:
Always test on testnets first
Audit contract changes
Use secure key management
Monitor for unusual activity
Performance:
Optimize gas usage
Use efficient data structures
Implement proper error handling
Monitor system resources
UX:
Provide clear status updates
Handle errors gracefully
Make wallets easy to connect
Show realistic time estimates
Contributing
Fork the repository
Create feature branch
Make your changes
Add tests
Submit pull request
Areas for contribution:
New blockchain integrations
UI/UX improvements
Gas optimization
Documentation
Testing coverage
Last updated