Tokenize your Agents

Summary of Agent Smart Contracts

The Agent Smart Contracts provide a modular and decentralized framework for deploying, managing, and interacting with AXES agents. Here’s a detailed summary of the three core components:

1. Agent Token (ERC20)

The Agent Token serves as the native ERC20 token for the agent. It is used to gate permissions, facilitate transactions, and enforce usage policies for interacting with the agent's external functionalities. The AgentTokenFactory contract ensures the streamlined deployment of these tokens, allowing developers to initialize the token with specific names, symbols, and initial supplies. This token is integral to creating an economic layer for the agent, enabling stakeholders to transact efficiently.

2. Agent DAO

The Agent DAO governs the agent's operations and ensures decentralized decision-making. Using the AgentDAO contract, members can create, vote on, and execute proposals to update the agent's logic, tokenomics, or any core behavior. The DAO employs a simple majority voting system to determine the outcomes of proposals, ensuring all changes require consensus among members. The AgentDAOFactory facilitates the deployment of DAO contracts, allowing developers to initialize them with member addresses and voting periods.

3. Agent Smart Contract

The Agent Smart Contract acts as the primary interface for connecting the agent with Web2 and Web3 APIs, much like a programmable router. It is tightly integrated with both the Agent Token and Agent DAO, ensuring that only authorized and consensus-approved actions can be executed. The contract enables external calls triggered by the DAO and supports robust logic for routing and handling requests. The AgentContractFactory simplifies the deployment process by linking the agent's token and DAO to this main contract.

Deployment Workflow

All three contracts are deployed via their respective factory contracts, streamlining the setup process for developers. By following the standardized deployment steps, developers can ensure that agents are secure, decentralized, and fully functional within the AXES ecosystem. These contracts collectively enable developers to create scalable, tokenized, and community-governed agents ready for integration with decentralized and traditional systems.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @title Factory for Deploying Agent Token (ERC20)
 */
contract AgentTokenFactory {
    event AgentTokenCreated(address indexed tokenAddress, string name, string symbol);

    function createAgentToken(string memory name, string memory symbol, uint256 initialSupply) external returns (address) {
        AgentToken newToken = new AgentToken(name, symbol, initialSupply, msg.sender);
        emit AgentTokenCreated(address(newToken), name, symbol);
        return address(newToken);
    }
}

contract AgentToken {
    string public name;
    string public symbol;
    uint256 public totalSupply;
    mapping(address => uint256) public balanceOf;
    address public owner;

    modifier onlyOwner() {
        require(msg.sender == owner, "Only owner can call this function");
        _;
    }

    constructor(string memory _name, string memory _symbol, uint256 _initialSupply, address _owner) {
        name = _name;
        symbol = _symbol;
        totalSupply = _initialSupply;
        balanceOf[_owner] = _initialSupply;
        owner = _owner;
    }

    function transfer(address to, uint256 amount) external {
        require(balanceOf[msg.sender] >= amount, "Insufficient balance");
        balanceOf[msg.sender] -= amount;
        balanceOf[to] += amount;
    }
}

Last updated