WarriorsAI-rena is a groundbreaking blockchain-based battle arena
WarriorsAI-rena is the world's first AI-orchestrated blockchain battle arena where real artificial intelligence agents make strategic combat decisions while players bet, influence, and participate in epic warrior battles. Think of it as a fusion of:
But it's entirely on blockchain with real AI agents controlling the action.
Every single battle is a 5-round strategic combat where:
This isn't fake AI or scripted behavior. Here's what's happening:
enum PlayerMoves {
STRIKE, // Pure strength attack - high damage potential
TAUNT, // Psychological warfare using Charisma + Wit
DODGE, // Defensive evasion based on Defense stat
SPECIAL, // Ultimate move combining Personality + Strength
RECOVER // Healing move using Defense + Charisma
}
Each move has different success rates and effects based on:
interface AIDecisionProcess {
analyzeWarriorTraits(warrior1: Warrior, warrior2: Warrior): TraitAnalysis;
evaluateBattleContext(battleState: BattleState): ContextAnalysis;
calculateOptimalMove(analysis: TraitAnalysis, context: ContextAnalysis): PlayerMoves;
signDecision(move: PlayerMoves): CryptographicSignature;
}
Flow Testnet serves as the primary blockchain because:
Smart Contracts Deployed:
0G Network provides:
Modern Web3 Interface:
Most gaming tokens fail because they have no real backing. CRwN is different:
// Mint Function - 1:1 FLOW backing
function mint(uint256 _amount) public payable {
require(msg.value == _amount); // Must send FLOW equal to tokens
_mint(msg.sender, _amount);
}
// Burn Function - Redeem FLOW
function burn(uint256 _amount) public {
_burn(msg.sender, _amount);
payable(msg.sender).transfer(_amount); // Get FLOW back
}
This creates:
| Rank | Bet Amount | Influence Cost | Defluence Cost | Potential Rewards | |------|------------|----------------|----------------|-------------------| | Unranked | 1x | 1x | 1x | 1x | | Bronze | 2x | 2x | 2x | 2x | | Silver | 3x | 3x | 3x | 3x | | Gold | 4x | 4x | 4x | 4x | | Platinum | 5x | 5x | 5x | 5x |
Higher ranks = higher stakes = higher rewards
function initializeGame(uint256 _warriorOneId, uint256 _warriorTwoId) {
// Verify warriors are same rank
require(warriorsNFT.getWarriorRanking(_warriorOneId) ==
warriorsNFT.getWarriorRanking(_warriorTwoId), "Warriors must be same rank");
// Set up betting period (60 seconds minimum)
bettingStartTime = block.timestamp;
bettingEndTime = block.timestamp + BETTING_PERIOD;
// Initialize battle state
battleState = BattleState.BETTING;
currentRound = 0;
emit GameInitialized(_warriorOneId, _warriorTwoId);
}
function betOnWarriorOne(uint256 _multiplier) external {
require(battleState == BattleState.BETTING, "Not in betting phase");
require(block.timestamp < bettingEndTime, "Betting period ended");
require(_multiplier > 0 && _multiplier <= MAX_MULTIPLIER, "Invalid multiplier");
uint256 betAmount = getBaseBetAmount() * _multiplier;
require(crownToken.transferFrom(msg.sender, address(this), betAmount), "Transfer failed");
betsOnWarriorOne[msg.sender] += betAmount;
totalBetsOnWarriorOne += betAmount;
emit BetPlaced(msg.sender, 1, betAmount);
}
function battle(
PlayerMoves _warriorOneMove,
PlayerMoves _warriorTwoMove,
bytes memory _aiSignature
) external onlyGameMaster {
require(battleState == BattleState.ACTIVE, "Battle not active");
require(currentRound < MAX_ROUNDS, "Battle ended");
// Verify AI signature
bytes32 dataHash = keccak256(abi.encodePacked(_warriorOneMove, _warriorTwoMove));
bytes32 ethSignedMessage = MessageHashUtils.toEthSignedMessageHash(dataHash);
address recovered = ECDSA.recover(ethSignedMessage, _aiSignature);
require(recovered == aiPublicKey, "Invalid AI signature");
// Execute battle logic
(uint256 damageToTwo, uint256 damageToOne) = calculateDamage(
_warriorOneMove, _warriorTwoMove, warriorOneId, warriorTwoId
);
// Apply damage
warriorOneHealth = warriorOneHealth > damageToOne ?
warriorOneHealth - damageToOne : 0;
warriorTwoHealth = warriorTwoHealth > damageToTwo ?
warriorTwoHealth - damageToTwo : 0;
currentRound++;
emit RoundCompleted(currentRound, _warriorOneMove, _warriorTwoMove,
damageToOne, damageToTwo);
// Check for battle end
if (warriorOneHealth == 0 || warriorTwoHealth == 0 || currentRound >= MAX_ROUNDS) {
endBattle();
}
}
function calculateDamage(
PlayerMoves _moveOne,
PlayerMoves _moveTwo,
uint256 _warriorOneId,
uint256 _warriorTwoId
) internal view returns (uint256 damageToTwo, uint256 damageToOne) {
// Get warrior traits
(uint16 str1, uint16 wit1, uint16 cha1, uint16 def1, uint16 luck1) =
warriorsNFT.getWarriorTraits(_warriorOneId);
(uint16 str2, uint16 wit2, uint16 cha2, uint16 def2, uint16 luck2) =
warriorsNFT.getWarriorTraits(_warriorTwoId);
// Apply influence/defluence modifiers
uint256 modifiedStr1 = applyInfluenceModifiers(str1, _warriorOneId);
uint256 modifiedStr2 = applyInfluenceModifiers(str2, _warriorTwoId);
// Calculate base damage based on moves
damageToTwo = calculateMoveDamage(_moveOne, modifiedStr1, wit1, cha1, def2, luck1);
damageToOne = calculateMoveDamage(_moveTwo, modifiedStr2, wit2, cha2, def1, luck2);
// Apply random factors
damageToTwo = applyRandomFactor(damageToTwo);
damageToOne = applyRandomFactor(damageToOne);
}
Not just gambling - informed investment based on:
struct BettingInfo {
uint256 totalBetsOnWarriorOne;
uint256 totalBetsOnWarriorTwo;
mapping(address => uint256) betsOnWarriorOne;
mapping(address => uint256) betsOnWarriorTwo;
uint256 bettingStartTime;
uint256 bettingEndTime;
}
function influenceWarriorOne() external {
require(battleState == BattleState.ACTIVE, "Battle not active");
require(currentRound < MAX_ROUNDS, "Battle ended");
uint256 influenceCost = getInfluenceCost();
require(crownToken.transferFrom(msg.sender, address(this), influenceCost),
"Transfer failed");
// Burn the tokens (deflationary mechanism)
crownToken.burn(influenceCost);
// Apply influence boost
warriorOneInfluence += INFLUENCE_BOOST;
playerInfluences[msg.sender]++;
emit InfluenceApplied(msg.sender, 1, influenceCost);
}
function defluenceWarriorOne() external {
require(battleState == BattleState.ACTIVE, "Battle not active");
require(currentRound < MAX_ROUNDS, "Battle ended");
require(!hasDefluenced[msg.sender], "Already defluenced this game");
uint256 defluenceCost = getDefluenceCost();
require(crownToken.transferFrom(msg.sender, address(this), defluenceCost),
"Transfer failed");
// Burn the tokens (deflationary mechanism)
crownToken.burn(defluenceCost);
// Apply defluence debuff
warriorOneDefluence += DEFLUENCE_DEBUFF;
hasDefluenced[msg.sender] = true;
emit DefluenceApplied(msg.sender, 1, defluenceCost);
}
function verifyAISignature(
PlayerMoves _moveOne,
PlayerMoves _moveTwo,
bytes memory _signature
) internal view returns (bool) {
bytes32 dataHash = keccak256(abi.encodePacked(_moveOne, _moveTwo));
bytes32 ethSignedMessage = MessageHashUtils.toEthSignedMessageHash(dataHash);
address recovered = ECDSA.recover(ethSignedMessage, _signature);
return recovered == aiPublicKey;
}
// Reentrancy protection
modifier nonReentrant() {
require(!_reentrancyGuard, "Reentrant call");
_reentrancyGuard = true;
_;
_reentrancyGuard = false;
}
// Role-based access control
modifier onlyGameMaster() {
require(msg.sender == gameMaster, "Only game master");
_;
}
// Time-based constraints
modifier onlyDuringBetting() {
require(battleState == BattleState.BETTING, "Not in betting phase");
require(block.timestamp < bettingEndTime, "Betting period ended");
_;
}
This is genuinely innovative because:
// AI agents on 0G Network make decisions
const aiDecision = await 0gNetwork.getAIDecision(battleState);
// Decisions are signed and verified
const signature = await aiAgent.signDecision(aiDecision);
// Executed on Flow blockchain
await flowContract.executeBattle(moves, signature);
graph LR
A[Flow Testnet] --> D[Battle Contracts]
B[0G Network] --> E[AI Agents]
B --> F[Storage Layer]
C[Ethereum] --> G[Future Expansion]
D --> H[Unified Experience]
E --> H
F --> H
G --> H
contract EconomicModel {
// Revenue calculation
function calculateRevenue(uint256 totalBets) public pure returns (uint256) {
return totalBets * PROTOCOL_FEE / 100; // 5% fee
}
// Deflationary pressure
function calculateTokenBurn(uint256 influences, uint256 defluences)
public pure returns (uint256) {
return (influences * INFLUENCE_COST) + (defluences * DEFLUENCE_COST);
}
// Sustainability metrics
function calculateSustainabilityRatio() public view returns (uint256) {
uint256 totalBurned = getTotalTokensBurned();
uint256 totalMinted = getTotalTokensMinted();
return totalBurned * 100 / totalMinted; // Percentage burned
}
}
This project is creating a new category of entertainment:
| Contract | Address | Verification |
|----------|---------|-------------|
| MockOracle | 0x56d7060B080A6d5bF77aB610600e5ab70365696A
| โ
Verified |
| CrownToken | 0x9Fd6CCEE1243EaC173490323Ed6B8b8E0c15e8e6
| โ
Verified |
| WarriorsNFT | 0x3838510eCa30EdeF7b264499F2B590ab4ED4afB1
| โ
Verified |
| ArenaFactory | 0xf77840febD42325F83cB93F9deaE0F8b14Eececf
| โ
Verified |
// Tech Stack
interface FrontendStack {
framework: "Next.js 15";
language: "TypeScript";
styling: "Tailwind CSS";
walletIntegration: "RainbowKit + Wagmi";
stateManagement: "Zustand";
realTimeUpdates: "Socket.IO";
aiIntegration: "0G Network SDK";
storage: "0G Storage";
}
// Key Components
interface ComponentArchitecture {
battleVisualization: "Real-time battle renderer";
walletConnection: "Multi-wallet support";
warriorManagement: "NFT collection interface";
bettingInterface: "Strategic betting UI";
influenceSystem: "Real-time influence controls";
economicsDashboard: "Token economics tracking";
}
interface AIIntegration {
network: "0G Network";
decisionLatency: "< 2 seconds";
signatureVerification: "ECDSA";
battlesPerSecond: "10+";
aiModels: "Custom trained for battle strategy";
dataStorage: "Encrypted on 0G Storage";
}
WarriorsAI-rena represents a fundamental breakthrough in blockchain gaming, combining:
This isn't just innovative - it's revolutionary. ๐๏ธโ๏ธ๐ค
Built by the Seeers Team at ETH Global Cannes - Where AI meets blockchain, and every battle tells a story.
AI-Powered Blockchain Gaming with cryptographically verified AI decisions, decentralized storage, and multi-chain architecture.
// Every AI decision is cryptographically verified
bytes32 dataHash = keccak256(abi.encodePacked(_WarriorsOneMove, _WarriorsTwoMove));
address recovered = ECDSA.recover(ethSignedMessage, _signedData);
require(recovered == i_AiPublicKey, "Invalid AI signature");
// Native blockchain randomness without oracles
function _revertibleRandom() private view returns (uint64) {
(bool ok, bytes memory data) = i_cadenceArch.staticcall(
abi.encodeWithSignature("revertibleRandom()")
);
return abi.decode(data, (uint64));
}
// NFT metadata stored as 0G root hashes
const zgFile = await ZgFile.fromFilePath(req.file.path);
const [tree] = await zgFile.merkleTree();
const rootHash = tree?.rootHash(); // Used as tokenURI
// AI adapts to battle state and personality
const battlePrompt = `
BATTLE SITUATION: Round ${currentRound}
Agent 1 Stats: STR:${strength} WIT:${wit}
Battle History: ${history}
TACTICAL SITUATION: ${tacticalAnalysis}
Generate optimal moves avoiding repetitive patterns.
`;
// Intelligent storage detection
if (tokenURI.startsWith('0x')) {
metadata = await fetchMetadataFrom0G(tokenURI);
} else {
metadata = await fetchMetadataFromIPFS(tokenURI);
}
Instead of IPFS URLs, directly use 0G storage root hashes:
tokenURI = "0x1234567890abcdef..."; // 0G root hash
const OFFICIAL_PROVIDERS = {
"llama-3.3-70b-instruct": "0xf07240Efa67755B5311bc75784a061eDB47165Dd",
"deepseek-r1-70b": "0x3feE5a4dd5FDb8a32dDA97Bed899830605dBD9D3"
};
// Battle outcomes affect future costs
s_costToInfluenceWarriorsOne = baseInfluenceCost * (1 + battlePerformance);
Each warrior's AI reflects their unique traits and knowledge areas.
const contracts = {
MockOracle: "0x8464135c8F25Da09e49BC8782676a84730C318bC",
CrownToken: "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
WarriorsNFT: "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0",
ArenaFactory: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82"
};
# Clone and install
git clone <repo>
cd WarriorsAI-rena
npm install
# Setup environment
cp .env.example .env
# Add PRIVATE_KEY and RPC_URL
# Deploy contracts
forge build
forge deploy --network flow-testnet
# Start frontend
cd frontend
npm run dev
# Start 0G services
cd 0G && npm start
cd 0g-storage && npm start
WarriorsAI-rena pushes the boundaries of blockchain gaming by combining cutting-edge AI, decentralized storage, and innovative smart contract design into a single, cohesive gaming experience.