Skip to content

ayushjava07/ATOS-Token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ATOS Token β€” ERC-20 Smart Contract

Solidity Hardhat OpenZeppelin Network License


πŸ“Œ Overview

ATOS Token is a production-ready, audit-standard ERC-20 token built with OpenZeppelin contracts. It is the foundational smart contract layer of the Autonomous Token Orchestration System (ATOS) β€” a decentralized multi-agent platform built on libp2p principles.

Part of NSUT x SEETA x AIC initiative.


✨ Features

Feature Description
βœ… ERC-20 Standard Fully compliant ERC-20 token
βœ… Mintable Role-based minting
βœ… Burnable Token burning (user + admin)
βœ… Capped Max supply of 2,000,000 ATOS
βœ… Pausable Emergency pause/unpause
βœ… ERC20Permit Gasless approvals (EIP-2612)
βœ… AccessControl Multi-role permission system
βœ… Miner Rewards Auto-reward block miners
βœ… Ownable Contract ownership management

πŸ“‹ Token Details

Property Value
Name ATOS
Symbol ATOS
Decimals 18
Initial Supply 200,000 ATOS
Max Supply (Cap) 2,000,000 ATOS
Network Sepolia Testnet
Standard ERC-20
License MIT

πŸ—οΈ Project Structure

ERC20-EXP/
β”œβ”€β”€ contracts/
β”‚   └── ATOSToken.sol          # Main ERC-20 contract
β”œβ”€β”€ ignition/
β”‚   └── modules/
β”‚       └── ATOSToken.ts       # Hardhat Ignition deploy module
β”œβ”€β”€ scripts/
β”‚   └── deploy.ts              # Deploy script (alternative)
β”œβ”€β”€ test/
β”‚   └── ATOSToken.test.ts      # Unit tests
β”œβ”€β”€ hardhat.config.ts          # Hardhat v3 configuration
β”œβ”€β”€ package.json
β”œβ”€β”€ .env.example
└── README.md

πŸ” Roles & Access Control

Role Capability
DEFAULT_ADMIN_ROLE Manage all roles
MINTER_ROLE Mint new tokens
BURNER_ROLE Burn tokens from any address
PAUSER_ROLE Pause and unpause transfers

All roles are assigned to the deployer at construction. Roles can be granted or revoked via grantRole / revokeRole.


πŸ“„ Smart Contract

