Skip to content

gelatodigital/coinflip-ai-agent-eliza

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eliza 🤖

Eliza Coinflip Game Agent 🎲

Overview

This agent is designed to interact with a Coinflip game on the blockchain. It allows users to:

  • Place bets on heads or tails
  • Check game results
  • View round information
  • Get random bet suggestions
  • Check their balance

The agent uses Gelato for gasless transactions, making the gaming experience seamless for users.

Screenshots

Game Interface

Coinflip Game Interface

Placing Bets

Placing Bets in Coinflip

Round Results

Viewing Round Results

Prerequisites

Quick Start

  1. Clone and checkout the correct branch:
git clone https://github.com/gelatodigital/coinflip-ai-agent-eliza
cd eliza
git checkout update-gelato-plugin
  1. Set up your environment variables:
cp .env.example .env
  1. Configure the following required variables in your .env:
EVM_PRIVATE_KEY=your_wallet_private_key
EVM_PROVIDER_URL=your_rpc_url
GELATO_RELAY_API_KEY=your_gelato_api_key
  1. Install dependencies and build:
pnpm install
pnpm run build
  1. Start the agent:
pnpm run start
  1. In a new terminal, start the client interface:
pnpm run start:client
  1. Open your browser and navigate to the URL shown in the terminal (usually http://localhost:3000)

Usage

The agent responds to the following commands:

  • bet 0.01 heads - Place a bet of 0.01 ETH on heads
  • bet 0.01 tails - Place a bet of 0.01 ETH on tails
  • pick for me - Get a random bet suggestion
  • balance - Check your current balance
  • show round - View current round information
  • did i win - Check if you won your last bet
  • check result 123 - Check results for round number 123

Important Notes

  • All transactions are gasless thanks to Gelato integration
  • The game is running on the Sepolia testnet
  • Minimum bet is 0.01 ETH
  • Maximum bet is 0.05 ETH
  • Each round has a time limit for betting

Web3 Functions & VRF Tasks

The game uses Gelato's Web3 Functions and VRF (Verifiable Random Function) for automation and randomness:

Troubleshooting

If you encounter issues:

  1. Ensure your wallet has enough testnet ETH
  2. Verify your environment variables are correctly set
  3. Make sure you're on the correct branch (update-gelato-plugin)
  4. Try cleaning the project and rebuilding:
pnpm clean
pnpm install
pnpm build

Support

For additional help:

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published