Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Blockchain Configuration
PRIVATE_KEY=your_private_key_here
BASE_RPC_URL=https://mainnet.base.org
BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
BASESCAN_API_KEY=your_basescan_api_key_here

# Contract Addresses (update after deployment)
NEXT_PUBLIC_CONTRACT_ADDRESS=
NEXT_PUBLIC_CHAIN_ID=8453

# API Keys
NEXT_PUBLIC_ALCHEMY_API_KEY=your_alchemy_api_key_here
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here

# Optional
COINMARKETCAP_API_KEY=
REPORT_GAS=false

# Development
NODE_ENV=development
150 changes: 150 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: CI/CD Pipeline

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

test-contracts:
name: Test Smart Contracts
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Compile contracts
run: npm run compile

- name: Run contract tests
run: npm test

- name: Generate coverage report
run: npm run test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
flags: smart-contracts
name: contract-coverage

build-frontend:
name: Build Frontend
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build Next.js app
run: npm run build
env:
NEXT_PUBLIC_CONTRACT_ADDRESS: "0x0000000000000000000000000000000000000000"
NEXT_PUBLIC_CHAIN_ID: "84532"

security-audit:
name: Security Audit
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Run npm audit
run: npm audit --audit-level=moderate
continue-on-error: true

- name: Install Slither
run: |
pip3 install slither-analyzer
pip3 install solc-select
solc-select install 0.8.19
solc-select use 0.8.19

- name: Run Slither
run: slither contracts/
continue-on-error: true

gas-report:
name: Gas Report
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Generate gas report
run: REPORT_GAS=true npm test
env:
COINMARKETCAP_API_KEY: ${{ secrets.COINMARKETCAP_API_KEY }}

- name: Comment gas report
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const gasReport = fs.readFileSync('gas-report.txt', 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## Gas Report\n\`\`\`\n${gasReport}\n\`\`\``
});
continue-on-error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
!.env.example

# vercel
.vercel
Expand Down
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Comprehensive smart contract test suite with 100% coverage target
- Hardhat development environment configuration
- Deployment scripts for local, testnet, and mainnet
- CI/CD pipeline with GitHub Actions
- Security audit workflows
- Gas reporting in pull requests
- Environment configuration templates
- Contributing guidelines
- Security policy documentation
- MIT License

### Changed
- Enhanced BaseRegistry contract with OpenZeppelin security features
- Added Ownable, ReentrancyGuard, and Pausable patterns
- Implemented transfer functionality for name ownership
- Added fee management and withdrawal mechanisms
- Updated README with comprehensive documentation
- Improved package.json with Hardhat scripts

### Security
- Added reentrancy protection to critical functions
- Implemented emergency pause mechanism
- Added input validation and length limits
- Integrated OpenZeppelin battle-tested contracts
- Added access control for admin functions

## [0.1.0] - 2026-01-18

### Added
- Initial release
- Basic BaseRegistry smart contract
- Name registration functionality
- Data update capability
- Next.js frontend with Tailwind CSS
- shadcn/ui component library integration
- Dark/light theme support

### Features
- Register unique names on Base blockchain
- Associate data with registered names
- Update data for owned names
- Query name availability
- View record details

[Unreleased]: https://github.com/yourusername/baseregistry/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/yourusername/baseregistry/releases/tag/v0.1.0
Loading
Loading