Hanzo Contracts is the smart contract repository for the Hanzo AI ecosystem.
Category: Hanzo Ecosystem Related Skills: hanzo/hanzo-evm.md, hanzo/hanzo-web3.md
Hanzo Contracts is the smart contract repository for the Hanzo AI ecosystem. Built with Foundry and Solidity 0.8.31, it contains three core contracts for the AI token economy, faucet distribution, and on-chain identity registry.
The contracts use @luxfi/ imports (from the Lux standard library) and OpenZeppelin for ERC20, access control, and utility patterns. The repo targets the Cancun EVM version with via-IR compilation and optimizer enabled.
Note: The master branch contains legacy Truffle-era contracts (Proxy, Versioned, Blacklist, Whitelist, Migrations with Solidity <0.6.0). The active main branch is the current Foundry-based codebase documented here.
@luxfi/standard, forge-std)| Item | Value | |------|-------| | Framework | Foundry | | Solidity | 0.8.31 | | EVM target | Cancun | | Repo | github.com/hanzoai/contracts | | Branch | main | | Build | forge build | | Test | forge test | | Format | forge fmt | | Optimizer | 200 runs, via-IR | | License | MIT |
| Contract | Path | Purpose | |----------|------|---------| | AIToken | src/AIToken.sol | ERC20 governance token with staking, vesting, and deflationary burn | | AIFaucet | src/AIFaucet.sol | Token distribution / faucet mechanism | | HanzoRegistry | src/identity-registry/HanzoRegistry.sol | On-chain identity registry |
contracts/ (main branch)
├── foundry.toml # Foundry config (solc 0.8.31, Cancun, via-IR)
├── foundry.lock
├── package.json
├── src/
│ ├── AIToken.sol
│ ├── AIFaucet.sol
│ └── identity-registry/
│ └── HanzoRegistry.sol
├── scripts/ # Deployment scripts
├── broadcast/ # Deployment artifacts
├── lib/ # Git submodule dependencies
│ ├── standard/ # @luxfi/standard (Lux standard library)
│ └── forge-std/ # Foundry test utilities
└── .github/ # CI workflows
ERC20 governance token ("AI Token", ticker "AI") with a 1 billion max supply:
@luxfi/tokens/LRC20/LRC20.sol, @luxfi/access/Access.sol, @luxfi/utils/Utils.solremappings = [
"@luxfi/=lib/standard/contracts/",
"@luxfi/standard/=lib/standard/contracts/",
"@openzeppelin/contracts/=lib/standard/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/standard/lib/openzeppelin-contracts-upgradeable/contracts/",
"forge-std/=lib/forge-std/src/",
]
hanzo_mainnet = "http://127.0.0.1:19630/v1/chain/.../rpc"
hanzo_testnet = "http://127.0.0.1:19640/v1/chain/.../rpc"
hanzo_devnet = "http://127.0.0.1:19650/v1/chain/.../rpc"
These point to local Lux subnet RPC endpoints for development.
git clone https://github.com/hanzoai/contracts.git
cd contracts
git checkout main
git submodule update --init --recursive
forge build
forge test
forge fmt
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.31;
import {AIToken} from "src/AIToken.sol";
// Deploy with treasury address
// AIToken token = new AIToken(treasuryAddress);
// token.stake(1000 * 10**18, 90); // Stake 1000 AI for 90 days at 6% APR
The master branch is a historical artifact containing the original Hanzo Solidity contracts:
| Contract | Solidity | Framework | |----------|----------|-----------| | Proxy.sol | >=0.4.25 <0.6.0 | Truffle | | Versioned.sol | >=0.4.25 <0.6.0 | Truffle | | Blacklist.sol | >=0.4.25 <0.6.0 | Truffle | | Whitelist.sol | >=0.4.25 <0.6.0 | Truffle | | Migrations.sol | >=0.4.25 <0.6.0 | Truffle |
Published as hanzo-solidity v0.2.1 on npm. Uses openzeppelin-solidity v2.1.2. Not used for new development.
hanzo/hanzo-evm.md - Rust EVM execution engine (reth fork)hanzo/hanzo-web3.md - Blockchain API accesshanzo/hanzo-web3-gateway.md - Keyless blockchain access via x402Last Updated: 2026-03-13 Category: Hanzo Ecosystem Related: solidity, foundry, erc20, staking, vesting, luxfi Prerequisites: Foundry, Solidity basics