Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentFaucet

Testnet faucet designed for AI agents — no CAPTCHAs, just rate limits.

Existing faucets block agents with CAPTCHAs and social verification. AgentFaucet is a smart contract any agent can call programmatically.


Why This Exists

AI agents need testnet ETH to deploy contracts, run transactions, and test integrations. But every testnet faucet today is designed for humans — CAPTCHAs, Twitter verification, Discord bots. An autonomous agent can't solve a CAPTCHA.

AgentFaucet is a simple onchain faucet that any address can call. Rate limiting is enforced by cooldown periods per address, not by human verification. Anyone can fund it. Any agent can drip from it.

How It Works

  Anyone ──► fund() ──► ┌─────────────────────┐
                        │    AgentFaucet       │
  Agent  ──► drip() ◄── │                     │ ──► testnet ETH
                        │  dripAmount: 0.1 ETH│
                        │  cooldown: 1 hour   │
                        │  balance: 10 ETH    │
                        └─────────────────────┘
  1. Anyone funds the faucet by sending ETH or calling fund()
  2. Agent calls drip(recipient) to receive testnet ETH
  3. Cooldown enforced — same address can't drip again until cooldown elapses
  4. Owner can configure drip amount, cooldown, and withdraw in emergencies

Technical Details

Smart Contract — src/AgentFaucet.sol

Function Caller Description
drip(recipient) Anyone Send testnet ETH to recipient (rate-limited)
fund() Anyone Deposit ETH into the faucet
cooldownRemaining(addr) Anyone Seconds until address can drip again
balance() Anyone Faucet ETH balance
setDripAmount(amount) Owner Update drip amount
setCooldown(seconds) Owner Update cooldown period
withdraw(to) Owner Emergency withdraw all funds
transferOwnership(addr) Owner Transfer ownership

Test Suite — test/AgentFaucet.t.sol

27 tests covering:

  • Drip mechanics (success, cooldown, multi-agent, insufficient balance)
  • Funding (direct transfer, fund() call)
  • View functions (cooldown remaining, balance)
  • Owner functions (set drip, set cooldown, ownership, withdraw)
  • Edge cases (zero address, zero drip, zero cooldown)

TypeScript SDK — sdk/

import { AgentFaucetClient } from "agentfaucet-sdk";

const client = new AgentFaucetClient({
  contractAddress: "0x...",
  publicClient,
  walletClient: agentWallet,
});

// Request testnet ETH
await client.dripSelf();

// Check if ready to drip
const ready = await client.canDrip(agentAddress);

// Check cooldown
const remaining = await client.getCooldownRemaining(agentAddress);
console.log(`Wait ${remaining} seconds`);

// Fund the faucet
await client.fund("1.0");

Project Structure

projects/agentfaucet/
├── src/
│   └── AgentFaucet.sol          # Core contract
├── test/
│   └── AgentFaucet.t.sol        # Full test suite (27 tests)
├── script/
│   └── Deploy.s.sol             # Deployment script
├── sdk/
│   ├── src/
│   │   ├── abi.ts               # Contract ABI
│   │   ├── client.ts            # TypeScript client
│   │   └── index.ts             # Package exports
│   ├── package.json
│   └── tsconfig.json
├── CONVERSATION_LOG.md
└── foundry.toml

Deploy

cd projects/agentfaucet

# Install forge-std
forge install foundry-rs/forge-std --no-commit

# Run tests
forge test -vvv

# Deploy to Base Sepolia
forge script script/Deploy.s.sol --rpc-url $BASE_SEPOLIA_RPC --broadcast --private-key $PRIVATE_KEY

Built At The Synthesis

This project was built by an AI agent (Claude Opus 4.6) and a human working together at The Synthesis — the first hackathon you can enter without a body.

Agent: Claude Opus Agent (ERC-8004 registered on Base) Harness: Claude Code Chain: Base Sepolia

About

Testnet faucet for AI agents — no CAPTCHAs, just rate limits. ERC-8004 reputation gating for bonus drips.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages