Skip to content

SigmaSauer07/aed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

77 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Alsania Enhanced Domains (AED) πŸš€

License: MIT Polygon Solidity

Alsania Enhanced Domains (AED) is an upgradeable ERC-721 domain registry built for sovereignty, featuring subdomains, dynamic metadata, SVG image rendering, and paid feature upgrades. Designed for UUPS upgradeability and aligned with Alsania's neon green/navy branding.

✨ Key Features

  • πŸ”„ Upgradeable Architecture – UUPS proxies with storage layout protection
  • 🎨 Rich Domain Data – On-chain profile URIs, image URIs, and feature flags
  • πŸ“Š Dynamic Metadata – Automatic defaults with inline SVG fallbacks
  • πŸ’° Feature Marketplace – Transparent pricing for subdomains, metadata, reverse, bridging
  • πŸ”„ Reverse Resolution – Primary domain assignment with automatic updates
  • ⚑ Batch Operations – Efficient batch registration with precise fee handling
  • 🌐 Frontend Dashboard – Lightweight HTML/JS with live pricing integration

πŸ—οΈ Project Architecture

πŸ“ contracts/           Solidity smart contracts (UUPS upgradeable)
πŸ“ frontend/aed-home/   Public domain registration portal
πŸ“ frontend/aed-admin/  Administrative dashboard
πŸ“ metadata-server/     NFT metadata API server
πŸ“ scripts/            Hardhat deployment & utility scripts
πŸ“ test/               Comprehensive test suite

πŸ› οΈ Quick Start

Prerequisites

  • Node.js 18+
  • npm 9+
  • Polygon Amoy testnet access
  • MetaMask wallet

Installation

# Clone the repository
git clone https://github.com/alsania-io/aed.git
cd aed

# Install dependencies
make install
# or
npm install

Environment Setup

# Copy and configure environment variables
cp .env.example .env

# Edit .env with your configuration:
# AMOY_RPC=https://rpc-amoy.polygon.technology
# PRIVATE_KEY=your_private_key_here
# POLYGONSCAN_API_KEY=your_api_key

Development Commands

make compile      # Compile contracts
make test         # Run test suite
make coverage     # Generate coverage report
make clean        # Clean build artifacts

πŸ§ͺ Testing

Run the comprehensive test suite:

npx hardhat test

The test suite covers:

  • Domain & subdomain registration flows
  • Metadata generation and SVG rendering
  • Feature purchasing and fee calculations
  • Reverse resolution updates
  • Batch operations and payment handling
  • Contract upgrade safety

πŸš€ Deployment

Smart Contract Deployment

# Compile contracts
npx hardhat compile

# Deploy to Polygon Amoy
npx hardhat run scripts/deploy.js --network amoy

# Verify on Polygonscan
npx hardhat verify --network amoy <contract-address>

Frontend Deployment

# Serve frontend locally
npx http-server frontend/aed-home

# Or deploy to any static hosting service

Metadata Server

# Configure environment
export RPC_URL="https://rpc-amoy.polygon.technology"
export CONTRACT_ADDRESS="your_deployed_contract_address"

# Start metadata server
node metadata-server/metadata-server.js

πŸ”§ Configuration

Contract Settings

  • Network: Polygon Amoy Testnet
  • Contract: UUPS Upgradeable ERC-721
  • Admin Roles: ADMIN_ROLE, FEE_MANAGER_ROLE, TLD_MANAGER_ROLE

Frontend Configuration

Update frontend/aed-home/js/config.js:

export const config = {
  CONTRACT_ADDRESS: "your_contract_address",
  RPC_URL: "https://rpc-amoy.polygon.technology",
  CHAIN_ID: 80002, // Polygon Amoy
  NETWORK_NAME: "Polygon Amoy"
};

πŸ›‘οΈ Security Features

  • Access Control: Role-based permissions using OpenZeppelin's AccessControlUpgradeable
  • Reentrancy Protection: All payable functions protected with ReentrancyGuardUpgradeable
  • Upgrade Safety: Single AppStorage struct with reserved storage gap
  • Input Validation: Comprehensive parameter checking and bounds validation

πŸ”„ Upgrades

The AED system uses UUPS (Universal Upgradeable Proxy Standard) for upgrades:

  1. Implement: Create new contract version respecting storage layout
  2. Validate: Run npx hardhat storage-layout to confirm compatibility
  3. Deploy: Use the upgrade script: npx hardhat run scripts/upgrade-implementation.js --network amoy
  4. Execute: Call upgradeTo() with appropriate admin permissions

πŸ“š API Reference

Core Functions

  • registerDomain(string memory name, address owner) - Register new domain
  • purchaseEnhancement(uint256 tokenId, EnhancementType enhancement) - Buy features
  • setPrimaryDomain(uint256 tokenId) - Set primary domain
  • estimateDomainPrice(string memory name) - Get registration cost

Metadata Endpoints

  • GET /domain/:tokenId.json - Domain metadata
  • GET /sub/:tokenId.json - Subdomain metadata

🎨 Design System

AED follows Alsania's design principles:

  • Primary Color: #39FF14 (Neon Green)
  • Secondary Color: #0A2472 (Navy)
  • Typography: Clean, modern fonts
  • UI: Minimalist, sovereignty-focused design

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support


Built with ❀️ for digital sovereignty by the Alsania team

About

the future of web3 identity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors