This repository contains the smart contracts for Envio Pilot, an AI-powered automation layer for DeFi trading using MetaMask Advanced Permissions and Envio indexing.
The EnvioPilot.sol contract serves as a tracking and event emission layer. It allows the frontend to emit high-level events that are indexed in real-time by Envio, enabling the AI Agent to stay synchronized with:
- Permission grants (ERC-7715)
- Trade executions
- DCA order creation and management
- Network: Sepolia Testnet
- Address:
0xF6Ee0a3a8Ea1fE73D0DFfac8419bF676276D56cB - Functions:
grantPermission(string perm, uint256 amount): Emits aPermissionGrantedevent.executeTrade(uint256 fromAmount, uint256 toAmount): Emits aTradeExecutedevent.- Note: In a production environment, these would be integrated directly into your trading logic.
-
Install dependencies:
npm install
-
Configure environment variables: Create a
.envfile with:PRIVATE_KEY=your_private_key ETHERSCAN_API_KEY=your_key
npx hardhat run scripts/deploy.js --network sepolianpx hardhat verify --network sepolia 0xF6Ee0a3a8Ea1fE73D0DFfac8419bF676276D56cBscripts/deploy.js: Main deployment script.scripts/emitEvents.js: Utility script to test Envio indexing by manually emitting events.scripts/verify.js: Automated verification script.
Built for the MetaMask & Envio Hackathon. 🚀