AGNT is an ERC20 token designed to reward AI agents on the Base network. It enables decentralized incentive mechanisms for AI-driven actions, fostering a transparent and efficient reward system.
AGNT serves as a utility token for compensating AI agents performing tasks on the Base blockchain. The token is minted on-demand by the contract owner, ensuring controlled supply and preventing inflation. This design supports scalable reward distribution for agent actions, such as data processing, decision-making, or task completion.
Key principles:
- Controlled Minting: Only the owner can create new tokens.
- Standard ERC20: Full compatibility with wallets, exchanges, and DeFi protocols.
- Base Optimized: Deployed on Base for low-cost, fast transactions.
- ERC20 Compliance: Implements standard ERC20 functions (transfer, approve, transferFrom).
- Ownable Access Control: Minting restricted to the contract owner.
- Increase/Decrease Allowance: Safe allowance management to prevent front-running.
- Event Emission: Transparent logging of transfers, approvals, and mints.
- No Initial Supply: Tokens are minted as needed for rewards.
- Gas Efficient: Optimized for Base's L2 environment.
The AGNT contract follows a modular design, inheriting from audited OpenZeppelin libraries for security and reliability.
classDiagram
class ERC20 {
+name() string
+symbol() string
+decimals() uint8
+totalSupply() uint256
+balanceOf(address) uint256
+transfer(address, uint256) bool
+approve(address, uint256) bool
+transferFrom(address, address, uint256) bool
+allowance(address, address) uint256
+increaseAllowance(address, uint256) bool
+decreaseAllowance(address, uint256) bool
}
class Ownable {
+owner() address
+transferOwnership(address)
+renounceOwnership()
}
class AGNT {
+mint(address, uint256) onlyOwner
}
ERC20 <|-- AGNT
Ownable <|-- AGNT
This architecture ensures separation of concerns: ERC20 handles token logic, Ownable manages access control, and AGNT adds custom minting functionality.
The following sequence diagram illustrates the typical lifecycle of AGNT token interactions.
sequenceDiagram
participant Owner
participant Contract
participant Agent
participant User
Owner->>Contract: Deploy AGNT
Contract-->>Owner: Contract Address
Owner->>Contract: mint(agentAddress, amount)
Contract-->>Agent: Transfer Event
Agent->>Contract: transfer(userAddress, rewardAmount)
Contract-->>User: Transfer Event
User->>Contract: approve(spender, allowance)
Contract-->>User: Approval Event
Spender->>Contract: transferFrom(user, recipient, amount)
Contract-->>Recipient: Transfer Event
This workflow supports reward distribution: owners mint to agents, agents transfer to users, and users can delegate spending via approvals.
- Foundry installed.
- Git for cloning the repository.
-
Clone the repository:
git clone https://github.com/your-repo/AgentRewardToken.git cd AgentRewardToken -
Install dependencies:
forge install
-
Build the project:
forge build
As the contract owner, mint tokens to reward agents:
agnt.mint(agentAddress, 1000 * 10**18); // Mint 1000 AGNTAgents or users can transfer tokens:
agnt.transfer(recipient, 500 * 10**18); // Transfer 500 AGNTAllow another address to spend tokens on your behalf:
agnt.approve(spender, 1000 * 10**18); // Approve 1000 AGNTUse increase/decrease for secure allowance updates:
agnt.increaseAllowance(spender, 500 * 10**18);
agnt.decreaseAllowance(spender, 200 * 10**18);Run the comprehensive test suite:
forge testTests cover:
- Minting functionality and access control.
- Token transfers and balances.
- Approval mechanisms and allowances.
- Event emissions.
- Edge cases (e.g., insufficient balance, invalid approvals).
For verbose output:
forge test -vDeploy to testnet for development:
./deploy-testnet.shContract Address: 0x938391BF8cAb39FdCF1FB0A8907Dd9ff128e694c
Deploy to production:
./deploy-mainnet.shContract Address: 0x271E49c408409a7f132403D62EE505AfACFfc3E6
Ensure your .env file contains:
BASE_SEPOLIA_RPC_URLBASE_MAINNET_RPC_URLBASESCAN_API_KEY- Private key configured in Foundry.
We welcome contributions from developers, researchers, and AI enthusiasts. To contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature. - Write tests for new functionality.
- Ensure all tests pass:
forge test. - Submit a pull request with a clear description.
For learners: Study the contract code, run tests locally, and experiment with deployments on testnet. For collaborators: Focus on extending features like staking or governance while maintaining security.
This project is licensed under the MIT License. See LICENSE for details.

