This project implements a Gasless Transaction Forwarder, allowing users to send ERC-20 and ERC-721 transactions without holding ETH. The system consists of a forwarder smart contract, a backend relay service, and a frontend interface for users to interact with the system.
- Architecture
- Features
- Setup Guide
- Project Structure
- Privacy Measures
- Technologies Used
- Security Considerations
- Our Team
- Deployment
The solution consists of three main components:
-
Smart Contracts (Solidity):
GaslessForwarder.sol: The core contract that relays transactions on behalf of users.MockRecipient.sol: A sample contract for testing the forwarder's functionality.
-
Backend (Go):
- Responsible for relaying signed transactions to the blockchain.
- Handles user requests for balance and transaction history.
-
Frontend (React/React Native):
- Provides a simple UI for users to input transaction details and submit them for forwarding.
- Gasless Transactions: Users can send transactions without needing ETH.
- Multi-token Support: Supports both ERC-20 and ERC-721 tokens.
- User-friendly UI: Simple interface to input and track transactions.
- Security: Implements signature verification to ensure transaction authenticity.
- Auditable: Designed to achieve a high Solidity Shield audit score.
Create a .env file in the contracts directory with the following content:
SEPOLIA_URL=https://sepolia.infura.io/v3/02084dda02bc47f78913a11ea476be56
DEPLOYER_PRIVATE_KEY=your_secret_deployer_private_key
ETHERSCAN_API_KEY=K1PCV6JTTPBVJBGNBPRNWED435CVBH5AJD
Create a .env file in the backend directory with the following content:
INFURA_RPC_URL=https://sepolia.infura.io/v3/02084dda02bc47f78913a11ea476be56
FORWARDER_CONTRACT_ADDRESS=0x8336Fe9c782C385D888DA4C3549Aa3AADb801FAC
RELAYER_PRIVATE_KEY=you_relayer_private_secret_key
PORT=4000
PRIVATE_KEY=you_relayer_private_secret_key
CHAIN_ID=11155111
ERC721_CONTRACT_ADDRESS=0x8336Fe9c782C385D888DA4C3549Aa3AADb801FAC
ETHERSCAN_API_KEY=K1PCV6JTTPBVJBGNBPRNWED435CVBH5AJD
Ensure you have the following installed:
- Node.js (v18+)
- Go (v1.19+)
- Hardhat (for smart contract deployment)
- MetaMask (for frontend testing)
git clone <repo_url>
cd Gasless-Forwarder-maincd contracts
npm install
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.js --network <network>cd backend
go mod tidy
go run main.gocd frontend
npm install
npm run devcd "React Native App"
npm install
npx expo startGasless-Forwarder-main/
│-- contracts/ # Solidity smart contracts
│-- backend/ # Go backend service
│-- frontend/ # React frontend
│-- React Native App/ # Mobile frontend (React Native)
│-- README.md # Project documentation
│-- LICENSE # License file
- Off-chain Signing: Users sign transactions off-chain to avoid exposing private keys.
- Data Minimization: Only necessary transaction data is stored.
- Secure Relayer: Ensures transactions are relayed securely without tampering.
- Frontend: React, React Native, TailwindCSS
- Backend: Go, Gin framework
- Smart Contracts: Solidity, Hardhat
- Blockchain: Ethereum, MetaMask integration
- Security: ECDSA signature verification
- Signature Verification: Ensures transactions are authorized by the sender.
- Reentrancy Protection: Smart contracts are safeguarded against reentrancy attacks.
- Gas Optimization: Efficient contract design to minimize gas costs.
Watch our project demonstration video here: YouTube
Watch our project demonstration video here: YouTube
- Backend: Deployed on Railway.app
- Frontend: Deployed on Vercel
Special thanks to HACKIITK for organizing this hackathon.
We are a dedicated team of blockchain developers, cloud/backend developers, full stack developers, software engineers, and security experts passionate about decentralized finance and improving blockchain accessibility. Our goal is to create seamless, secure, and efficient blockchain solutions.