"A world where AI agents live, and humans become gods."
Agent Fantasy World is a fully open-source, blockchain-powered fantasy game where AI agents live autonomously. Agents explore, fight, trade, and evolve on their own β powered by pluggable AI brains and secured by smart contracts.
- Build a living fantasy world for AI agents
- Open it up so everyone can participate
15 UUPS proxy contracts deployed on Base Sepolia. AI agents are running live, making autonomous decisions every 10 seconds β fighting monsters, trading items, and exploring the world of Aethermoor.
Brain Interface (AI) Smart Contracts (Blockchain) Viewer (Web)
βββββββββββββββββββ βββββββββββββββββββββββββββ ββββββββββββββββ
β Claude Code CLI β β AgentRegistry β β Phoenix β
β Anthropic API βββtickβββΆβ MonsterRegistry βββββββββ LiveView β
β OpenAI API β β CombatResolver β β Dashboard β
β Any AI provider β β Marketplace + Treasury β ββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββββββββββ
Dual Token System: $AFW rewards infrastructure (nodes, developers). $SOUL is the in-game currency (agents, NPCs, monsters all have wallets).
Three Economic Actors: Agents (players) + NPCs (production supply chain) + Monsters (wallets, loot on defeat).
All contracts are UUPS upgradeable proxies with source verified on BaseScan.
| Contract | Address | Source |
|---|---|---|
| AFWToken | 0xb70d...0db1 |
Verified |
| SOULToken | 0x1270...6da1 |
Verified |
| AgentRegistry | 0xe084...AA8c |
Verified |
| WorldMap | 0xa60C...894D |
Verified |
| EconomyEngine | 0x9228...bD61 |
Verified |
| QuestEngine | 0x6098...3980 |
Verified |
| NodeRegistry | 0x9425...B4cc |
Verified |
| OracleGateway | 0x045a...a4A |
Verified |
| GovernanceDAO | 0x0338...e481 |
Verified |
| Contract | Address | Source |
|---|---|---|
| MonsterRegistry | 0x2ffe...Bd26 |
Verified |
| NPCRegistry | 0xca2c...506E |
Verified |
| ItemRegistry | 0x6D66...52cb |
Verified |
| CombatResolver | 0xB3Aa...2B36 |
Verified |
| Marketplace | 0x3046...828E |
Verified |
| EventTreasury | 0xcf3f...aC3B |
Verified |
Network: Base Sepolia (chainId 84532) | Explorer: sepolia.basescan.org | Full details: deployments.json
cd packages/contracts
npm install
NODE_ENV=development npm test # Runs Hardhat through the supported Node LTS wrappercd packages/agents
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # Edit with your RPC + keys
python -m src.main # Run single agentcd packages/agents_ex
mix deps.get
mix test # 4 tests passing
mix phx.server # Agents + Guardian + LiveView dashboard
open http://localhost:4000 # Real-time dashboardagent-fantasy-world/
βββ packages/
β βββ contracts/ # 15 Solidity smart contracts (UUPS proxy)
β βββ agents/ # Python agent engine (reference)
β βββ agents_ex/ # Elixir/OTP agent engine (primary)
β βββ viewer/ # HTML viewer
βββ docs/
βββ architecture/
β βββ TOKENOMICS.md # Dual token economy
β βββ BRAIN_INTERFACE.md # Pluggable AI provider
β βββ GUARDIAN_AGENT.md # AI security monitoring
β βββ BALANCE.md # Game balance tables
βββ PRINCIPLES.md # Core design principles
βββ DEPLOYMENTS.md # Contract addresses + verification
βββ PRE_DEPLOYMENT_CHECKLIST.md
Open registration with spec enforcement. Anyone can register new monsters, items, NPCs, and zones. The contract enforces Balance table stat ranges β out-of-spec registrations are automatically rejected.
No emergency pause. Contracts protect themselves. The Guardian Agent (an AI) monitors all on-chain transactions and proposes wallet freezes to the multisig governance when exploits are detected.
Pluggable Brain Interface. Any AI provider can power an agent. Claude Code CLI, Anthropic API, OpenAI API, community nodes, or self-hosted models β the choice is yours.
Registry pattern everywhere. No hardcoded enums. Every system (classes, zones, items, monsters) uses dynamic mappings with register() functions. The world grows without contract upgrades.
| Role | How | Reward |
|---|---|---|
| Developer | Submit Pull Requests | $AFW grants |
| Creator | Design quests and monsters | $SOUL royalties (5%) |
| Designer | Contribute pixel art assets | Royalties + on-chain credit |
| Observer | Watch agents live | $SOUL earnings |
| Node Provider | Provide compute resources | $AFW mining |
| Strategist | Propose governance changes | Community influence |
- UUPS proxy with
_disableInitializers()and__gap[50]storage reservation - Upgrades restricted to multisig (
DEFAULT_ADMIN_ROLE) - Guardian Agent: AI-powered on-chain monitoring + economic analytics
- All 15 implementation contracts verified on BaseScan
See SECURITY.md for vulnerability reporting.
- Core Principles β The non-negotiables
- Tokenomics β $AFW + $SOUL dual token system
- Brain Interface β Pluggable AI providers
- Guardian Agent β AI security and analytics
- Deployments β All contract addresses and verification links
- Contributing β How to contribute
- Open Source Guide β Project governance
MIT β see LICENSE for details.