// contracts/ATOSToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC20Burnable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import {ERC20Capped} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
import {ERC20Pausable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.sol";
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

contract ATOSToken is
    ERC20,
    Ownable,
    ERC20Burnable,
    ERC20Capped,
    ERC20Pausable,
    ERC20Permit,
    AccessControl
{
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

    // ... (see full contract in contracts/ATOSToken.sol)
}

πŸš€ Getting Started

Prerequisites

  • Node.js >= 18
  • npm or yarn
  • MetaMask wallet
  • Sepolia testnet ETH

Installation

# Clone the repository
git clone https://github.com/YOUR_USERNAME/ERC20-EXP.git

# Navigate to project
cd ERC20-EXP

# Install dependencies
npm install

Environment Setup

# Set environment variables (Linux/Mac)
export SEPOLIA_RPC_URL="https://sepolia.infura.io/v3/YOUR_KEY"
export SEPOLIA_PRIVATE_KEY="0xYOUR_PRIVATE_KEY"

# Windows (PowerShell)
setx SEPOLIA_RPC_URL "https://sepolia.infura.io/v3/YOUR_KEY"
setx SEPOLIA_PRIVATE_KEY "0xYOUR_PRIVATE_KEY"

βš™οΈ Hardhat Configuration

// hardhat.config.ts
import hardhatToolboxMochaEthersPlugin from
  "@nomicfoundation/hardhat-toolbox-mocha-ethers";
import { defineConfig } from "hardhat/config";

const SEPOLIA_RPC_URL = process.env.SEPOLIA_RPC_URL ?? "";
const SEPOLIA_PRIVATE_KEY = process.env.SEPOLIA_PRIVATE_KEY ?? "";

export default defineConfig({
  plugins: [hardhatToolboxMochaEthersPlugin],
  solidity: {
    profiles: {
      default: { version: "0.8.28" },
      production: {
        version: "0.8.28",
        settings: {
          optimizer: { enabled: true, runs: 200 },
        },
      },
    },
  },
  networks: {
    sepolia: {
      type: "http",
      chainType: "l1",
      url: SEPOLIA_RPC_URL,
      accounts: SEPOLIA_PRIVATE_KEY ? [SEPOLIA_PRIVATE_KEY] : [],
    },
  },
});

πŸ”¨ Compile

# Compile contracts
npx hardhat compile

πŸš€ Deploy

Using Hardhat Ignition (Recommended)

npx hardhat ignition deploy ignition/modules/ATOSToken.ts \
  --network sepolia

Check Deployed Address

cat ignition/deployments/chain-11155111/deployed_addresses.json

βœ… Verify on Etherscan

npx hardhat ignition verify chain-11155111

Or:

npx hardhat verify --network sepolia YOUR_CONTRACT_ADDRESS

πŸ§ͺ Testing All Functions

Read Functions

Function Expected Output
name() ATOS
symbol() ATOS
decimals() 18
totalSupply() 200000 Γ— 10^18
cap() 2000000 Γ— 10^18
paused() false
owner() deployer address

Write Functions

Function Parameters Result
mint to, amount Mints tokens
burn amount Burns caller's tokens
adminBurn from, amount Burns any address tokens
pauseContract β€” Pauses all transfers
unpause β€” Resumes transfers
transfer to, amount Transfers tokens
approve spender, amount Approves allowance
transferFrom from, to, amount Transfers on behalf
grantRole role, account Grants a role
revokeRole role, account Revokes a role

πŸ“‘ Deployed Contract

Property Value
Network Sepolia Testnet
Contract Address 0xYOUR_DEPLOYED_ADDRESS
Etherscan View on Etherscan
Verified βœ… Yes

πŸ—ΊοΈ Roadmap

Phase 1 β€” ERC-20 Smart Contract        βœ… DONE
Phase 2 β€” Multi-Agent Framework        πŸ”œ Next
Phase 3 β€” DEX Integration (Uniswap)    πŸ”œ Planned
Phase 4 β€” PQC Integration              πŸ”œ Planned
Phase 5 β€” IPLD + Multiformats          πŸ”œ Planned
Phase 6 β€” CEX Preparation              πŸ”œ Planned
Phase 7 β€” Dashboard                    πŸ”œ Planned

πŸ›οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         ATOS β€” Full System              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Smart Contract Layer (βœ… Done)         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  ATOSToken.sol                  β”‚   β”‚
β”‚  β”‚  ERC20 + Roles + Permit + Cap   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Multi-Agent Layer (πŸ”œ Next)           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚Deployβ”‚ β”‚ Liq  β”‚ β”‚ Mon  β”‚           β”‚
β”‚  β”‚Agent β”‚ β”‚Agent β”‚ β”‚Agent β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  libp2p Network Layer                   β”‚
β”‚  Peer Discovery + PubSub + Transport    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  DEX Layer (Uniswap V3)                β”‚
β”‚  Liquidity Pools + Swaps               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Data Layer (IPLD + Multiformats)      β”‚
β”‚  Agent State + Task DAGs + Logs        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Technology Purpose
Solidity 0.8.28 Smart contract language
Hardhat v3 Development environment
OpenZeppelin 5.x Secure contract libraries
Hardhat Ignition Deployment system
TypeScript Scripting + config
Ethers.js Blockchain interaction
Sepolia Test network

πŸ‘₯ Team

Role Organization
Developer NSUT
Mentor @seetadev
Mentor @johannamoran
Mentor @aspiringsecurity
Mentor @yashksaini-coder
Mentor @prithagupta
Mentor @acul71

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch
git checkout -b feature/your-feature
  1. Commit your changes
git commit -m "Add: your feature"
  1. Push to the branch
git push origin feature/your-feature
  1. Open a Pull Request

πŸ”’ Security

  • All roles use OpenZeppelin AccessControl
  • Contract is pausable in case of emergency
  • Cap prevents infinite minting
  • Never share your private key
  • Use hardware wallet for mainnet

πŸ“œ License

This project is licensed under the MIT License.


πŸ”— Links


Built with ❀️ by NSUT x SEETA x AIC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors