Skip to content

Repository files navigation

Arc Token & DEX Suite (TypeScript & Viem) — Arc Testnet

Institutional-grade ERC-20 smart contracts, automated Constant-Product AMM Liquidity Pools ($x \cdot y = k$), and deployment pipelines written in TypeScript & Viem, deployed and verified on the Arc Testnet (Chain ID 5042002).


💎 Overview & Architecture

  • Smart Contracts: Built with Solidity ^0.8.28 using OpenZeppelin Contracts v5 (ERC20 + ERC20Permit with EIP-2612 gasless 1-tx permit signatures).
  • Decentralization & Governance: 100% immutable — no owner/admin keys, no pause, no blacklists, no post-deployment minting.
  • Total Fixed Supply: Exactly 10,000,000 tokens per asset minted during construction to designated recipient; burning is disabled.
  • Automated Market Maker (AMM): Production-grade Constant Product AMM pair contracts (ArcLiquidityPool.sol) with 0.30% LP fee, reentrancy guards, and slippage protection.
  • TypeScript & Viem Pipeline: End-to-end type safety, native BigInt handling, ABI type inference (as const), and structured CLI tools.

📋 Master Deployment Directory (Arc Testnet)

Symbol Asset Name Token Contract Address AMM Liquidity Pool (Token / USDC) Explorer Link
SYC Solus Yield Credit 0xa5622cf9c6cf6f90aa036695a345e5d0673f1c93 0x6b3d360f6e7c336c8f05f208533ea9f94b0609f1 View Pool
ART Aegis Reserve Token 0x4040099751d192170f09003a5addacdcc41093bf 0x967b0737e77f2d0ffe22a8b29065a237ed68b63e View Pool
CSC Chronos Settlement Credit 0x5e8841d9d6b31b6775edc978418795824d563e52 0xd1ba8e8c37e0dd1e6f6da65bb059513728fdedef View Pool
HLU Helios Liquidity Unit 0x5e6cd3981aeb0731b4e246999eb6bfe82ce88945 0x3c638488dac91bd1de7233723d7e2ceadf7a2ad3 View Pool
NDG Nexus Data Gas 0xf68e833216fece57fa221eaf72325885fdff92c6 0x6c4a3c91ab34df1bdb920e558269d7450f86f1c3 View Pool
VPT Vanguard Prime Token 0x8907ee92b9f14d805f9c5df7db4924129dc0bbb2 0xfa4bdae859b3de99a1ed6406eba4798b69228b9c View Pool
  • Base Token: USDC (0x3600000000000000000000000000000000000000)
  • Network: Arc Testnet (RPC: https://rpc.testnet.arc.network | Chain ID: 5042002)

🏛️ Smart Contract Details

1. ArcStandardToken.sol & SolusYieldCredit.sol

  • Standards: OpenZeppelin ERC20, ERC20Permit.
  • Supply Integrity: Total supply 10,000,000 * 10^18 minted once during deployment to the recipient.
  • Immutable: No mint(), burn(), pause(), blacklist(), or owner() backdoors.
  • EIP-2612: Full permit signing capability (permit()) for gasless approvals in DeFi.

2. ArcLiquidityPool.sol (Constant Product AMM)

  • Invariant: $x \cdot y = k$ Constant Product Formula.
  • LP Tokens: Minted and burned dynamically upon addLiquidity() and removeLiquidity().
  • Swap Fee: 0.30% fee allocated directly to LP providers.
  • Security:
    • ReentrancyGuard on all state-mutating functions.
    • SafeERC20 token transfer safety.
    • Slippage bounds with minAmountOut assertions.
    • Minimum liquidity (MINIMUM_LIQUIDITY = 1000) permanently locked to prevent first-depositor inflation attacks.

🛠️ TypeScript Project Structure

├── contracts/
│   ├── ArcLiquidityPool.sol      # Constant Product AMM Pool (x * y = k)
│   ├── ArcStandardToken.sol      # Parameterized Immutable ERC-20 + EIP-2612
│   └── SolusYieldCredit.sol      # Dedicated SYC Token Implementation
├── artifacts/                    # Compiled ABI & Bytecode
├── deployments/                  # On-chain deployment manifests & records
├── scripts/
│   ├── config.ts                 # Typed chain, token & pool configuration
│   ├── compile.ts                # TypeScript solc build pipeline
│   ├── deploy.ts                 # Single token deployment script
│   ├── create-all-pools.ts       # Batch AMM pool deployment & liquidity seeding
│   ├── check-balances.ts         # Portfolio & balance inspector
│   └── swap.ts                   # Interactive DEX CLI for swapping/quoting
├── tsconfig.json                 # Strict TypeScript configuration
├── .env.example                  # Environment template (NO SECRETS)
└── package.json

🚀 Quickstart & CLI Usage

1. Install Dependencies

npm install

2. Configure Environment

cp .env.example .env

Populate .env with your Arc Testnet wallet credentials:

PRIVATE_KEY=0x...
ARC_RPC_URL=https://rpc.testnet.arc.network
CHAIN_ID=5042002
EXPLORER_URL=https://testnet.arcscan.app

3. Compile Contracts & Typecheck

npm run compile
npm run typecheck

4. Interactive DEX Trading CLI (TypeScript)

Inspect pools, real-time spot prices, and execute on-chain swaps:

# List all active pools, reserves, spot prices, and your balances
npm run swap list

# Check wallet balances across native ARC, USDC, and all 6 tokens
npm run check-balances

# Buy $2.00 worth of Solus Yield Credit (SYC) using USDC
npm run swap buy SYC 2

# Sell 500 Helios Liquidity Units (HLU) for USDC
npm run swap sell HLU 500

# Get a real-time spot price quote
npm run swap quote CSC 1

📜 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages